summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2011-05-31 18:11:29 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2011-05-31 18:11:29 -0700
commit7322e557cfe42da42779625d69ced2db74a9df90 (patch)
tree168cbb98976d6c44a513c3e6a7a3c79957f85fb1 /services
parent409db558b3f47ac28f1291d82bef15a07b2920c3 (diff)
parenta4cfcf10cc300a1eb5b2a4254fb7d3190c56c4f1 (diff)
downloadframeworks_base-7322e557cfe42da42779625d69ced2db74a9df90.zip
frameworks_base-7322e557cfe42da42779625d69ced2db74a9df90.tar.gz
frameworks_base-7322e557cfe42da42779625d69ced2db74a9df90.tar.bz2
am a4cfcf10: am 75d6b3c2: Merge "Fix issue #4502672: Wrong xml resources used for homescreen widgets." into honeycomb-mr2
* commit 'a4cfcf10cc300a1eb5b2a4254fb7d3190c56c4f1': Fix issue #4502672: Wrong xml resources used for homescreen widgets.
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/AppWidgetService.java1
-rw-r--r--services/java/com/android/server/am/ActivityManagerService.java9
-rw-r--r--services/java/com/android/server/am/ActivityStack.java8
-rw-r--r--services/java/com/android/server/am/CompatModePackages.java4
-rw-r--r--services/java/com/android/server/wm/StartingData.java7
-rw-r--r--services/java/com/android/server/wm/WindowManagerService.java17
6 files changed, 33 insertions, 13 deletions
diff --git a/services/java/com/android/server/AppWidgetService.java b/services/java/com/android/server/AppWidgetService.java
index a4a95a0..65f8b34 100644
--- a/services/java/com/android/server/AppWidgetService.java
+++ b/services/java/com/android/server/AppWidgetService.java
@@ -29,6 +29,7 @@ import java.util.Iterator;
import java.util.List;
import java.util.Locale;
+import org.apache.commons.logging.impl.SimpleLog;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
import org.xmlpull.v1.XmlSerializer;
diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java
index 72a2e4a..9989d3b 100644
--- a/services/java/com/android/server/am/ActivityManagerService.java
+++ b/services/java/com/android/server/am/ActivityManagerService.java
@@ -12225,6 +12225,15 @@ public final class ActivityManagerService extends ActivityManagerNative
ac.updateConfiguration(mConfiguration);
}
+ // Make sure all resources in our process are updated
+ // right now, so that anyone who is going to retrieve
+ // resource values after we return will be sure to get
+ // the new ones. This is especially important during
+ // boot, where the first config change needs to guarantee
+ // all resources have that config before following boot
+ // code is executed.
+ mSystemThread.applyConfigurationToResources(newConfig);
+
if (Settings.System.hasInterestingConfigurationChanges(changes)) {
Message msg = mHandler.obtainMessage(UPDATE_CONFIGURATION_MSG);
msg.obj = new Configuration(mConfiguration);
diff --git a/services/java/com/android/server/am/ActivityStack.java b/services/java/com/android/server/am/ActivityStack.java
index 65ea4f4..2706d49 100644
--- a/services/java/com/android/server/am/ActivityStack.java
+++ b/services/java/com/android/server/am/ActivityStack.java
@@ -1455,6 +1455,8 @@ public class ActivityStack {
if (SHOW_APP_STARTING_PREVIEW && mMainStack) {
mService.mWindowManager.setAppStartingWindow(
next, next.packageName, next.theme,
+ mService.compatibilityInfoForPackageLocked(
+ next.info.applicationInfo),
next.nonLocalizedLabel,
next.labelRes, next.icon, next.windowFlags,
null, true);
@@ -1491,6 +1493,8 @@ public class ActivityStack {
if (SHOW_APP_STARTING_PREVIEW) {
mService.mWindowManager.setAppStartingWindow(
next, next.packageName, next.theme,
+ mService.compatibilityInfoForPackageLocked(
+ next.info.applicationInfo),
next.nonLocalizedLabel,
next.labelRes, next.icon, next.windowFlags,
null, true);
@@ -1617,7 +1621,9 @@ public class ActivityStack {
else if (prev.nowVisible) prev = null;
}
mService.mWindowManager.setAppStartingWindow(
- r, r.packageName, r.theme, r.nonLocalizedLabel,
+ r, r.packageName, r.theme,
+ mService.compatibilityInfoForPackageLocked(
+ r.info.applicationInfo), r.nonLocalizedLabel,
r.labelRes, r.icon, r.windowFlags, prev, showStartingIcon);
}
} else {
diff --git a/services/java/com/android/server/am/CompatModePackages.java b/services/java/com/android/server/am/CompatModePackages.java
index 8949f48..1334bcd 100644
--- a/services/java/com/android/server/am/CompatModePackages.java
+++ b/services/java/com/android/server/am/CompatModePackages.java
@@ -150,9 +150,11 @@ public class CompatModePackages {
}
public CompatibilityInfo compatibilityInfoForPackageLocked(ApplicationInfo ai) {
- return new CompatibilityInfo(ai, mService.mConfiguration.screenLayout,
+ CompatibilityInfo ci = new CompatibilityInfo(ai, mService.mConfiguration.screenLayout,
mService.mConfiguration.smallestScreenWidthDp,
(getPackageFlags(ai.packageName)&COMPAT_FLAG_ENABLED) != 0);
+ //Slog.i(TAG, "*********** COMPAT FOR PKG " + ai.packageName + ": " + ci);
+ return ci;
}
public int computeCompatModeLocked(ApplicationInfo ai) {
diff --git a/services/java/com/android/server/wm/StartingData.java b/services/java/com/android/server/wm/StartingData.java
index 625fcfe..46bb480 100644
--- a/services/java/com/android/server/wm/StartingData.java
+++ b/services/java/com/android/server/wm/StartingData.java
@@ -16,18 +16,23 @@
package com.android.server.wm;
+import android.content.res.CompatibilityInfo;
+
final class StartingData {
final String pkg;
final int theme;
+ final CompatibilityInfo compatInfo;
final CharSequence nonLocalizedLabel;
final int labelRes;
final int icon;
final int windowFlags;
- StartingData(String _pkg, int _theme, CharSequence _nonLocalizedLabel,
+ StartingData(String _pkg, int _theme, CompatibilityInfo _compatInfo,
+ CharSequence _nonLocalizedLabel,
int _labelRes, int _icon, int _windowFlags) {
pkg = _pkg;
theme = _theme;
+ compatInfo = _compatInfo;
nonLocalizedLabel = _nonLocalizedLabel;
labelRes = _labelRes;
icon = _icon;
diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java
index 9c98296..7760897 100644
--- a/services/java/com/android/server/wm/WindowManagerService.java
+++ b/services/java/com/android/server/wm/WindowManagerService.java
@@ -602,8 +602,7 @@ public class WindowManagerService extends IWindowManager.Stub
final Configuration mTempConfiguration = new Configuration();
- // The frame use to limit the size of the app running in compatibility mode.
- Rect mCompatibleScreenFrame = new Rect();
+ // The desired scaling factor for compatible apps.
float mCompatibleScreenScale;
public static WindowManagerService main(Context context,
@@ -3526,7 +3525,8 @@ public class WindowManagerService extends IWindowManager.Stub
}
public void setAppStartingWindow(IBinder token, String pkg,
- int theme, CharSequence nonLocalizedLabel, int labelRes, int icon,
+ int theme, CompatibilityInfo compatInfo,
+ CharSequence nonLocalizedLabel, int labelRes, int icon,
int windowFlags, IBinder transferFrom, boolean createIfNeeded) {
if (!checkCallingPermission(android.Manifest.permission.MANAGE_APP_TOKENS,
"setAppStartingIcon()")) {
@@ -3676,8 +3676,7 @@ public class WindowManagerService extends IWindowManager.Stub
}
mStartingIconInTransition = true;
- wtoken.startingData = new StartingData(
- pkg, theme, nonLocalizedLabel,
+ wtoken.startingData = new StartingData(pkg, theme, compatInfo, nonLocalizedLabel,
labelRes, icon, windowFlags);
Message m = mH.obtainMessage(H.ADD_STARTING, wtoken);
// Note: we really want to do sendMessageAtFrontOfQueue() because we
@@ -5562,8 +5561,7 @@ public class WindowManagerService extends IWindowManager.Stub
dm.heightPixels = dm.unscaledHeightPixels = mAppDisplayHeight
= mPolicy.getNonDecorDisplayHeight(mRotation, dh);
- mCompatibleScreenScale = CompatibilityInfo.updateCompatibleScreenFrame(
- dm, mCompatibleScreenFrame, null);
+ mCompatibleScreenScale = CompatibilityInfo.computeCompatibleScaling(dm, null);
config.screenWidthDp = (int)(mPolicy.getConfigDisplayWidth(mRotation, dw) / dm.density);
config.screenHeightDp = (int)(mPolicy.getConfigDisplayHeight(mRotation, dh) / dm.density);
@@ -6138,9 +6136,8 @@ public class WindowManagerService extends IWindowManager.Stub
View view = null;
try {
view = mPolicy.addStartingWindow(
- wtoken.token, sd.pkg,
- sd.theme, sd.nonLocalizedLabel, sd.labelRes,
- sd.icon, sd.windowFlags);
+ wtoken.token, sd.pkg, sd.theme, sd.compatInfo,
+ sd.nonLocalizedLabel, sd.labelRes, sd.icon, sd.windowFlags);
} catch (Exception e) {
Slog.w(TAG, "Exception when adding starting window", e);
}