From eb5fbdc904bbc804c6799c5f92aab6998ce9a087 Mon Sep 17 00:00:00 2001 From: Bryce Lee Date: Thu, 3 Mar 2022 17:37:09 -0800 Subject: [PATCH] Remove communal support from SystemUI. This changelist removes support for deprecated communal mode functionality from SystemUI. Test: atest NotificationPanelViewControllerTest Bug: 202873080 Change-Id: Id86754003222e8229f901d3aeb7c2f8ef8a333aa --- .../res/layout/communal_host_view.xml | 23 - .../res/layout/status_bar_expanded.xml | 3 - .../KeyguardStatusViewController.java | 7 +- .../keyguard/KeyguardVisibilityHelper.java | 16 +- .../systemui/communal/CommunalHostView.java | 45 -- .../communal/CommunalHostViewController.java | 396 ------------------ .../CommunalHostViewPositionAlgorithm.java | 74 ---- .../systemui/communal/CommunalSource.java | 105 ----- .../communal/CommunalSourceMonitor.java | 158 ------- .../communal/CommunalSourcePrimer.java | 180 -------- .../communal/CommunalStateController.java | 125 ------ .../systemui/communal/PackageObserver.java | 101 ----- .../conditions/CommunalSettingCondition.java | 67 --- .../communal/dagger/CommunalModule.java | 125 ------ .../dagger/CommunalViewComponent.java | 38 -- .../systemui/dagger/SystemUIModule.java | 4 +- .../systemui/dreams/dagger/DreamModule.java | 2 +- .../coordinator/CommunalCoordinator.java | 82 ---- .../coordinator/NotifCoordinators.kt | 2 - .../NotificationPanelViewController.java | 154 +------ .../KeyguardQsUserSwitchController.java | 7 +- .../KeyguardUserSwitcherController.java | 7 +- .../util/service/PackageObserver.java | 6 +- .../KeyguardStatusViewControllerTest.java | 4 - .../KeyguardVisibilityHelperTest.java | 92 ---- .../CommunalHostViewControllerTest.java | 242 ----------- ...CommunalHostViewPositionAlgorithmTest.java | 44 -- .../CommunalSettingConditionTest.java | 119 ------ .../communal/CommunalSourceMonitorTest.java | 169 -------- .../communal/CommunalSourcePrimerTest.java | 205 --------- .../communal/CommunalStateControllerTest.java | 91 ---- .../communal/PackageObserverTest.java | 77 ---- .../coordinator/CommunalCoordinatorTest.java | 106 ----- .../NotificationPanelViewControllerTest.java | 108 +---- .../KeyguardQsUserSwitchControllerTest.kt | 5 - 35 files changed, 19 insertions(+), 2970 deletions(-) delete mode 100644 packages/SystemUI/res/layout/communal_host_view.xml delete mode 100644 packages/SystemUI/src/com/android/systemui/communal/CommunalHostView.java delete mode 100644 packages/SystemUI/src/com/android/systemui/communal/CommunalHostViewController.java delete mode 100644 packages/SystemUI/src/com/android/systemui/communal/CommunalHostViewPositionAlgorithm.java delete mode 100644 packages/SystemUI/src/com/android/systemui/communal/CommunalSource.java delete mode 100644 packages/SystemUI/src/com/android/systemui/communal/CommunalSourceMonitor.java delete mode 100644 packages/SystemUI/src/com/android/systemui/communal/CommunalSourcePrimer.java delete mode 100644 packages/SystemUI/src/com/android/systemui/communal/CommunalStateController.java delete mode 100644 packages/SystemUI/src/com/android/systemui/communal/PackageObserver.java delete mode 100644 packages/SystemUI/src/com/android/systemui/communal/conditions/CommunalSettingCondition.java delete mode 100644 packages/SystemUI/src/com/android/systemui/communal/dagger/CommunalModule.java delete mode 100644 packages/SystemUI/src/com/android/systemui/communal/dagger/CommunalViewComponent.java delete mode 100644 packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/CommunalCoordinator.java delete mode 100644 packages/SystemUI/tests/src/com/android/keyguard/KeyguardVisibilityHelperTest.java delete mode 100644 packages/SystemUI/tests/src/com/android/systemui/communal/CommunalHostViewControllerTest.java delete mode 100644 packages/SystemUI/tests/src/com/android/systemui/communal/CommunalHostViewPositionAlgorithmTest.java delete mode 100644 packages/SystemUI/tests/src/com/android/systemui/communal/CommunalSettingConditionTest.java delete mode 100644 packages/SystemUI/tests/src/com/android/systemui/communal/CommunalSourceMonitorTest.java delete mode 100644 packages/SystemUI/tests/src/com/android/systemui/communal/CommunalSourcePrimerTest.java delete mode 100644 packages/SystemUI/tests/src/com/android/systemui/communal/CommunalStateControllerTest.java delete mode 100644 packages/SystemUI/tests/src/com/android/systemui/communal/PackageObserverTest.java delete mode 100644 packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/CommunalCoordinatorTest.java diff --git a/packages/SystemUI/res/layout/communal_host_view.xml b/packages/SystemUI/res/layout/communal_host_view.xml deleted file mode 100644 index cd9c26065dc12..0000000000000 --- a/packages/SystemUI/res/layout/communal_host_view.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - \ No newline at end of file diff --git a/packages/SystemUI/res/layout/status_bar_expanded.xml b/packages/SystemUI/res/layout/status_bar_expanded.xml index e4706e263a0f0..ef030baa967b6 100644 --- a/packages/SystemUI/res/layout/status_bar_expanded.xml +++ b/packages/SystemUI/res/layout/status_bar_expanded.xml @@ -26,9 +26,6 @@ android:layout_height="match_parent" android:background="@android:color/transparent"> - - { - private static final String TAG = "CommunalController"; - private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG); - private static final String STATE_LIST_FORMAT = "[%s]"; - private static final AnimationProperties COMMUNAL_ANIMATION_PROPERTIES = - new AnimationProperties().setDuration(StackStateAnimator.ANIMATION_DURATION_STANDARD); - - private final Executor mMainExecutor; - private final CommunalStateController mCommunalStateController; - private final KeyguardUpdateMonitor mKeyguardUpdateMonitor; - private final KeyguardStateController mKeyguardStateController; - private final StatusBarStateController mStatusBarStateController; - private WeakReference mCurrentSource; - private Optional mLastRequest = Optional.empty(); - private int mState; - private float mQsExpansion; - private float mShadeExpansion; - - @Retention(RetentionPolicy.RUNTIME) - @IntDef({STATE_KEYGUARD_SHOWING, STATE_DOZING, STATE_BOUNCER_SHOWING, STATE_KEYGUARD_OCCLUDED}) - public @interface State {} - - private static final int STATE_KEYGUARD_SHOWING = 1 << 0; - private static final int STATE_DOZING = 1 << 1; - private static final int STATE_BOUNCER_SHOWING = 1 << 2; - private static final int STATE_KEYGUARD_OCCLUDED = 1 << 3; - - // Only show communal view when keyguard is showing and not dozing. - private static final int SHOW_COMMUNAL_VIEW_REQUIRED_STATES = STATE_KEYGUARD_SHOWING; - private static final int SHOW_COMMUNAL_VIEW_INVALID_STATES = - STATE_DOZING | STATE_KEYGUARD_OCCLUDED; - - private final KeyguardVisibilityHelper mKeyguardVisibilityHelper; - - private ViewController mCommunalViewController; - - private static class ShowRequest { - private boolean mShouldShow; - private WeakReference mSource; - - ShowRequest(boolean shouldShow, WeakReference source) { - mShouldShow = shouldShow; - mSource = source; - } - - CommunalSource getSource() { - return mSource != null ? mSource.get() : null; - } - - boolean shouldShow() { - return mShouldShow; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (!(o instanceof ShowRequest)) return false; - ShowRequest that = (ShowRequest) o; - return mShouldShow == that.mShouldShow && Objects.equals(getSource(), that.getSource()); - } - - @Override - public int hashCode() { - return Objects.hash(mShouldShow, mSource); - } - } - - private KeyguardUpdateMonitorCallback mKeyguardUpdateCallback = - new KeyguardUpdateMonitorCallback() { - @Override - public void onKeyguardBouncerChanged(boolean bouncer) { - if (DEBUG) { - Log.d(TAG, "onKeyguardBouncerChanged:" + bouncer); - } - - setState(STATE_BOUNCER_SHOWING, bouncer); - } - - @Override - public void onKeyguardOccludedChanged(boolean occluded) { - if (DEBUG) { - Log.d(TAG, "onKeyguardOccludedChanged" + occluded); - } - - setState(STATE_KEYGUARD_OCCLUDED, occluded); - } - }; - - private KeyguardStateController.Callback mKeyguardCallback = - new KeyguardStateController.Callback() { - @Override - public void onKeyguardShowingChanged() { - final boolean isShowing = mKeyguardStateController.isShowing(); - if (DEBUG) { - Log.d(TAG, "setKeyguardShowing:" + isShowing); - } - - setState(STATE_KEYGUARD_SHOWING, isShowing); - } - }; - - private StatusBarStateController.StateListener mDozeCallback = - new StatusBarStateController.StateListener() { - @Override - public void onDozingChanged(boolean isDozing) { - if (DEBUG) { - Log.d(TAG, "setDozing:" + isDozing); - } - - setState(STATE_DOZING, isDozing); - } - - @Override - public void onStateChanged(int newState) { - updateCommunalViewOccluded(); - } - }; - - @Inject - protected CommunalHostViewController(@Main Executor mainExecutor, - CommunalStateController communalStateController, - KeyguardUpdateMonitor keyguardUpdateMonitor, - KeyguardStateController keyguardStateController, - DozeParameters dozeParameters, - ScreenOffAnimationController screenOffAnimationController, - StatusBarStateController statusBarStateController, CommunalHostView view) { - super(view); - mCommunalStateController = communalStateController; - mKeyguardUpdateMonitor = keyguardUpdateMonitor; - mMainExecutor = mainExecutor; - mKeyguardStateController = keyguardStateController; - mStatusBarStateController = statusBarStateController; - mKeyguardVisibilityHelper = new KeyguardVisibilityHelper(mView, communalStateController, - keyguardStateController, dozeParameters, screenOffAnimationController, - /* animateYPos= */ false, /* visibleOnCommunal= */ true); - } - - /** - * Set the visibility of the keyguard status view based on some new state. - */ - public void setKeyguardStatusViewVisibility( - int statusBarState, - boolean keyguardFadingAway, - boolean goingToFullShade, - int oldStatusBarState) { - mKeyguardVisibilityHelper.setViewVisibility( - statusBarState, keyguardFadingAway, goingToFullShade, oldStatusBarState); - } - - /** - * Set keyguard status view alpha. - */ - public void setAlpha(float alpha) { - if (!mKeyguardVisibilityHelper.isVisibilityAnimating()) { - mView.setAlpha(alpha); - - // Some communal view implementations, such as SurfaceViews, do not behave correctly - // inheriting the alpha of their parent. Directly set child alpha here to work around - // this. - for (int i = mView.getChildCount() - 1; i >= 0; --i) { - mView.getChildAt(i).setAlpha(alpha); - } - } - } - @Override - public void onInit() { - setState(STATE_KEYGUARD_SHOWING, mKeyguardStateController.isShowing()); - setState(STATE_DOZING, mStatusBarStateController.isDozing()); - } - - @Override - protected void onViewAttached() { - mKeyguardStateController.addCallback(mKeyguardCallback); - mStatusBarStateController.addCallback(mDozeCallback); - mKeyguardUpdateMonitor.registerCallback(mKeyguardUpdateCallback); - } - - @Override - protected void onViewDetached() { - mKeyguardStateController.removeCallback(mKeyguardCallback); - mStatusBarStateController.removeCallback(mDozeCallback); - mKeyguardUpdateMonitor.removeCallback(mKeyguardUpdateCallback); - } - - private void setState(@State int stateFlag, boolean enabled) { - final int existingState = mState; - if (DEBUG) { - Log.d(TAG, "setState flag:" + describeState(stateFlag) + " enabled:" + enabled); - } - - if (enabled) { - mState |= stateFlag; - } else { - mState &= ~stateFlag; - } - - if (DEBUG) { - Log.d(TAG, "updated state:" + describeState()); - } - - if (existingState != mState) { - showSource(); - } - - updateCommunalViewOccluded(); - } - - private String describeState(@State int stateFlag) { - switch(stateFlag) { - case STATE_DOZING: - return "dozing"; - case STATE_BOUNCER_SHOWING: - return "bouncer_showing"; - case STATE_KEYGUARD_SHOWING: - return "keyguard_showing"; - default: - return "UNDEFINED_STATE"; - } - } - - private String describeState() { - StringBuilder stringBuilder = new StringBuilder(); - - if ((mState & STATE_KEYGUARD_SHOWING) == STATE_KEYGUARD_SHOWING) { - stringBuilder.append(String.format(STATE_LIST_FORMAT, - describeState(STATE_KEYGUARD_SHOWING))); - } - if ((mState & STATE_DOZING) == STATE_DOZING) { - stringBuilder.append(String.format(STATE_LIST_FORMAT, - describeState(STATE_DOZING))); - } - if ((mState & STATE_BOUNCER_SHOWING) == STATE_BOUNCER_SHOWING) { - stringBuilder.append(String.format(STATE_LIST_FORMAT, - describeState(STATE_BOUNCER_SHOWING))); - } - - return stringBuilder.toString(); - } - - private void showSource() { - final ShowRequest request = new ShowRequest( - (mState & SHOW_COMMUNAL_VIEW_REQUIRED_STATES) == SHOW_COMMUNAL_VIEW_REQUIRED_STATES - && (mState & SHOW_COMMUNAL_VIEW_INVALID_STATES) == 0 - && mCurrentSource != null, - mCurrentSource); - - if (mLastRequest.isPresent() && Objects.equals(mLastRequest.get(), request)) { - return; - } - - mLastRequest = Optional.of(request); - - // Make sure all necessary states are present for showing communal and all invalid states - // are absent - mMainExecutor.execute(() -> { - if (DEBUG) { - Log.d(TAG, "showSource. currentSource:" + request.getSource()); - } - - if (request.shouldShow()) { - mView.removeAllViews(); - - // Make view visible. - mView.setVisibility(View.VISIBLE); - - final Context context = mView.getContext(); - - final ListenableFuture listenableFuture = - request.getSource().requestCommunalView(context); - - if (listenableFuture == null) { - Log.e(TAG, "could not request communal view"); - return; - } - - listenableFuture.addListener(() -> { - try { - final CommunalSource.CommunalViewResult result = listenableFuture.get(); - result.view.setLayoutParams(new ViewGroup.LayoutParams( - ViewGroup.LayoutParams.MATCH_PARENT, - ViewGroup.LayoutParams.MATCH_PARENT)); - mView.addView(result.view); - - mCommunalViewController = result.viewController; - mCommunalViewController.init(); - } catch (Exception e) { - Log.e(TAG, "could not obtain communal view through callback:" + e); - } - }, mMainExecutor); - } else { - mView.removeAllViews(); - mView.setVisibility(View.INVISIBLE); - mCommunalStateController.setCommunalViewShowing(false); - } - }); - } - - /** - * Instructs {@link CommunalHostViewController} to display provided source. - * - * @param source The new {@link CommunalSource}, {@code null} if not set. - */ - public void show(WeakReference source) { - mCurrentSource = source; - showSource(); - } - - /** - * Update position of the view with an optional animation - */ - public void updatePosition(int y, boolean animate) { - PropertyAnimator.setProperty(mView, AnimatableProperty.Y, y, COMMUNAL_ANIMATION_PROPERTIES, - animate); - } - - /** - * Invoked when the quick settings is expanded. - * @param expansionFraction the percentage the QS shade has been expanded. - */ - public void updateQsExpansion(float expansionFraction) { - mQsExpansion = expansionFraction; - updateCommunalViewOccluded(); - } - - /** - * Invoked when the main shade is expanded. - * @param shadeExpansion the percentage the main shade has expanded. - */ - public void updateShadeExpansion(float shadeExpansion) { - mShadeExpansion = shadeExpansion; - updateCommunalViewOccluded(); - } - - private void updateCommunalViewOccluded() { - final boolean bouncerShowing = (mState & STATE_BOUNCER_SHOWING) == STATE_BOUNCER_SHOWING; - final int statusBarState = mStatusBarStateController.getState(); - final boolean shadeExpanded = statusBarState == StatusBarState.SHADE - || statusBarState == StatusBarState.SHADE_LOCKED; - - mCommunalStateController.setCommunalViewOccluded( - bouncerShowing || shadeExpanded || mQsExpansion > 0.0f || mShadeExpansion > 0.0f); - } -} diff --git a/packages/SystemUI/src/com/android/systemui/communal/CommunalHostViewPositionAlgorithm.java b/packages/SystemUI/src/com/android/systemui/communal/CommunalHostViewPositionAlgorithm.java deleted file mode 100644 index 424da0b111c5a..0000000000000 --- a/packages/SystemUI/src/com/android/systemui/communal/CommunalHostViewPositionAlgorithm.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (C) 2021 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.communal; - -import android.util.Log; - -import com.android.systemui.statusbar.phone.NotificationPanelViewController; - -/** - * {@link CommunalHostViewPositionAlgorithm} calculates the position of the communal view given - * input such as the notification panel position. - */ -public class CommunalHostViewPositionAlgorithm { - private static final String TAG = "CommunalPositionAlg"; - private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG); - - /** - * @see NotificationPanelViewController#getExpandedFraction() - */ - private float mPanelExpansion; - - /** - * Height of {@link CommunalHostView}. - */ - private int mCommunalHeight; - - /** - * A data container for the result of the position algorithm. - */ - public static class Result { - /** - * The y translation of the clock. - */ - public int communalY; - } - - /** - * Sets the conditions under which the result should be calculated from. - * @param panelExpansion The percentage the keyguard panel has been moved upwards. - * @param communalHeight The height of the communal panel. - */ - public void setup(float panelExpansion, int communalHeight) { - if (DEBUG) { - Log.d(TAG, "setup. panelExpansion:" + panelExpansion); - } - mPanelExpansion = panelExpansion; - mCommunalHeight = communalHeight; - } - - /** - * Calculates the position based on factors input through {link {@link #setup(float, int)}}. - * @param result The resulting calculations. - */ - public void run(Result result) { - // The panel expansion relates to the keyguard expansion. At full expansion, the communal - // view should be aligned at the top (0). Otherwise, it should be shifted offscreen by the - // unexpanded amount. - result.communalY = (int) ((1 - mPanelExpansion) * -mCommunalHeight); - } -} diff --git a/packages/SystemUI/src/com/android/systemui/communal/CommunalSource.java b/packages/SystemUI/src/com/android/systemui/communal/CommunalSource.java deleted file mode 100644 index 42ecd5c835bbd..0000000000000 --- a/packages/SystemUI/src/com/android/systemui/communal/CommunalSource.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (C) 2021 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.communal; - -import android.content.Context; -import android.view.View; - -import com.android.systemui.util.ViewController; - -import com.google.common.util.concurrent.ListenableFuture; - -import java.util.Optional; - -/** - * {@link CommunalSource} defines an interface for working with a source for communal data. Clients - * may request a communal surface that can be shown within a {@link android.view.SurfaceView}. - * Callbacks may also be registered to listen to state changes. - */ -public interface CommunalSource { - /** - * {@link Connector} defines an interface for {@link CommunalSource} instances to be generated. - */ - interface Connector { - Connection connect(Connection.Callback callback); - } - - /** - * {@link Connection} defines an interface for an entity which holds the necessary components - * for establishing and maintaining a connection to the communal source. - */ - interface Connection { - /** - * {@link Callback} defines an interface for clients to be notified when a source is ready - */ - interface Callback { - void onSourceEstablished(Optional source); - void onDisconnected(); - } - - void disconnect(); - } - - /** - * The {@link Observer} interface specifies an entity which {@link CommunalSource} listeners - * can be informed of changes to the source, which will require updating. Note that this deals - * with changes to the source itself, not content which will be updated through the - * {@link CommunalSource} interface. - */ - interface Observer { - interface Callback { - void onSourceChanged(); - } - - void addCallback(Callback callback); - void removeCallback(Callback callback); - } - - /** - * {@link CommunalViewResult} is handed back from {@link #requestCommunalView(Context)} and - * contains the view to be displayed and its associated controller. - */ - class CommunalViewResult { - /** - * The resulting communal view. - */ - public final View view; - /** - * The controller for the communal view. - */ - public final ViewController viewController; - - /** - * The default constructor for {@link CommunalViewResult}. - * @param view The communal view. - * @param viewController The communal view's controller. - */ - public CommunalViewResult(View view, ViewController viewController) { - this.view = view; - this.viewController = viewController; - } - } - - /** - * Requests a communal surface that can be displayed inside {@link CommunalHostView}. - * - * @param context The {@link View} {@link Context} to build the resulting view from - * @return A future that can be listened upon for the resulting {@link CommunalViewResult}. The - * value will be {@code null} in case of a failure. - */ - ListenableFuture requestCommunalView(Context context); -} diff --git a/packages/SystemUI/src/com/android/systemui/communal/CommunalSourceMonitor.java b/packages/SystemUI/src/com/android/systemui/communal/CommunalSourceMonitor.java deleted file mode 100644 index 58cf35f2917c0..0000000000000 --- a/packages/SystemUI/src/com/android/systemui/communal/CommunalSourceMonitor.java +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Copyright (C) 2021 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.communal; - -import static com.android.systemui.communal.dagger.CommunalModule.COMMUNAL_CONDITIONS; - -import android.util.Log; - -import com.android.internal.annotations.VisibleForTesting; -import com.android.systemui.dagger.SysUISingleton; -import com.android.systemui.dagger.qualifiers.Main; -import com.android.systemui.util.condition.Monitor; - -import com.google.android.collect.Lists; - -import java.lang.ref.WeakReference; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.concurrent.Executor; - -import javax.inject.Inject; -import javax.inject.Named; - -/** - * A Monitor for reporting a {@link CommunalSource} presence. - */ -@SysUISingleton -public class CommunalSourceMonitor { - private static final String TAG = "CommunalSourceMonitor"; - private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG); - - // A list of {@link Callback} that have registered to receive updates. - private final ArrayList> mCallbacks = Lists.newArrayList(); - private final Monitor mConditionsMonitor; - private final Executor mExecutor; - - private CommunalSource mCurrentSource; - - // Whether all conditions for communal mode to show have been met. - private boolean mAllCommunalConditionsMet = false; - - // Whether the class is currently listening for condition changes. - private boolean mListeningForConditions = false; - - private final Monitor.Callback mConditionsCallback = - allConditionsMet -> { - if (mAllCommunalConditionsMet != allConditionsMet) { - if (DEBUG) Log.d(TAG, "communal conditions changed: " + allConditionsMet); - - mAllCommunalConditionsMet = allConditionsMet; - executeOnSourceAvailableCallbacks(); - } - }; - - @VisibleForTesting - @Inject - public CommunalSourceMonitor(@Main Executor executor, - @Named(COMMUNAL_CONDITIONS) Monitor communalConditionsMonitor) { - mExecutor = executor; - mConditionsMonitor = communalConditionsMonitor; - } - - /** - * Sets the current {@link CommunalSource}, informing any callbacks. Any existing - * {@link CommunalSource} will be disconnected. - * - * @param source The new {@link CommunalSource}. - */ - public void setSource(CommunalSource source) { - mCurrentSource = source; - - if (mAllCommunalConditionsMet) { - executeOnSourceAvailableCallbacks(); - } - } - - private void executeOnSourceAvailableCallbacks() { - mExecutor.execute(() -> { - // If the new source is valid, inform registered Callbacks of its presence. - Iterator> itr = mCallbacks.iterator(); - while (itr.hasNext()) { - Callback cb = itr.next().get(); - if (cb == null) { - itr.remove(); - } else { - cb.onSourceAvailable( - (mAllCommunalConditionsMet && mCurrentSource != null) - ? new WeakReference<>(mCurrentSource) : null); - } - } - }); - } - - /** - * Adds a {@link Callback} to receive {@link CommunalSource} updates. - * - * @param callback The {@link Callback} to add. - */ - public void addCallback(Callback callback) { - mExecutor.execute(() -> { - mCallbacks.add(new WeakReference<>(callback)); - - // Inform the callback of any already present CommunalSource. - if (mAllCommunalConditionsMet && mCurrentSource != null) { - callback.onSourceAvailable(new WeakReference<>(mCurrentSource)); - } - - if (!mListeningForConditions) { - mConditionsMonitor.addCallback(mConditionsCallback); - mListeningForConditions = true; - } - }); - } - - /** - * Removes the specified {@link Callback} from receive future updates if present. - * - * @param callback The {@link Callback} to add. - */ - public void removeCallback(Callback callback) { - mExecutor.execute(() -> { - mCallbacks.removeIf(el -> el.get() == callback); - - if (mCallbacks.isEmpty() && mListeningForConditions) { - mConditionsMonitor.removeCallback(mConditionsCallback); - mListeningForConditions = false; - } - }); - } - - /** - * Interface implemented to be notified when new {@link CommunalSource} become available. - */ - public interface Callback { - /** - * Called when a new {@link CommunalSource} has been registered. This will also be invoked - * when a {@link Callback} is first registered and a {@link CommunalSource} is already - * registered. - * - * @param source The new {@link CommunalSource}. - */ - void onSourceAvailable(WeakReference source); - } -} diff --git a/packages/SystemUI/src/com/android/systemui/communal/CommunalSourcePrimer.java b/packages/SystemUI/src/com/android/systemui/communal/CommunalSourcePrimer.java deleted file mode 100644 index f965431a80018..0000000000000 --- a/packages/SystemUI/src/com/android/systemui/communal/CommunalSourcePrimer.java +++ /dev/null @@ -1,180 +0,0 @@ -/* - * Copyright (C) 2021 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.communal; - -import android.content.Context; -import android.content.res.Resources; -import android.util.Log; - -import com.android.systemui.CoreStartable; -import com.android.systemui.R; -import com.android.systemui.dagger.SysUISingleton; -import com.android.systemui.dagger.qualifiers.Main; -import com.android.systemui.util.concurrency.DelayableExecutor; -import com.android.systemui.util.time.SystemClock; - -import java.util.Optional; - -import javax.inject.Inject; - -/** - * The {@link CommunalSourcePrimer} is responsible for priming SystemUI with a pre-configured - * Communal source. The SystemUI service binds to the component to retrieve the - * {@link CommunalSource}. {@link CommunalSourcePrimer} has no effect - * if there is no pre-defined value. - */ -@SysUISingleton -public class CommunalSourcePrimer extends CoreStartable { - private static final String TAG = "CommunalSourcePrimer"; - private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG); - - private final SystemClock mSystemClock; - private final DelayableExecutor mMainExecutor; - private final CommunalSourceMonitor mMonitor; - private final int mBaseReconnectDelayMs; - private final int mMaxReconnectAttempts; - private final int mMinConnectionDuration; - - private int mReconnectAttempts = 0; - private Runnable mCurrentReconnectCancelable; - - private final Optional mObserver; - private final Optional mConnector; - - private CommunalSource.Connection mCurrentConnection; - - private final Runnable mConnectRunnable = new Runnable() { - @Override - public void run() { - mCurrentReconnectCancelable = null; - connect(); - } - }; - - private final CommunalSource.Observer.Callback mObserverCallback = () -> { - initiateConnectionAttempt(); - }; - - @Inject - public CommunalSourcePrimer(Context context, @Main Resources resources, - SystemClock clock, - DelayableExecutor mainExecutor, - CommunalSourceMonitor monitor, - Optional connector, - Optional observer) { - super(context); - mSystemClock = clock; - mMainExecutor = mainExecutor; - mMonitor = monitor; - mConnector = connector; - mObserver = observer; - - mMaxReconnectAttempts = resources.getInteger( - R.integer.config_communalSourceMaxReconnectAttempts); - mBaseReconnectDelayMs = resources.getInteger( - R.integer.config_communalSourceReconnectBaseDelay); - mMinConnectionDuration = resources.getInteger( - R.integer.config_connectionMinDuration); - } - - @Override - public void start() { - } - - private void initiateConnectionAttempt() { - // Reset attempts - mReconnectAttempts = 0; - mMonitor.setSource(null); - - // The first attempt is always a direct invocation rather than delayed. - connect(); - } - - private void scheduleConnectionAttempt() { - // always clear cancelable if present. - if (mCurrentReconnectCancelable != null) { - mCurrentReconnectCancelable.run(); - mCurrentReconnectCancelable = null; - } - - if (mReconnectAttempts >= mMaxReconnectAttempts) { - if (DEBUG) { - Log.d(TAG, "exceeded max connection attempts."); - } - return; - } - - final long reconnectDelayMs = - (long) Math.scalb(mBaseReconnectDelayMs, mReconnectAttempts); - - if (DEBUG) { - Log.d(TAG, - "scheduling connection attempt in " + reconnectDelayMs + "milliseconds"); - } - - mCurrentReconnectCancelable = mMainExecutor.executeDelayed(mConnectRunnable, - reconnectDelayMs); - - mReconnectAttempts++; - } - - @Override - protected void onBootCompleted() { - if (mObserver.isPresent()) { - mObserver.get().addCallback(mObserverCallback); - } - initiateConnectionAttempt(); - } - - private void connect() { - if (DEBUG) { - Log.d(TAG, "attempting to connect to communal source"); - } - - if (mCurrentConnection != null) { - if (DEBUG) { - Log.d(TAG, "canceling in-flight connection"); - } - mCurrentConnection.disconnect(); - } - - mCurrentConnection = mConnector.get().connect(new CommunalSource.Connection.Callback() { - private long mStartTime; - - @Override - public void onSourceEstablished(Optional optionalSource) { - mStartTime = mSystemClock.currentTimeMillis(); - - if (optionalSource.isPresent()) { - final CommunalSource source = optionalSource.get(); - mMonitor.setSource(source); - } else { - scheduleConnectionAttempt(); - } - } - - @Override - public void onDisconnected() { - if (mSystemClock.currentTimeMillis() - mStartTime > mMinConnectionDuration) { - initiateConnectionAttempt(); - } else { - scheduleConnectionAttempt(); - } - } - }); - } -} diff --git a/packages/SystemUI/src/com/android/systemui/communal/CommunalStateController.java b/packages/SystemUI/src/com/android/systemui/communal/CommunalStateController.java deleted file mode 100644 index c72f5422b1f54..0000000000000 --- a/packages/SystemUI/src/com/android/systemui/communal/CommunalStateController.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright (C) 2021 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.communal; - -import android.annotation.NonNull; - -import com.android.internal.annotations.VisibleForTesting; -import com.android.systemui.dagger.SysUISingleton; -import com.android.systemui.statusbar.policy.CallbackController; - -import java.util.ArrayList; -import java.util.Objects; - -import javax.inject.Inject; - -/** - * CommunalStateController enables publishing and listening to communal-related state changes. - */ -@SysUISingleton -public class CommunalStateController implements - CallbackController { - private final ArrayList mCallbacks = new ArrayList<>(); - private boolean mCommunalViewOccluded; - private boolean mCommunalViewShowing; - - /** - * Callback for communal events. - */ - public interface Callback { - /** - * Called when the visibility of the communal view changes. - */ - default void onCommunalViewShowingChanged() { - } - - /** - * Called when the occlusion of the communal view changes. - */ - default void onCommunalViewOccludedChanged() { - } - } - - @VisibleForTesting - @Inject - public CommunalStateController() { - } - - /** - * Sets whether the communal view is showing. - * @param communalViewShowing {@code true} if the view is showing, {@code false} otherwise. - */ - public void setCommunalViewShowing(boolean communalViewShowing) { - if (mCommunalViewShowing == communalViewShowing) { - return; - } - - mCommunalViewShowing = communalViewShowing; - - final ArrayList callbacks = new ArrayList<>(mCallbacks); - for (Callback callback : callbacks) { - callback.onCommunalViewShowingChanged(); - } - } - - /** - * Sets whether the communal view is occluded (but otherwise still showing). - * @param communalViewOccluded {@code true} if the view is occluded, {@code false} otherwise. - */ - public void setCommunalViewOccluded(boolean communalViewOccluded) { - if (mCommunalViewOccluded == communalViewOccluded) { - return; - } - - mCommunalViewOccluded = communalViewOccluded; - - ArrayList callbacks = new ArrayList<>(mCallbacks); - for (int i = 0; i < callbacks.size(); i++) { - callbacks.get(i).onCommunalViewOccludedChanged(); - } - } - - /** - * Returns whether the communal view is showing. - * @return {@code true} if the view is showing, {@code false} otherwise. - */ - public boolean getCommunalViewShowing() { - return mCommunalViewShowing; - } - - /** - * Returns whether the communal view is occluded. - * @return {@code true} if the view is occluded, {@code false} otherwise. - */ - public boolean getCommunalViewOccluded() { - return mCommunalViewOccluded; - } - - @Override - public void addCallback(@NonNull Callback callback) { - Objects.requireNonNull(callback, "Callback must not be null. b/128895449"); - if (!mCallbacks.contains(callback)) { - mCallbacks.add(callback); - } - } - - @Override - public void removeCallback(@NonNull Callback callback) { - Objects.requireNonNull(callback, "Callback must not be null. b/128895449"); - mCallbacks.remove(callback); - } -} diff --git a/packages/SystemUI/src/com/android/systemui/communal/PackageObserver.java b/packages/SystemUI/src/com/android/systemui/communal/PackageObserver.java deleted file mode 100644 index 3d25d126a2914..0000000000000 --- a/packages/SystemUI/src/com/android/systemui/communal/PackageObserver.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (C) 2021 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.communal; - -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; -import android.content.IntentFilter; -import android.os.PatternMatcher; -import android.util.Log; - -import com.google.android.collect.Lists; - -import java.lang.ref.WeakReference; -import java.util.ArrayList; -import java.util.Iterator; - -/** - * {@link PackageObserver} allows for monitoring the system for changes relating to a particular - * package. This can be used by {@link CommunalSource} clients to detect when a related package - * has changed and reloading is necessary. - */ -public class PackageObserver implements CommunalSource.Observer { - private static final String TAG = "PackageObserver"; - private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG); - - private final ArrayList> mCallbacks = Lists.newArrayList(); - - private final BroadcastReceiver mReceiver = new BroadcastReceiver() { - @Override - public void onReceive(Context context, Intent intent) { - if (DEBUG) { - Log.d(TAG, "package added receiver - onReceive"); - } - - final Iterator> iter = mCallbacks.iterator(); - while (iter.hasNext()) { - final Callback callback = iter.next().get(); - if (callback != null) { - callback.onSourceChanged(); - } else { - iter.remove(); - } - } - } - }; - - private final String mPackageName; - private final Context mContext; - - public PackageObserver(Context context, String packageName) { - mContext = context; - mPackageName = packageName; - } - - @Override - public void addCallback(Callback callback) { - if (DEBUG) { - Log.d(TAG, "addCallback:" + callback); - } - mCallbacks.add(new WeakReference<>(callback)); - - // Only register for listening to package additions on first callback. - if (mCallbacks.size() > 1) { - return; - } - - final IntentFilter filter = new IntentFilter(Intent.ACTION_PACKAGE_ADDED); - filter.addDataScheme("package"); - filter.addDataSchemeSpecificPart(mPackageName, PatternMatcher.PATTERN_LITERAL); - // Note that we directly register the receiver here as data schemes are not supported by - // BroadcastDispatcher. - mContext.registerReceiver(mReceiver, filter, Context.RECEIVER_EXPORTED); - } - - @Override - public void removeCallback(Callback callback) { - if (DEBUG) { - Log.d(TAG, "removeCallback:" + callback); - } - final boolean removed = mCallbacks.removeIf(el -> el.get() == callback); - - if (removed && mCallbacks.isEmpty()) { - mContext.unregisterReceiver(mReceiver); - } - } -} diff --git a/packages/SystemUI/src/com/android/systemui/communal/conditions/CommunalSettingCondition.java b/packages/SystemUI/src/com/android/systemui/communal/conditions/CommunalSettingCondition.java deleted file mode 100644 index 25519d0f96c75..0000000000000 --- a/packages/SystemUI/src/com/android/systemui/communal/conditions/CommunalSettingCondition.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (C) 2021 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.communal.conditions; - -import android.database.ContentObserver; -import android.os.Handler; -import android.os.UserHandle; -import android.provider.Settings; - -import androidx.annotation.MainThread; - -import com.android.systemui.util.condition.Condition; -import com.android.systemui.util.settings.SecureSettings; - -import javax.inject.Inject; - -/** - * Monitors the communal setting, and informs any listeners with updates. - */ -public class CommunalSettingCondition extends Condition { - private final SecureSettings mSecureSettings; - private final ContentObserver mCommunalSettingContentObserver; - - @Inject - public CommunalSettingCondition(@MainThread Handler mainHandler, - SecureSettings secureSettings) { - mSecureSettings = secureSettings; - - mCommunalSettingContentObserver = new ContentObserver(mainHandler) { - @Override - public void onChange(boolean selfChange) { - final boolean communalSettingEnabled = mSecureSettings.getIntForUser( - Settings.Secure.COMMUNAL_MODE_ENABLED, 0, UserHandle.USER_SYSTEM) == 1; - updateCondition(communalSettingEnabled); - } - }; - } - - @Override - protected void start() { - mSecureSettings.registerContentObserverForUser(Settings.Secure.COMMUNAL_MODE_ENABLED, - false /*notifyForDescendants*/, mCommunalSettingContentObserver, - UserHandle.USER_SYSTEM); - - // Fetches setting immediately. - mCommunalSettingContentObserver.onChange(false); - } - - @Override - protected void stop() { - mSecureSettings.unregisterContentObserver(mCommunalSettingContentObserver); - } -} diff --git a/packages/SystemUI/src/com/android/systemui/communal/dagger/CommunalModule.java b/packages/SystemUI/src/com/android/systemui/communal/dagger/CommunalModule.java deleted file mode 100644 index 814b251d08ab2..0000000000000 --- a/packages/SystemUI/src/com/android/systemui/communal/dagger/CommunalModule.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright (C) 2021 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.communal.dagger; - -import android.content.ComponentName; -import android.content.Context; -import android.content.res.Resources; -import android.text.TextUtils; - -import androidx.annotation.Nullable; - -import com.android.systemui.R; -import com.android.systemui.communal.CommunalSource; -import com.android.systemui.communal.PackageObserver; -import com.android.systemui.communal.conditions.CommunalSettingCondition; -import com.android.systemui.dagger.qualifiers.Main; -import com.android.systemui.util.condition.Condition; -import com.android.systemui.util.condition.Monitor; -import com.android.systemui.util.condition.dagger.MonitorComponent; - -import java.util.Collections; -import java.util.HashSet; -import java.util.Map; -import java.util.Optional; -import java.util.Set; - -import javax.inject.Named; -import javax.inject.Provider; - -import dagger.Module; -import dagger.Provides; -import dagger.multibindings.ElementsIntoSet; -import dagger.multibindings.IntoMap; -import dagger.multibindings.StringKey; - -/** - * Dagger Module providing Communal-related functionality. - */ -@Module(subcomponents = { - CommunalViewComponent.class, -}) -public interface CommunalModule { - String COMMUNAL_CONDITIONS = "communal_conditions"; - - /** */ - @Provides - static Optional provideCommunalSourcePackageObserver( - Context context, @Main Resources resources) { - final String componentName = resources.getString(R.string.config_communalSourceComponent); - - if (TextUtils.isEmpty(componentName)) { - return Optional.empty(); - } - - return Optional.of(new PackageObserver(context, - ComponentName.unflattenFromString(componentName).getPackageName())); - } - - /** - * Provides a set of conditions that need to be fulfilled in order for Communal Mode to display. - */ - @Provides - @ElementsIntoSet - @Named(COMMUNAL_CONDITIONS) - static Set provideCommunalConditions( - CommunalSettingCondition communalSettingCondition) { - return new HashSet<>(Collections.singletonList(communalSettingCondition)); - } - - /** - * TODO(b/205638389): Remove when there is a base implementation of - * {@link CommunalSource.Connector}. Currently a place holder to allow a map to be present. - */ - @Provides - @IntoMap - @Nullable - @StringKey("empty") - static CommunalSource.Connector provideEmptyCommunalSourceConnector() { - return null; - } - - /** */ - @Provides - static Optional provideCommunalSourceConnector( - @Main Resources resources, - Map, Provider> connectorCreators) { - final String className = resources.getString(R.string.config_communalSourceConnector); - - if (TextUtils.isEmpty(className)) { - return Optional.empty(); - } - - try { - Class clazz = Class.forName(className); - Provider provider = connectorCreators.get(clazz); - return provider != null ? Optional.of(provider.get()) : Optional.empty(); - } catch (ClassNotFoundException e) { - return Optional.empty(); - } - } - - /** */ - @Provides - @Named(COMMUNAL_CONDITIONS) - static Monitor provideCommunalSourceMonitor( - @Named(COMMUNAL_CONDITIONS) Set communalConditions, - MonitorComponent.Factory factory) { - final MonitorComponent component = factory.create(communalConditions, new HashSet<>()); - return component.getMonitor(); - } -} diff --git a/packages/SystemUI/src/com/android/systemui/communal/dagger/CommunalViewComponent.java b/packages/SystemUI/src/com/android/systemui/communal/dagger/CommunalViewComponent.java deleted file mode 100644 index 3a80a03aecb25..0000000000000 --- a/packages/SystemUI/src/com/android/systemui/communal/dagger/CommunalViewComponent.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2021 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.communal.dagger; - -import com.android.systemui.communal.CommunalHostView; -import com.android.systemui.communal.CommunalHostViewController; - -import dagger.BindsInstance; -import dagger.Subcomponent; - -/** - * Subcomponent for working with {@link CommunalHostView}. - */ -@Subcomponent -public interface CommunalViewComponent { - /** Simple factory for {@link CommunalViewComponent}. */ - @Subcomponent.Factory - interface Factory { - CommunalViewComponent build(@BindsInstance CommunalHostView view); - } - - /** Builds a {@link CommunalHostViewController}. */ - CommunalHostViewController getCommunalHostViewController(); -} diff --git a/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java b/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java index 27993010c9172..8e323051012d6 100644 --- a/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java +++ b/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java @@ -32,7 +32,6 @@ import com.android.systemui.assist.AssistModule; import com.android.systemui.biometrics.UdfpsHbmProvider; import com.android.systemui.biometrics.dagger.BiometricsModule; import com.android.systemui.classifier.FalsingModule; -import com.android.systemui.communal.dagger.CommunalModule; import com.android.systemui.controls.dagger.ControlsModule; import com.android.systemui.dagger.qualifiers.Main; import com.android.systemui.demomode.dagger.DemoModeModule; @@ -66,8 +65,8 @@ import com.android.systemui.statusbar.notification.people.PeopleHubModule; import com.android.systemui.statusbar.notification.row.dagger.ExpandableNotificationRowComponent; import com.android.systemui.statusbar.notification.row.dagger.NotificationRowComponent; import com.android.systemui.statusbar.notification.row.dagger.NotificationShelfComponent; -import com.android.systemui.statusbar.phone.ShadeController; import com.android.systemui.statusbar.phone.CentralSurfaces; +import com.android.systemui.statusbar.phone.ShadeController; import com.android.systemui.statusbar.phone.dagger.CentralSurfacesComponent; import com.android.systemui.statusbar.policy.ConfigurationController; import com.android.systemui.statusbar.policy.HeadsUpManager; @@ -106,7 +105,6 @@ import dagger.Provides; AssistModule.class, BiometricsModule.class, ClockModule.class, - CommunalModule.class, DreamModule.class, ControlsModule.class, DemoModeModule.class, diff --git a/packages/SystemUI/src/com/android/systemui/dreams/dagger/DreamModule.java b/packages/SystemUI/src/com/android/systemui/dreams/dagger/DreamModule.java index 65f060b43c08a..3c96f8da1a557 100644 --- a/packages/SystemUI/src/com/android/systemui/dreams/dagger/DreamModule.java +++ b/packages/SystemUI/src/com/android/systemui/dreams/dagger/DreamModule.java @@ -27,7 +27,7 @@ import dagger.Module; import dagger.Provides; /** - * Dagger Module providing Communal-related functionality. + * Dagger Module providing Dream-related functionality. */ @Module(includes = { DreamTouchModule.class, diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/CommunalCoordinator.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/CommunalCoordinator.java deleted file mode 100644 index 5396b86382257..0000000000000 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/CommunalCoordinator.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (C) 2021 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.statusbar.notification.collection.coordinator; - -import androidx.annotation.NonNull; - -import com.android.systemui.communal.CommunalStateController; -import com.android.systemui.dagger.qualifiers.Main; -import com.android.systemui.statusbar.NotificationLockscreenUserManager; -import com.android.systemui.statusbar.notification.NotificationEntryManager; -import com.android.systemui.statusbar.notification.collection.NotifPipeline; -import com.android.systemui.statusbar.notification.collection.NotificationEntry; -import com.android.systemui.statusbar.notification.collection.coordinator.dagger.CoordinatorScope; -import com.android.systemui.statusbar.notification.collection.listbuilder.pluggable.NotifFilter; - -import java.util.concurrent.Executor; - -import javax.inject.Inject; - -/** - * {@link CommunalCoordinator} prevents notifications from showing on the keyguard when the communal - * view is present. - */ -@CoordinatorScope -public class CommunalCoordinator implements Coordinator { - final Executor mExecutor; - final CommunalStateController mCommunalStateController; - final NotificationEntryManager mNotificationEntryManager; - final NotificationLockscreenUserManager mNotificationLockscreenUserManager; - - @Inject - public CommunalCoordinator(@Main Executor executor, - NotificationEntryManager notificationEntryManager, - NotificationLockscreenUserManager notificationLockscreenUserManager, - CommunalStateController communalStateController) { - mExecutor = executor; - mNotificationEntryManager = notificationEntryManager; - mNotificationLockscreenUserManager = notificationLockscreenUserManager; - mCommunalStateController = communalStateController; - } - - final NotifFilter mFilter = new NotifFilter("CommunalCoordinator") { - @Override - public boolean shouldFilterOut(@NonNull NotificationEntry entry, long now) { - return mCommunalStateController.getCommunalViewShowing(); - } - }; - - final CommunalStateController.Callback mStateCallback = new CommunalStateController.Callback() { - @Override - public void onCommunalViewShowingChanged() { - mExecutor.execute(() -> { - mFilter.invalidateList(); - mNotificationEntryManager.updateNotifications("Communal mode state changed"); - }); - } - }; - - @Override - public void attach(@NonNull NotifPipeline pipeline) { - pipeline.addPreGroupFilter(mFilter); - mCommunalStateController.addCallback(mStateCallback); - if (!pipeline.isNewPipelineEnabled()) { - mNotificationLockscreenUserManager.addKeyguardNotificationSuppressor( - entry -> mCommunalStateController.getCommunalViewShowing()); - } - } -} diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/NotifCoordinators.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/NotifCoordinators.kt index 757fb5a2fe9a3..352e5ac8a5bdb 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/NotifCoordinators.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/NotifCoordinators.kt @@ -45,7 +45,6 @@ class NotifCoordinatorsImpl @Inject constructor( bubbleCoordinator: BubbleCoordinator, headsUpCoordinator: HeadsUpCoordinator, gutsCoordinator: GutsCoordinator, - communalCoordinator: CommunalCoordinator, conversationCoordinator: ConversationCoordinator, debugModeCoordinator: DebugModeCoordinator, groupCountCoordinator: GroupCountCoordinator, @@ -86,7 +85,6 @@ class NotifCoordinatorsImpl @Inject constructor( mCoordinators.add(appOpsCoordinator) mCoordinators.add(deviceProvisionedCoordinator) mCoordinators.add(bubbleCoordinator) - mCoordinators.add(communalCoordinator) mCoordinators.add(debugModeCoordinator) mCoordinators.add(conversationCoordinator) mCoordinators.add(groupCountCoordinator) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java index 01860a822503b..39655fac25721 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java @@ -120,13 +120,6 @@ import com.android.systemui.animation.LaunchAnimator; import com.android.systemui.biometrics.AuthController; import com.android.systemui.classifier.Classifier; import com.android.systemui.classifier.FalsingCollector; -import com.android.systemui.communal.CommunalHostView; -import com.android.systemui.communal.CommunalHostViewController; -import com.android.systemui.communal.CommunalHostViewPositionAlgorithm; -import com.android.systemui.communal.CommunalSource; -import com.android.systemui.communal.CommunalSourceMonitor; -import com.android.systemui.communal.CommunalStateController; -import com.android.systemui.communal.dagger.CommunalViewComponent; import com.android.systemui.controls.dagger.ControlsComponent; import com.android.systemui.dagger.qualifiers.DisplayId; import com.android.systemui.dagger.qualifiers.Main; @@ -209,7 +202,6 @@ import com.android.wm.shell.animation.FlingAnimationUtils; import java.io.FileDescriptor; import java.io.PrintWriter; -import java.lang.ref.WeakReference; import java.util.ArrayList; import java.util.Collections; import java.util.HashSet; @@ -309,13 +301,10 @@ public class NotificationPanelViewController extends PanelViewController private final PulseExpansionHandler mPulseExpansionHandler; private final KeyguardBypassController mKeyguardBypassController; private final KeyguardUpdateMonitor mUpdateMonitor; - private final CommunalSourceMonitor mCommunalSourceMonitor; - private final CommunalStateController mCommunalStateController; private final ConversationNotificationManager mConversationNotificationManager; private final AuthController mAuthController; private final MediaHierarchyManager mMediaHierarchyManager; private final StatusBarKeyguardViewManager mStatusBarKeyguardViewManager; - private final CommunalViewComponent.Factory mCommunalViewComponentFactory; private final KeyguardStatusViewComponent.Factory mKeyguardStatusViewComponentFactory; private final KeyguardQsUserSwitchComponent.Factory mKeyguardQsUserSwitchComponentFactory; private final KeyguardUserSwitcherComponent.Factory mKeyguardUserSwitcherComponentFactory; @@ -350,8 +339,6 @@ public class NotificationPanelViewController extends PanelViewController @VisibleForTesting QS mQs; private FrameLayout mQsFrame; private QsFrameTranslateController mQsFrameTranslateController; - @Nullable - private CommunalHostViewController mCommunalViewController; private KeyguardStatusViewController mKeyguardStatusViewController; private LockIconViewController mLockIconViewController; private NotificationsQuickSettingsContainer mNotificationContainerParent; @@ -364,8 +351,6 @@ public class NotificationPanelViewController extends PanelViewController private VelocityTracker mQsVelocityTracker; private boolean mQsTracking; - private CommunalHostView mCommunalView; - /** * If set, the ongoing touch gesture might both trigger the expansion in {@link PanelView} and * the expansion for quick settings. @@ -413,12 +398,6 @@ public class NotificationPanelViewController extends PanelViewController private final KeyguardClockPositionAlgorithm.Result mClockPositionResult = new KeyguardClockPositionAlgorithm.Result(); - private final CommunalHostViewPositionAlgorithm - mCommunalPositionAlgorithm = - new CommunalHostViewPositionAlgorithm(); - private final CommunalHostViewPositionAlgorithm.Result - mCommunalPositionResult = - new CommunalHostViewPositionAlgorithm.Result(); private boolean mIsExpanding; private boolean mBlockTouches; @@ -523,10 +502,6 @@ public class NotificationPanelViewController extends PanelViewController mPanelAlphaAnimator.getProperty(), Interpolators.ALPHA_IN); private final NotificationEntryManager mEntryManager; - private final CommunalSourceMonitor.Callback mCommunalSourceMonitorCallback; - - private WeakReference mCommunalSource; - private final CommandQueue mCommandQueue; private final NotificationLockscreenUserManager mLockscreenUserManager; private final UserManager mUserManager; @@ -688,32 +663,6 @@ public class NotificationPanelViewController extends PanelViewController } }; - private final CommunalStateController.Callback mCommunalStateCallback = - new CommunalStateController.Callback() { - @Override - public void onCommunalViewShowingChanged() { - mKeyguardStatusViewController.setKeyguardStatusViewVisibility( - mBarState, - mKeyguardStateController.isKeyguardFadingAway(), - mStatusBarStateController.goingToFullShade(), - mBarState); - if (mKeyguardUserSwitcherController != null) { - mKeyguardUserSwitcherController.setKeyguardUserSwitcherVisibility( - mBarState, - mKeyguardStateController.isKeyguardFadingAway(), - mStatusBarStateController.goingToFullShade(), - mBarState); - } - if (mKeyguardQsUserSwitchController != null) { - mKeyguardQsUserSwitchController.setKeyguardQsUserSwitchVisibility( - mBarState, - mKeyguardStateController.isKeyguardFadingAway(), - mStatusBarStateController.goingToFullShade(), - mBarState); - } - } - }; - private final FalsingTapListener mFalsingTapListener = new FalsingTapListener() { @Override public void onDoubleTapRequired() { @@ -739,7 +688,6 @@ public class NotificationPanelViewController extends PanelViewController FalsingCollector falsingCollector, NotificationLockscreenUserManager notificationLockscreenUserManager, NotificationEntryManager notificationEntryManager, - CommunalStateController communalStateController, KeyguardStateController keyguardStateController, StatusBarStateController statusBarStateController, StatusBarWindowStateController statusBarWindowStateController, @@ -749,7 +697,7 @@ public class NotificationPanelViewController extends PanelViewController LatencyTracker latencyTracker, PowerManager powerManager, AccessibilityManager accessibilityManager, @DisplayId int displayId, KeyguardUpdateMonitor keyguardUpdateMonitor, - CommunalSourceMonitor communalSourceMonitor, MetricsLogger metricsLogger, + MetricsLogger metricsLogger, ActivityManager activityManager, ConfigurationController configurationController, Provider flingAnimationUtilsBuilder, @@ -763,7 +711,6 @@ public class NotificationPanelViewController extends PanelViewController KeyguardQsUserSwitchComponent.Factory keyguardQsUserSwitchComponentFactory, KeyguardUserSwitcherComponent.Factory keyguardUserSwitcherComponentFactory, KeyguardStatusBarViewComponent.Factory keyguardStatusBarViewComponentFactory, - CommunalViewComponent.Factory communalViewComponentFactory, LockscreenShadeTransitionController lockscreenShadeTransitionController, NotificationGroupManagerLegacy groupManager, NotificationIconAreaController notificationIconAreaController, @@ -832,8 +779,6 @@ public class NotificationPanelViewController extends PanelViewController mNotificationStackScrollLayoutController = notificationStackScrollLayoutController; mGroupManager = groupManager; mNotificationIconAreaController = notificationIconAreaController; - mCommunalStateController = communalStateController; - mCommunalViewComponentFactory = communalViewComponentFactory; mKeyguardStatusViewComponentFactory = keyguardStatusViewComponentFactory; mKeyguardStatusBarViewComponentFactory = keyguardStatusBarViewComponentFactory; mDepthController = notificationShadeDepthController; @@ -877,7 +822,6 @@ public class NotificationPanelViewController extends PanelViewController mThemeResId = mView.getContext().getThemeResId(); mKeyguardBypassController = bypassController; mUpdateMonitor = keyguardUpdateMonitor; - mCommunalSourceMonitor = communalSourceMonitor; mLockscreenShadeTransitionController = lockscreenShadeTransitionController; lockscreenShadeTransitionController.setNotificationPanelController(this); DynamicPrivacyControlListener @@ -924,9 +868,6 @@ public class NotificationPanelViewController extends PanelViewController mNotificationPanelUnfoldAnimationController = unfoldComponent.map( SysUIUnfoldComponent::getNotificationPanelUnfoldAnimationController); - mCommunalSourceMonitorCallback = (source) -> { - mUiExecutor.execute(() -> setCommunalSource(source)); - }; mQsFrameTranslateController = qsFrameTranslateController; updateUserSwitcherFlags(); onFinishInflate(); @@ -962,7 +903,6 @@ public class NotificationPanelViewController extends PanelViewController private void onFinishInflate() { loadDimens(); mKeyguardStatusBar = mView.findViewById(R.id.keyguard_header); - mCommunalView = mView.findViewById(R.id.communal_host); FrameLayout userAvatarContainer = null; KeyguardUserSwitcherView keyguardUserSwitcherView = null; @@ -984,20 +924,11 @@ public class NotificationPanelViewController extends PanelViewController .getKeyguardStatusBarViewController(); mKeyguardStatusBarViewController.init(); - if (mCommunalView != null) { - CommunalViewComponent communalViewComponent = - mCommunalViewComponentFactory.build(mCommunalView); - mCommunalViewController = - communalViewComponent.getCommunalHostViewController(); - mCommunalViewController.init(); - } - mNotificationContainerParent = mView.findViewById(R.id.notification_container_parent); updateViewControllers( mView.findViewById(R.id.keyguard_status_view), userAvatarContainer, - keyguardUserSwitcherView, - mCommunalView); + keyguardUserSwitcherView); NotificationStackScrollLayout stackScrollLayout = mView.findViewById( R.id.notification_stack_scroller); @@ -1088,8 +1019,7 @@ public class NotificationPanelViewController extends PanelViewController private void updateViewControllers(KeyguardStatusView keyguardStatusView, FrameLayout userAvatarView, - KeyguardUserSwitcherView keyguardUserSwitcherView, - CommunalHostView communalView) { + KeyguardUserSwitcherView keyguardUserSwitcherView) { // Re-associate the KeyguardStatusViewController KeyguardStatusViewComponent statusViewComponent = mKeyguardStatusViewComponentFactory.build(keyguardStatusView); @@ -1282,7 +1212,7 @@ public class NotificationPanelViewController extends PanelViewController showKeyguardUserSwitcher /* enabled */); updateViewControllers(mView.findViewById(R.id.keyguard_status_view), userAvatarView, - keyguardUserSwitcherView, mCommunalView); + keyguardUserSwitcherView); // Update keyguard bottom area int index = mView.indexOfChild(mKeyguardBottomArea); @@ -1428,10 +1358,6 @@ public class NotificationPanelViewController extends PanelViewController int stackScrollerPadding; boolean onKeyguard = isOnKeyguard(); - if (onKeyguard) { - updateCommunalViewAppearance(); - } - if (onKeyguard || forceClockUpdate) { updateClockAppearance(); } @@ -1457,22 +1383,6 @@ public class NotificationPanelViewController extends PanelViewController mAnimateNextPositionUpdate = false; } - private void updateCommunalViewAppearance() { - if (mCommunalViewController == null) { - return; - } - - float expandedFraction = - mScreenOffAnimationController.shouldExpandNotifications() - ? 1.0f : getExpandedFraction(); - mCommunalPositionAlgorithm.setup(expandedFraction, mCommunalView.getHeight()); - mCommunalPositionAlgorithm.run(mCommunalPositionResult); - boolean animate = - mNotificationStackScrollLayoutController.isAddOrRemoveAnimationPending() - || mAnimateNextPositionUpdate; - mCommunalViewController.updatePosition(mCommunalPositionResult.communalY, animate); - } - private void updateClockAppearance() { int userSwitcherPreferredY = mStatusBarHeaderHeightKeyguard; boolean bypassEnabled = mKeyguardBypassController.getBypassEnabled(); @@ -1547,9 +1457,8 @@ public class NotificationPanelViewController extends PanelViewController private void updateKeyguardStatusViewAlignment(boolean animate) { boolean hasVisibleNotifications = mNotificationStackScrollLayoutController .getVisibleNotificationCount() != 0 || mMediaDataManager.hasActiveMedia(); - boolean hasCommunalSurface = mCommunalSource != null && mCommunalSource.get() != null; - boolean shouldBeCentered = !mShouldUseSplitNotificationShade - || (!hasVisibleNotifications && !hasCommunalSurface) || mDozing; + boolean shouldBeCentered = !mShouldUseSplitNotificationShade || !hasVisibleNotifications + || mDozing; if (mStatusViewCentered != shouldBeCentered) { mStatusViewCentered = shouldBeCentered; ConstraintSet constraintSet = new ConstraintSet(); @@ -1579,11 +1488,6 @@ public class NotificationPanelViewController extends PanelViewController * @return the maximum keyguard notifications that can fit on the screen */ private int computeMaxKeyguardNotifications() { - // Do not show any notifications on the keyguard if a communal source is set. - if (mCommunalSource != null && mCommunalSource.get() != null) { - return 0; - } - float minPadding = mClockPositionAlgorithm.getMinStackScrollerPadding(); int notificationPadding = Math.max( 1, mResources.getDimensionPixelSize(R.dimen.notification_divider_height)); @@ -1707,12 +1611,6 @@ public class NotificationPanelViewController extends PanelViewController return true; } - private void updateCommunal() { - if (mCommunalViewController != null) { - mCommunalViewController.setAlpha(mKeyguardOnlyContentAlpha); - } - } - private void updateClock() { float alpha = mClockPositionResult.clockAlpha * mKeyguardOnlyContentAlpha; mKeyguardStatusViewController.setAlpha(alpha); @@ -2483,10 +2381,6 @@ public class NotificationPanelViewController extends PanelViewController mSplitShadeHeaderController.setShadeExpandedFraction(shadeExpandedFraction); mSplitShadeHeaderController.setQsExpandedFraction(qsExpansionFraction); mSplitShadeHeaderController.setShadeExpanded(mQsVisible); - - if (mCommunalViewController != null) { - mCommunalViewController.updateQsExpansion(qsExpansionFraction); - } } private void onStackYChanged(boolean shouldAnimate) { @@ -2849,10 +2743,6 @@ public class NotificationPanelViewController extends PanelViewController } mTransitionToFullShadeQSPosition = position; updateQsExpansion(); - - if (mCommunalViewController != null) { - mCommunalViewController.updateShadeExpansion(mTransitioningToFullShadeProgress); - } } /** @@ -2876,7 +2766,6 @@ public class NotificationPanelViewController extends PanelViewController updateKeyguardBottomAreaAlpha(); } updateClock(); - updateCommunal(); } private void trackMovement(MotionEvent event) { @@ -4770,14 +4659,6 @@ public class NotificationPanelViewController extends PanelViewController goingToFullShade, mBarState); - if (mCommunalViewController != null) { - mCommunalViewController.setKeyguardStatusViewVisibility( - statusBarState, - keyguardFadingAway, - goingToFullShade, - mBarState); - } - setKeyguardBottomAreaVisibility(statusBarState, goingToFullShade); mBarState = statusBarState; @@ -4905,25 +4786,6 @@ public class NotificationPanelViewController extends PanelViewController setExpandedFraction(1f); } - private void setCommunalSource(WeakReference source) { - CommunalSource existingSource = mCommunalSource != null ? mCommunalSource.get() : null; - - if (existingSource != null) { - mCommunalViewController.show(null /*source*/); - } - - mCommunalSource = source; - - CommunalSource currentSource = mCommunalSource != null ? mCommunalSource.get() : null; - // Set source and register callback - if (currentSource != null && mCommunalViewController != null) { - mCommunalViewController.show(source); - } - - updateKeyguardStatusViewAlignment(true /*animate*/); - updateMaxDisplayedNotifications(true /*recompute*/); - } - /** * Sets the overstretch amount in raw pixels when dragging down. */ @@ -4941,7 +4803,6 @@ public class NotificationPanelViewController extends PanelViewController .addTagListener(QS.TAG, mFragmentListener); mStatusBarStateController.addCallback(mStatusBarStateListener); mConfigurationController.addCallback(mConfigurationListener); - mCommunalSourceMonitor.addCallback(mCommunalSourceMonitorCallback); // Theme might have changed between inflating this view and attaching it to the // window, so // force a call to onThemeChanged @@ -4949,7 +4810,6 @@ public class NotificationPanelViewController extends PanelViewController mFalsingManager.addTapListener(mFalsingTapListener); mKeyguardIndicationController.init(); registerSettingsChangeListener(); - mCommunalStateController.addCallback(mCommunalStateCallback); } @Override @@ -4959,9 +4819,7 @@ public class NotificationPanelViewController extends PanelViewController .removeTagListener(QS.TAG, mFragmentListener); mStatusBarStateController.removeCallback(mStatusBarStateListener); mConfigurationController.removeCallback(mConfigurationListener); - mCommunalSourceMonitor.removeCallback(mCommunalSourceMonitorCallback); mFalsingManager.removeTapListener(mFalsingTapListener); - mCommunalStateController.removeCallback(mCommunalStateCallback); } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardQsUserSwitchController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardQsUserSwitchController.java index 7e2488f1dfab3..2cdbabde81150 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardQsUserSwitchController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardQsUserSwitchController.java @@ -35,7 +35,6 @@ import com.android.keyguard.KeyguardVisibilityHelper; import com.android.keyguard.dagger.KeyguardUserSwitcherScope; import com.android.settingslib.drawable.CircleFramedDrawable; import com.android.systemui.R; -import com.android.systemui.communal.CommunalStateController; import com.android.systemui.dagger.qualifiers.Main; import com.android.systemui.keyguard.ScreenLifecycle; import com.android.systemui.plugins.FalsingManager; @@ -119,7 +118,6 @@ public class KeyguardQsUserSwitchController extends ViewController @Main Resources resources, ScreenLifecycle screenLifecycle, UserSwitcherController userSwitcherController, - CommunalStateController communalStateController, KeyguardStateController keyguardStateController, FalsingManager falsingManager, ConfigurationController configurationController, @@ -138,10 +136,9 @@ public class KeyguardQsUserSwitchController extends ViewController mFalsingManager = falsingManager; mConfigurationController = configurationController; mStatusBarStateController = statusBarStateController; - mKeyguardVisibilityHelper = new KeyguardVisibilityHelper(mView, communalStateController, + mKeyguardVisibilityHelper = new KeyguardVisibilityHelper(mView, keyguardStateController, dozeParameters, - screenOffAnimationController, /* animateYPos= */ false, - /* visibleOnCommunal= */ false); + screenOffAnimationController, /* animateYPos= */ false); mUserSwitchDialogController = userSwitchDialogController; mUiEventLogger = uiEventLogger; } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardUserSwitcherController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardUserSwitcherController.java index 04a6a114a07dd..e6306e5cdd3fe 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardUserSwitcherController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardUserSwitcherController.java @@ -42,7 +42,6 @@ import com.android.keyguard.dagger.KeyguardUserSwitcherScope; import com.android.settingslib.drawable.CircleFramedDrawable; import com.android.systemui.R; import com.android.systemui.animation.Interpolators; -import com.android.systemui.communal.CommunalStateController; import com.android.systemui.dagger.qualifiers.Main; import com.android.systemui.keyguard.ScreenLifecycle; import com.android.systemui.plugins.statusbar.StatusBarStateController; @@ -158,7 +157,6 @@ public class KeyguardUserSwitcherController extends ViewController