Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationListener.java +0 −4 Original line number Diff line number Diff line Loading @@ -16,8 +16,6 @@ package com.android.systemui.statusbar; import static com.android.systemui.statusbar.RemoteInputController.processForRemoteInput; import android.annotation.NonNull; import android.annotation.SuppressLint; import android.app.NotificationChannel; Loading Loading @@ -142,8 +140,6 @@ public class NotificationListener extends NotificationListenerWithPlugins implem if (DEBUG) Log.d(TAG, "onNotificationPosted: " + sbn); if (sbn != null && !onPluginNotificationPosted(sbn, rankingMap)) { mMainExecutor.execute(() -> { processForRemoteInput(sbn.getNotification(), mContext); for (NotificationHandler handler : mNotificationHandlers) { handler.onNotificationPosted(sbn, rankingMap); } Loading packages/SystemUI/src/com/android/systemui/statusbar/RemoteInputController.java +0 −55 Original line number Diff line number Diff line Loading @@ -17,11 +17,7 @@ package com.android.systemui.statusbar; import android.annotation.Nullable; import android.app.Notification; import android.app.RemoteInput; import android.content.Context; import android.net.Uri; import android.os.SystemProperties; import android.service.notification.StatusBarNotification; import android.util.ArrayMap; import android.util.IndentingPrintWriter; Loading @@ -37,16 +33,12 @@ import com.android.systemui.util.DumpUtilsKt; import java.lang.ref.WeakReference; import java.util.ArrayList; import java.util.List; import java.util.Objects; /** * Keeps track of the currently active {@link RemoteInputView}s. */ public class RemoteInputController { private static final boolean ENABLE_REMOTE_INPUT = SystemProperties.getBoolean("debug.enable_remote_input", true); private final ArrayList<Pair<WeakReference<NotificationEntry>, Object>> mOpen = new ArrayList<>(); private final ArrayMap<String, Object> mSpinning = new ArrayMap<>(); Loading @@ -71,53 +63,6 @@ public class RemoteInputController { mLogger = logger; } /** * Adds RemoteInput actions from the WearableExtender; to be removed once more apps support this * via first-class API. * * TODO: Remove once enough apps specify remote inputs on their own. */ public static void processForRemoteInput(Notification n, Context context) { if (!ENABLE_REMOTE_INPUT) { return; } if (n.extras != null && n.extras.containsKey("android.wearable.EXTENSIONS") && (n.actions == null || n.actions.length == 0)) { Notification.Action viableAction = null; Notification.WearableExtender we = new Notification.WearableExtender(n); List<Notification.Action> actions = we.getActions(); final int numActions = actions.size(); for (int i = 0; i < numActions; i++) { Notification.Action action = actions.get(i); if (action == null) { continue; } RemoteInput[] remoteInputs = action.getRemoteInputs(); if (remoteInputs == null) { continue; } for (RemoteInput ri : remoteInputs) { if (ri.getAllowFreeFormInput()) { viableAction = action; break; } } if (viableAction != null) { break; } } if (viableAction != null) { Notification.Builder rebuilder = Notification.Builder.recoverBuilder(context, n); rebuilder.setActions(viableAction); rebuilder.build(); // will rewrite n } } } /** * Adds a currently active remote input. * Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationListener.java +0 −4 Original line number Diff line number Diff line Loading @@ -16,8 +16,6 @@ package com.android.systemui.statusbar; import static com.android.systemui.statusbar.RemoteInputController.processForRemoteInput; import android.annotation.NonNull; import android.annotation.SuppressLint; import android.app.NotificationChannel; Loading Loading @@ -142,8 +140,6 @@ public class NotificationListener extends NotificationListenerWithPlugins implem if (DEBUG) Log.d(TAG, "onNotificationPosted: " + sbn); if (sbn != null && !onPluginNotificationPosted(sbn, rankingMap)) { mMainExecutor.execute(() -> { processForRemoteInput(sbn.getNotification(), mContext); for (NotificationHandler handler : mNotificationHandlers) { handler.onNotificationPosted(sbn, rankingMap); } Loading
packages/SystemUI/src/com/android/systemui/statusbar/RemoteInputController.java +0 −55 Original line number Diff line number Diff line Loading @@ -17,11 +17,7 @@ package com.android.systemui.statusbar; import android.annotation.Nullable; import android.app.Notification; import android.app.RemoteInput; import android.content.Context; import android.net.Uri; import android.os.SystemProperties; import android.service.notification.StatusBarNotification; import android.util.ArrayMap; import android.util.IndentingPrintWriter; Loading @@ -37,16 +33,12 @@ import com.android.systemui.util.DumpUtilsKt; import java.lang.ref.WeakReference; import java.util.ArrayList; import java.util.List; import java.util.Objects; /** * Keeps track of the currently active {@link RemoteInputView}s. */ public class RemoteInputController { private static final boolean ENABLE_REMOTE_INPUT = SystemProperties.getBoolean("debug.enable_remote_input", true); private final ArrayList<Pair<WeakReference<NotificationEntry>, Object>> mOpen = new ArrayList<>(); private final ArrayMap<String, Object> mSpinning = new ArrayMap<>(); Loading @@ -71,53 +63,6 @@ public class RemoteInputController { mLogger = logger; } /** * Adds RemoteInput actions from the WearableExtender; to be removed once more apps support this * via first-class API. * * TODO: Remove once enough apps specify remote inputs on their own. */ public static void processForRemoteInput(Notification n, Context context) { if (!ENABLE_REMOTE_INPUT) { return; } if (n.extras != null && n.extras.containsKey("android.wearable.EXTENSIONS") && (n.actions == null || n.actions.length == 0)) { Notification.Action viableAction = null; Notification.WearableExtender we = new Notification.WearableExtender(n); List<Notification.Action> actions = we.getActions(); final int numActions = actions.size(); for (int i = 0; i < numActions; i++) { Notification.Action action = actions.get(i); if (action == null) { continue; } RemoteInput[] remoteInputs = action.getRemoteInputs(); if (remoteInputs == null) { continue; } for (RemoteInput ri : remoteInputs) { if (ri.getAllowFreeFormInput()) { viableAction = action; break; } } if (viableAction != null) { break; } } if (viableAction != null) { Notification.Builder rebuilder = Notification.Builder.recoverBuilder(context, n); rebuilder.setActions(viableAction); rebuilder.build(); // will rewrite n } } } /** * Adds a currently active remote input. * Loading