summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorJoe Onorato <joeo@google.com>2011-05-25 11:43:06 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2011-05-25 11:43:06 -0700
commit2c09a9c0e960163a16ad1d06055aa6ee9635c693 (patch)
tree5fc6f6752a6295d6b4003114a0c3b86d6bdbaa8c /services
parentd6f29cd8f92b098330818227428f5a42836097b7 (diff)
parent5520610cb2612054c5d0bcec9d031f7b71faa349 (diff)
downloadframeworks_base-2c09a9c0e960163a16ad1d06055aa6ee9635c693.zip
frameworks_base-2c09a9c0e960163a16ad1d06055aa6ee9635c693.tar.gz
frameworks_base-2c09a9c0e960163a16ad1d06055aa6ee9635c693.tar.bz2
am 5520610c: Merge "Make adb shell am display-size persistent." into honeycomb-mr2
* commit '5520610cb2612054c5d0bcec9d031f7b71faa349': Make adb shell am display-size persistent.
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/wm/WindowManagerService.java32
1 files changed, 31 insertions, 1 deletions
diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java
index 5c49ef09..31977e4 100644
--- a/services/java/com/android/server/wm/WindowManagerService.java
+++ b/services/java/com/android/server/wm/WindowManagerService.java
@@ -5996,8 +5996,12 @@ public class WindowManagerService extends IWindowManager.Stub
mActivityManager.updateConfiguration(null);
} catch (RemoteException e) {
}
-
+
mPolicy.systemReady();
+
+ synchronized (mWindowMap) {
+ readForcedDisplaySizeLocked();
+ }
}
// This is an animation that does nothing: it just immediately finishes
@@ -6513,6 +6517,8 @@ public class WindowManagerService extends IWindowManager.Stub
? shortDimen : mInitialDisplayHeight;
}
setForcedDisplaySizeLocked(width, height);
+ Settings.Secure.putString(mContext.getContentResolver(),
+ Settings.Secure.DISPLAY_SIZE_FORCED, width + "," + height);
}
}
@@ -6559,7 +6565,29 @@ public class WindowManagerService extends IWindowManager.Stub
}
}
+ private void readForcedDisplaySizeLocked() {
+ final String str = Settings.Secure.getString(mContext.getContentResolver(),
+ Settings.Secure.DISPLAY_SIZE_FORCED);
+ if (str == null || str.length() == 0) {
+ return;
+ }
+ final int pos = str.indexOf(',');
+ if (pos <= 0 || str.lastIndexOf(',') != pos) {
+ return;
+ }
+ int width, height;
+ try {
+ width = Integer.parseInt(str.substring(0, pos));
+ height = Integer.parseInt(str.substring(pos+1));
+ } catch (NumberFormatException ex) {
+ return;
+ }
+ setForcedDisplaySizeLocked(width, height);
+ }
+
private void setForcedDisplaySizeLocked(int width, int height) {
+ Slog.i(TAG, "Using new display size: " + width + "x" + height);
+
mBaseDisplayWidth = width;
mBaseDisplayHeight = height;
mPolicy.setInitialDisplaySize(mBaseDisplayWidth, mBaseDisplayHeight);
@@ -6589,6 +6617,8 @@ public class WindowManagerService extends IWindowManager.Stub
public void clearForcedDisplaySize() {
synchronized(mWindowMap) {
setForcedDisplaySizeLocked(mInitialDisplayWidth, mInitialDisplayHeight);
+ Settings.Secure.putString(mContext.getContentResolver(),
+ Settings.Secure.DISPLAY_SIZE_FORCED, "");
}
}