Only WTF when trying to use remote animation in ActivityOptions
There is a legitimate use case when sending a PendingIntent from within system_server, for example AlarmManager. However, we used to WTF always in this case. To fix this, we only WTF when trying to use a remote animation that originates from within system_server. Test: Boots, open apps Change-Id: I7bafae9f899cbb8966cf22166270000ce887baba Fixes: 79417917
This commit is contained in:
@@ -79,9 +79,6 @@ 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");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -93,9 +90,6 @@ class SafeActivityOptions {
|
||||
mRealCallingPid = Binder.getCallingPid();
|
||||
mRealCallingUid = Binder.getCallingUid();
|
||||
mCallerOptions = options;
|
||||
if (mRealCallingPid == Process.myPid()) {
|
||||
Slog.wtf(TAG, "setCallerOptions called after clearing calling id");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -128,20 +122,28 @@ class SafeActivityOptions {
|
||||
if (mOriginalOptions != null) {
|
||||
checkPermissions(intent, aInfo, callerApp, supervisor, mOriginalOptions,
|
||||
mOriginalCallingPid, mOriginalCallingUid);
|
||||
if (mOriginalOptions.getRemoteAnimationAdapter() != null) {
|
||||
mOriginalOptions.getRemoteAnimationAdapter().setCallingPid(mOriginalCallingPid);
|
||||
}
|
||||
setCallingPidForRemoteAnimationAdapter(mOriginalOptions, mOriginalCallingPid);
|
||||
}
|
||||
if (mCallerOptions != null) {
|
||||
checkPermissions(intent, aInfo, callerApp, supervisor, mCallerOptions,
|
||||
mRealCallingPid, mRealCallingUid);
|
||||
if (mCallerOptions.getRemoteAnimationAdapter() != null) {
|
||||
mCallerOptions.getRemoteAnimationAdapter().setCallingPid(mRealCallingPid);
|
||||
}
|
||||
setCallingPidForRemoteAnimationAdapter(mCallerOptions, mRealCallingPid);
|
||||
}
|
||||
return mergeActivityOptions(mOriginalOptions, mCallerOptions);
|
||||
}
|
||||
|
||||
private void setCallingPidForRemoteAnimationAdapter(ActivityOptions options, int callingPid) {
|
||||
final RemoteAnimationAdapter adapter = options.getRemoteAnimationAdapter();
|
||||
if (adapter == null) {
|
||||
return;
|
||||
}
|
||||
if (callingPid == Process.myPid()) {
|
||||
Slog.wtf(TAG, "Safe activity options constructed after clearing calling id");
|
||||
return;
|
||||
}
|
||||
adapter.setCallingPid(callingPid);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ActivityOptions#popAppVerificationBundle
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user