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

Commit a3331309 authored by Jeff Sharkey's avatar Jeff Sharkey Committed by Android (Google) Code Review
Browse files

Merge "Disable StrictMode when starting activity." into nyc-dev

parents 1256ab67 2b9eb89a
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) {