Loading packages/SystemUI/src/com/android/systemui/log/dagger/LogModule.java +8 −0 Original line number Diff line number Diff line Loading @@ -136,6 +136,14 @@ public class LogModule { return factory.create("NotifSectionLog", 1000 /* maxSize */, false /* systrace */); } /** Provides a logging buffer for all logs related to remote input controller. */ @Provides @SysUISingleton @NotificationRemoteInputLog public static LogBuffer provideNotificationRemoteInputLogBuffer(LogBufferFactory factory) { return factory.create("NotifRemoteInputLog", 50 /* maxSize */, false /* systrace */); } /** Provides a logging buffer for all logs related to the data layer of notifications. */ @Provides @SysUISingleton Loading packages/SystemUI/src/com/android/systemui/log/dagger/NotificationRemoteInputLog.kt 0 → 100644 +25 −0 Original line number Diff line number Diff line /* * Copyright (C) 2023 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.log.dagger import javax.inject.Qualifier /** A [com.android.systemui.log.LogBuffer] for NotificationRemoteInput. */ @Qualifier @MustBeDocumented @Retention(AnnotationRetention.RUNTIME) annotation class NotificationRemoteInputLog packages/SystemUI/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java +9 −3 Original line number Diff line number Diff line Loading @@ -54,6 +54,7 @@ import com.android.systemui.dump.DumpManager; import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.statusbar.dagger.CentralSurfacesDependenciesModule; import com.android.systemui.statusbar.notification.NotifPipelineFlags; import com.android.systemui.statusbar.notification.RemoteInputControllerLogger; import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.collection.NotificationEntry.EditedSuggestionInfo; import com.android.systemui.statusbar.notification.collection.render.NotificationVisibilityProvider; Loading @@ -65,6 +66,8 @@ import com.android.systemui.statusbar.policy.RemoteInputView; import com.android.systemui.util.DumpUtilsKt; import com.android.systemui.util.ListenerSet; import dagger.Lazy; import java.io.PrintWriter; import java.util.ArrayList; import java.util.List; Loading @@ -72,8 +75,6 @@ import java.util.Objects; import java.util.Optional; import java.util.function.Consumer; import dagger.Lazy; /** * Class for handling remote input state over a set of notifications. This class handles things * like keeping notifications temporarily that were cancelled as a response to a remote input Loading Loading @@ -104,6 +105,8 @@ public class NotificationRemoteInputManager implements Dumpable { private final KeyguardManager mKeyguardManager; private final StatusBarStateController mStatusBarStateController; private final RemoteInputUriController mRemoteInputUriController; private final RemoteInputControllerLogger mRemoteInputControllerLogger; private final NotificationClickNotifier mClickNotifier; protected RemoteInputController mRemoteInputController; Loading Loading @@ -259,6 +262,7 @@ public class NotificationRemoteInputManager implements Dumpable { Lazy<Optional<CentralSurfaces>> centralSurfacesOptionalLazy, StatusBarStateController statusBarStateController, RemoteInputUriController remoteInputUriController, RemoteInputControllerLogger remoteInputControllerLogger, NotificationClickNotifier clickNotifier, ActionClickLogger logger, DumpManager dumpManager) { Loading @@ -275,6 +279,7 @@ public class NotificationRemoteInputManager implements Dumpable { mKeyguardManager = context.getSystemService(KeyguardManager.class); mStatusBarStateController = statusBarStateController; mRemoteInputUriController = remoteInputUriController; mRemoteInputControllerLogger = remoteInputControllerLogger; mClickNotifier = clickNotifier; dumpManager.registerDumpable(this); Loading @@ -294,7 +299,8 @@ public class NotificationRemoteInputManager implements Dumpable { /** Initializes this component with the provided dependencies. */ public void setUpWithCallback(Callback callback, RemoteInputController.Delegate delegate) { mCallback = callback; mRemoteInputController = new RemoteInputController(delegate, mRemoteInputUriController); mRemoteInputController = new RemoteInputController(delegate, mRemoteInputUriController, mRemoteInputControllerLogger); if (mRemoteInputListener != null) { mRemoteInputListener.setRemoteInputController(mRemoteInputController); } Loading packages/SystemUI/src/com/android/systemui/statusbar/RemoteInputController.java +24 −3 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import android.util.Pair; import androidx.annotation.NonNull; import com.android.systemui.statusbar.notification.RemoteInputControllerLogger; import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.policy.RemoteInputUriController; import com.android.systemui.statusbar.policy.RemoteInputView; Loading @@ -52,10 +53,14 @@ public class RemoteInputController { private final Delegate mDelegate; private final RemoteInputUriController mRemoteInputUriController; private final RemoteInputControllerLogger mLogger; public RemoteInputController(Delegate delegate, RemoteInputUriController remoteInputUriController) { RemoteInputUriController remoteInputUriController, RemoteInputControllerLogger logger) { mDelegate = delegate; mRemoteInputUriController = remoteInputUriController; mLogger = logger; } /** Loading Loading @@ -117,6 +122,9 @@ public class RemoteInputController { boolean isActive = isRemoteInputActive(entry); boolean found = pruneWeakThenRemoveAndContains( entry /* contains */, null /* remove */, token /* removeToken */); mLogger.logAddRemoteInput(entry.getKey()/* entryKey */, isActive /* isRemoteInputAlreadyActive */, found /* isRemoteInputFound */); if (!found) { mOpen.add(new Pair<>(new WeakReference<>(entry), token)); } Loading @@ -137,9 +145,22 @@ public class RemoteInputController { */ public void removeRemoteInput(NotificationEntry entry, Object token) { Objects.requireNonNull(entry); if (entry.mRemoteEditImeVisible && entry.mRemoteEditImeAnimatingAway) return; if (entry.mRemoteEditImeVisible && entry.mRemoteEditImeAnimatingAway) { mLogger.logRemoveRemoteInput( entry.getKey() /* entryKey*/, true /* remoteEditImeVisible */, true /* remoteEditImeAnimatingAway */); return; } // If the view is being removed, this may be called even though we're not active if (!isRemoteInputActive(entry)) return; boolean remoteInputActive = isRemoteInputActive(entry); mLogger.logRemoveRemoteInput( entry.getKey() /* entryKey*/, entry.mRemoteEditImeVisible /* remoteEditImeVisible */, entry.mRemoteEditImeAnimatingAway /* remoteEditImeAnimatingAway */, remoteInputActive /* isRemoteInputActive */); if (!remoteInputActive) return; pruneWeakThenRemoveAndContains(null /* contains */, entry /* remove */, token); Loading packages/SystemUI/src/com/android/systemui/statusbar/dagger/CentralSurfacesDependenciesModule.java +6 −3 Original line number Diff line number Diff line Loading @@ -54,6 +54,7 @@ import com.android.systemui.statusbar.SysuiStatusBarStateController; import com.android.systemui.statusbar.commandline.CommandRegistry; import com.android.systemui.statusbar.gesture.SwipeStatusBarAwayGestureHandler; import com.android.systemui.statusbar.notification.NotifPipelineFlags; import com.android.systemui.statusbar.notification.RemoteInputControllerLogger; import com.android.systemui.statusbar.notification.collection.NotifCollection; import com.android.systemui.statusbar.notification.collection.NotifPipeline; import com.android.systemui.statusbar.notification.collection.notifcollection.CommonNotifCollection; Loading @@ -77,14 +78,14 @@ import com.android.systemui.tracing.ProtoTracer; import com.android.systemui.util.concurrency.DelayableExecutor; import com.android.systemui.util.time.SystemClock; import java.util.Optional; import java.util.concurrent.Executor; import dagger.Binds; import dagger.Lazy; import dagger.Module; import dagger.Provides; import java.util.Optional; import java.util.concurrent.Executor; /** * This module provides instances needed to construct {@link CentralSurfacesImpl}. These are moved to * this separate from {@link CentralSurfacesModule} module so that components that wish to build Loading @@ -105,6 +106,7 @@ public interface CentralSurfacesDependenciesModule { Lazy<Optional<CentralSurfaces>> centralSurfacesOptionalLazy, StatusBarStateController statusBarStateController, RemoteInputUriController remoteInputUriController, RemoteInputControllerLogger remoteInputControllerLogger, NotificationClickNotifier clickNotifier, ActionClickLogger actionClickLogger, DumpManager dumpManager) { Loading @@ -117,6 +119,7 @@ public interface CentralSurfacesDependenciesModule { centralSurfacesOptionalLazy, statusBarStateController, remoteInputUriController, remoteInputControllerLogger, clickNotifier, actionClickLogger, dumpManager); Loading Loading
packages/SystemUI/src/com/android/systemui/log/dagger/LogModule.java +8 −0 Original line number Diff line number Diff line Loading @@ -136,6 +136,14 @@ public class LogModule { return factory.create("NotifSectionLog", 1000 /* maxSize */, false /* systrace */); } /** Provides a logging buffer for all logs related to remote input controller. */ @Provides @SysUISingleton @NotificationRemoteInputLog public static LogBuffer provideNotificationRemoteInputLogBuffer(LogBufferFactory factory) { return factory.create("NotifRemoteInputLog", 50 /* maxSize */, false /* systrace */); } /** Provides a logging buffer for all logs related to the data layer of notifications. */ @Provides @SysUISingleton Loading
packages/SystemUI/src/com/android/systemui/log/dagger/NotificationRemoteInputLog.kt 0 → 100644 +25 −0 Original line number Diff line number Diff line /* * Copyright (C) 2023 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.log.dagger import javax.inject.Qualifier /** A [com.android.systemui.log.LogBuffer] for NotificationRemoteInput. */ @Qualifier @MustBeDocumented @Retention(AnnotationRetention.RUNTIME) annotation class NotificationRemoteInputLog
packages/SystemUI/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java +9 −3 Original line number Diff line number Diff line Loading @@ -54,6 +54,7 @@ import com.android.systemui.dump.DumpManager; import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.statusbar.dagger.CentralSurfacesDependenciesModule; import com.android.systemui.statusbar.notification.NotifPipelineFlags; import com.android.systemui.statusbar.notification.RemoteInputControllerLogger; import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.collection.NotificationEntry.EditedSuggestionInfo; import com.android.systemui.statusbar.notification.collection.render.NotificationVisibilityProvider; Loading @@ -65,6 +66,8 @@ import com.android.systemui.statusbar.policy.RemoteInputView; import com.android.systemui.util.DumpUtilsKt; import com.android.systemui.util.ListenerSet; import dagger.Lazy; import java.io.PrintWriter; import java.util.ArrayList; import java.util.List; Loading @@ -72,8 +75,6 @@ import java.util.Objects; import java.util.Optional; import java.util.function.Consumer; import dagger.Lazy; /** * Class for handling remote input state over a set of notifications. This class handles things * like keeping notifications temporarily that were cancelled as a response to a remote input Loading Loading @@ -104,6 +105,8 @@ public class NotificationRemoteInputManager implements Dumpable { private final KeyguardManager mKeyguardManager; private final StatusBarStateController mStatusBarStateController; private final RemoteInputUriController mRemoteInputUriController; private final RemoteInputControllerLogger mRemoteInputControllerLogger; private final NotificationClickNotifier mClickNotifier; protected RemoteInputController mRemoteInputController; Loading Loading @@ -259,6 +262,7 @@ public class NotificationRemoteInputManager implements Dumpable { Lazy<Optional<CentralSurfaces>> centralSurfacesOptionalLazy, StatusBarStateController statusBarStateController, RemoteInputUriController remoteInputUriController, RemoteInputControllerLogger remoteInputControllerLogger, NotificationClickNotifier clickNotifier, ActionClickLogger logger, DumpManager dumpManager) { Loading @@ -275,6 +279,7 @@ public class NotificationRemoteInputManager implements Dumpable { mKeyguardManager = context.getSystemService(KeyguardManager.class); mStatusBarStateController = statusBarStateController; mRemoteInputUriController = remoteInputUriController; mRemoteInputControllerLogger = remoteInputControllerLogger; mClickNotifier = clickNotifier; dumpManager.registerDumpable(this); Loading @@ -294,7 +299,8 @@ public class NotificationRemoteInputManager implements Dumpable { /** Initializes this component with the provided dependencies. */ public void setUpWithCallback(Callback callback, RemoteInputController.Delegate delegate) { mCallback = callback; mRemoteInputController = new RemoteInputController(delegate, mRemoteInputUriController); mRemoteInputController = new RemoteInputController(delegate, mRemoteInputUriController, mRemoteInputControllerLogger); if (mRemoteInputListener != null) { mRemoteInputListener.setRemoteInputController(mRemoteInputController); } Loading
packages/SystemUI/src/com/android/systemui/statusbar/RemoteInputController.java +24 −3 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import android.util.Pair; import androidx.annotation.NonNull; import com.android.systemui.statusbar.notification.RemoteInputControllerLogger; import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.policy.RemoteInputUriController; import com.android.systemui.statusbar.policy.RemoteInputView; Loading @@ -52,10 +53,14 @@ public class RemoteInputController { private final Delegate mDelegate; private final RemoteInputUriController mRemoteInputUriController; private final RemoteInputControllerLogger mLogger; public RemoteInputController(Delegate delegate, RemoteInputUriController remoteInputUriController) { RemoteInputUriController remoteInputUriController, RemoteInputControllerLogger logger) { mDelegate = delegate; mRemoteInputUriController = remoteInputUriController; mLogger = logger; } /** Loading Loading @@ -117,6 +122,9 @@ public class RemoteInputController { boolean isActive = isRemoteInputActive(entry); boolean found = pruneWeakThenRemoveAndContains( entry /* contains */, null /* remove */, token /* removeToken */); mLogger.logAddRemoteInput(entry.getKey()/* entryKey */, isActive /* isRemoteInputAlreadyActive */, found /* isRemoteInputFound */); if (!found) { mOpen.add(new Pair<>(new WeakReference<>(entry), token)); } Loading @@ -137,9 +145,22 @@ public class RemoteInputController { */ public void removeRemoteInput(NotificationEntry entry, Object token) { Objects.requireNonNull(entry); if (entry.mRemoteEditImeVisible && entry.mRemoteEditImeAnimatingAway) return; if (entry.mRemoteEditImeVisible && entry.mRemoteEditImeAnimatingAway) { mLogger.logRemoveRemoteInput( entry.getKey() /* entryKey*/, true /* remoteEditImeVisible */, true /* remoteEditImeAnimatingAway */); return; } // If the view is being removed, this may be called even though we're not active if (!isRemoteInputActive(entry)) return; boolean remoteInputActive = isRemoteInputActive(entry); mLogger.logRemoveRemoteInput( entry.getKey() /* entryKey*/, entry.mRemoteEditImeVisible /* remoteEditImeVisible */, entry.mRemoteEditImeAnimatingAway /* remoteEditImeAnimatingAway */, remoteInputActive /* isRemoteInputActive */); if (!remoteInputActive) return; pruneWeakThenRemoveAndContains(null /* contains */, entry /* remove */, token); Loading
packages/SystemUI/src/com/android/systemui/statusbar/dagger/CentralSurfacesDependenciesModule.java +6 −3 Original line number Diff line number Diff line Loading @@ -54,6 +54,7 @@ import com.android.systemui.statusbar.SysuiStatusBarStateController; import com.android.systemui.statusbar.commandline.CommandRegistry; import com.android.systemui.statusbar.gesture.SwipeStatusBarAwayGestureHandler; import com.android.systemui.statusbar.notification.NotifPipelineFlags; import com.android.systemui.statusbar.notification.RemoteInputControllerLogger; import com.android.systemui.statusbar.notification.collection.NotifCollection; import com.android.systemui.statusbar.notification.collection.NotifPipeline; import com.android.systemui.statusbar.notification.collection.notifcollection.CommonNotifCollection; Loading @@ -77,14 +78,14 @@ import com.android.systemui.tracing.ProtoTracer; import com.android.systemui.util.concurrency.DelayableExecutor; import com.android.systemui.util.time.SystemClock; import java.util.Optional; import java.util.concurrent.Executor; import dagger.Binds; import dagger.Lazy; import dagger.Module; import dagger.Provides; import java.util.Optional; import java.util.concurrent.Executor; /** * This module provides instances needed to construct {@link CentralSurfacesImpl}. These are moved to * this separate from {@link CentralSurfacesModule} module so that components that wish to build Loading @@ -105,6 +106,7 @@ public interface CentralSurfacesDependenciesModule { Lazy<Optional<CentralSurfaces>> centralSurfacesOptionalLazy, StatusBarStateController statusBarStateController, RemoteInputUriController remoteInputUriController, RemoteInputControllerLogger remoteInputControllerLogger, NotificationClickNotifier clickNotifier, ActionClickLogger actionClickLogger, DumpManager dumpManager) { Loading @@ -117,6 +119,7 @@ public interface CentralSurfacesDependenciesModule { centralSurfacesOptionalLazy, statusBarStateController, remoteInputUriController, remoteInputControllerLogger, clickNotifier, actionClickLogger, dumpManager); Loading