Merge "Add a method to return the flags set for a PendingIntent"
This commit is contained in:
committed by
Android (Google) Code Review
commit
93b2f301cf
@@ -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.
|
||||
*/
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user