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

Commit c1d48df2 authored by Mark Renouf's avatar Mark Renouf
Browse files

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
Change-Id: I1db78ab74babe71b516f601be35cf476b5e43271
Merged-In: I928b6ea68aa8d6d710dc51eb70acd2cc2ec682c3
Merged-In: I4116ecbd3534b0391a5b468ed4cd18f2d4b3ae0a
parent de5889aa
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -602,6 +602,14 @@ public class ChooserActivity extends ResolverActivity implements

    @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.