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

Commit 2b9eb89a authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Disable StrictMode when starting activity.

Since intents can come in from older apps, don't let them crash us
by including file:// Uris.  This narrows the relaxation to only apply
when starting the requested intent.

Bug: 27070755
Change-Id: Ifcf9068424e072f52758c8feeab5fbf23d678a2e
parent 21eb4e26
Loading
Loading
Loading
Loading
+11 −4
Original line number Diff line number Diff line
@@ -174,10 +174,6 @@ public class ResolverActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // We're dispatching intents that might be coming from legacy apps, so
        // don't kill ourselves.
        StrictMode.disableDeathOnFileUriExposure();

        // Use a specialized prompt when we're handling the 'Home' app startActivity()
        final Intent intent = makeMyIntent();
        final Set<String> categories = intent.getCategories();
@@ -768,6 +764,17 @@ public class ResolverActivity extends Activity {
    }

    public void safelyStartActivity(TargetInfo cti) {
        // We're dispatching intents that might be coming from legacy apps, so
        // don't kill ourselves.
        StrictMode.disableDeathOnFileUriExposure();
        try {
            safelyStartActivityInternal(cti);
        } finally {
            StrictMode.enableDeathOnFileUriExposure();
        }
    }

    private void safelyStartActivityInternal(TargetInfo cti) {
        // If needed, show that intent is forwarded
        // from managed profile to owner or other way around.
        if (mProfileSwitchMessageId != -1) {