From 54d068ec6af0ee6d261a135400efe6816c6f5ffe Mon Sep 17 00:00:00 2001 From: Svetoslav Ganov Date: Wed, 2 Mar 2011 12:58:40 -0800 Subject: Add system wide management of core settings bug:3505060 Since we want to have some settings that are used very frequently by many applications (long-press timeout is one example) these should be managed efficiently to reduce lookups from different processes because in the case of a cache miss a disk I/O is performed. Now the system manages such core settings and propagates them to the application processes. Change-Id: Ie793211baf8770f2181ac8ba9d7c2609dfaa32a7 --- core/java/android/app/ApplicationThreadNative.java | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'core/java/android/app/ApplicationThreadNative.java') diff --git a/core/java/android/app/ApplicationThreadNative.java b/core/java/android/app/ApplicationThreadNative.java index ef929333823c..aa26b0471fdf 100644 --- a/core/java/android/app/ApplicationThreadNative.java +++ b/core/java/android/app/ApplicationThreadNative.java @@ -257,10 +257,11 @@ public abstract class ApplicationThreadNative extends Binder boolean restrictedBackupMode = (data.readInt() != 0); Configuration config = Configuration.CREATOR.createFromParcel(data); HashMap services = data.readHashMap(null); + Bundle coreSettings = data.readBundle(); bindApplication(packageName, info, providers, testName, profileName, testArgs, testWatcher, testMode, restrictedBackupMode, - config, services); + config, services, coreSettings); return true; } @@ -454,6 +455,13 @@ public abstract class ApplicationThreadNative extends Binder } return true; } + + case SET_CORE_SETTINGS: { + data.enforceInterface(IApplicationThread.descriptor); + Bundle settings = data.readBundle(); + setCoreSettings(settings); + return true; + } } return super.onTransact(code, data, reply, flags); @@ -712,7 +720,7 @@ class ApplicationThreadProxy implements IApplicationThread { List providers, ComponentName testName, String profileName, Bundle testArgs, IInstrumentationWatcher testWatcher, int debugMode, boolean restrictedBackupMode, Configuration config, - Map services) throws RemoteException { + Map services, Bundle coreSettings) throws RemoteException { Parcel data = Parcel.obtain(); data.writeInterfaceToken(IApplicationThread.descriptor); data.writeString(packageName); @@ -731,6 +739,7 @@ class ApplicationThreadProxy implements IApplicationThread { data.writeInt(restrictedBackupMode ? 1 : 0); config.writeToParcel(data, 0); data.writeMap(services); + data.writeBundle(coreSettings); mRemote.transact(BIND_APPLICATION_TRANSACTION, data, null, IBinder.FLAG_ONEWAY); data.recycle(); @@ -938,4 +947,11 @@ class ApplicationThreadProxy implements IApplicationThread { mRemote.transact(DUMP_ACTIVITY_TRANSACTION, data, null, 0); data.recycle(); } + + public void setCoreSettings(Bundle coreSettings) throws RemoteException { + Parcel data = Parcel.obtain(); + data.writeInterfaceToken(IApplicationThread.descriptor); + data.writeBundle(coreSettings); + mRemote.transact(SET_CORE_SETTINGS, data, null, IBinder.FLAG_ONEWAY); + } } -- cgit v1.2.3