summaryrefslogtreecommitdiff
path: root/core/java/android/app/ActivityThread.java
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2012-02-28 12:08:37 -0800
committerJeff Sharkey <jsharkey@android.com>2012-02-28 12:11:29 -0800
commit7c5016787ec862445b1d4301787f46d52acfa88d (patch)
tree76714c173c858ff5912d84d2c015dbaded47f0e6 /core/java/android/app/ActivityThread.java
parent1d29a3064f20652416f81ea292adcc07566ba974 (diff)
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
Diffstat (limited to 'core/java/android/app/ActivityThread.java')
-rw-r--r--core/java/android/app/ActivityThread.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index 5d1d4618e32c..d4b9a364beeb 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -3986,6 +3986,12 @@ public final class ActivityThread {
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
// a restricted environment with the base application class.
Application app = data.info.makeApplication(data.restrictedBackupMode, null);
@@ -3993,7 +3999,7 @@ public final class ActivityThread {
// don't bring up providers in restricted mode; they may depend on the
// app's custom Application class
- if (!data.restrictedBackupMode){
+ if (!data.restrictedBackupMode) {
List<ProviderInfo> providers = data.providers;
if (providers != null) {
installContentProviders(app, providers);
@@ -4012,6 +4018,8 @@ public final class ActivityThread {
+ ": " + e.toString(), e);
}
}
+
+ StrictMode.setThreadPolicy(savedPolicy);
}
/*package*/ final void finishInstrumentation(int resultCode, Bundle results) {