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

Commit 9176f4a7 authored by Vadim Caen's avatar Vadim Caen Committed by Android (Google) Code Review
Browse files

Merge "Remove the mediaProjectionRequestAttributionFix flag" into main

parents 95138a14 3b422f05
Loading
Loading
Loading
Loading
+9 −10
Original line number Diff line number Diff line
@@ -122,21 +122,20 @@ public class MediaProjectionPermissionActivity extends Activity {
        final Intent launchingIntent = getIntent();
        mReviewGrantedConsentRequired = launchingIntent.getBooleanExtra(
                EXTRA_USER_REVIEW_GRANTED_CONSENT, false);
        if (com.android.systemui.Flags.mediaProjectionRequestAttributionFix()) {

        // The original requester of this activity start
        mPackageName = getLaunchedFromPackage();
        } else {
            mPackageName = getCallingPackage();
        }

        // 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 || (
                com.android.systemui.Flags.mediaProjectionRequestAttributionFix()
                        && getCallingPackage() == null)) {
        // This activity is launched directly by using startActivity(),
        // thus getCallingPackage() will be null.
        if (getCallingPackage() == null) {
            // System server provides the package name through the intent if so and is able to get
            // the result back. Other applications can't.
            if (launchingIntent.hasExtra(EXTRA_PACKAGE_REUSING_GRANTED_CONSENT)) {
                mPackageName = launchingIntent.getStringExtra(
                        EXTRA_PACKAGE_REUSING_GRANTED_CONSENT);
            } else {
                // The activity was not launched for result, we abort here
                finishAsCancelled();
                return;
            }