Skip to content
This repository has been archived by the owner on Feb 10, 2025. It is now read-only.

Commit

Permalink
Do not use filter calling uid parameter originally intended for insta…
Browse files Browse the repository at this point in the history
…nt apps
  • Loading branch information
quh4gko8 authored and thestinger committed May 3, 2024
1 parent 5af848e commit f408254
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
10 changes: 1 addition & 9 deletions services/core/java/com/android/server/wm/ActivityStarter.java
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,6 @@ void set(@NonNull Request request) {
avoidMoveToFront = request.avoidMoveToFront;
allowPendingRemoteAnimationRegistryLookup
= request.allowPendingRemoteAnimationRegistryLookup;
filterCallingUid = request.filterCallingUid;
originatingPendingIntent = request.originatingPendingIntent;
forcedBalByPiSender = request.forcedBalByPiSender;
errorCallbackToken = request.errorCallbackToken;
Expand Down Expand Up @@ -1458,9 +1457,7 @@ void postStartActivityProcessing(ActivityRecord r, int result,
*/
static int computeResolveFilterUid(int customCallingUid, int actualCallingUid,
int filterCallingUid) {
return filterCallingUid != UserHandle.USER_NULL
? filterCallingUid
: (customCallingUid >= 0 ? customCallingUid : actualCallingUid);
return customCallingUid >= 0 ? customCallingUid : actualCallingUid;
}

/**
Expand Down Expand Up @@ -3162,11 +3159,6 @@ ActivityStarter setIgnoreTargetSecurity(boolean ignoreTargetSecurity) {
return this;
}

ActivityStarter setFilterCallingUid(int filterCallingUid) {
mRequest.filterCallingUid = filterCallingUid;
return this;
}

ActivityStarter setComponentSpecified(boolean componentSpecified) {
mRequest.componentSpecified = componentSpecified;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1681,7 +1681,6 @@ public final int startActivityAsCaller(IApplicationThread caller, String calling
.setActivityOptions(createSafeActivityOptionsWithBalAllowed(bOptions))
.setUserId(userId)
.setIgnoreTargetSecurity(ignoreTargetSecurity)
.setFilterCallingUid(isResolver ? 0 /* system */ : targetUid)
// The target may well be in the background, which would normally prevent it
// from starting an activity. Here we definitely want the start to succeed.
.setBackgroundStartPrivileges(BackgroundStartPrivileges.ALLOW_BAL)
Expand Down

0 comments on commit f408254

Please sign in to comment.