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

Commit f1191ceb authored by Santos Cordon's avatar Santos Cordon Committed by Android Build Coastguard Worker
Browse files

DO NOT SUBMIT (Testing Code)

Simulate InCallActivity with DisplayState = OFF

Bug: 284687313
Test: Manual
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:b45a94269c3eaa3557a8f23aa84d394787c50d6e)
Merged-In: I7e38dc60dfe6c726bd20b8960f484799b743084a
Change-Id: I7e38dc60dfe6c726bd20b8960f484799b743084a
parent c0602b7f
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -1438,6 +1438,11 @@ public final class ViewRootImpl implements ViewParent,
                // We should update mAttachInfo.mDisplayState after registerDisplayListener
                // because displayState might be changed before registerDisplayListener.
                mAttachInfo.mDisplayState = mDisplay.getState();
                if (mBasePackageName != null
                        && mBasePackageName.equals("com.google.android.dialer")) {
                    Slog.w(TAG, "(" + mBasePackageName + ") Initial DisplayState: "
                            + mAttachInfo.mDisplayState, new Throwable());
                }
                if ((res & WindowManagerGlobal.ADD_FLAG_USE_BLAST) != 0) {
                    mUseBLASTAdapter = true;
                }
@@ -1522,6 +1527,7 @@ public final class ViewRootImpl implements ViewParent,
     * Register any kind of listeners if setView was success.
     */
    private void registerListeners() {
        Slog.i(TAG, "Register listeners: " + mBasePackageName);
        mAccessibilityManager.addAccessibilityStateChangeListener(
                mAccessibilityInteractionConnectionManager, mHandler);
        mAccessibilityManager.addHighTextContrastStateChangeListener(
@@ -1547,6 +1553,7 @@ public final class ViewRootImpl implements ViewParent,
        DisplayManagerGlobal
                .getInstance()
                .unregisterDisplayListener(mDisplayListener);
        Slog.w(TAG, "Unregister listeners: " + mBasePackageName, new Throwable());
    }

    private void setTag() {
@@ -1950,9 +1957,14 @@ public final class ViewRootImpl implements ViewParent,
    private final DisplayListener mDisplayListener = new DisplayListener() {
        @Override
        public void onDisplayChanged(int displayId) {
            if (mBasePackageName != null && mBasePackageName.equals("com.google.android.dialer")) {
                Slog.i(TAG, "Received onDisplayChanged - " + mView);
                return;
            }
            if (mView != null && mDisplay.getDisplayId() == displayId) {
                final int oldDisplayState = mAttachInfo.mDisplayState;
                final int newDisplayState = mDisplay.getState();
                Slog.i(TAG, "DisplayState - old: " + oldDisplayState + ", new: " + newDisplayState);
                if (oldDisplayState != newDisplayState) {
                    mAttachInfo.mDisplayState = newDisplayState;
                    pokeDrawLockIfNeeded();
+2 −2
Original line number Diff line number Diff line
@@ -2854,10 +2854,10 @@ public final class DisplayManagerService extends SystemService {
    // Delivers display event notifications to callbacks.
    private void deliverDisplayEvent(int displayId, ArraySet<Integer> uids,
            @DisplayEvent int event) {
        if (DEBUG) {
        //if (DEBUG) {
            Slog.d(TAG, "Delivering display event: displayId="
                    + displayId + ", event=" + event);
        }
        //}

        // Grab the lock and copy the callbacks.
        final int count;