Merge "Replace PendingIntent#getIntent"

This commit is contained in:
Paul Hu
2021-03-10 02:13:11 +00:00
committed by Gerrit Code Review

View File

@@ -3614,11 +3614,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();
}
}