Loading services/core/java/com/android/server/am/PendingIntentRecord.java +8 −7 Original line number Diff line number Diff line Loading @@ -283,6 +283,14 @@ final class PendingIntentRecord extends IIntentSender.Stub { final int callingUid = Binder.getCallingUid(); final int callingPid = Binder.getCallingPid(); // Extract options before clearing calling identity SafeActivityOptions mergedOptions = key.options; if (mergedOptions == null) { mergedOptions = SafeActivityOptions.fromBundle(options); } else { mergedOptions.setCallerOptions(ActivityOptions.fromBundle(options)); } final long origId = Binder.clearCallingIdentity(); if (whitelistDuration != null) { Loading Loading @@ -319,13 +327,6 @@ final class PendingIntentRecord extends IIntentSender.Stub { switch (key.type) { case ActivityManager.INTENT_SENDER_ACTIVITY: try { SafeActivityOptions mergedOptions = key.options; if (mergedOptions == null) { mergedOptions = SafeActivityOptions.fromBundle(options); } else { mergedOptions.setCallerOptions(ActivityOptions.fromBundle(options)); } // Note when someone has a pending intent, even from different // users, then there's no need to ensure the calling user matches // the target user, so validateIncomingUser is always false below. Loading services/core/java/com/android/server/am/SafeActivityOptions.java +7 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import android.content.Intent; import android.content.pm.ActivityInfo; import android.os.Binder; import android.os.Bundle; import android.os.Process; import android.os.UserHandle; import android.util.Slog; import android.view.RemoteAnimationAdapter; Loading Loading @@ -78,6 +79,9 @@ class SafeActivityOptions { mOriginalCallingPid = Binder.getCallingPid(); mOriginalCallingUid = Binder.getCallingUid(); mOriginalOptions = options; if (mOriginalCallingPid == Process.myPid()) { Slog.wtf(TAG, "Safe activity options constructed after clearing calling id"); } } /** Loading @@ -89,6 +93,9 @@ class SafeActivityOptions { mRealCallingPid = Binder.getCallingPid(); mRealCallingUid = Binder.getCallingUid(); mCallerOptions = options; if (mRealCallingPid == Process.myPid()) { Slog.wtf(TAG, "setCallerOptions called after clearing calling id"); } } /** Loading Loading
services/core/java/com/android/server/am/PendingIntentRecord.java +8 −7 Original line number Diff line number Diff line Loading @@ -283,6 +283,14 @@ final class PendingIntentRecord extends IIntentSender.Stub { final int callingUid = Binder.getCallingUid(); final int callingPid = Binder.getCallingPid(); // Extract options before clearing calling identity SafeActivityOptions mergedOptions = key.options; if (mergedOptions == null) { mergedOptions = SafeActivityOptions.fromBundle(options); } else { mergedOptions.setCallerOptions(ActivityOptions.fromBundle(options)); } final long origId = Binder.clearCallingIdentity(); if (whitelistDuration != null) { Loading Loading @@ -319,13 +327,6 @@ final class PendingIntentRecord extends IIntentSender.Stub { switch (key.type) { case ActivityManager.INTENT_SENDER_ACTIVITY: try { SafeActivityOptions mergedOptions = key.options; if (mergedOptions == null) { mergedOptions = SafeActivityOptions.fromBundle(options); } else { mergedOptions.setCallerOptions(ActivityOptions.fromBundle(options)); } // Note when someone has a pending intent, even from different // users, then there's no need to ensure the calling user matches // the target user, so validateIncomingUser is always false below. Loading
services/core/java/com/android/server/am/SafeActivityOptions.java +7 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import android.content.Intent; import android.content.pm.ActivityInfo; import android.os.Binder; import android.os.Bundle; import android.os.Process; import android.os.UserHandle; import android.util.Slog; import android.view.RemoteAnimationAdapter; Loading Loading @@ -78,6 +79,9 @@ class SafeActivityOptions { mOriginalCallingPid = Binder.getCallingPid(); mOriginalCallingUid = Binder.getCallingUid(); mOriginalOptions = options; if (mOriginalCallingPid == Process.myPid()) { Slog.wtf(TAG, "Safe activity options constructed after clearing calling id"); } } /** Loading @@ -89,6 +93,9 @@ class SafeActivityOptions { mRealCallingPid = Binder.getCallingPid(); mRealCallingUid = Binder.getCallingUid(); mCallerOptions = options; if (mRealCallingPid == Process.myPid()) { Slog.wtf(TAG, "setCallerOptions called after clearing calling id"); } } /** Loading