Loading packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java +0 −1 Original line number Diff line number Diff line Loading @@ -2629,7 +2629,6 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump if (isPanelExpanded() != isExpanded) { setExpandedOrAwaitingInputTransfer(isExpanded); updateSystemUiStateFlags(); mShadeExpansionStateManager.onShadeExpansionFullyChanged(isExpanded); if (!isExpanded) { mQsController.closeQsCustomizer(); } Loading packages/SystemUI/src/com/android/systemui/shade/ShadeExpansionStateManager.kt +0 −22 Original line number Diff line number Diff line Loading @@ -36,7 +36,6 @@ import javax.inject.Inject class ShadeExpansionStateManager @Inject constructor() : ShadeStateEvents { private val expansionListeners = CopyOnWriteArrayList<ShadeExpansionListener>() private val fullExpansionListeners = CopyOnWriteArrayList<ShadeFullExpansionListener>() private val qsExpansionListeners = CopyOnWriteArrayList<ShadeQsExpansionListener>() private val qsExpansionFractionListeners = CopyOnWriteArrayList<ShadeQsExpansionFractionListener>() Loading Loading @@ -67,15 +66,6 @@ class ShadeExpansionStateManager @Inject constructor() : ShadeStateEvents { expansionListeners.remove(listener) } fun addFullExpansionListener(listener: ShadeFullExpansionListener) { fullExpansionListeners.add(listener) listener.onShadeExpansionFullyChanged(qsExpanded) } fun removeFullExpansionListener(listener: ShadeFullExpansionListener) { fullExpansionListeners.remove(listener) } fun addQsExpansionListener(listener: ShadeQsExpansionListener) { qsExpansionListeners.add(listener) listener.onQsExpansionChanged(qsExpanded) Loading @@ -99,11 +89,6 @@ class ShadeExpansionStateManager @Inject constructor() : ShadeStateEvents { stateListeners.add(listener) } /** Removes a state listener. */ fun removeStateListener(listener: ShadeStateListener) { stateListeners.remove(listener) } override fun addShadeStateEventsListener(listener: ShadeStateEventsListener) { shadeStateEventsListeners.addIfAbsent(listener) } Loading Loading @@ -196,13 +181,6 @@ class ShadeExpansionStateManager @Inject constructor() : ShadeStateEvents { } } fun onShadeExpansionFullyChanged(isExpanded: Boolean) { this.expanded = isExpanded debugLog("expanded=$isExpanded") fullExpansionListeners.forEach { it.onShadeExpansionFullyChanged(isExpanded) } } /** Updates the panel state if necessary. */ fun updateState(@PanelState state: Int) { debugLog( Loading packages/SystemUI/src/com/android/systemui/shade/ShadeFullExpansionListener.ktdeleted 100644 → 0 +0 −23 Original line number Diff line number Diff line /* * Copyright (c) 2022 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.shade /** A listener interface to be notified of expansion events for the notification shade. */ fun interface ShadeFullExpansionListener { /** Invoked whenever the shade expansion changes, when it is fully collapsed or expanded */ fun onShadeExpansionFullyChanged(isExpanded: Boolean) } packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeInteractor.kt +7 −6 Original line number Diff line number Diff line Loading @@ -148,12 +148,13 @@ constructor( * * TODO(b/300258424) remove all but the first sentence of this comment */ val isAnyExpanded: Flow<Boolean> = val isAnyExpanded: StateFlow<Boolean> = if (sceneContainerFlags.isEnabled()) { anyExpansion.map { it > 0f }.distinctUntilChanged() } else { repository.legacyExpandedOrAwaitingInputTransfer } .stateIn(scope, SharingStarted.Eagerly, false) /** * Whether the user is expanding or collapsing the shade with user input. This will be true even Loading Loading @@ -184,7 +185,7 @@ constructor( * but a transition they initiated is still animating. */ val isUserInteracting: Flow<Boolean> = combine(isUserInteractingWithShade, isUserInteractingWithShade) { shade, qs -> shade || qs } combine(isUserInteractingWithShade, isUserInteractingWithQs) { shade, qs -> shade || qs } .distinctUntilChanged() /** Are touches allowed on the notification panel? */ Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java +28 −4 Original line number Diff line number Diff line Loading @@ -48,11 +48,12 @@ import androidx.annotation.Nullable; import com.android.internal.statusbar.IStatusBarService; import com.android.internal.statusbar.NotificationVisibility; import com.android.systemui.CoreStartable; import com.android.systemui.Dumpable; import com.android.systemui.dump.DumpManager; import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.power.domain.interactor.PowerInteractor; import com.android.systemui.res.R; import com.android.systemui.shade.domain.interactor.ShadeInteractor; import com.android.systemui.statusbar.dagger.CentralSurfacesDependenciesModule; import com.android.systemui.statusbar.notification.NotifPipelineFlags; import com.android.systemui.statusbar.notification.RemoteInputControllerLogger; Loading @@ -65,6 +66,7 @@ import com.android.systemui.statusbar.policy.RemoteInputUriController; import com.android.systemui.statusbar.policy.RemoteInputView; import com.android.systemui.util.DumpUtilsKt; import com.android.systemui.util.ListenerSet; import com.android.systemui.util.kotlin.JavaAdapter; import java.io.PrintWriter; import java.util.ArrayList; Loading @@ -78,7 +80,7 @@ import java.util.function.Consumer; * interaction, keeping track of notifications to remove when NotificationPresenter is collapsed, * and handling clicks on remote views. */ public class NotificationRemoteInputManager implements Dumpable { public class NotificationRemoteInputManager implements CoreStartable { public static final boolean ENABLE_REMOTE_INPUT = SystemProperties.getBoolean("debug.enable_remote_input", true); public static boolean FORCE_REMOTE_INPUT_HISTORY = Loading @@ -94,6 +96,8 @@ public class NotificationRemoteInputManager implements Dumpable { private final NotificationVisibilityProvider mVisibilityProvider; private final PowerInteractor mPowerInteractor; private final ActionClickLogger mLogger; private final JavaAdapter mJavaAdapter; private final ShadeInteractor mShadeInteractor; protected final Context mContext; protected final NotifPipelineFlags mNotifPipelineFlags; private final UserManager mUserManager; Loading Loading @@ -261,7 +265,8 @@ public class NotificationRemoteInputManager implements Dumpable { RemoteInputControllerLogger remoteInputControllerLogger, NotificationClickNotifier clickNotifier, ActionClickLogger logger, DumpManager dumpManager) { JavaAdapter javaAdapter, ShadeInteractor shadeInteractor) { mContext = context; mNotifPipelineFlags = notifPipelineFlags; mLockscreenUserManager = lockscreenUserManager; Loading @@ -269,6 +274,8 @@ public class NotificationRemoteInputManager implements Dumpable { mVisibilityProvider = visibilityProvider; mPowerInteractor = powerInteractor; mLogger = logger; mJavaAdapter = javaAdapter; mShadeInteractor = shadeInteractor; mBarService = IStatusBarService.Stub.asInterface( ServiceManager.getService(Context.STATUS_BAR_SERVICE)); mUserManager = (UserManager) mContext.getSystemService(Context.USER_SERVICE); Loading @@ -277,8 +284,25 @@ public class NotificationRemoteInputManager implements Dumpable { mRemoteInputUriController = remoteInputUriController; mRemoteInputControllerLogger = remoteInputControllerLogger; mClickNotifier = clickNotifier; } dumpManager.registerDumpable(this); @Override public void start() { mJavaAdapter.alwaysCollectFlow(mShadeInteractor.isAnyExpanded(), this::onShadeOrQsExpanded); } private void onShadeOrQsExpanded(boolean expanded) { if (expanded && mStatusBarStateController.getState() != StatusBarState.KEYGUARD) { try { mBarService.clearNotificationEffects(); } catch (RemoteException e) { // Won't fail unless the world has ended. } } if (!expanded) { onPanelCollapsed(); } } /** Add a listener for various remote input events. Works with NEW pipeline only. */ Loading Loading
packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java +0 −1 Original line number Diff line number Diff line Loading @@ -2629,7 +2629,6 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump if (isPanelExpanded() != isExpanded) { setExpandedOrAwaitingInputTransfer(isExpanded); updateSystemUiStateFlags(); mShadeExpansionStateManager.onShadeExpansionFullyChanged(isExpanded); if (!isExpanded) { mQsController.closeQsCustomizer(); } Loading
packages/SystemUI/src/com/android/systemui/shade/ShadeExpansionStateManager.kt +0 −22 Original line number Diff line number Diff line Loading @@ -36,7 +36,6 @@ import javax.inject.Inject class ShadeExpansionStateManager @Inject constructor() : ShadeStateEvents { private val expansionListeners = CopyOnWriteArrayList<ShadeExpansionListener>() private val fullExpansionListeners = CopyOnWriteArrayList<ShadeFullExpansionListener>() private val qsExpansionListeners = CopyOnWriteArrayList<ShadeQsExpansionListener>() private val qsExpansionFractionListeners = CopyOnWriteArrayList<ShadeQsExpansionFractionListener>() Loading Loading @@ -67,15 +66,6 @@ class ShadeExpansionStateManager @Inject constructor() : ShadeStateEvents { expansionListeners.remove(listener) } fun addFullExpansionListener(listener: ShadeFullExpansionListener) { fullExpansionListeners.add(listener) listener.onShadeExpansionFullyChanged(qsExpanded) } fun removeFullExpansionListener(listener: ShadeFullExpansionListener) { fullExpansionListeners.remove(listener) } fun addQsExpansionListener(listener: ShadeQsExpansionListener) { qsExpansionListeners.add(listener) listener.onQsExpansionChanged(qsExpanded) Loading @@ -99,11 +89,6 @@ class ShadeExpansionStateManager @Inject constructor() : ShadeStateEvents { stateListeners.add(listener) } /** Removes a state listener. */ fun removeStateListener(listener: ShadeStateListener) { stateListeners.remove(listener) } override fun addShadeStateEventsListener(listener: ShadeStateEventsListener) { shadeStateEventsListeners.addIfAbsent(listener) } Loading Loading @@ -196,13 +181,6 @@ class ShadeExpansionStateManager @Inject constructor() : ShadeStateEvents { } } fun onShadeExpansionFullyChanged(isExpanded: Boolean) { this.expanded = isExpanded debugLog("expanded=$isExpanded") fullExpansionListeners.forEach { it.onShadeExpansionFullyChanged(isExpanded) } } /** Updates the panel state if necessary. */ fun updateState(@PanelState state: Int) { debugLog( Loading
packages/SystemUI/src/com/android/systemui/shade/ShadeFullExpansionListener.ktdeleted 100644 → 0 +0 −23 Original line number Diff line number Diff line /* * Copyright (c) 2022 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.shade /** A listener interface to be notified of expansion events for the notification shade. */ fun interface ShadeFullExpansionListener { /** Invoked whenever the shade expansion changes, when it is fully collapsed or expanded */ fun onShadeExpansionFullyChanged(isExpanded: Boolean) }
packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeInteractor.kt +7 −6 Original line number Diff line number Diff line Loading @@ -148,12 +148,13 @@ constructor( * * TODO(b/300258424) remove all but the first sentence of this comment */ val isAnyExpanded: Flow<Boolean> = val isAnyExpanded: StateFlow<Boolean> = if (sceneContainerFlags.isEnabled()) { anyExpansion.map { it > 0f }.distinctUntilChanged() } else { repository.legacyExpandedOrAwaitingInputTransfer } .stateIn(scope, SharingStarted.Eagerly, false) /** * Whether the user is expanding or collapsing the shade with user input. This will be true even Loading Loading @@ -184,7 +185,7 @@ constructor( * but a transition they initiated is still animating. */ val isUserInteracting: Flow<Boolean> = combine(isUserInteractingWithShade, isUserInteractingWithShade) { shade, qs -> shade || qs } combine(isUserInteractingWithShade, isUserInteractingWithQs) { shade, qs -> shade || qs } .distinctUntilChanged() /** Are touches allowed on the notification panel? */ Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java +28 −4 Original line number Diff line number Diff line Loading @@ -48,11 +48,12 @@ import androidx.annotation.Nullable; import com.android.internal.statusbar.IStatusBarService; import com.android.internal.statusbar.NotificationVisibility; import com.android.systemui.CoreStartable; import com.android.systemui.Dumpable; import com.android.systemui.dump.DumpManager; import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.power.domain.interactor.PowerInteractor; import com.android.systemui.res.R; import com.android.systemui.shade.domain.interactor.ShadeInteractor; import com.android.systemui.statusbar.dagger.CentralSurfacesDependenciesModule; import com.android.systemui.statusbar.notification.NotifPipelineFlags; import com.android.systemui.statusbar.notification.RemoteInputControllerLogger; Loading @@ -65,6 +66,7 @@ import com.android.systemui.statusbar.policy.RemoteInputUriController; import com.android.systemui.statusbar.policy.RemoteInputView; import com.android.systemui.util.DumpUtilsKt; import com.android.systemui.util.ListenerSet; import com.android.systemui.util.kotlin.JavaAdapter; import java.io.PrintWriter; import java.util.ArrayList; Loading @@ -78,7 +80,7 @@ import java.util.function.Consumer; * interaction, keeping track of notifications to remove when NotificationPresenter is collapsed, * and handling clicks on remote views. */ public class NotificationRemoteInputManager implements Dumpable { public class NotificationRemoteInputManager implements CoreStartable { public static final boolean ENABLE_REMOTE_INPUT = SystemProperties.getBoolean("debug.enable_remote_input", true); public static boolean FORCE_REMOTE_INPUT_HISTORY = Loading @@ -94,6 +96,8 @@ public class NotificationRemoteInputManager implements Dumpable { private final NotificationVisibilityProvider mVisibilityProvider; private final PowerInteractor mPowerInteractor; private final ActionClickLogger mLogger; private final JavaAdapter mJavaAdapter; private final ShadeInteractor mShadeInteractor; protected final Context mContext; protected final NotifPipelineFlags mNotifPipelineFlags; private final UserManager mUserManager; Loading Loading @@ -261,7 +265,8 @@ public class NotificationRemoteInputManager implements Dumpable { RemoteInputControllerLogger remoteInputControllerLogger, NotificationClickNotifier clickNotifier, ActionClickLogger logger, DumpManager dumpManager) { JavaAdapter javaAdapter, ShadeInteractor shadeInteractor) { mContext = context; mNotifPipelineFlags = notifPipelineFlags; mLockscreenUserManager = lockscreenUserManager; Loading @@ -269,6 +274,8 @@ public class NotificationRemoteInputManager implements Dumpable { mVisibilityProvider = visibilityProvider; mPowerInteractor = powerInteractor; mLogger = logger; mJavaAdapter = javaAdapter; mShadeInteractor = shadeInteractor; mBarService = IStatusBarService.Stub.asInterface( ServiceManager.getService(Context.STATUS_BAR_SERVICE)); mUserManager = (UserManager) mContext.getSystemService(Context.USER_SERVICE); Loading @@ -277,8 +284,25 @@ public class NotificationRemoteInputManager implements Dumpable { mRemoteInputUriController = remoteInputUriController; mRemoteInputControllerLogger = remoteInputControllerLogger; mClickNotifier = clickNotifier; } dumpManager.registerDumpable(this); @Override public void start() { mJavaAdapter.alwaysCollectFlow(mShadeInteractor.isAnyExpanded(), this::onShadeOrQsExpanded); } private void onShadeOrQsExpanded(boolean expanded) { if (expanded && mStatusBarStateController.getState() != StatusBarState.KEYGUARD) { try { mBarService.clearNotificationEffects(); } catch (RemoteException e) { // Won't fail unless the world has ended. } } if (!expanded) { onPanelCollapsed(); } } /** Add a listener for various remote input events. Works with NEW pipeline only. */ Loading