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

Commit 8cbafbe6 authored by Craig Mautner's avatar Craig Mautner Committed by Android (Google) Code Review
Browse files

Merge "Add debug for specific bug."

parents 9b43a604 e7c58b6d
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -422,6 +422,8 @@ public final class ViewRootImpl implements ViewParent,
        synchronized (this) {
            if (mView == null) {
                mView = view;
                Slog.d(TAG, "setView: b9404689 setting mView to " + view + " mAdded=" + mAdded
                        + " Callers=" + Debug.getCallers(4));
                mViewLayoutDirectionInitial = mView.getRawLayoutDirection();
                mFallbackEventHandler.setView(view);
                mWindowAttributes.copyFrom(attrs);
@@ -478,6 +480,8 @@ public final class ViewRootImpl implements ViewParent,
                            = panelParentView.getApplicationWindowToken();
                }
                mAdded = true;
                Slog.d(TAG, "setView: b9404689 setting mAdded=true mView=" + mView
                        + " Callers=" + Debug.getCallers(4));
                int res; /* = WindowManagerImpl.ADD_OKAY; */

                // Schedule the first layout -before- adding to the window
@@ -503,6 +507,8 @@ public final class ViewRootImpl implements ViewParent,
                    mFallbackEventHandler.setView(null);
                    unscheduleTraversals();
                    setAccessibilityFocus(null, null);
                    Slog.d(TAG, "setView: b9404689 threw exception e=" + e
                            + " Callers=" + Debug.getCallers(4));
                    throw new RuntimeException("Adding window failed", e);
                } finally {
                    if (restore) {
@@ -5158,11 +5164,14 @@ public final class ViewRootImpl implements ViewParent,
                return;
            }
            mRemoved = true;
            Slog.d(TAG, "doDie: b9404689 mAdded==true mView=" + mView
                    + " Callers=" + Debug.getCallers(4));
            if (mAdded) {
                dispatchDetachedFromWindow();
            }

            if (mAdded && !mFirst) {
                Slog.d(TAG, "doDie: b9404689 mAdded && !mFirst");
                invalidateDisplayLists();
                destroyHardwareRenderer();

@@ -5186,6 +5195,8 @@ public final class ViewRootImpl implements ViewParent,
                }
            }

            Slog.d(TAG, "doDie: b9404689 setting mAdded=false mView=" + mView
                    + " Callers=" + Debug.getCallers(4));
            mAdded = false;
        }
        WindowManagerGlobal.getInstance().doRemoveView(this);
+11 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import android.app.ActivityManager;
import android.content.ComponentCallbacks2;
import android.content.res.Configuration;
import android.opengl.ManagedEGLContext;
import android.os.Debug;
import android.os.IBinder;
import android.os.RemoteException;
import android.os.ServiceManager;
@@ -28,6 +29,7 @@ import android.os.SystemProperties;
import android.util.AndroidRuntimeException;
import android.util.ArraySet;
import android.util.Log;
import android.util.Slog;
import android.view.inputmethod.InputMethodManager;
import com.android.internal.util.FastPrintWriter;

