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

Commit 74732021 authored by Winson Chung's avatar Winson Chung Committed by Android (Google) Code Review
Browse files

Merge "Enabling logs for nav mode & sysui flag updates"

parents 7b893b81 75375e02
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.systemui.model;
import static android.view.Display.DEFAULT_DISPLAY;

import android.annotation.NonNull;
import android.util.Log;

import com.android.systemui.Dumpable;
import com.android.systemui.shared.system.QuickStepContract;
@@ -37,6 +38,9 @@ import javax.inject.Singleton;
@Singleton
public class SysUiState implements Dumpable {

    private static final String TAG = SysUiState.class.getSimpleName();
    public static final boolean DEBUG = true;

    private @QuickStepContract.SystemUiStateFlags int mFlags;
    private final List<SysUiStateCallback> mCallbacks = new ArrayList<>();
    private int mFlagsToSet = 0;
@@ -76,6 +80,7 @@ public class SysUiState implements Dumpable {
    private void updateFlags(int displayId) {
        if (displayId != DEFAULT_DISPLAY) {
            // Ignore non-default displays for now
            Log.w(TAG, "Ignoring flag update for display: " + displayId, new Throwable());
            return;
        }

@@ -87,6 +92,9 @@ public class SysUiState implements Dumpable {

    /** Notify all those who are registered that the state has changed. */
    private void notifyAndSetSystemUiStateChanged(int newFlags, int oldFlags) {
        if (DEBUG) {
            Log.d(TAG, "SysUiState changed: old=" + oldFlags + " new=" + newFlags);
        }
        if (newFlags != oldFlags) {
            mCallbacks.forEach(callback -> callback.onSystemUiStateChanged(newFlags));
            mFlags = newFlags;
+11 −0
Original line number Diff line number Diff line
@@ -418,6 +418,9 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
    private final ServiceConnection mOverviewServiceConnection = new ServiceConnection() {
        @Override
        public void onServiceConnected(ComponentName name, IBinder service) {
            if (SysUiState.DEBUG) {
                Log.d(TAG_OPS, "Overview proxy service connected");
            }
            mConnectionBackoffAttempts = 0;
            mHandler.removeCallbacks(mDeferredConnectionCallback);
            try {
@@ -570,6 +573,10 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
                mNavBarController.getDefaultNavigationBarFragment();
        final NavigationBarView navBarView =
                mNavBarController.getNavigationBarView(mContext.getDisplayId());
        if (SysUiState.DEBUG) {
            Log.d(TAG_OPS, "Updating sysui state flags: navBarFragment=" + navBarFragment
                    + " navBarView=" + navBarView);
        }

        if (navBarFragment != null) {
            navBarFragment.updateSystemUiStateFlags(-1);
@@ -584,6 +591,10 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
    }

    private void notifySystemUiStateFlags(int flags) {
        if (SysUiState.DEBUG) {
            Log.d(TAG_OPS, "Notifying sysui state change to overview service: proxy="
                    + mOverviewProxy + " flags=" + flags);
        }
        try {
            if (mOverviewProxy != null) {
                mOverviewProxy.onSystemUiStateChanged(flags);
+7 −0
Original line number Diff line number Diff line
@@ -770,7 +770,14 @@ public class NavigationBarView extends FrameLayout implements

    public void updatePanelSystemUiStateFlags() {
        int displayId = mContext.getDisplayId();
        if (SysUiState.DEBUG) {
            Log.d(TAG, "Updating panel sysui state flags: panelView=" + mPanelView);
        }
        if (mPanelView != null) {
            if (SysUiState.DEBUG) {
                Log.d(TAG, "Updating panel sysui state flags: fullyExpanded="
                        + mPanelView.isFullyExpanded() + " inQs=" + mPanelView.isInSettings());
            }
            mSysUiFlagContainer.setFlag(SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED,
                    mPanelView.isFullyExpanded() && !mPanelView.isInSettings())
                    .setFlag(SYSUI_STATE_QUICK_SETTINGS_EXPANDED,
+5 −4
Original line number Diff line number Diff line
@@ -73,7 +73,7 @@ import javax.inject.Singleton;
public class NavigationModeController implements Dumpable {

    private static final String TAG = NavigationModeController.class.getSimpleName();
    private static final boolean DEBUG = false;
    private static final boolean DEBUG = true;

    public interface ModeChangedListener {
        void onNavigationModeChanged(int mode);
@@ -248,8 +248,7 @@ public class NavigationModeController implements Dumpable {
                    Secure.NAVIGATION_MODE, String.valueOf(mode));
        });
        if (DEBUG) {
            Log.e(TAG, "updateCurrentInteractionMode: mode=" + mMode
                    + " contextUser=" + mCurrentUserContext.getUserId());
            Log.e(TAG, "updateCurrentInteractionMode: mode=" + mMode);
            dumpAssetPaths(mCurrentUserContext);
        }

@@ -293,6 +292,7 @@ public class NavigationModeController implements Dumpable {
                    0 /* flags */, UserHandle.of(userId));
        } catch (PackageManager.NameNotFoundException e) {
            // Never happens for the sysui package
            Log.e(TAG, "Failed to create package context", e);
            return null;
        }
    }
@@ -408,6 +408,7 @@ public class NavigationModeController implements Dumpable {
    }

    private void dumpAssetPaths(Context context) {
        Log.d(TAG, "  contextUser=" + mCurrentUserContext.getUserId());
        Log.d(TAG, "  assetPaths=");
        ApkAssets[] assets = context.getResources().getAssets().getApkAssets();
        for (ApkAssets a : assets) {