diff options
author | Svetoslav Ganov <svetoslavganov@google.com> | 2011-03-02 12:58:40 -0800 |
---|---|---|
committer | Svetoslav Ganov <svetoslavganov@google.com> | 2011-03-02 18:22:49 -0800 |
commit | 54d068ec6af0ee6d261a135400efe6816c6f5ffe (patch) | |
tree | 066b6a2ef26c1b18c446a46803cf7429c0fe5bae /core/java/android/app/ApplicationThreadNative.java | |
parent | 5a39c95c004d856b47a844c962b1c2b18f4e96aa (diff) | |
download | frameworks_base-54d068ec6af0ee6d261a135400efe6816c6f5ffe.zip frameworks_base-54d068ec6af0ee6d261a135400efe6816c6f5ffe.tar.gz frameworks_base-54d068ec6af0ee6d261a135400efe6816c6f5ffe.tar.bz2 |
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
Diffstat (limited to 'core/java/android/app/ApplicationThreadNative.java')
-rw-r--r-- | core/java/android/app/ApplicationThreadNative.java | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/core/java/android/app/ApplicationThreadNative.java b/core/java/android/app/ApplicationThreadNative.java index ef92933..aa26b04 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<String, IBinder> 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<ProviderInfo> providers, ComponentName testName, String profileName, Bundle testArgs, IInstrumentationWatcher testWatcher, int debugMode, boolean restrictedBackupMode, Configuration config, - Map<String, IBinder> services) throws RemoteException { + Map<String, IBinder> 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); + } } |