Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d37b2f8b authored by Marvin Ramin's avatar Marvin Ramin Committed by Android Build Coastguard Worker
Browse files

RESTRICT AUTOMERGE Use getLaunchedFromPackage instead of getCallingPackage

Ensure that MediaProjectionPermissionActivity is doing proper
attribution and validation of permissions before showing.

Bug: 372670004
Bug: 373581993
Test: presubmit
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:39ff0377a592fa9bacd308e982a397106665a046)
Merged-In: I48adb14fbc8d5f2f2e21ef8a30a713d33f03ab02
Change-Id: I48adb14fbc8d5f2f2e21ef8a30a713d33f03ab02
parent 0a23febf
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -98,12 +98,11 @@ public class MediaProjectionPermissionActivity extends Activity
        final Intent launchingIntent = getIntent();
        mReviewGrantedConsentRequired = launchingIntent.getBooleanExtra(
                EXTRA_USER_REVIEW_GRANTED_CONSENT, false);

        mPackageName = getCallingPackage();
        mPackageName = getLaunchedFromPackage();

        // This activity is launched directly by an app, or system server. System server provides
        // the package name through the intent if so.
        if (mPackageName == null) {
        if (getCallingPackage() == null)  {
            if (launchingIntent.hasExtra(EXTRA_PACKAGE_REUSING_GRANTED_CONSENT)) {
                mPackageName = launchingIntent.getStringExtra(
                        EXTRA_PACKAGE_REUSING_GRANTED_CONSENT);