Spiffy new compatibility mode UI.
Change-Id: I1207eaafae59a434fcc979ad60a83e2d685288af
diff --git a/core/java/android/app/ActivityManager.java b/core/java/android/app/ActivityManager.java
index a70a219..48b8ca8 100644
--- a/core/java/android/app/ActivityManager.java
+++ b/core/java/android/app/ActivityManager.java
@@ -137,6 +137,25 @@
}
}
+ /** @hide */
+ public boolean getPackageAskScreenCompat(String packageName) {
+ try {
+ return ActivityManagerNative.getDefault().getPackageAskScreenCompat(packageName);
+ } catch (RemoteException e) {
+ // System dead, we will be dead too soon!
+ return false;
+ }
+ }
+
+ /** @hide */
+ public void setPackageAskScreenCompat(String packageName, boolean ask) {
+ try {
+ ActivityManagerNative.getDefault().setPackageAskScreenCompat(packageName, ask);
+ } catch (RemoteException e) {
+ // System dead, we will be dead too soon!
+ }
+ }
+
/**
* Return the approximate per-application memory class of the current
* device. This gives you an idea of how hard a memory limit you should
diff --git a/core/java/android/app/ActivityManagerNative.java b/core/java/android/app/ActivityManagerNative.java
index 4beb5cc..88293e8 100644
--- a/core/java/android/app/ActivityManagerNative.java
+++ b/core/java/android/app/ActivityManagerNative.java
@@ -1437,6 +1437,26 @@
return true;
}
+ case GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION:
+ {
+ data.enforceInterface(IActivityManager.descriptor);
+ String pkg = data.readString();
+ boolean ask = getPackageAskScreenCompat(pkg);
+ reply.writeNoException();
+ reply.writeInt(ask ? 1 : 0);
+ return true;
+ }
+
+ case SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION:
+ {
+ data.enforceInterface(IActivityManager.descriptor);
+ String pkg = data.readString();
+ boolean ask = data.readInt() != 0;
+ setPackageAskScreenCompat(pkg, ask);
+ reply.writeNoException();
+ return true;
+ }
+
}
return super.onTransact(code, data, reply, flags);
@@ -3208,7 +3228,8 @@
Parcel data = Parcel.obtain();
Parcel reply = Parcel.obtain();
data.writeInterfaceToken(IActivityManager.descriptor);
- mRemote.transact(SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
+ data.writeString(packageName);
+ mRemote.transact(GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
reply.readException();
int mode = reply.readInt();
reply.recycle();
@@ -3229,5 +3250,31 @@
data.recycle();
}
+ public boolean getPackageAskScreenCompat(String packageName) throws RemoteException {
+ Parcel data = Parcel.obtain();
+ Parcel reply = Parcel.obtain();
+ data.writeInterfaceToken(IActivityManager.descriptor);
+ data.writeString(packageName);
+ mRemote.transact(GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0);
+ reply.readException();
+ boolean ask = reply.readInt() != 0;
+ reply.recycle();
+ data.recycle();
+ return ask;
+ }
+
+ public void setPackageAskScreenCompat(String packageName, boolean ask)
+ throws RemoteException {
+ Parcel data = Parcel.obtain();
+ Parcel reply = Parcel.obtain();
+ data.writeInterfaceToken(IActivityManager.descriptor);
+ data.writeString(packageName);
+ data.writeInt(ask ? 1 : 0);
+ mRemote.transact(SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0);
+ reply.readException();
+ reply.recycle();
+ data.recycle();
+ }
+
private IBinder mRemote;
}
diff --git a/core/java/android/app/IActivityManager.java b/core/java/android/app/IActivityManager.java
index 24706f9..b0cbbb5 100644
--- a/core/java/android/app/IActivityManager.java
+++ b/core/java/android/app/IActivityManager.java
@@ -347,6 +347,9 @@
public int getPackageScreenCompatMode(String packageName) throws RemoteException;
public void setPackageScreenCompatMode(String packageName, int mode)
throws RemoteException;
+ public boolean getPackageAskScreenCompat(String packageName) throws RemoteException;
+ public void setPackageAskScreenCompat(String packageName, boolean ask)
+ throws RemoteException;
/*
* Private non-Binder interfaces
@@ -567,4 +570,6 @@
int SET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+124;
int GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+125;
int SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+126;
+ int GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+127;
+ int SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+128;
}