resolved conflicts for merge of 590ec479 to master
Change-Id: I30503da6a73b9cb15eee66a67c75d50ccdc4b9f0
diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java
index cf5592c..262e5ce 100644
--- a/services/java/com/android/server/am/ActivityManagerService.java
+++ b/services/java/com/android/server/am/ActivityManagerService.java
@@ -968,10 +968,12 @@
static final int CHECK_EXCESSIVE_WAKE_LOCKS_MSG = 27;
static final int CLEAR_DNS_CACHE = 28;
static final int UPDATE_HTTP_PROXY = 29;
- static final int DISPATCH_FOREGROUND_ACTIVITIES_CHANGED = 30;
- static final int DISPATCH_PROCESS_DIED = 31;
+ static final int SHOW_COMPAT_MODE_DIALOG_MSG = 30;
+ static final int DISPATCH_FOREGROUND_ACTIVITIES_CHANGED = 31;
+ static final int DISPATCH_PROCESS_DIED = 32;
AlertDialog mUidAlert;
+ CompatModeDialog mCompatModeDialog;
final Handler mHandler = new Handler() {
//public Handler() {
@@ -1270,6 +1272,34 @@
sendMessageDelayed(nmsg, POWER_CHECK_DELAY);
}
} break;
+ case SHOW_COMPAT_MODE_DIALOG_MSG: {
+ synchronized (ActivityManagerService.this) {
+ ActivityRecord ar = (ActivityRecord)msg.obj;
+ if (mCompatModeDialog != null) {
+ if (mCompatModeDialog.mAppInfo.packageName.equals(
+ ar.info.applicationInfo.packageName)) {
+ return;
+ }
+ mCompatModeDialog.dismiss();
+ mCompatModeDialog = null;
+ }
+ if (ar != null) {
+ if (mCompatModePackages.getPackageAskCompatModeLocked(
+ ar.packageName)) {
+ int mode = mCompatModePackages.computeCompatModeLocked(
+ ar.info.applicationInfo);
+ if (mode == ActivityManager.COMPAT_MODE_DISABLED
+ || mode == ActivityManager.COMPAT_MODE_ENABLED) {
+ mCompatModeDialog = new CompatModeDialog(
+ ActivityManagerService.this, mContext,
+ ar.info.applicationInfo);
+ mCompatModeDialog.show();
+ }
+ }
+ }
+ }
+ break;
+ }
case DISPATCH_FOREGROUND_ACTIVITIES_CHANGED: {
final ProcessRecord app = (ProcessRecord) msg.obj;
final boolean foregroundActivities = msg.arg1 != 0;
@@ -2112,6 +2142,18 @@
}
}
+ public boolean getPackageAskScreenCompat(String packageName) {
+ synchronized (this) {
+ return mCompatModePackages.getPackageAskCompatModeLocked(packageName);
+ }
+ }
+
+ public void setPackageAskScreenCompat(String packageName, boolean ask) {
+ synchronized (this) {
+ mCompatModePackages.setPackageAskCompatModeLocked(packageName, ask);
+ }
+ }
+
void reportResumedActivityLocked(ActivityRecord r) {
//Slog.i(TAG, "**** REPORT RESUME: " + r);
@@ -7948,8 +7990,14 @@
if (dumpAll) {
pw.println(" mConfigWillChange: " + mMainStack.mConfigWillChange);
if (mCompatModePackages.getPackages().size() > 0) {
- pw.print(" mScreenCompatPackages=");
- pw.println(mCompatModePackages.getPackages());
+ pw.println(" mScreenCompatPackages:");
+ for (Map.Entry<String, Integer> entry
+ : mCompatModePackages.getPackages().entrySet()) {
+ String pkg = entry.getKey();
+ int mode = entry.getValue();
+ pw.print(" "); pw.print(pkg); pw.print(": ");
+ pw.print(mode); pw.println();
+ }
}
}
pw.println(" mSleeping=" + mSleeping + " mShuttingDown=" + mShuttingDown);