diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/os/IServiceManager.java | 3 | ||||
-rw-r--r-- | core/java/android/os/ServiceManager.java | 19 | ||||
-rw-r--r-- | core/java/android/os/ServiceManagerNative.java | 6 | ||||
-rw-r--r-- | core/java/android/os/UserId.java | 5 | ||||
-rw-r--r-- | core/res/AndroidManifest.xml | 7 | ||||
-rwxr-xr-x | core/res/res/values/strings.xml | 7 |
6 files changed, 43 insertions, 4 deletions
diff --git a/core/java/android/os/IServiceManager.java b/core/java/android/os/IServiceManager.java index 9a5ff47..7b11c28 100644 --- a/core/java/android/os/IServiceManager.java +++ b/core/java/android/os/IServiceManager.java @@ -45,7 +45,8 @@ public interface IServiceManager extends IInterface * Place a new @a service called @a name into the service * manager. */ - public void addService(String name, IBinder service) throws RemoteException; + public void addService(String name, IBinder service, boolean allowIsolated) + throws RemoteException; /** * Return a list of all currently running services. diff --git a/core/java/android/os/ServiceManager.java b/core/java/android/os/ServiceManager.java index 1af24f4..13b8b66 100644 --- a/core/java/android/os/ServiceManager.java +++ b/core/java/android/os/ServiceManager.java @@ -69,7 +69,24 @@ public final class ServiceManager { */ public static void addService(String name, IBinder service) { try { - getIServiceManager().addService(name, service); + getIServiceManager().addService(name, service, false); + } catch (RemoteException e) { + Log.e(TAG, "error in addService", e); + } + } + + /** + * Place a new @a service called @a name into the service + * manager. + * + * @param name the name of the new service + * @param service the service object + * @param allowIsolated set to true to allow isolated sandboxed processes + * to access this service + */ + public static void addService(String name, IBinder service, boolean allowIsolated) { + try { + getIServiceManager().addService(name, service, allowIsolated); } catch (RemoteException e) { Log.e(TAG, "error in addService", e); } diff --git a/core/java/android/os/ServiceManagerNative.java b/core/java/android/os/ServiceManagerNative.java index 2aab0e6..43b5128 100644 --- a/core/java/android/os/ServiceManagerNative.java +++ b/core/java/android/os/ServiceManagerNative.java @@ -71,7 +71,8 @@ public abstract class ServiceManagerNative extends Binder implements IServiceMan data.enforceInterface(IServiceManager.descriptor); String name = data.readString(); IBinder service = data.readStrongBinder(); - addService(name, service); + boolean allowIsolated = data.readInt() != 0; + addService(name, service, allowIsolated); return true; } @@ -136,13 +137,14 @@ class ServiceManagerProxy implements IServiceManager { return binder; } - public void addService(String name, IBinder service) + public void addService(String name, IBinder service, boolean allowIsolated) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IServiceManager.descriptor); data.writeString(name); data.writeStrongBinder(service); + data.writeInt(allowIsolated ? 1 : 0); mRemote.transact(ADD_SERVICE_TRANSACTION, data, reply, 0); reply.recycle(); data.recycle(); diff --git a/core/java/android/os/UserId.java b/core/java/android/os/UserId.java index 4124d51..286b674 100644 --- a/core/java/android/os/UserId.java +++ b/core/java/android/os/UserId.java @@ -56,6 +56,11 @@ public final class UserId { return getAppId(uid1) == getAppId(uid2); } + public static final boolean isIsolated(int uid) { + uid = getAppId(uid); + return uid >= Process.FIRST_ISOLATED_UID && uid <= Process.LAST_ISOLATED_UID; + } + /** * Returns the user id for a given uid. * @hide diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml index 97658a1..1199cf7 100644 --- a/core/res/AndroidManifest.xml +++ b/core/res/AndroidManifest.xml @@ -717,6 +717,13 @@ android:label="@string/permlab_removeTasks" android:description="@string/permdesc_removeTasks" /> + <!-- @hide Change the screen compatibility mode of applications --> + <permission android:name="android.permission.SET_SCREEN_COMPATIBILITY" + android:permissionGroup="android.permission-group.SYSTEM_TOOLS" + android:protectionLevel="signature" + android:label="@string/permlab_setScreenCompatibility" + android:description="@string/permdesc_setScreenCompatibility" /> + <!-- Allows an application to modify the current configuration, such as locale. --> <permission android:name="android.permission.CHANGE_CONFIGURATION" diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml index dc45c40..701782c 100755 --- a/core/res/res/values/strings.xml +++ b/core/res/res/values/strings.xml @@ -532,6 +532,13 @@ tasks and kill their apps. Malicious apps may disrupt the behavior of other apps.</string> + <!-- Title of an application permission, allowing control of app screen compatibility mode --> + <string name="permlab_setScreenCompatibility">set screen compatibility</string> + <!-- Description of an application permission, allowing control of app screen compatibility mode --> + <string name="permdesc_setScreenCompatibility">Allows the app to control the + screen compatibility mode of other applications. Malicious applications may + break the behavior of other applications.</string> + <!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. --> <string name="permlab_setDebugApp">enable app debugging</string> <!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. --> |