Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cceeb58c authored by Craig Mautner's avatar Craig Mautner
Browse files

Remove one ANR cause and add logging for another

For bug 19823482.

Change-Id: Ic44c4fd11ef92546118b09526c97446a92a7b4e7
parent 7258118c
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1246,6 +1246,11 @@ final class ActivityStack {
                TAG, "ensureActivitiesVisible behind " + top
                + " configChanges=0x" + Integer.toHexString(configChanges));

        if (DEBUG_STATES && starting != null && starting.task.stack == this) {
            Slog.d(TAG, "ensureActivitiesVisibleLocked: starting=" + starting + " state="
                    + starting.state + " fullscreen=" + starting.fullscreen + " top=" + top
                    + " state=" + top.state + " fullscreen=" + top.fullscreen);
        }
        if (mTranslucentActivityWaiting != top) {
            mUndrawnActivitiesBelowTopTranslucent.clear();
            if (mTranslucentActivityWaiting != null) {
+35 −33
Original line number Diff line number Diff line
@@ -9055,39 +9055,41 @@ public class WindowManagerService extends IWindowManager.Stub
                    goodToGo = false;
                }
            }
            if (goodToGo && isWallpaperVisible(mWallpaperTarget)) {
                boolean wallpaperGoodToGo = true;
                for (int curTokenIndex = mWallpaperTokens.size() - 1;
                        curTokenIndex >= 0 && wallpaperGoodToGo; curTokenIndex--) {
                    WindowToken token = mWallpaperTokens.get(curTokenIndex);
                    for (int curWallpaperIndex = token.windows.size() - 1; curWallpaperIndex >= 0;
                            curWallpaperIndex--) {
                        WindowState wallpaper = token.windows.get(curWallpaperIndex);
                        if (wallpaper.mWallpaperVisible && !wallpaper.isDrawnLw()) {
                            // We've told this wallpaper to be visible, but it is not drawn yet
                            wallpaperGoodToGo = false;
                            if (mWallpaperDrawState != WALLPAPER_DRAW_TIMEOUT) {
                                // wait for this wallpaper until it is drawn or timeout
                                goodToGo = false;
                            }
                            if (mWallpaperDrawState == WALLPAPER_DRAW_NORMAL) {
                                mWallpaperDrawState = WALLPAPER_DRAW_PENDING;
                                mH.removeMessages(H.WALLPAPER_DRAW_PENDING_TIMEOUT);
                                mH.sendEmptyMessageDelayed(H.WALLPAPER_DRAW_PENDING_TIMEOUT,
                                        WALLPAPER_DRAW_PENDING_TIMEOUT_DURATION);
                            }
                            if (DEBUG_APP_TRANSITIONS || DEBUG_WALLPAPER) Slog.v(TAG,
                                    "Wallpaper should be visible but has not been drawn yet. " +
                                    "mWallpaperDrawState=" + mWallpaperDrawState);
                            break;
                        }
                    }
                }
                if (wallpaperGoodToGo) {
                    mWallpaperDrawState = WALLPAPER_DRAW_NORMAL;
                    mH.removeMessages(H.WALLPAPER_DRAW_PENDING_TIMEOUT);
                }
            }
// Stuck in a state with mWallpaperDrawState == WALLPAPER_DRAW_PENDING without a timeout. Leave
// commented out until that is understood.
//            if (goodToGo && isWallpaperVisible(mWallpaperTarget)) {
//                boolean wallpaperGoodToGo = true;
//                for (int curTokenIndex = mWallpaperTokens.size() - 1;
//                        curTokenIndex >= 0 && wallpaperGoodToGo; curTokenIndex--) {
//                    WindowToken token = mWallpaperTokens.get(curTokenIndex);
//                    for (int curWallpaperIndex = token.windows.size() - 1; curWallpaperIndex >= 0;
//                            curWallpaperIndex--) {
//                        WindowState wallpaper = token.windows.get(curWallpaperIndex);
//                        if (wallpaper.mWallpaperVisible && !wallpaper.isDrawnLw()) {
//                            // We've told this wallpaper to be visible, but it is not drawn yet
//                            wallpaperGoodToGo = false;
//                            if (mWallpaperDrawState != WALLPAPER_DRAW_TIMEOUT) {
//                                // wait for this wallpaper until it is drawn or timeout
//                                goodToGo = false;
//                            }
//                            if (mWallpaperDrawState == WALLPAPER_DRAW_NORMAL) {
//                                mWallpaperDrawState = WALLPAPER_DRAW_PENDING;
//                                mH.removeMessages(H.WALLPAPER_DRAW_PENDING_TIMEOUT);
//                                mH.sendEmptyMessageDelayed(H.WALLPAPER_DRAW_PENDING_TIMEOUT,
//                                        WALLPAPER_DRAW_PENDING_TIMEOUT_DURATION);
//                            }
//                            if (DEBUG_APP_TRANSITIONS || DEBUG_WALLPAPER) Slog.v(TAG,
//                                    "Wallpaper should be visible but has not been drawn yet. " +
//                                    "mWallpaperDrawState=" + mWallpaperDrawState);
//                            break;
//                        }
//                    }
//                }
//                if (wallpaperGoodToGo) {
//                    mWallpaperDrawState = WALLPAPER_DRAW_NORMAL;
//                    mH.removeMessages(H.WALLPAPER_DRAW_PENDING_TIMEOUT);
//                }
//            }
        }
        if (goodToGo) {
            if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, "**** GOOD TO GO");