2024-10-13 15:51:16 -04:00
|
|
|
From 1346eac616e21574788efa8bf374d8eb1ee744b7 Mon Sep 17 00:00:00 2001
|
2024-10-13 13:51:12 -04:00
|
|
|
From: Mark Renouf <mrenouf@google.com>
|
|
|
|
Date: Thu, 20 Jun 2024 16:37:42 -0400
|
|
|
|
Subject: [PATCH] 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
|
2024-10-13 15:51:16 -04:00
|
|
|
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:5080af26387a18d5638d5a42eadfb8d4d700518c)
|
2024-10-13 13:51:12 -04:00
|
|
|
Merged-In: I1db78ab74babe71b516f601be35cf476b5e43271
|
|
|
|
Change-Id: I1db78ab74babe71b516f601be35cf476b5e43271
|
|
|
|
---
|
|
|
|
core/java/com/android/internal/app/ChooserActivity.java | 8 ++++++++
|
|
|
|
1 file changed, 8 insertions(+)
|
|
|
|
|
|
|
|
diff --git a/core/java/com/android/internal/app/ChooserActivity.java b/core/java/com/android/internal/app/ChooserActivity.java
|
2024-10-13 15:51:16 -04:00
|
|
|
index bc80dc9213bea..e259f1d20adb9 100644
|
2024-10-13 13:51:12 -04:00
|
|
|
--- a/core/java/com/android/internal/app/ChooserActivity.java
|
|
|
|
+++ b/core/java/com/android/internal/app/ChooserActivity.java
|
2024-10-13 15:51:16 -04:00
|
|
|
@@ -594,6 +594,14 @@ public void handleMessage(Message msg) {
|
2024-10-13 13:51:12 -04:00
|
|
|
|
|
|
|
@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();
|
|
|
|
getChooserActivityLogger().logSharesheetTriggered();
|
|
|
|
// This is the only place this value is being set. Effectively final.
|