summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/java/android/appwidget/AppWidgetManager.java4
-rw-r--r--docs/html/shareables/training/CustomView.zipbin72290 -> 40248 bytes
-rw-r--r--media/java/android/media/MediaCodec.java16
-rw-r--r--packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java19
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java18
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java17
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java11
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanelTitle.java8
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java20
-rwxr-xr-xpolicy/src/com/android/internal/policy/impl/PhoneWindowManager.java19
-rw-r--r--services/java/com/android/server/SystemServer.java2
-rw-r--r--services/java/com/android/server/wm/AppWindowAnimator.java4
-rw-r--r--services/java/com/android/server/wm/AppWindowToken.java10
-rw-r--r--services/java/com/android/server/wm/WindowAnimator.java151
-rwxr-xr-xservices/java/com/android/server/wm/WindowManagerService.java147
-rw-r--r--services/java/com/android/server/wm/WindowStateAnimator.java59
16 files changed, 339 insertions, 166 deletions
diff --git a/core/java/android/appwidget/AppWidgetManager.java b/core/java/android/appwidget/AppWidgetManager.java
index 3aa5181..810e790 100644
--- a/core/java/android/appwidget/AppWidgetManager.java
+++ b/core/java/android/appwidget/AppWidgetManager.java
@@ -323,7 +323,7 @@ public class AppWidgetManager {
*
* <p>
* The total Bitmap memory used by the RemoteViews object cannot exceed that required to
- * fill the screen once, ie. (screen width x screen height x 4) bytes.
+ * fill the screen 1.5 times, ie. (screen width x screen height x 4 x 1.5) bytes.
*
* @param appWidgetIds The AppWidget instances for which to set the RemoteViews.
* @param views The RemoteViews object to show.
@@ -391,7 +391,7 @@ public class AppWidgetManager {
*
* <p>
* The total Bitmap memory used by the RemoteViews object cannot exceed that required to
- * fill the screen once, ie. (screen width x screen height x 4) bytes.
+ * fill the screen 1.5 times, ie. (screen width x screen height x 4 x 1.5) bytes.
*
* @param appWidgetId The AppWidget instance for which to set the RemoteViews.
* @param views The RemoteViews object to show.
diff --git a/docs/html/shareables/training/CustomView.zip b/docs/html/shareables/training/CustomView.zip
index f8c1c7a..d7ae8a2 100644
--- a/docs/html/shareables/training/CustomView.zip
+++ b/docs/html/shareables/training/CustomView.zip
Binary files differ
diff --git a/media/java/android/media/MediaCodec.java b/media/java/android/media/MediaCodec.java
index 2debd57..fcb676d 100644
--- a/media/java/android/media/MediaCodec.java
+++ b/media/java/android/media/MediaCodec.java
@@ -159,6 +159,22 @@ final public class MediaCodec {
/**
* Instantiate a decoder supporting input data of the given mime type.
+ *
+ * The following is a partial list of defined mime types and their semantics:
+ * <ul>
+ * <li>"video/x-vnd.on2.vp8" - VPX video (i.e. video in .webm)
+ * <li>"video/avc" - H.264/AVC video
+ * <li>"video/mp4v-es" - MPEG4 video
+ * <li>"video/3gpp" - H.263 video
+ * <li>"audio/3gpp" - AMR narrowband audio
+ * <li>"audio/amr-wb" - AMR wideband audio
+ * <li>"audio/mpeg" - MPEG1/2 audio layer III
+ * <li>"audio/mp4a-latm" - AAC audio
+ * <li>"audio/vorbis" - vorbis audio
+ * <li>"audio/g711-alaw" - G.711 alaw audio
+ * <li>"audio/g711-mlaw" - G.711 ulaw audio
+ * </ul>
+ *
* @param type The mime type of the input data.
*/
public static MediaCodec createDecoderByType(String type) {
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
index b0939de..2594167 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
@@ -63,7 +63,7 @@ public class DatabaseHelper extends SQLiteOpenHelper {
// database gets upgraded properly. At a minimum, please confirm that 'upgradeVersion'
// is properly propagated through your change. Not doing so will result in a loss of user
// settings.
- private static final int DATABASE_VERSION = 78;
+ private static final int DATABASE_VERSION = 79;
private Context mContext;
@@ -1054,6 +1054,23 @@ public class DatabaseHelper extends SQLiteOpenHelper {
upgradeVersion = 78;
}
+ if (upgradeVersion == 78) {
+ // The JavaScript based screen-reader URL changes in JellyBean.
+ db.beginTransaction();
+ SQLiteStatement stmt = null;
+ try {
+ stmt = db.compileStatement("INSERT OR REPLACE INTO secure(name,value)"
+ + " VALUES(?,?);");
+ loadStringSetting(stmt, Settings.Secure.ACCESSIBILITY_SCREEN_READER_URL,
+ R.string.def_accessibility_screen_reader_url);
+ db.setTransactionSuccessful();
+ } finally {
+ db.endTransaction();
+ if (stmt != null) stmt.close();
+ }
+ upgradeVersion = 79;
+ }
+
// *** Remember to update DATABASE_VERSION above!
if (upgradeVersion != currentVersion) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
index a2a03ea..04cff96 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
@@ -65,6 +65,7 @@ import com.android.systemui.recent.RecentsPanelView;
import com.android.systemui.recent.RecentTasksLoader;
import com.android.systemui.recent.TaskDescription;
import com.android.systemui.statusbar.CommandQueue;
+import com.android.systemui.statusbar.NotificationData.Entry;
import com.android.systemui.statusbar.policy.NotificationRowLayout;
import com.android.systemui.statusbar.tablet.StatusBarPanel;
@@ -935,4 +936,21 @@ public abstract class BaseStatusBar extends SystemUI implements
}
}
}
+
+ // Q: What kinds of notifications should show during setup?
+ // A: Almost none! Only things coming from the system (package is "android") that also
+ // have special "kind" tags marking them as relevant for setup (see below).
+ protected boolean showNotificationEvenIfUnprovisioned(StatusBarNotification sbn) {
+ if ("android".equals(sbn.pkg)) {
+ if (sbn.notification.kind != null) {
+ for (String aKind : sbn.notification.kind) {
+ // IME switcher, created by InputMethodManagerService
+ if ("android.system.imeswitcher".equals(aKind)) return true;
+ // OTA availability & errors, created by SystemUpdateService
+ if ("android.system.update".equals(aKind)) return true;
+ }
+ }
+ }
+ return false;
+ }
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
index 3c19ad2..eff6061 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -821,23 +821,6 @@ public class PhoneStatusBar extends BaseStatusBar {
R.integer.config_show_search_delay);
}
- // Q: What kinds of notifications should show during setup?
- // A: Almost none! Only things coming from the system (package is "android") that also
- // have special "kind" tags marking them as relevant for setup (see below).
- private boolean showNotificationEvenIfUnprovisioned(StatusBarNotification sbn) {
- if ("android".equals(sbn.pkg)) {
- if (sbn.notification.kind != null) {
- for (String aKind : sbn.notification.kind) {
- // IME switcher, created by InputMethodManagerService
- if ("android.system.imeswitcher".equals(aKind)) return true;
- // OTA availability & errors, created by SystemUpdateService
- if ("android.system.update".equals(aKind)) return true;
- }
- }
- }
- return false;
- }
-
private void loadNotificationShade() {
if (mPile == null) return;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java
index af0f9d3..fdbfb65 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java
@@ -217,7 +217,7 @@ public class NotificationPanel extends RelativeLayout implements StatusBarPanel,
*/
public void onClick(View v) {
- if (v == mTitleArea) {
+ if (mSettingsButton.isEnabled() && v == mTitleArea) {
swapPanels();
}
}
@@ -280,7 +280,7 @@ public class NotificationPanel extends RelativeLayout implements StatusBarPanel,
public void updatePanelModeButtons() {
final boolean settingsVisible = (mSettingsView != null);
- mSettingsButton.setVisibility(!settingsVisible ? View.VISIBLE : View.GONE);
+ mSettingsButton.setVisibility(!settingsVisible && mSettingsButton.isEnabled() ? View.VISIBLE : View.GONE);
mNotificationButton.setVisibility(settingsVisible ? View.VISIBLE : View.GONE);
}
@@ -421,5 +421,12 @@ public class NotificationPanel extends RelativeLayout implements StatusBarPanel,
super.onTouchEvent(ev);
return handled;
}
+
+ public void setSettingsEnabled(boolean settingsEnabled) {
+ if (mSettingsButton != null) {
+ mSettingsButton.setEnabled(settingsEnabled);
+ mSettingsButton.setVisibility(settingsEnabled ? View.VISIBLE : View.GONE);
+ }
+ }
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanelTitle.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanelTitle.java
index 00cf3c5..d180ab9 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanelTitle.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanelTitle.java
@@ -32,7 +32,7 @@ import com.android.systemui.R;
public class NotificationPanelTitle extends RelativeLayout implements View.OnClickListener {
private NotificationPanel mPanel;
private ArrayList<View> buttons;
- private View mNotificationsButton;
+ private View mSettingsButton;
public NotificationPanelTitle(Context context, AttributeSet attrs) {
super(context, attrs);
@@ -47,7 +47,7 @@ public class NotificationPanelTitle extends RelativeLayout implements View.OnCli
@Override
public void onFinishInflate() {
super.onFinishInflate();
- buttons.add(findViewById(R.id.settings_button));
+ buttons.add(mSettingsButton = findViewById(R.id.settings_button));
buttons.add(findViewById(R.id.notification_button));
}
@@ -63,6 +63,8 @@ public class NotificationPanelTitle extends RelativeLayout implements View.OnCli
@Override
public boolean onTouchEvent(MotionEvent e) {
+ if (!mSettingsButton.isEnabled())
+ return false;
switch (e.getAction()) {
case MotionEvent.ACTION_DOWN:
setPressed(true);
@@ -88,7 +90,7 @@ public class NotificationPanelTitle extends RelativeLayout implements View.OnCli
@Override
public void onClick(View v) {
- if (v == this) {
+ if (mSettingsButton.isEnabled() && v == this) {
mPanel.swapPanels();
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
index 9b46af8..29d8c98 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
@@ -1235,7 +1235,7 @@ public class TabletStatusBar extends BaseStatusBar implements
@Override
protected void setAreThereNotifications() {
if (mNotificationPanel != null) {
- mNotificationPanel.setClearable(mNotificationData.hasClearableItems());
+ mNotificationPanel.setClearable(isDeviceProvisioned() && mNotificationData.hasClearableItems());
}
}
@@ -1533,10 +1533,13 @@ public class TabletStatusBar extends BaseStatusBar implements
if (mInputMethodSwitchButton.getVisibility() != View.GONE) maxNotificationIconsCount --;
if (mCompatModeButton.getVisibility() != View.GONE) maxNotificationIconsCount --;
+ final boolean provisioned = isDeviceProvisioned();
+ // If the device hasn't been through Setup, we only show system notifications
for (int i=0; toShow.size()< maxNotificationIconsCount; i++) {
if (i >= N) break;
Entry ent = mNotificationData.get(N-i-1);
- if (ent.notification.score >= HIDE_ICONS_BELOW_SCORE) {
+ if ((provisioned && ent.notification.score >= HIDE_ICONS_BELOW_SCORE)
+ || showNotificationEvenIfUnprovisioned(ent.notification)) {
toShow.add(ent.icon);
}
}
@@ -1567,9 +1570,13 @@ public class TabletStatusBar extends BaseStatusBar implements
ArrayList<View> toShow = new ArrayList<View>();
+ final boolean provisioned = isDeviceProvisioned();
+ // If the device hasn't been through Setup, we only show system notifications
for (int i=0; i<N; i++) {
- View row = mNotificationData.get(N-i-1).row;
- toShow.add(row);
+ Entry ent = mNotificationData.get(N-i-1);
+ if (provisioned || showNotificationEvenIfUnprovisioned(ent.notification)) {
+ toShow.add(ent.row);
+ }
}
ArrayList<View> toRemove = new ArrayList<View>();
@@ -1588,11 +1595,12 @@ public class TabletStatusBar extends BaseStatusBar implements
View v = toShow.get(i);
if (v.getParent() == null) {
// the notification panel has the most important things at the bottom
- mPile.addView(v, N-1-i);
+ mPile.addView(v, Math.min(toShow.size()-1-i, mPile.getChildCount()));
}
}
- mNotificationPanel.setNotificationCount(N);
+ mNotificationPanel.setNotificationCount(toShow.size());
+ mNotificationPanel.setSettingsEnabled(isDeviceProvisioned());
}
@Override
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
index 756a3df..41a6ae7 100755
--- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -65,7 +65,6 @@ import com.android.internal.telephony.ITelephony;
import com.android.internal.widget.PointerLocationView;
import android.service.dreams.IDreamManager;
-import android.speech.RecognizerIntent;
import android.util.DisplayMetrics;
import android.util.EventLog;
import android.util.Log;
@@ -160,6 +159,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
static final boolean localLOGV = false;
static final boolean DEBUG_LAYOUT = false;
static final boolean DEBUG_INPUT = false;
+ static final boolean DEBUG_STARTING_WINDOW = false;
static final boolean SHOW_STARTING_ANIMATIONS = true;
static final boolean SHOW_PROCESSES_ON_ALT_MENU = false;
@@ -1454,8 +1454,9 @@ public class PhoneWindowManager implements WindowManagerPolicy {
try {
Context context = mContext;
- //Log.i(TAG, "addStartingWindow " + packageName + ": nonLocalizedLabel="
- // + nonLocalizedLabel + " theme=" + Integer.toHexString(theme));
+ if (DEBUG_STARTING_WINDOW) Slog.d(TAG, "addStartingWindow " + packageName
+ + ": nonLocalizedLabel=" + nonLocalizedLabel + " theme="
+ + Integer.toHexString(theme));
if (theme != context.getThemeResId() || labelRes != 0) {
try {
context = context.createPackageContext(packageName, 0);
@@ -1522,7 +1523,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
return null;
}
- if (localLOGV) Log.v(
+ if (DEBUG_STARTING_WINDOW) Slog.d(
TAG, "Adding starting window for " + packageName
+ " / " + appToken + ": "
+ (view.getParent() != null ? view : null));
@@ -1547,11 +1548,11 @@ public class PhoneWindowManager implements WindowManagerPolicy {
/** {@inheritDoc} */
public void removeStartingWindow(IBinder appToken, View window) {
- // RuntimeException e = new RuntimeException();
- // Log.i(TAG, "remove " + appToken + " " + window, e);
-
- if (localLOGV) Log.v(
- TAG, "Removing starting window for " + appToken + ": " + window);
+ if (DEBUG_STARTING_WINDOW) {
+ RuntimeException e = new RuntimeException("here");
+ e.fillInStackTrace();
+ Log.v(TAG, "Removing starting window for " + appToken + ": " + window, e);
+ }
if (window != null) {
WindowManager wm = (WindowManager)mContext.getSystemService(Context.WINDOW_SERVICE);
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java
index eaecd4c..9dd4a91 100644
--- a/services/java/com/android/server/SystemServer.java
+++ b/services/java/com/android/server/SystemServer.java
@@ -229,7 +229,7 @@ class ServerThread extends Thread {
Slog.i(TAG, "Window Manager");
wm = WindowManagerService.main(context, power,
factoryTest != SystemServer.FACTORY_TEST_LOW_LEVEL,
- !firstBoot);
+ !firstBoot, onlyCore);
ServiceManager.addService(Context.WINDOW_SERVICE, wm);
inputManager = wm.getInputManagerService();
ServiceManager.addService(Context.INPUT_SERVICE, inputManager);
diff --git a/services/java/com/android/server/wm/AppWindowAnimator.java b/services/java/com/android/server/wm/AppWindowAnimator.java
index 1953ad7..13e8bc5 100644
--- a/services/java/com/android/server/wm/AppWindowAnimator.java
+++ b/services/java/com/android/server/wm/AppWindowAnimator.java
@@ -35,6 +35,10 @@ public class AppWindowAnimator {
// AppWindowToken animations.
int animLayerAdjustment;
+ // Propagated from AppWindowToken.allDrawn, to determine when
+ // the state changes.
+ boolean allDrawn;
+
// Special surface for thumbnail animation.
Surface thumbnail;
int thumbnailTransactionSeq;
diff --git a/services/java/com/android/server/wm/AppWindowToken.java b/services/java/com/android/server/wm/AppWindowToken.java
index bf35154..6ecbb8e 100644
--- a/services/java/com/android/server/wm/AppWindowToken.java
+++ b/services/java/com/android/server/wm/AppWindowToken.java
@@ -241,12 +241,18 @@ class AppWindowToken extends WindowToken {
pw.print(prefix); pw.print("paused="); pw.println(paused);
}
if (numInterestingWindows != 0 || numDrawnWindows != 0
- || inPendingTransaction || allDrawn) {
+ || allDrawn || mAppAnimator.allDrawn) {
pw.print(prefix); pw.print("numInterestingWindows=");
pw.print(numInterestingWindows);
pw.print(" numDrawnWindows="); pw.print(numDrawnWindows);
pw.print(" inPendingTransaction="); pw.print(inPendingTransaction);
- pw.print(" allDrawn="); pw.println(allDrawn);
+ pw.print(" allDrawn="); pw.print(allDrawn);
+ pw.print(" (animator="); pw.print(mAppAnimator.allDrawn);
+ pw.println(")");
+ }
+ if (inPendingTransaction) {
+ pw.print(prefix); pw.print("inPendingTransaction=");
+ pw.println(inPendingTransaction);
}
if (startingData != null || removed || firstWindowDrawn) {
pw.print(prefix); pw.print("startingData="); pw.print(startingData);
diff --git a/services/java/com/android/server/wm/WindowAnimator.java b/services/java/com/android/server/wm/WindowAnimator.java
index 758b6e7..fdd8aab 100644
--- a/services/java/com/android/server/wm/WindowAnimator.java
+++ b/services/java/com/android/server/wm/WindowAnimator.java
@@ -38,7 +38,6 @@ public class WindowAnimator {
ArrayList<WindowStateAnimator> mWinAnimators = new ArrayList<WindowStateAnimator>();
boolean mAnimating;
- boolean mTokenMayBeDrawn;
boolean mForceHiding;
WindowState mWindowAnimationBackground;
int mWindowAnimationBackgroundColor;
@@ -57,7 +56,7 @@ public class WindowAnimator {
/** Skip repeated AppWindowTokens initialization. Note that AppWindowsToken's version of this
* is a long initialized to Long.MIN_VALUE so that it doesn't match this value on startup. */
- private int mTransactionSequence;
+ private int mAnimTransactionSequence;
/** The one and only screen rotation if one is happening */
ScreenRotationAnimation mScreenRotationAnimation = null;
@@ -194,7 +193,7 @@ public class WindowAnimator {
}
private void updateWindowsAndWallpaperLocked() {
- ++mTransactionSequence;
+ ++mAnimTransactionSequence;
ArrayList<WindowStateAnimator> unForceHiding = null;
boolean wallpaperInUnForceHiding = false;
@@ -332,59 +331,22 @@ public class WindowAnimator {
}
final AppWindowToken atoken = win.mAppToken;
- if (atoken != null && (!atoken.allDrawn || atoken.mAppAnimator.freezingScreen)) {
- if (atoken.lastTransactionSequence != mTransactionSequence) {
- atoken.lastTransactionSequence = mTransactionSequence;
- atoken.numInterestingWindows = atoken.numDrawnWindows = 0;
- atoken.startingDisplayed = false;
- }
- if ((win.isOnScreen() || winAnimator.mAttrType
- == WindowManager.LayoutParams.TYPE_BASE_APPLICATION)
- && !win.mExiting && !win.mDestroying) {
- if (WindowManagerService.DEBUG_VISIBILITY ||
- WindowManagerService.DEBUG_ORIENTATION) {
- Slog.v(TAG, "Eval win " + win + ": isDrawn=" + win.isDrawnLw()
- + ", isAnimating=" + winAnimator.isAnimating());
- if (!win.isDrawnLw()) {
- Slog.v(TAG, "Not displayed: s=" + winAnimator.mSurface
- + " pv=" + win.mPolicyVisibility
- + " mDrawState=" + winAnimator.mDrawState
- + " ah=" + win.mAttachedHidden
- + " th=" + atoken.hiddenRequested
- + " a=" + winAnimator.mAnimating);
- }
- }
- if (win != atoken.startingWindow) {
- if (!atoken.mAppAnimator.freezingScreen || !win.mAppFreezing) {
- atoken.numInterestingWindows++;
- if (win.isDrawnLw()) {
- atoken.numDrawnWindows++;
- if (WindowManagerService.DEBUG_VISIBILITY ||
- WindowManagerService.DEBUG_ORIENTATION) Slog.v(TAG,
- "tokenMayBeDrawn: " + atoken
- + " freezingScreen=" + atoken.mAppAnimator.freezingScreen
- + " mAppFreezing=" + win.mAppFreezing);
- mTokenMayBeDrawn = true;
- }
+ if (winAnimator.mDrawState == WindowStateAnimator.READY_TO_SHOW) {
+ if (atoken == null || atoken.allDrawn) {
+ if (winAnimator.performShowLocked()) {
+ mPendingLayoutChanges |= WindowManagerPolicy.FINISH_LAYOUT_REDO_ANIM;
+ if (WindowManagerService.DEBUG_LAYOUT_REPEATS) {
+ mService.debugLayoutRepeats("updateWindowsAndWallpaperLocked 5",
+ mPendingLayoutChanges);
}
- } else if (win.isDrawnLw()) {
- atoken.startingDisplayed = true;
- }
- }
- } else if (winAnimator.mDrawState == WindowStateAnimator.READY_TO_SHOW) {
- if (winAnimator.performShowLocked()) {
- mPendingLayoutChanges |= WindowManagerPolicy.FINISH_LAYOUT_REDO_ANIM;
- if (WindowManagerService.DEBUG_LAYOUT_REPEATS) {
- mService.debugLayoutRepeats("updateWindowsAndWallpaperLocked 5",
- mPendingLayoutChanges);
}
}
}
final AppWindowAnimator appAnimator =
atoken == null ? null : atoken.mAppAnimator;
if (appAnimator != null && appAnimator.thumbnail != null) {
- if (appAnimator.thumbnailTransactionSeq != mTransactionSequence) {
- appAnimator.thumbnailTransactionSeq = mTransactionSequence;
+ if (appAnimator.thumbnailTransactionSeq != mAnimTransactionSequence) {
+ appAnimator.thumbnailTransactionSeq = mAnimTransactionSequence;
appAnimator.thumbnailLayer = 0;
}
if (appAnimator.thumbnailLayer < winAnimator.mAnimLayer) {
@@ -414,39 +376,32 @@ public class WindowAnimator {
final int NT = appTokens.size();
for (int i=0; i<NT; i++) {
AppWindowToken wtoken = appTokens.get(i);
- if (wtoken.mAppAnimator.freezingScreen) {
- int numInteresting = wtoken.numInterestingWindows;
- if (numInteresting > 0 && wtoken.numDrawnWindows >= numInteresting) {
- if (WindowManagerService.DEBUG_VISIBILITY) Slog.v(TAG,
- "allDrawn: " + wtoken
- + " interesting=" + numInteresting
- + " drawn=" + wtoken.numDrawnWindows);
- wtoken.mAppAnimator.showAllWindowsLocked();
- mService.unsetAppFreezingScreenLocked(wtoken, false, true);
- if (WindowManagerService.DEBUG_ORIENTATION) Slog.i(TAG,
- "Setting mOrientationChangeComplete=true because wtoken "
- + wtoken + " numInteresting=" + numInteresting
- + " numDrawn=" + wtoken.numDrawnWindows);
- // This will set mOrientationChangeComplete and cause a pass through layout.
- mPendingLayoutChanges |= WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER;
- }
- } else if (!wtoken.allDrawn) {
- int numInteresting = wtoken.numInterestingWindows;
- if (numInteresting > 0 && wtoken.numDrawnWindows >= numInteresting) {
- if (WindowManagerService.DEBUG_VISIBILITY) Slog.v(TAG,
- "allDrawn: " + wtoken
- + " interesting=" + numInteresting
- + " drawn=" + wtoken.numDrawnWindows);
- wtoken.allDrawn = true;
- mPendingLayoutChanges |= PhoneWindowManager.FINISH_LAYOUT_REDO_ANIM;
- if (WindowManagerService.DEBUG_LAYOUT_REPEATS) {
- mService.debugLayoutRepeats("testTokenMayBeDrawnLocked",
- mPendingLayoutChanges);
- }
+ final boolean allDrawn = wtoken.allDrawn;
+ if (allDrawn != wtoken.mAppAnimator.allDrawn) {
+ wtoken.mAppAnimator.allDrawn = allDrawn;
+ if (allDrawn) {
+ // The token has now changed state to having all
+ // windows shown... what to do, what to do?
+ if (wtoken.mAppAnimator.freezingScreen) {
+ wtoken.mAppAnimator.showAllWindowsLocked();
+ mService.unsetAppFreezingScreenLocked(wtoken, false, true);
+ if (WindowManagerService.DEBUG_ORIENTATION) Slog.i(TAG,
+ "Setting mOrientationChangeComplete=true because wtoken "
+ + wtoken + " numInteresting=" + wtoken.numInterestingWindows
+ + " numDrawn=" + wtoken.numDrawnWindows);
+ // This will set mOrientationChangeComplete and cause a pass through layout.
+ mPendingLayoutChanges |= WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER;
+ } else {
+ mPendingLayoutChanges |= PhoneWindowManager.FINISH_LAYOUT_REDO_ANIM;
+ if (WindowManagerService.DEBUG_LAYOUT_REPEATS) {
+ mService.debugLayoutRepeats("testTokenMayBeDrawnLocked",
+ mPendingLayoutChanges);
+ }
- // We can now show all of the drawn windows!
- if (!mService.mOpeningApps.contains(wtoken)) {
- mAnimating |= wtoken.mAppAnimator.showAllWindowsLocked();
+ // We can now show all of the drawn windows!
+ if (!mService.mOpeningApps.contains(wtoken)) {
+ mAnimating |= wtoken.mAppAnimator.showAllWindowsLocked();
+ }
}
}
}
@@ -454,7 +409,6 @@ public class WindowAnimator {
}
private void performAnimationsLocked() {
- mTokenMayBeDrawn = false;
mForceHiding = false;
mDetachedWallpaper = null;
mWindowAnimationBackground = null;
@@ -465,9 +419,7 @@ public class WindowAnimator {
mPendingActions |= WALLPAPER_ACTION_PENDING;
}
- if (mTokenMayBeDrawn) {
- testTokenMayBeDrawnLocked();
- }
+ testTokenMayBeDrawnLocked();
}
synchronized void animate() {
@@ -584,18 +536,23 @@ public class WindowAnimator {
}
public void dump(PrintWriter pw, String prefix, boolean dumpAll) {
- if (mWindowDetachedWallpaper != null) {
- pw.print(" mWindowDetachedWallpaper="); pw.println(mWindowDetachedWallpaper);
- }
- if (mWindowAnimationBackgroundSurface != null) {
- pw.println(" mWindowAnimationBackgroundSurface:");
- mWindowAnimationBackgroundSurface.printTo(" ", pw);
- }
- if (mDimAnimator != null) {
- pw.println(" mDimAnimator:");
- mDimAnimator.printTo(" ", pw);
- } else {
- pw.println( " no DimAnimator ");
+ if (dumpAll) {
+ if (mWindowDetachedWallpaper != null) {
+ pw.print(prefix); pw.print("mWindowDetachedWallpaper=");
+ pw.println(mWindowDetachedWallpaper);
+ }
+ pw.print(prefix); pw.print("mAnimTransactionSequence=");
+ pw.println(mAnimTransactionSequence);
+ if (mWindowAnimationBackgroundSurface != null) {
+ pw.print(prefix); pw.print("mWindowAnimationBackgroundSurface:");
+ mWindowAnimationBackgroundSurface.printTo(prefix + " ", pw);
+ }
+ if (mDimAnimator != null) {
+ pw.print(prefix); pw.print("mDimAnimator:");
+ mDimAnimator.printTo(prefix + " ", pw);
+ } else {
+ pw.print(prefix); pw.print("no DimAnimator ");
+ }
}
}
diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java
index 73bfe8e..c850bd2 100755
--- a/services/java/com/android/server/wm/WindowManagerService.java
+++ b/services/java/com/android/server/wm/WindowManagerService.java
@@ -96,6 +96,7 @@ import android.util.DisplayMetrics;
import android.util.EventLog;
import android.util.FloatMath;
import android.util.Log;
+import android.util.LogPrinter;
import android.util.Pair;
import android.util.Slog;
import android.util.SparseIntArray;
@@ -642,6 +643,10 @@ public class WindowManagerService extends IWindowManager.Stub
}
LayoutFields mInnerFields = new LayoutFields();
+ /** Skip repeated AppWindowTokens initialization. Note that AppWindowsToken's version of this
+ * is a long initialized to Long.MIN_VALUE so that it doesn't match this value on startup. */
+ private int mTransactionSequence;
+
/** Only do a maximum of 6 repeated layouts. After that quit */
private int mLayoutRepeatCount;
@@ -758,9 +763,15 @@ public class WindowManagerService extends IWindowManager.Stub
// The desired scaling factor for compatible apps.
float mCompatibleScreenScale;
+ // If true, only the core apps and services are being launched because the device
+ // is in a special boot mode, such as being encrypted or waiting for a decryption password.
+ // For example, when this flag is true, there will be no wallpaper service.
+ final boolean mOnlyCore;
+
public static WindowManagerService main(Context context,
- PowerManagerService pm, boolean haveInputMethods, boolean allowBootMsgs) {
- WMThread thr = new WMThread(context, pm, haveInputMethods, allowBootMsgs);
+ PowerManagerService pm, boolean haveInputMethods, boolean allowBootMsgs,
+ boolean onlyCore) {
+ WMThread thr = new WMThread(context, pm, haveInputMethods, allowBootMsgs, onlyCore);
thr.start();
synchronized (thr) {
@@ -781,21 +792,25 @@ public class WindowManagerService extends IWindowManager.Stub
private final PowerManagerService mPM;
private final boolean mHaveInputMethods;
private final boolean mAllowBootMessages;
+ private final boolean mOnlyCore;
public WMThread(Context context, PowerManagerService pm,
- boolean haveInputMethods, boolean allowBootMsgs) {
+ boolean haveInputMethods, boolean allowBootMsgs, boolean onlyCore) {
super("WindowManager");
mContext = context;
mPM = pm;
mHaveInputMethods = haveInputMethods;
mAllowBootMessages = allowBootMsgs;
+ mOnlyCore = onlyCore;
}
@Override
public void run() {
Looper.prepare();
+ //Looper.myLooper().setMessageLogging(new LogPrinter(
+ // android.util.Log.DEBUG, TAG, android.util.Log.LOG_ID_SYSTEM));
WindowManagerService s = new WindowManagerService(mContext, mPM,
- mHaveInputMethods, mAllowBootMessages);
+ mHaveInputMethods, mAllowBootMessages, mOnlyCore);
android.os.Process.setThreadPriority(
android.os.Process.THREAD_PRIORITY_DISPLAY);
android.os.Process.setCanSelfBackground(false);
@@ -858,10 +873,11 @@ public class WindowManagerService extends IWindowManager.Stub
}
private WindowManagerService(Context context, PowerManagerService pm,
- boolean haveInputMethods, boolean showBootMsgs) {
+ boolean haveInputMethods, boolean showBootMsgs, boolean onlyCore) {
mContext = context;
mHaveInputMethods = haveInputMethods;
mAllowBootMessages = showBootMsgs;
+ mOnlyCore = onlyCore;
mLimitedAlphaCompositing = context.getResources().getBoolean(
com.android.internal.R.bool.config_sf_limitedAlpha);
mHeadless = "1".equals(SystemProperties.get(SYSTEM_HEADLESS, "0"));
@@ -3573,7 +3589,7 @@ public class WindowManagerService extends IWindowManager.Stub
public void setAppGroupId(IBinder token, int groupId) {
if (!checkCallingPermission(android.Manifest.permission.MANAGE_APP_TOKENS,
- "setAppStartingIcon()")) {
+ "setAppGroupId()")) {
throw new SecurityException("Requires MANAGE_APP_TOKENS permission");
}
@@ -3996,7 +4012,7 @@ public class WindowManagerService extends IWindowManager.Stub
CharSequence nonLocalizedLabel, int labelRes, int icon,
int windowFlags, IBinder transferFrom, boolean createIfNeeded) {
if (!checkCallingPermission(android.Manifest.permission.MANAGE_APP_TOKENS,
- "setAppStartingIcon()")) {
+ "setAppStartingWindow()")) {
throw new SecurityException("Requires MANAGE_APP_TOKENS permission");
}
@@ -4052,12 +4068,13 @@ public class WindowManagerService extends IWindowManager.Stub
startingWindow.mToken = wtoken;
startingWindow.mRootToken = wtoken;
startingWindow.mAppToken = wtoken;
- if (DEBUG_WINDOW_MOVEMENT || DEBUG_ADD_REMOVE) Slog.v(TAG,
- "Removing starting window: " + startingWindow);
+ if (DEBUG_WINDOW_MOVEMENT || DEBUG_ADD_REMOVE || DEBUG_STARTING_WINDOW) {
+ Slog.v(TAG, "Removing starting window: " + startingWindow);
+ }
mWindows.remove(startingWindow);
mWindowsChanged = true;
- if (DEBUG_ADD_REMOVE) Slog.v(TAG, "Removing starting " + startingWindow
- + " from " + ttoken);
+ if (DEBUG_ADD_REMOVE) Slog.v(TAG,
+ "Removing starting " + startingWindow + " from " + ttoken);
ttoken.windows.remove(startingWindow);
ttoken.allAppWindows.remove(startingWindow);
addWindowToListInOrderLocked(startingWindow, true);
@@ -4144,6 +4161,8 @@ public class WindowManagerService extends IWindowManager.Stub
// show a starting window -- the current effect (a full-screen
// opaque starting window that fades away to the real contents
// when it is ready) does not work for this.
+ if (DEBUG_STARTING_WINDOW) Slog.v(TAG, "Checking theme of starting window: 0x"
+ + Integer.toHexString(theme));
if (theme != 0) {
AttributeCache.Entry ent = AttributeCache.instance().get(pkg, theme,
com.android.internal.R.styleable.Window);
@@ -4152,6 +4171,15 @@ public class WindowManagerService extends IWindowManager.Stub
// pretend like we didn't see that.
return;
}
+ if (DEBUG_STARTING_WINDOW) Slog.v(TAG, "Translucent="
+ + ent.array.getBoolean(
+ com.android.internal.R.styleable.Window_windowIsTranslucent, false)
+ + " Floating="
+ + ent.array.getBoolean(
+ com.android.internal.R.styleable.Window_windowIsFloating, false)
+ + " ShowWallpaper="
+ + ent.array.getBoolean(
+ com.android.internal.R.styleable.Window_windowShowWallpaper, false));
if (ent.array.getBoolean(
com.android.internal.R.styleable.Window_windowIsTranslucent, false)) {
return;
@@ -4175,6 +4203,7 @@ public class WindowManagerService extends IWindowManager.Stub
}
}
+ if (DEBUG_STARTING_WINDOW) Slog.v(TAG, "Creating StartingData");
mStartingIconInTransition = true;
wtoken.startingData = new StartingData(pkg, theme, compatInfo, nonLocalizedLabel,
labelRes, icon, windowFlags);
@@ -4182,6 +4211,7 @@ public class WindowManagerService extends IWindowManager.Stub
// Note: we really want to do sendMessageAtFrontOfQueue() because we
// want to process the message ASAP, before any other queued
// messages.
+ if (DEBUG_STARTING_WINDOW) Slog.v(TAG, "Enqueueing ADD_STARTING");
mH.sendMessageAtFrontOfQueue(m);
}
}
@@ -5191,7 +5221,8 @@ public class WindowManagerService extends IWindowManager.Stub
Slog.i(TAG, "performEnableScreen: mDisplayEnabled=" + mDisplayEnabled
+ " mForceDisplayEnabled=" + mForceDisplayEnabled
+ " mShowingBootMessages=" + mShowingBootMessages
- + " mSystemBooted=" + mSystemBooted, here);
+ + " mSystemBooted=" + mSystemBooted
+ + " mOnlyCore=" + mOnlyCore, here);
}
if (mDisplayEnabled) {
return;
@@ -5209,7 +5240,8 @@ public class WindowManagerService extends IWindowManager.Stub
// wallpaper, don't bother waiting for it
boolean haveWallpaper = false;
boolean wallpaperEnabled = mContext.getResources().getBoolean(
- com.android.internal.R.bool.config_enableWallpaperService);
+ com.android.internal.R.bool.config_enableWallpaperService)
+ && !mOnlyCore;
boolean haveKeyguard = true;
final int N = mWindows.size();
for (int i=0; i<N; i++) {
@@ -5285,6 +5317,9 @@ public class WindowManagerService extends IWindowManager.Stub
} catch (RemoteException ex) {
Slog.e(TAG, "Boot completed: SurfaceFlinger is dead!");
}
+
+ // Enable input dispatch.
+ mInputMonitor.setEventDispatchingLw(mEventDispatchingEnabled);
}
mPolicy.enableScreenAfterBoot();
@@ -6636,7 +6671,8 @@ public class WindowManagerService extends IWindowManager.Stub
// -------------------------------------------------------------
final InputMonitor mInputMonitor = new InputMonitor(this);
-
+ private boolean mEventDispatchingEnabled;
+
public void pauseKeyDispatching(IBinder _token) {
if (!checkCallingPermission(android.Manifest.permission.MANAGE_APP_TOKENS,
"pauseKeyDispatching()")) {
@@ -6672,7 +6708,10 @@ public class WindowManagerService extends IWindowManager.Stub
}
synchronized (mWindowMap) {
- mInputMonitor.setEventDispatchingLw(enabled);
+ mEventDispatchingEnabled = enabled;
+ if (mDisplayEnabled) {
+ mInputMonitor.setEventDispatchingLw(enabled);
+ }
sendScreenStatusToClientsLocked();
}
}
@@ -8444,6 +8483,26 @@ public class WindowManagerService extends IWindowManager.Stub
}
}
+ private void updateAllDrawnLocked() {
+ // See if any windows have been drawn, so they (and others
+ // associated with them) can now be shown.
+ final ArrayList<AppWindowToken> appTokens = mAnimatingAppTokens;
+ final int NT = appTokens.size();
+ for (int i=0; i<NT; i++) {
+ AppWindowToken wtoken = appTokens.get(i);
+ if (!wtoken.allDrawn) {
+ int numInteresting = wtoken.numInterestingWindows;
+ if (numInteresting > 0 && wtoken.numDrawnWindows >= numInteresting) {
+ if (WindowManagerService.DEBUG_VISIBILITY) Slog.v(TAG,
+ "allDrawn: " + wtoken
+ + " interesting=" + numInteresting
+ + " drawn=" + wtoken.numDrawnWindows);
+ wtoken.allDrawn = true;
+ }
+ }
+ }
+ }
+
// "Something has changed! Let's make it correct now."
private final void performLayoutAndPlaceSurfacesLockedInner(
boolean recoveringMemory) {
@@ -8483,6 +8542,7 @@ public class WindowManagerService extends IWindowManager.Stub
mInnerFields.mHoldScreen = null;
mInnerFields.mScreenBrightness = -1;
mInnerFields.mButtonBrightness = -1;
+ mTransactionSequence++;
if (SHOW_LIGHT_TRANSACTIONS) Slog.i(TAG,
">>> OPEN TRANSACTION performLayoutAndPlaceSurfaces");
@@ -8560,6 +8620,7 @@ public class WindowManagerService extends IWindowManager.Stub
mInnerFields.mSyswin = false;
boolean focusDisplayed = false;
+ boolean updateAllDrawn = false;
final int N = mWindows.size();
for (i=N-1; i>=0; i--) {
WindowState w = mWindows.get(i);
@@ -8616,6 +8677,53 @@ public class WindowManagerService extends IWindowManager.Stub
}
winAnimator.setSurfaceBoundaries(recoveringMemory);
+
+ final AppWindowToken atoken = w.mAppToken;
+ if (DEBUG_STARTING_WINDOW && atoken != null && w == atoken.startingWindow) {
+ Slog.d(TAG, "updateWindows: starting " + w + " isOnScreen="
+ + w.isOnScreen() + " allDrawn=" + atoken.allDrawn
+ + " freezingScreen=" + atoken.mAppAnimator.freezingScreen);
+ }
+ if (atoken != null && (!atoken.allDrawn || atoken.mAppAnimator.freezingScreen)) {
+ if (atoken.lastTransactionSequence != mTransactionSequence) {
+ atoken.lastTransactionSequence = mTransactionSequence;
+ atoken.numInterestingWindows = atoken.numDrawnWindows = 0;
+ atoken.startingDisplayed = false;
+ }
+ if ((w.isOnScreen() || winAnimator.mAttrType
+ == WindowManager.LayoutParams.TYPE_BASE_APPLICATION)
+ && !w.mExiting && !w.mDestroying) {
+ if (WindowManagerService.DEBUG_VISIBILITY ||
+ WindowManagerService.DEBUG_ORIENTATION) {
+ Slog.v(TAG, "Eval win " + w + ": isDrawn=" + w.isDrawnLw()
+ + ", isAnimating=" + winAnimator.isAnimating());
+ if (!w.isDrawnLw()) {
+ Slog.v(TAG, "Not displayed: s=" + winAnimator.mSurface
+ + " pv=" + w.mPolicyVisibility
+ + " mDrawState=" + winAnimator.mDrawState
+ + " ah=" + w.mAttachedHidden
+ + " th=" + atoken.hiddenRequested
+ + " a=" + winAnimator.mAnimating);
+ }
+ }
+ if (w != atoken.startingWindow) {
+ if (!atoken.mAppAnimator.freezingScreen || !w.mAppFreezing) {
+ atoken.numInterestingWindows++;
+ if (w.isDrawnLw()) {
+ atoken.numDrawnWindows++;
+ if (WindowManagerService.DEBUG_VISIBILITY ||
+ WindowManagerService.DEBUG_ORIENTATION) Slog.v(TAG,
+ "tokenMayBeDrawn: " + atoken
+ + " freezingScreen=" + atoken.mAppAnimator.freezingScreen
+ + " mAppFreezing=" + w.mAppFreezing);
+ updateAllDrawn = true;
+ }
+ }
+ } else if (w.isDrawnLw()) {
+ atoken.startingDisplayed = true;
+ }
+ }
+ }
}
if (someoneLosingFocus && w == mCurrentFocus && w.isDisplayedLw()) {
@@ -8625,6 +8733,10 @@ public class WindowManagerService extends IWindowManager.Stub
updateResizingWindows(w);
}
+ if (updateAllDrawn) {
+ updateAllDrawnLocked();
+ }
+
if (focusDisplayed) {
mH.sendEmptyMessage(H.REPORT_LOSING_FOCUS);
}
@@ -9753,7 +9865,8 @@ public class WindowManagerService extends IWindowManager.Stub
}
pw.print(" mSystemBooted="); pw.print(mSystemBooted);
pw.print(" mDisplayEnabled="); pw.println(mDisplayEnabled);
- pw.print(" mLayoutNeeded="); pw.println(mLayoutNeeded);
+ pw.print(" mLayoutNeeded="); pw.print(mLayoutNeeded);
+ pw.print("mTransactionSequence="); pw.println(mTransactionSequence);
pw.print(" mDisplayFrozen="); pw.print(mDisplayFrozen);
pw.print(" mWindowsFreezingScreen="); pw.print(mWindowsFreezingScreen);
pw.print(" mAppsFreezingScreen="); pw.print(mAppsFreezingScreen);
@@ -9814,6 +9927,8 @@ public class WindowManagerService extends IWindowManager.Stub
}
pw.print(" mStartingIconInTransition="); pw.print(mStartingIconInTransition);
pw.print(" mSkipAppTransitionAnimation="); pw.println(mSkipAppTransitionAnimation);
+ pw.println(" Window Animator:");
+ mAnimator.dump(pw, " ", dumpAll);
}
}
diff --git a/services/java/com/android/server/wm/WindowStateAnimator.java b/services/java/com/android/server/wm/WindowStateAnimator.java
index 109161a..03e52fe 100644
--- a/services/java/com/android/server/wm/WindowStateAnimator.java
+++ b/services/java/com/android/server/wm/WindowStateAnimator.java
@@ -120,6 +120,16 @@ class WindowStateAnimator {
static final int READY_TO_SHOW = 3;
/** Set when the window has been shown in the screen the first time. */
static final int HAS_DRAWN = 4;
+ static String drawStateToString(int state) {
+ switch (state) {
+ case NO_SURFACE: return "NO_SURFACE";
+ case DRAW_PENDING: return "DRAW_PENDING";
+ case COMMIT_DRAW_PENDING: return "COMMIT_DRAW_PENDING";
+ case READY_TO_SHOW: return "READY_TO_SHOW";
+ case HAS_DRAWN: return "HAS_DRAWN";
+ default: return Integer.toString(state);
+ }
+ }
int mDrawState;
/** Was this window last hidden? */
@@ -399,10 +409,19 @@ class WindowStateAnimator {
}
boolean finishDrawingLocked() {
+ if (DEBUG_STARTING_WINDOW &&
+ mWin.mAttrs.type == WindowManager.LayoutParams.TYPE_APPLICATION_STARTING) {
+ Slog.v(TAG, "Finishing drawing window " + mWin + ": mDrawState="
+ + drawStateToString(mDrawState));
+ }
if (mDrawState == DRAW_PENDING) {
if (DEBUG_SURFACE_TRACE || DEBUG_ANIM || SHOW_TRANSACTIONS || DEBUG_ORIENTATION)
Slog.v(TAG, "finishDrawingLocked: mDrawState=COMMIT_DRAW_PENDING " + this + " in "
+ mSurface);
+ if (DEBUG_STARTING_WINDOW &&
+ mWin.mAttrs.type == WindowManager.LayoutParams.TYPE_APPLICATION_STARTING) {
+ Slog.v(TAG, "Draw state now committed in " + mWin);
+ }
mDrawState = COMMIT_DRAW_PENDING;
return true;
}
@@ -411,11 +430,17 @@ class WindowStateAnimator {
// This must be called while inside a transaction.
boolean commitFinishDrawingLocked(long currentTime) {
+ if (DEBUG_STARTING_WINDOW &&
+ mWin.mAttrs.type == WindowManager.LayoutParams.TYPE_APPLICATION_STARTING) {
+ Slog.i(TAG, "commitFinishDrawingLocked: " + mWin + " cur mDrawState="
+ + drawStateToString(mDrawState));
+ }
if (mDrawState != COMMIT_DRAW_PENDING) {
return false;
}
- if (DEBUG_SURFACE_TRACE || DEBUG_ANIM)
+ if (DEBUG_SURFACE_TRACE || DEBUG_ANIM) {
Slog.i(TAG, "commitFinishDrawingLocked: mDrawState=READY_TO_SHOW " + mSurface);
+ }
mDrawState = READY_TO_SHOW;
final boolean starting = mWin.mAttrs.type == TYPE_APPLICATION_STARTING;
final AppWindowToken atoken = mWin.mAppToken;
@@ -1214,7 +1239,8 @@ class WindowStateAnimator {
// This must be called while inside a transaction.
boolean performShowLocked() {
- if (DEBUG_VISIBILITY) {
+ if (DEBUG_VISIBILITY || (DEBUG_STARTING_WINDOW &&
+ mWin.mAttrs.type == WindowManager.LayoutParams.TYPE_APPLICATION_STARTING)) {
RuntimeException e = null;
if (!WindowManagerService.HIDE_STACK_CRAWLS) {
e = new RuntimeException();
@@ -1223,12 +1249,7 @@ class WindowStateAnimator {
Slog.v(TAG, "performShow on " + this
+ ": mDrawState=" + mDrawState + " readyForDisplay="
+ mWin.isReadyForDisplayIgnoringKeyguard()
- + " starting=" + (mWin.mAttrs.type == TYPE_APPLICATION_STARTING), e);
- }
- if (mDrawState == READY_TO_SHOW && mWin.isReadyForDisplayIgnoringKeyguard()) {
- if (SHOW_TRANSACTIONS || DEBUG_ORIENTATION)
- WindowManagerService.logSurface(mWin, "SHOW (performShowLocked)", null);
- if (DEBUG_VISIBILITY) Slog.v(TAG, "Showing " + this
+ + " starting=" + (mWin.mAttrs.type == TYPE_APPLICATION_STARTING)
+ " during animation: policyVis=" + mWin.mPolicyVisibility
+ " attHidden=" + mWin.mAttachedHidden
+ " tok.hiddenRequested="
@@ -1237,7 +1258,24 @@ class WindowStateAnimator {
+ (mWin.mAppToken != null ? mWin.mAppToken.hidden : false)
+ " animating=" + mAnimating
+ " tok animating="
- + (mWin.mAppToken != null ? mWin.mAppToken.mAppAnimator.animating : false));
+ + (mWin.mAppToken != null ? mWin.mAppToken.mAppAnimator.animating : false), e);
+ }
+ if (mDrawState == READY_TO_SHOW && mWin.isReadyForDisplayIgnoringKeyguard()) {
+ if (SHOW_TRANSACTIONS || DEBUG_ORIENTATION)
+ WindowManagerService.logSurface(mWin, "SHOW (performShowLocked)", null);
+ if (DEBUG_VISIBILITY || (DEBUG_STARTING_WINDOW &&
+ mWin.mAttrs.type == WindowManager.LayoutParams.TYPE_APPLICATION_STARTING)) {
+ Slog.v(TAG, "Showing " + this
+ + " during animation: policyVis=" + mWin.mPolicyVisibility
+ + " attHidden=" + mWin.mAttachedHidden
+ + " tok.hiddenRequested="
+ + (mWin.mAppToken != null ? mWin.mAppToken.hiddenRequested : false)
+ + " tok.hidden="
+ + (mWin.mAppToken != null ? mWin.mAppToken.hidden : false)
+ + " animating=" + mAnimating
+ + " tok animating="
+ + (mWin.mAppToken != null ? mWin.mAppToken.mAppAnimator.animating : false));
+ }
mService.enableScreenIfNeededLocked();
@@ -1425,7 +1463,8 @@ class WindowStateAnimator {
if (mSurface != null) {
if (dumpAll) {
pw.print(prefix); pw.print("mSurface="); pw.println(mSurface);
- pw.print(prefix); pw.print("mDrawState="); pw.print(mDrawState);
+ pw.print(prefix); pw.print("mDrawState=");
+ pw.print(drawStateToString(mDrawState));
pw.print(" mLastHidden="); pw.println(mLastHidden);
}
pw.print(prefix); pw.print("Surface: shown="); pw.print(mSurfaceShown);