summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/BarTransitions.java17
-rw-r--r--policy/src/com/android/internal/policy/impl/ImmersiveModeConfirmation.java1
-rw-r--r--tests/AppLaunch/src/com/android/tests/applaunch/AppLaunch.java21
3 files changed, 24 insertions, 15 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/BarTransitions.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/BarTransitions.java
index cb17ac6..eb63a54 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/BarTransitions.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/BarTransitions.java
@@ -37,6 +37,8 @@ public class BarTransitions {
private static final boolean DEBUG = false;
private static final boolean DEBUG_COLORS = false;
+ public static final boolean HIGH_END = ActivityManager.isHighEndGfx();
+
public static final int MODE_OPAQUE = 0;
public static final int MODE_SEMI_TRANSPARENT = 1;
public static final int MODE_TRANSLUCENT = 2;
@@ -48,7 +50,6 @@ public class BarTransitions {
private final String mTag;
private final View mView;
- private final boolean mSupportsTransitions = ActivityManager.isHighEndGfx();
private final BarBackgroundDrawable mBarBackground;
private int mMode;
@@ -57,7 +58,7 @@ public class BarTransitions {
mTag = "BarTransitions." + view.getClass().getSimpleName();
mView = view;
mBarBackground = new BarBackgroundDrawable(mView.getContext(), gradientResourceId);
- if (mSupportsTransitions) {
+ if (HIGH_END) {
mView.setBackground(mBarBackground);
}
}
@@ -67,18 +68,22 @@ public class BarTransitions {
}
public void transitionTo(int mode, boolean animate) {
+ // low-end devices do not support translucent modes, fallback to opaque
+ if (!HIGH_END && (mode == MODE_SEMI_TRANSPARENT || mode == MODE_TRANSLUCENT)) {
+ mode = MODE_OPAQUE;
+ }
if (mMode == mode) return;
int oldMode = mMode;
mMode = mode;
if (DEBUG) Log.d(mTag, String.format("%s -> %s animate=%s",
modeToString(oldMode), modeToString(mode), animate));
- if (mSupportsTransitions) {
- onTransition(oldMode, mMode, animate);
- }
+ onTransition(oldMode, mMode, animate);
}
protected void onTransition(int oldMode, int newMode, boolean animate) {
- applyModeBackground(oldMode, newMode, animate);
+ if (HIGH_END) {
+ applyModeBackground(oldMode, newMode, animate);
+ }
}
protected void applyModeBackground(int oldMode, int newMode, boolean animate) {
diff --git a/policy/src/com/android/internal/policy/impl/ImmersiveModeConfirmation.java b/policy/src/com/android/internal/policy/impl/ImmersiveModeConfirmation.java
index 3e57a77..b734c41 100644
--- a/policy/src/com/android/internal/policy/impl/ImmersiveModeConfirmation.java
+++ b/policy/src/com/android/internal/policy/impl/ImmersiveModeConfirmation.java
@@ -178,6 +178,7 @@ public class ImmersiveModeConfirmation {
| WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED
,
PixelFormat.TRANSLUCENT);
+ lp.privateFlags |= WindowManager.LayoutParams.PRIVATE_FLAG_SHOW_FOR_ALL_USERS;
lp.setTitle("ImmersiveModeConfirmation");
lp.windowAnimations = com.android.internal.R.style.Animation_RecentApplications;
lp.gravity = Gravity.FILL;
diff --git a/tests/AppLaunch/src/com/android/tests/applaunch/AppLaunch.java b/tests/AppLaunch/src/com/android/tests/applaunch/AppLaunch.java
index 62f6aff..dfb8070 100644
--- a/tests/AppLaunch/src/com/android/tests/applaunch/AppLaunch.java
+++ b/tests/AppLaunch/src/com/android/tests/applaunch/AppLaunch.java
@@ -85,11 +85,13 @@ public class AppLaunch extends InstrumentationTestCase {
// do initial app launch, without force stopping
for (String app : mNameToResultKey.keySet()) {
long launchTime = startApp(app, false);
- if (launchTime <=0 ) {
+ if (launchTime <= 0) {
mNameToLaunchTime.put(app, -1L);
// simply pass the app if launch isn't successful
// error should have already been logged by startApp
continue;
+ } else {
+ mNameToLaunchTime.put(app, launchTime);
}
sleep(INITIAL_LAUNCH_IDLE_TIMEOUT);
closeApp(app, false);
@@ -98,9 +100,9 @@ public class AppLaunch extends InstrumentationTestCase {
// do the real app launch now
for (int i = 0; i < mLaunchIterations; i++) {
for (String app : mNameToResultKey.keySet()) {
- long totalLaunchTime = mNameToLaunchTime.get(app);
+ long prevLaunchTime = mNameToLaunchTime.get(app);
long launchTime = 0;
- if (totalLaunchTime < 0) {
+ if (prevLaunchTime < 0) {
// skip if the app has previous failures
continue;
}
@@ -110,18 +112,19 @@ public class AppLaunch extends InstrumentationTestCase {
mNameToLaunchTime.put(app, -1L);
continue;
}
- totalLaunchTime += launchTime;
- mNameToLaunchTime.put(app, totalLaunchTime);
+ // keep the min launch time
+ if (launchTime < prevLaunchTime) {
+ mNameToLaunchTime.put(app, launchTime);
+ }
sleep(POST_LAUNCH_IDLE_TIMEOUT);
closeApp(app, true);
sleep(BETWEEN_LAUNCH_SLEEP_TIMEOUT);
}
}
for (String app : mNameToResultKey.keySet()) {
- long totalLaunchTime = mNameToLaunchTime.get(app);
- if (totalLaunchTime != -1) {
- mResult.putDouble(mNameToResultKey.get(app),
- ((double) totalLaunchTime) / mLaunchIterations);
+ long launchTime = mNameToLaunchTime.get(app);
+ if (launchTime != -1) {
+ mResult.putLong(mNameToResultKey.get(app), launchTime);
}
}
instrumentation.sendStatus(0, mResult);