summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Vadim Caen <caen@google.com> 2024-12-05 17:20:02 +0100
committer Vadim Caen <caen@google.com> 2024-12-06 12:10:07 +0100
commit3b422f0543874c8e1fc27af096e183a7dd4bb8dc (patch)
tree67980cbef66bebb1de226335ca21881f5f332ca4
parent929eab03a31ec679e8c9dbb8290cf90adfb88a9f (diff)
Remove the mediaProjectionRequestAttributionFix flag
Ibcc14090ce38a0fac21a394d861d044b9669a8a0 was flag but is actually a security fix, so we should not flag the change Flag: EXEMPT security fix Bug: 372670004 Test: N/A Change-Id: I1fe00d54ac8b8fcf802c0b0ac18ab2a802272325
-rw-r--r--packages/SystemUI/src/com/android/systemui/mediaprojection/permission/MediaProjectionPermissionActivity.java19
1 files changed, 9 insertions, 10 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/mediaprojection/permission/MediaProjectionPermissionActivity.java b/packages/SystemUI/src/com/android/systemui/mediaprojection/permission/MediaProjectionPermissionActivity.java
index 2fda2013d6f5..d33ad8f80021 100644
--- a/packages/SystemUI/src/com/android/systemui/mediaprojection/permission/MediaProjectionPermissionActivity.java
+++ b/packages/SystemUI/src/com/android/systemui/mediaprojection/permission/MediaProjectionPermissionActivity.java
@@ -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()) {
- 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)) {
+ // The original requester of this activity start
+ mPackageName = getLaunchedFromPackage();
+
+ // 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;
}