Fix issue #3302006: Cannot see the dialog lunched from a transparent activity.
The activity manager was not performing the layout pass on the new window,
because its app token was still hidden, because the activity manager / window
manager were still waiting for it to be ready to show.
Just ignore whether the app token is hidden for this case.
Also fixes some problems with animations, and tweaks the ViewConfiguration
values for xlarge screens.
Change-Id: Icbe9c77ba8127d1e02df2d6f27b8e86ec842e50a
diff --git a/services/java/com/android/server/LightsService.java b/services/java/com/android/server/LightsService.java
index 9b57735..21f2bcf 100644
--- a/services/java/com/android/server/LightsService.java
+++ b/services/java/com/android/server/LightsService.java
@@ -24,12 +24,12 @@
import android.os.Message;
import android.util.Slog;
-import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
public class LightsService {
private static final String TAG = "LightsService";
+ private static final boolean DEBUG = false;
static final int LIGHT_ID_BACKLIGHT = 0;
static final int LIGHT_ID_KEYBOARD = 1;
@@ -115,6 +115,8 @@
private void setLightLocked(int color, int mode, int onMS, int offMS, int brightnessMode) {
if (color != mColor || mode != mMode || onMS != mOnMS || offMS != mOffMS) {
+ if (DEBUG) Slog.v(TAG, "setLight #" + mId + ": color=#"
+ + Integer.toHexString(color));
mColor = color;
mMode = mode;
mOnMS = onMS;
diff --git a/services/java/com/android/server/WindowManagerService.java b/services/java/com/android/server/WindowManagerService.java
index d2a1786..ac3b96b 100644
--- a/services/java/com/android/server/WindowManagerService.java
+++ b/services/java/com/android/server/WindowManagerService.java
@@ -9515,7 +9515,7 @@
final AppWindowToken atoken = win.mAppToken;
final boolean gone = win.mViewVisibility == View.GONE
|| !win.mRelayoutCalled
- || win.mRootToken.hidden
+ || (atoken == null && win.mRootToken.hidden)
|| (atoken != null && atoken.hiddenRequested)
|| win.mAttachedHidden
|| win.mExiting || win.mDestroying;
diff --git a/services/java/com/android/server/am/ActivityRecord.java b/services/java/com/android/server/am/ActivityRecord.java
index 3dc3965..0fb30ff 100644
--- a/services/java/com/android/server/am/ActivityRecord.java
+++ b/services/java/com/android/server/am/ActivityRecord.java
@@ -60,7 +60,8 @@
final String processName; // process where this component wants to run
final String taskAffinity; // as per ActivityInfo.taskAffinity
final boolean stateNotNeeded; // As per ActivityInfo.flags
- final boolean fullscreen; // covers the full screen?
+ final boolean fullscreen; // covers the full screen?
+ final boolean noDisplay; // activity is not displayed?
final boolean componentSpecified; // did caller specifiy an explicit component?
final boolean isHomeActivity; // do we consider this to be a home activity?
final String baseDir; // where activity source (resources etc) located
@@ -165,12 +166,13 @@
pw.print(" finishing="); pw.println(finishing);
pw.print(prefix); pw.print("keysPaused="); pw.print(keysPaused);
pw.print(" inHistory="); pw.print(inHistory);
- pw.print(" immersive="); pw.print(immersive);
- pw.print(" launchMode="); pw.println(launchMode);
- pw.print(prefix); pw.print("fullscreen="); pw.print(fullscreen);
pw.print(" visible="); pw.print(visible);
pw.print(" sleeping="); pw.print(sleeping);
pw.print(" idle="); pw.println(idle);
+ pw.print(prefix); pw.print("fullscreen="); pw.print(fullscreen);
+ pw.print(" noDisplay="); pw.print(noDisplay);
+ pw.print(" immersive="); pw.print(immersive);
+ pw.print(" launchMode="); pw.println(launchMode);
pw.print(prefix); pw.print("frozenBeforeDestroy="); pw.print(frozenBeforeDestroy);
pw.print(" thumbnailNeeded="); pw.println(thumbnailNeeded);
if (launchTime != 0 || startTime != 0) {
@@ -282,6 +284,8 @@
com.android.internal.R.styleable.Window_windowIsFloating, false)
&& !ent.array.getBoolean(
com.android.internal.R.styleable.Window_windowIsTranslucent, false);
+ noDisplay = ent != null && ent.array.getBoolean(
+ com.android.internal.R.styleable.Window_windowNoDisplay, false);
if (!_componentSpecified || _launchedFromUid == Process.myUid()
|| _launchedFromUid == 0) {
@@ -318,6 +322,7 @@
processName = null;
packageName = null;
fullscreen = true;
+ noDisplay = false;
isHomeActivity = false;
immersive = false;
}
diff --git a/services/java/com/android/server/am/ActivityStack.java b/services/java/com/android/server/am/ActivityStack.java
index 3761928..2040cbd 100644
--- a/services/java/com/android/server/am/ActivityStack.java
+++ b/services/java/com/android/server/am/ActivityStack.java
@@ -750,6 +750,10 @@
}
public final Bitmap screenshotActivities(ActivityRecord who) {
+ if (who.noDisplay) {
+ return null;
+ }
+
Resources res = mService.mContext.getResources();
int w = mThumbnailWidth;
int h = mThumbnailHeight;