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();
|
mOriginalCallingPid = Binder.getCallingPid();
|
||||||
mOriginalCallingUid = Binder.getCallingUid();
|
mOriginalCallingUid = Binder.getCallingUid();
|
||||||
mOriginalOptions = options;
|
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();
|
mRealCallingPid = Binder.getCallingPid();
|
||||||
mRealCallingUid = Binder.getCallingUid();
|
mRealCallingUid = Binder.getCallingUid();
|
||||||
mCallerOptions = options;
|
mCallerOptions = options;
|
||||||
if (mRealCallingPid == Process.myPid()) {
|
|
||||||
Slog.wtf(TAG, "setCallerOptions called after clearing calling id");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -128,20 +122,28 @@ class SafeActivityOptions {
|
|||||||
if (mOriginalOptions != null) {
|
if (mOriginalOptions != null) {
|
||||||
checkPermissions(intent, aInfo, callerApp, supervisor, mOriginalOptions,
|
checkPermissions(intent, aInfo, callerApp, supervisor, mOriginalOptions,
|
||||||
mOriginalCallingPid, mOriginalCallingUid);
|
mOriginalCallingPid, mOriginalCallingUid);
|
||||||
if (mOriginalOptions.getRemoteAnimationAdapter() != null) {
|
setCallingPidForRemoteAnimationAdapter(mOriginalOptions, mOriginalCallingPid);
|
||||||
mOriginalOptions.getRemoteAnimationAdapter().setCallingPid(mOriginalCallingPid);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (mCallerOptions != null) {
|
if (mCallerOptions != null) {
|
||||||
checkPermissions(intent, aInfo, callerApp, supervisor, mCallerOptions,
|
checkPermissions(intent, aInfo, callerApp, supervisor, mCallerOptions,
|
||||||
mRealCallingPid, mRealCallingUid);
|
mRealCallingPid, mRealCallingUid);
|
||||||
if (mCallerOptions.getRemoteAnimationAdapter() != null) {
|
setCallingPidForRemoteAnimationAdapter(mCallerOptions, mRealCallingPid);
|
||||||
mCallerOptions.getRemoteAnimationAdapter().setCallingPid(mRealCallingPid);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return mergeActivityOptions(mOriginalOptions, mCallerOptions);
|
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
|
* @see ActivityOptions#popAppVerificationBundle
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user