Loading services/core/java/com/android/server/am/ActivityManagerService.java +4 −30 Original line number Diff line number Diff line Loading @@ -5375,34 +5375,13 @@ public class ActivityManagerService extends IActivityManager.Stub @Override public void registerIntentSenderCancelListener(IIntentSender sender, IResultReceiver receiver) { if (!(sender instanceof PendingIntentRecord)) { return; } boolean isCancelled; synchronized(this) { PendingIntentRecord pendingIntent = (PendingIntentRecord) sender; isCancelled = pendingIntent.canceled; if (!isCancelled) { pendingIntent.registerCancelListenerLocked(receiver); } } if (isCancelled) { try { receiver.send(Activity.RESULT_CANCELED, null); } catch (RemoteException e) { } } mPendingIntentController.registerIntentSenderCancelListener(sender, receiver); } @Override public void unregisterIntentSenderCancelListener(IIntentSender sender, IResultReceiver receiver) { if (!(sender instanceof PendingIntentRecord)) { return; } synchronized(this) { ((PendingIntentRecord)sender).unregisterCancelListenerLocked(receiver); } mPendingIntentController.unregisterIntentSenderCancelListener(sender, receiver); } @Override Loading Loading @@ -17679,13 +17658,8 @@ public class ActivityManagerService extends IActivityManager.Stub @Override public void setPendingIntentWhitelistDuration(IIntentSender target, IBinder whitelistToken, long duration) { if (!(target instanceof PendingIntentRecord)) { Slog.w(TAG, "markAsSentFromNotification(): not a PendingIntentRecord: " + target); return; } synchronized (ActivityManagerService.this) { ((PendingIntentRecord) target).setWhitelistDurationLocked(whitelistToken, duration); } mPendingIntentController.setPendingIntentWhitelistDuration(target, whitelistToken, duration); } @Override services/core/java/com/android/server/am/PendingIntentController.java +43 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.server.am; import static android.content.pm.PackageManager.MATCH_DEBUG_TRIAGED_MISSING; import static com.android.server.am.ActivityManagerDebugConfig.DEBUG_MU; import static com.android.server.am.ActivityManagerDebugConfig.POSTFIX_MU; import static com.android.server.am.ActivityManagerDebugConfig.TAG_AM; Loading @@ -39,6 +40,7 @@ import android.os.RemoteException; import android.os.UserHandle; import android.util.ArrayMap; import android.util.Slog; import com.android.internal.os.IResultReceiver; import com.android.internal.util.function.pooled.PooledLambda; import com.android.server.LocalServices; Loading Loading @@ -242,6 +244,47 @@ public class PendingIntentController { } } void registerIntentSenderCancelListener(IIntentSender sender, IResultReceiver receiver) { if (!(sender instanceof PendingIntentRecord)) { return; } boolean isCancelled; synchronized (mLock) { PendingIntentRecord pendingIntent = (PendingIntentRecord) sender; isCancelled = pendingIntent.canceled; if (!isCancelled) { pendingIntent.registerCancelListenerLocked(receiver); } } if (isCancelled) { try { receiver.send(Activity.RESULT_CANCELED, null); } catch (RemoteException e) { } } } void unregisterIntentSenderCancelListener(IIntentSender sender, IResultReceiver receiver) { if (!(sender instanceof PendingIntentRecord)) { return; } synchronized (mLock) { ((PendingIntentRecord) sender).unregisterCancelListenerLocked(receiver); } } void setPendingIntentWhitelistDuration(IIntentSender target, IBinder whitelistToken, long duration) { if (!(target instanceof PendingIntentRecord)) { Slog.w(TAG, "markAsSentFromNotification(): not a PendingIntentRecord: " + target); return; } synchronized (mLock) { ((PendingIntentRecord) target).setWhitelistDurationLocked(whitelistToken, duration); } } private void makeIntentSenderCanceled(PendingIntentRecord rec) { rec.canceled = true; final RemoteCallbackList<IResultReceiver> callbacks = rec.detachCancelListenersLocked(); Loading Loading
services/core/java/com/android/server/am/ActivityManagerService.java +4 −30 Original line number Diff line number Diff line Loading @@ -5375,34 +5375,13 @@ public class ActivityManagerService extends IActivityManager.Stub @Override public void registerIntentSenderCancelListener(IIntentSender sender, IResultReceiver receiver) { if (!(sender instanceof PendingIntentRecord)) { return; } boolean isCancelled; synchronized(this) { PendingIntentRecord pendingIntent = (PendingIntentRecord) sender; isCancelled = pendingIntent.canceled; if (!isCancelled) { pendingIntent.registerCancelListenerLocked(receiver); } } if (isCancelled) { try { receiver.send(Activity.RESULT_CANCELED, null); } catch (RemoteException e) { } } mPendingIntentController.registerIntentSenderCancelListener(sender, receiver); } @Override public void unregisterIntentSenderCancelListener(IIntentSender sender, IResultReceiver receiver) { if (!(sender instanceof PendingIntentRecord)) { return; } synchronized(this) { ((PendingIntentRecord)sender).unregisterCancelListenerLocked(receiver); } mPendingIntentController.unregisterIntentSenderCancelListener(sender, receiver); } @Override Loading Loading @@ -17679,13 +17658,8 @@ public class ActivityManagerService extends IActivityManager.Stub @Override public void setPendingIntentWhitelistDuration(IIntentSender target, IBinder whitelistToken, long duration) { if (!(target instanceof PendingIntentRecord)) { Slog.w(TAG, "markAsSentFromNotification(): not a PendingIntentRecord: " + target); return; } synchronized (ActivityManagerService.this) { ((PendingIntentRecord) target).setWhitelistDurationLocked(whitelistToken, duration); } mPendingIntentController.setPendingIntentWhitelistDuration(target, whitelistToken, duration); } @Override
services/core/java/com/android/server/am/PendingIntentController.java +43 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.server.am; import static android.content.pm.PackageManager.MATCH_DEBUG_TRIAGED_MISSING; import static com.android.server.am.ActivityManagerDebugConfig.DEBUG_MU; import static com.android.server.am.ActivityManagerDebugConfig.POSTFIX_MU; import static com.android.server.am.ActivityManagerDebugConfig.TAG_AM; Loading @@ -39,6 +40,7 @@ import android.os.RemoteException; import android.os.UserHandle; import android.util.ArrayMap; import android.util.Slog; import com.android.internal.os.IResultReceiver; import com.android.internal.util.function.pooled.PooledLambda; import com.android.server.LocalServices; Loading Loading @@ -242,6 +244,47 @@ public class PendingIntentController { } } void registerIntentSenderCancelListener(IIntentSender sender, IResultReceiver receiver) { if (!(sender instanceof PendingIntentRecord)) { return; } boolean isCancelled; synchronized (mLock) { PendingIntentRecord pendingIntent = (PendingIntentRecord) sender; isCancelled = pendingIntent.canceled; if (!isCancelled) { pendingIntent.registerCancelListenerLocked(receiver); } } if (isCancelled) { try { receiver.send(Activity.RESULT_CANCELED, null); } catch (RemoteException e) { } } } void unregisterIntentSenderCancelListener(IIntentSender sender, IResultReceiver receiver) { if (!(sender instanceof PendingIntentRecord)) { return; } synchronized (mLock) { ((PendingIntentRecord) sender).unregisterCancelListenerLocked(receiver); } } void setPendingIntentWhitelistDuration(IIntentSender target, IBinder whitelistToken, long duration) { if (!(target instanceof PendingIntentRecord)) { Slog.w(TAG, "markAsSentFromNotification(): not a PendingIntentRecord: " + target); return; } synchronized (mLock) { ((PendingIntentRecord) target).setWhitelistDurationLocked(whitelistToken, duration); } } private void makeIntentSenderCanceled(PendingIntentRecord rec) { rec.canceled = true; final RemoteCallbackList<IResultReceiver> callbacks = rec.detachCancelListenersLocked(); Loading