diff options
author | Winson Chung <winsonc@google.com> | 2014-08-28 19:15:09 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-08-28 19:15:10 +0000 |
commit | 8bd5d6900827c465f0770290776ec52753dc9622 (patch) | |
tree | 459cc65a41d7391cc11f2496187eb917962b5d3c /services/core/java/com/android/server/am | |
parent | 45c0d5838f0a26dd69a0ee28d688b36f2fbcdc2f (diff) | |
parent | 48a10a56e98b008ac55b9d50aee1ad33b377e367 (diff) | |
download | frameworks_base-8bd5d6900827c465f0770290776ec52753dc9622.zip frameworks_base-8bd5d6900827c465f0770290776ec52753dc9622.tar.gz frameworks_base-8bd5d6900827c465f0770290776ec52753dc9622.tar.bz2 |
Merge "Change API to return thumbnail size instead of individual dimensions. (Bug 17295512)" into lmp-dev
Diffstat (limited to 'services/core/java/com/android/server/am')
-rwxr-xr-x | services/core/java/com/android/server/am/ActivityManagerService.java | 23 | ||||
-rwxr-xr-x | services/core/java/com/android/server/am/ActivityStack.java | 11 |
2 files changed, 16 insertions, 18 deletions
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java index 469eb18..1367761 100755 --- a/services/core/java/com/android/server/am/ActivityManagerService.java +++ b/services/core/java/com/android/server/am/ActivityManagerService.java @@ -1198,11 +1198,12 @@ public final class ActivityManagerService extends ActivityManagerNative */ private boolean mUserIsMonkey; - /** Flag whether the device has a recents UI */ - final boolean mHasRecents; + /** Flag whether the device has a Recents UI */ + boolean mHasRecents; - final int mThumbnailWidth; - final int mThumbnailHeight; + /** The dimensions of the thumbnails in the Recents UI. */ + int mThumbnailWidth; + int mThumbnailHeight; final ServiceThread mHandlerThread; final MainHandler mHandler; @@ -2257,11 +2258,6 @@ public final class ActivityManagerService extends ActivityManagerNative mConfigurationSeq = mConfiguration.seq = 1; mProcessCpuTracker.init(); - final Resources res = mContext.getResources(); - mHasRecents = res.getBoolean(com.android.internal.R.bool.config_hasRecents); - mThumbnailWidth = res.getDimensionPixelSize(com.android.internal.R.dimen.thumbnail_width); - mThumbnailHeight = res.getDimensionPixelSize(com.android.internal.R.dimen.thumbnail_height); - mCompatModePackages = new CompatModePackages(this, systemDir, mHandler); mIntentFirewall = new IntentFirewall(new IntentFirewallInterface(), mHandler); mStackSupervisor = new ActivityStackSupervisor(this); @@ -10680,6 +10676,14 @@ public final class ActivityManagerService extends ActivityManagerNative } } + /** Loads resources after the current configuration has been set. */ + private void loadResourcesOnSystemReady() { + final Resources res = mContext.getResources(); + mHasRecents = res.getBoolean(com.android.internal.R.bool.config_hasRecents); + mThumbnailWidth = res.getDimensionPixelSize(com.android.internal.R.dimen.thumbnail_width); + mThumbnailHeight = res.getDimensionPixelSize(com.android.internal.R.dimen.thumbnail_height); + } + public boolean testIsSystemReady() { // no need to synchronize(this) just to read & return the value return mSystemReady; @@ -10961,6 +10965,7 @@ public final class ActivityManagerService extends ActivityManagerNative } retrieveSettings(); + loadResourcesOnSystemReady(); synchronized (this) { readGrantedUriPermissionsLocked(); diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java index d066940..3efd049 100755 --- a/services/core/java/com/android/server/am/ActivityStack.java +++ b/services/core/java/com/android/server/am/ActivityStack.java @@ -229,9 +229,6 @@ final class ActivityStack { private ActivityRecord mLastScreenshotActivity = null; private Bitmap mLastScreenshotBitmap = null; - int mThumbnailWidth = -1; - int mThumbnailHeight = -1; - int mCurrentUser; final int mStackId; @@ -355,10 +352,6 @@ final class ActivityStack { mWindowManager = mService.mWindowManager; mStackId = activityContainer.mStackId; mCurrentUser = mService.mCurrentUserId; - // Get the activity screenshot thumbnail dimensions - Resources res = mService.mContext.getResources(); - mThumbnailWidth = mService.mThumbnailWidth; - mThumbnailHeight = mService.mThumbnailHeight; } /** @@ -773,8 +766,8 @@ final class ActivityStack { return null; } - int w = mThumbnailWidth; - int h = mThumbnailHeight; + int w = mService.mThumbnailWidth; + int h = mService.mThumbnailHeight; if (w > 0) { if (who != mLastScreenshotActivity || mLastScreenshotBitmap == null || mLastScreenshotActivity.state == ActivityState.RESUMED |