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

Commit a3e45d5d authored by Matt Casey's avatar Matt Casey Committed by Android (Google) Code Review
Browse files

Merge "Remove assist status stuff from StatusBar." into qt-dev

parents a8cf1061 a0966b58
Loading
Loading
Loading
Loading
+0 −21
Original line number Diff line number Diff line
@@ -14,7 +14,6 @@ import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.metrics.LogMaker;
import android.os.AsyncTask;
import android.os.Binder;
@@ -195,26 +194,6 @@ public class AssistManager implements ConfigurationChangedReceiver {
        startAssistInternal(args, assistComponent, isService);
    }

    /**
     * Returns a {@code Rect} containing system UI presented on behalf of the assistant that
     * consumes touches.
     */
    @Nullable
    public Rect getTouchableRegion() {
        // intentional no-op, vendor's AssistManager implementation should override if needed.
        return null;
    }

    /** Registers a listener for changes to system UI presented on behalf of the assistant. */
    public void setAssistSysUiChangeListener(AssistSysUiChangeListener listener) {
        // intentional no-op, vendor's AssistManager implementation should override if needed.
    }

    /** Returns {@code true} if the system UI is showing UI for the assistant. */
    public boolean hasAssistUi() {
        return false;
    }

    /** Called when the user is performing an assistant invocation action (e.g. Active Edge) */
    public void onInvocationProgress(int type, float progress) {
        // intentional no-op, vendor's AssistManager implementation should override if needed.
+0 −27
Original line number Diff line number Diff line
/*
 * Copyright (C) 2019 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.systemui.assist;

/**
 * Used to notify when system UI is showing UI for the assistant.
 */
public interface AssistSysUiChangeListener {

    /** Called when the visibility of system UI for the assistant has changed. */
    void onChange(boolean isVisible);

}
+0 −5
Original line number Diff line number Diff line
@@ -3274,11 +3274,6 @@ public class StatusBar extends SystemUI implements DemoMode,
            }
            return true;
        }
        if (mStatusBarWindowController.hasAssistActiveSession()) {
            // Back pressed during an assist session, cancel it.
            mAssistManager.hideAssist();
            return true;
        }
        if (mState != StatusBarState.KEYGUARD && mState != StatusBarState.SHADE_LOCKED) {
            if (mNotificationPanel.canPanelBeCollapsed()) {
                animateCollapsePanels();
+0 −9
Original line number Diff line number Diff line
@@ -60,9 +60,6 @@ public final class StatusBarTouchableRegionManager implements

        initResources();

        mAssistManager.setAssistSysUiChangeListener((isVisible) -> {
            updateTouchableRegion();
        });
        mBubbleController.setBubbleStateChangeListener((hasBubbles) -> {
            updateTouchableRegion();
        });
@@ -79,7 +76,6 @@ public final class StatusBarTouchableRegionManager implements
        boolean shouldObserve =
                mHeadsUpManager.hasPinnedHeadsUp() || mHeadsUpManager.isHeadsUpGoingAway()
                        || mBubbleController.hasBubbles()
                        || mAssistManager.hasAssistUi()
                        || mForceCollapsedUntilLayout
                        || hasCutoutInset;
        if (shouldObserve == mShouldAdjustInsets) {
@@ -143,11 +139,6 @@ public final class StatusBarTouchableRegionManager implements
        if (bubbleRect != null) {
            info.touchableRegion.union(bubbleRect);
        }

        Rect assistRect = mAssistManager.getTouchableRegion();
        if (assistRect != null) {
            info.touchableRegion.union(assistRect);
        }
    }

    @Override
+2 −33
Original line number Diff line number Diff line
@@ -208,8 +208,7 @@ public class StatusBarWindowController implements Callback, Dumpable, Configurat
                || state.bubbleExpanded) {
            mLpChanged.flags &= ~WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
            mLpChanged.flags &= ~WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM;
        } else if (state.isKeyguardShowingAndNotOccluded() || panelFocusable
                || state.assistActiveSession) {
        } else if (state.isKeyguardShowingAndNotOccluded() || panelFocusable) {
            mLpChanged.flags &= ~WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
            mLpChanged.flags |= WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM;
        } else {
@@ -247,7 +246,7 @@ public class StatusBarWindowController implements Callback, Dumpable, Configurat
    private boolean isExpanded(State state) {
        return !state.forceCollapsed && (state.isKeyguardShowingAndNotOccluded()
                || state.panelVisible || state.keyguardFadingAway || state.bouncerShowing
                || state.headsUpShowing || state.bubblesShowing || state.assistShowing
                || state.headsUpShowing || state.bubblesShowing
                || state.scrimsVisibility != ScrimController.VISIBILITY_FULLY_TRANSPARENT);
    }

@@ -500,32 +499,6 @@ public class StatusBarWindowController implements Callback, Dumpable, Configurat
        return mCurrentState.bubblesShowing;
    }

    /**
     * Sets whether assist UI is showing on the screen.
     *
     * @param assistShowing whether any assist UI is being shown.
     * @param activeSession whether AssistManager has an active assist session in progress.
     */
    public void setAssistState(boolean assistShowing, boolean activeSession) {
        mCurrentState.assistShowing = assistShowing;
        mCurrentState.assistActiveSession = activeSession;
        apply(mCurrentState);
    }

    /**
     * The assist UI showing state for the status bar.
     */
    public boolean getAssistShowing() {
        return mCurrentState.assistShowing;
    }

    /**
     * The AssistManager is handling an active assist session.
     */
    public boolean hasAssistActiveSession() {
        return mCurrentState.assistActiveSession;
    }

    /**
     * Sets if there is a bubble being expanded on the screen.
     */
@@ -602,10 +575,6 @@ public class StatusBarWindowController implements Callback, Dumpable, Configurat
        boolean notTouchable;
        boolean bubblesShowing;
        boolean bubbleExpanded;
        // Assist manager is rendering any UI.
        boolean assistShowing;
        // Assist manager is handling an active assist session.
        boolean assistActiveSession;

        /**
         * The {@link StatusBar} state from the status bar.