Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 93b2f301 authored by Ashwini Oruganti's avatar Ashwini Oruganti Committed by Android (Google) Code Review
Browse files

Merge "Add a method to return the flags set for a PendingIntent"

parents 3f32fa6a 407e8d2c
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -102,6 +102,11 @@ public abstract class ActivityManagerInternal {
    public abstract void setPendingIntentWhitelistDuration(IIntentSender target,
            IBinder whitelistToken, long duration);

    /**
     * Returns the flags set for a {@link PendingIntent}.
     */
    public abstract int getPendingIntentFlags(IIntentSender target);

    /**
     * Allows a {@link PendingIntent} to start activities from background.
     */
+5 −0
Original line number Diff line number Diff line
@@ -15788,6 +15788,11 @@ public class ActivityManagerService extends IActivityManager.Stub
                    duration);
        }
        @Override
        public int getPendingIntentFlags(IIntentSender target) {
            return mPendingIntentController.getPendingIntentFlags(target);
        }
        @Override
        public void setPendingIntentAllowBgActivityStarts(IIntentSender target,
                IBinder whitelistToken, int flags) {
+10 −0
Original line number Diff line number Diff line
@@ -311,6 +311,16 @@ public class PendingIntentController {
        }
    }

    int getPendingIntentFlags(IIntentSender target) {
        if (!(target instanceof PendingIntentRecord)) {
            Slog.w(TAG, "markAsSentFromNotification(): not a PendingIntentRecord: " + target);
            return 0;
        }
        synchronized (mLock) {
            return ((PendingIntentRecord) target).key.flags;
        }
    }

    private void makeIntentSenderCanceled(PendingIntentRecord rec) {
        rec.canceled = true;
        final RemoteCallbackList<IResultReceiver> callbacks = rec.detachCancelListenersLocked();