Replace PendingIntent#getIntent
Connectivity is becoming a mainline module in S but mainline modules are not allowed to use non-formal APIs. Thus, replace non-formal API PendingIntent#getIntent to new formal API PendingIntent#intentFilterEquals. Bug: 174237997 Test: FrameworksNetTests Change-Id: Ic5e27f812bd42dbc80b9d29d81303df4dd5e8199
This commit is contained in:
parent
a3073a34d8
commit
90b43ff5e1
1 changed files with 1 additions and 2 deletions
|
|
@ -3590,11 +3590,10 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||
// pendingIntent => NetworkRequestInfo map.
|
||||
// This method assumes that every non-null PendingIntent maps to exactly 1 NetworkRequestInfo.
|
||||
private NetworkRequestInfo findExistingNetworkRequestInfo(PendingIntent pendingIntent) {
|
||||
Intent intent = pendingIntent.getIntent();
|
||||
for (Map.Entry<NetworkRequest, NetworkRequestInfo> entry : mNetworkRequests.entrySet()) {
|
||||
PendingIntent existingPendingIntent = entry.getValue().mPendingIntent;
|
||||
if (existingPendingIntent != null &&
|
||||
existingPendingIntent.getIntent().filterEquals(intent)) {
|
||||
existingPendingIntent.intentFilterEquals(pendingIntent)) {
|
||||
return entry.getValue();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue