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

Commit 85987ea1 authored by Marvin Ramin's avatar Marvin Ramin Committed by Vadim Caen
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
Change-Id: I48adb14fbc8d5f2f2e21ef8a30a713d33f03ab02
Merged-In: I48adb14fbc8d5f2f2e21ef8a30a713d33f03ab02
parent 361f6633
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);