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

Commit 7c501678 authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Suppress StrictMode in handleBindApplication().

Allow disk access during application and provider setup.  This could
block processing ordered broadcasts, but later processing would
probably end up doing the same disk access.

Bug: 6083825
Change-Id: I80f383063cedba2b099c78465134faa811e898d8
parent 1d29a306
Loading
Loading
Loading
Loading
+9 −1
Original line number Original line Diff line number Diff line
@@ -3986,6 +3986,12 @@ public final class ActivityThread {
            dalvik.system.VMRuntime.getRuntime().clearGrowthLimit();
            dalvik.system.VMRuntime.getRuntime().clearGrowthLimit();
        }
        }


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

        // 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);
@@ -4012,6 +4018,8 @@ public final class ActivityThread {
                    + ": " + e.toString(), e);
                    + ": " + e.toString(), e);
            }
            }
        }
        }

        StrictMode.setThreadPolicy(savedPolicy);
    }
    }


    /*package*/ final void finishInstrumentation(int resultCode, Bundle results) {
    /*package*/ final void finishInstrumentation(int resultCode, Bundle results) {