summaryrefslogtreecommitdiffstats
path: root/policy
diff options
context:
space:
mode:
authorCraig Mautner <cmautner@google.com>2012-05-23 16:57:23 -0700
committerCraig Mautner <cmautner@google.com>2012-05-23 16:57:23 -0700
commit8e4df6c1e261a5b41193b00b1c0ce0badaa84f1c (patch)
tree63d2c6e011b3b1b8f98964ecebc100efb071f7e8 /policy
parent85aea3664992cd1e16ef4497c3450b26bdef06b0 (diff)
downloadframeworks_base-8e4df6c1e261a5b41193b00b1c0ce0badaa84f1c.zip
frameworks_base-8e4df6c1e261a5b41193b00b1c0ce0badaa84f1c.tar.gz
frameworks_base-8e4df6c1e261a5b41193b00b1c0ce0badaa84f1c.tar.bz2
Fix jank when launching apps that show wallpaper.
Do not create a StartingWindow for apps that show wallpaper. Fix handling of obscure case where found wallpaper is hidden. Fixes bug 6484034. Change-Id: I07181c4aea56fa9e530df0c95d886fe8ad61ec9d
Diffstat (limited to 'policy')
-rwxr-xr-xpolicy/src/com/android/internal/policy/impl/PhoneWindowManager.java25
1 files changed, 15 insertions, 10 deletions
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
index 29de5c1..4ee0d25 100755
--- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -33,6 +33,7 @@ import android.content.pm.PackageManager;
import android.content.res.CompatibilityInfo;
import android.content.res.Configuration;
import android.content.res.Resources;
+import android.content.res.TypedArray;
import android.database.ContentObserver;
import android.graphics.PixelFormat;
import android.graphics.Rect;
@@ -1434,8 +1435,9 @@ public class PhoneWindowManager implements WindowManagerPolicy {
&& attrs.type != WindowManager.LayoutParams.TYPE_NAVIGATION_BAR
&& attrs.type != WindowManager.LayoutParams.TYPE_WALLPAPER;
}
-
+
/** {@inheritDoc} */
+ @Override
public View addStartingWindow(IBinder appToken, String packageName, int theme,
CompatibilityInfo compatInfo, CharSequence nonLocalizedLabel, int labelRes,
int icon, int windowFlags) {
@@ -1445,7 +1447,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
if (packageName == null) {
return null;
}
-
+
try {
Context context = mContext;
//Log.i(TAG, "addStartingWindow " + packageName + ": nonLocalizedLabel="
@@ -1458,16 +1460,19 @@ public class PhoneWindowManager implements WindowManagerPolicy {
// Ignore
}
}
-
+
Window win = PolicyManager.makeNewWindow(context);
- if (win.getWindowStyle().getBoolean(
- com.android.internal.R.styleable.Window_windowDisablePreview, false)) {
+ final TypedArray ta = win.getWindowStyle();
+ if (ta.getBoolean(
+ com.android.internal.R.styleable.Window_windowDisablePreview, false)
+ || ta.getBoolean(
+ com.android.internal.R.styleable.Window_windowShowWallpaper,false)) {
return null;
}
-
+
Resources r = context.getResources();
win.setTitle(r.getText(labelRes, nonLocalizedLabel));
-
+
win.setType(
WindowManager.LayoutParams.TYPE_APPLICATION_STARTING);
// Force the window flags: this is a fake window, so it is not really
@@ -1483,14 +1488,14 @@ public class PhoneWindowManager implements WindowManagerPolicy {
WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE|
WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE|
WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);
-
+
if (!compatInfo.supportsScreen()) {
win.addFlags(WindowManager.LayoutParams.FLAG_COMPATIBLE_WINDOW);
}
win.setLayout(WindowManager.LayoutParams.MATCH_PARENT,
WindowManager.LayoutParams.MATCH_PARENT);
-
+
final WindowManager.LayoutParams params = win.getAttributes();
params.token = appToken;
params.packageName = packageName;
@@ -1512,7 +1517,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
// earlier.)
return null;
}
-
+
if (localLOGV) Log.v(
TAG, "Adding starting window for " + packageName
+ " / " + appToken + ": "