commit | 1ccc1d11986adc4a3b7b8bfa63f825d952676dd8 | [log] [tgz] |
---|---|---|
author | Mark Renouf <mrenouf@google.com> | Thu Jun 20 16:37:42 2024 -0400 |
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Wed Aug 07 23:07:48 2024 +0000 |
tree | 02df7da8fb55a8827d147800473d859e37b0fc72 | |
parent | 95e40613912b97fd3a5965a8749a39a9a004afb0 [diff] |
Prevent Sharing when FRP enforcement is in effect ADB command to trigger sharing: ``` adb shell 'am start -a android.intent.action.CHOOSER --eu android.intent.extra.INTENT "intent:#Intent;action=android.intent.action.SEND;type=text/plain;S.android.intent.extra.TEXT=Shared%20text;end"' ``` Bug: 327645387 Test: manual; trigger FRP; attempt to open share sheet using adb (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:1c7101154d42f804d52d65643a7e79dfee22295a) Merged-In: I1db78ab74babe71b516f601be35cf476b5e43271 Change-Id: I1db78ab74babe71b516f601be35cf476b5e43271
diff --git a/core/java/com/android/internal/app/ChooserActivity.java b/core/java/com/android/internal/app/ChooserActivity.java index 25ba36cc..919c176 100644 --- a/core/java/com/android/internal/app/ChooserActivity.java +++ b/core/java/com/android/internal/app/ChooserActivity.java
@@ -515,6 +515,14 @@ @Override protected void onCreate(Bundle savedInstanceState) { + if (Settings.Secure.getIntForUser(getContentResolver(), + Settings.Secure.SECURE_FRP_MODE, 0, + getUserId()) == 1) { + Log.e(TAG, "Sharing disabled due to active FRP lock."); + super.onCreate(savedInstanceState); + finish(); + return; + } final long intentReceivedTime = System.currentTimeMillis(); mLatencyTracker.onActionStart(ACTION_LOAD_SHARE_SHEET);