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

Commit 6bff62c2 authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Wrap StrictMode changes in try/finally.

Bug: 6091030
Change-Id: I2614f8bb30203e00953b1978bbcaf24d84d0397b
parent e7bb71d2
Loading
Loading
Loading
Loading
+28 −28
Original line number Original line Diff line number Diff line
@@ -3986,12 +3986,11 @@ public final class ActivityThread {
            dalvik.system.VMRuntime.getRuntime().clearGrowthLimit();
            dalvik.system.VMRuntime.getRuntime().clearGrowthLimit();
        }
        }


        // allow disk access during application and provider setup. this could
        // Allow disk access during application and provider setup. This could
        // block processing ordered broadcasts, but later processing would
        // block processing ordered broadcasts, but later processing would
        // probably end up doing the same disk access. restore not guarded with
        // probably end up doing the same disk access.
        // finally block, since exceptions here will take down the application.
        final StrictMode.ThreadPolicy savedPolicy = StrictMode.allowThreadDiskWrites();
        final StrictMode.ThreadPolicy savedPolicy = StrictMode.allowThreadDiskWrites();

        try {
            // If the app is being launched for full backup or restore, bring it up in
            // If the app is being launched for full backup or restore, bring it up in
            // a restricted environment with the base application class.
            // a restricted environment with the base application class.
            Application app = data.info.makeApplication(data.restrictedBackupMode, null);
            Application app = data.info.makeApplication(data.restrictedBackupMode, null);
@@ -4018,9 +4017,10 @@ public final class ActivityThread {
                        + ": " + e.toString(), e);
                        + ": " + e.toString(), e);
                }
                }
            }
            }

        } finally {
            StrictMode.setThreadPolicy(savedPolicy);
            StrictMode.setThreadPolicy(savedPolicy);
        }
        }
    }


    /*package*/ final void finishInstrumentation(int resultCode, Bundle results) {
    /*package*/ final void finishInstrumentation(int resultCode, Bundle results) {
        IActivityManager am = ActivityManagerNative.getDefault();
        IActivityManager am = ActivityManagerNative.getDefault();