@@ -225,6 +227,7 @@ public final class WindowManagerGlobal {
            if (index >= 0) {
                if (mDyingViews.contains(view)) {
                    // Don't wait for MSG_DIE to make it's way through root's queue.
                    Slog.d(TAG, "addView: b9404689 mDying contains view=" + view);
                    mRoots.get(index).doDie();
                } else {
                    throw new IllegalStateException("View " + view
@@ -249,6 +252,7 @@ public final class WindowManagerGlobal {

            view.setLayoutParams(wparams);

            Slog.d(TAG, "addView: b9404689 adding view=" + view + " root=" + root);
            mViews.add(view);
            mRoots.add(root);
            mParams.add(wparams);
@@ -347,6 +351,8 @@ public final class WindowManagerGlobal {
        if (view != null) {
            view.assignParent(null);
            if (deferred) {
                Slog.d(TAG, "removeViewLocked: b9404689 mDyingViews adding view=" + view
                        + " root=" + root + " Callers=" + Debug.getCallers(4));
                mDyingViews.add(view);
            }
        }
@@ -356,10 +362,15 @@ public final class WindowManagerGlobal {
        synchronized (mLock) {
            final int index = mRoots.indexOf(root);
            if (index >= 0) {
                Slog.d(TAG, "doRemoveView: b9404689 removing view=" + mViews.get(index)
                    + " Callers=" + Debug.getCallers(4));
                mRoots.remove(index);
                mParams.remove(index);
                final View view = mViews.remove(index);
                mDyingViews.remove(view);
            } else {
                Slog.d(TAG, "doRemoveView: b9404689 couldn't find root=" + root
                    + " Callers=" + Debug.getCallers(4));
            }
        }
    }
+3 −0
Original line number Diff line number Diff line
@@ -205,6 +205,7 @@ public final class ActivityManagerService extends ActivityManagerNative
    static final boolean DEBUG_BACKGROUND_BROADCAST = DEBUG_BROADCAST || false;
    static final boolean DEBUG_CLEANUP = localLOGV || false;
    static final boolean DEBUG_CONFIGURATION = localLOGV || false;
    static final boolean DEBUG_FOCUS = true;
    static final boolean DEBUG_IMMERSIVE = localLOGV || false;
    static final boolean DEBUG_MU = localLOGV || false;
    static final boolean DEBUG_OOM_ADJ = localLOGV || false;
@@ -1994,6 +1995,7 @@ public final class ActivityManagerService extends ActivityManagerNative
    final void setFocusedActivityLocked(ActivityRecord r) {
        if (mFocusedActivity != r) {
            if (DEBUG_FOCUS) Slog.d(TAG, "setFocusedActivitiyLocked: r=" + r);
            mFocusedActivity = r;
            mStackSupervisor.setFocusedStack(r);
            if (r != null) {
@@ -2005,6 +2007,7 @@ public final class ActivityManagerService extends ActivityManagerNative
    @Override
    public void setFocusedStack(int stackId) {
        if (DEBUG_FOCUS) Slog.d(TAG, "setFocusedStack: stackId=" + stackId);
        mHandler.obtainMessage(SET_FOCUSED_STACK, stackId, 0).sendToTarget();
    }
+8 −1
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import static android.content.Intent.FLAG_ACTIVITY_TASK_ON_HOME;
import static android.content.pm.PackageManager.PERMISSION_GRANTED;
import static com.android.server.am.ActivityManagerService.localLOGV;
import static com.android.server.am.ActivityManagerService.DEBUG_CONFIGURATION;
import static com.android.server.am.ActivityManagerService.DEBUG_FOCUS;
import static com.android.server.am.ActivityManagerService.DEBUG_PAUSE;
import static com.android.server.am.ActivityManagerService.DEBUG_RESULTS;
import static com.android.server.am.ActivityManagerService.DEBUG_STACK;
@@ -1198,9 +1199,13 @@ public final class ActivityStackSupervisor {
                // Time to create the first app stack for this user.
                int stackId = mService.createStack(-1, HOME_STACK_ID,
                        StackBox.TASK_STACK_GOES_OVER, 1.0f);
                if (DEBUG_FOCUS) Slog.d(TAG, "getCorrectStack: New stack r=" + r + " stackId="
                        + stackId);
                mFocusedStack = getStack(stackId);
            }
            if (task != null) {
                if (DEBUG_FOCUS) Slog.d(TAG, "getCorrectStack: Setting focused stack to r=" +
                        r + " task=" + task);
                mFocusedStack = task.stack;
            }
            return mFocusedStack;
@@ -1214,13 +1219,15 @@ public final class ActivityStackSupervisor {
        }
        if (!r.isApplicationActivity() || (r.task != null && !r.task.isApplicationTask())) {
            if (mStackState != STACK_STATE_HOME_IN_FRONT) {
                if (DEBUG_STACK) Slog.d(TAG, "setFocusedStack: mStackState old=" +
                if (DEBUG_STACK || DEBUG_FOCUS) Slog.d(TAG, "setFocusedStack: mStackState old=" +
                        stackStateToString(mStackState) + " new=" +
                        stackStateToString(STACK_STATE_HOME_TO_FRONT) +
                        " Callers=" + Debug.getCallers(3));
                mStackState = STACK_STATE_HOME_TO_FRONT;
            }
        } else {
            if (DEBUG_FOCUS) Slog.d(TAG, "setFocusedStack: Setting focused stack to r=" +
                    r + " task=" + r.task + " Callers=" + Debug.getCallers(3));
            mFocusedStack = r.task.stack;
            if (mStackState != STACK_STATE_HOME_IN_BACK) {
                if (DEBUG_STACK) Slog.d(TAG, "setFocusedStack: mStackState old=" +