Loading core/api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -9743,6 +9743,7 @@ package android.service.notification { method public void onActionInvoked(@NonNull String, @NonNull android.app.Notification.Action, int); method public void onAllowedAdjustmentsChanged(); method @NonNull public final android.os.IBinder onBind(@Nullable android.content.Intent); method public void onNotificationClicked(@NonNull String); method public void onNotificationDirectReplied(@NonNull String); method @Nullable public abstract android.service.notification.Adjustment onNotificationEnqueued(@NonNull android.service.notification.StatusBarNotification); method @Nullable public android.service.notification.Adjustment onNotificationEnqueued(@NonNull android.service.notification.StatusBarNotification, @NonNull android.app.NotificationChannel); core/api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -292,6 +292,7 @@ package android.app { } public class StatusBarManager { method public void clickNotification(@Nullable String, int, int, boolean); method @RequiresPermission(android.Manifest.permission.STATUS_BAR) public void collapsePanels(); method public void expandNotificationsPanel(); method @RequiresPermission(android.Manifest.permission.STATUS_BAR) public void setExpansionDisabledForSimNetworkLock(boolean); Loading core/java/android/app/StatusBarManager.java +23 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ import android.util.Slog; import android.view.View; import com.android.internal.statusbar.IStatusBarService; import com.android.internal.statusbar.NotificationVisibility; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; Loading Loading @@ -262,6 +263,28 @@ public class StatusBarManager { } } /** * Simulate notification click for testing * * @hide */ @TestApi public void clickNotification(@Nullable String key, int rank, int count, boolean visible) { clickNotificationInternal(key, rank, count, visible); } private void clickNotificationInternal(String key, int rank, int count, boolean visible) { try { final IStatusBarService svc = getService(); if (svc != null) { svc.onNotificationClick(key, NotificationVisibility.obtain(key, rank, count, visible)); } } catch (RemoteException ex) { throw ex.rethrowFromSystemServer(); } } /** * Expand the notifications panel. * Loading core/java/android/service/notification/INotificationListener.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -56,5 +56,6 @@ oneway interface INotificationListener void onNotificationDirectReply(String key); void onSuggestedReplySent(String key, in CharSequence reply, int source); void onActionClicked(String key, in Notification.Action action, int source); void onNotificationClicked(String key); void onAllowedAdjustmentsChanged(); } core/java/android/service/notification/NotificationAssistantService.java +22 −0 Original line number Diff line number Diff line Loading @@ -241,6 +241,13 @@ public abstract class NotificationAssistantService extends NotificationListenerS @Source int source) { } /** * Implement this to know when a notification is clicked by user. * @param key the notification key */ public void onNotificationClicked(@NonNull String key) { } /** * Implement this to know when a user has changed which features of * their notifications the assistant can modify. Loading Loading @@ -421,6 +428,13 @@ public abstract class NotificationAssistantService extends NotificationListenerS mHandler.obtainMessage(MyHandler.MSG_ON_ACTION_INVOKED, args).sendToTarget(); } @Override public void onNotificationClicked(String key) { SomeArgs args = SomeArgs.obtain(); args.arg1 = key; mHandler.obtainMessage(MyHandler.MSG_ON_NOTIFICATION_CLICKED, args).sendToTarget(); } @Override public void onAllowedAdjustmentsChanged() { mHandler.obtainMessage(MyHandler.MSG_ON_ALLOWED_ADJUSTMENTS_CHANGED).sendToTarget(); Loading @@ -445,6 +459,7 @@ public abstract class NotificationAssistantService extends NotificationListenerS public static final int MSG_ON_PANEL_REVEALED = 9; public static final int MSG_ON_PANEL_HIDDEN = 10; public static final int MSG_ON_NOTIFICATION_VISIBILITY_CHANGED = 11; public static final int MSG_ON_NOTIFICATION_CLICKED = 12; public MyHandler(Looper looper) { super(looper, null, false); Loading Loading @@ -550,6 +565,13 @@ public abstract class NotificationAssistantService extends NotificationListenerS onNotificationVisibilityChanged(key, isVisible); break; } case MSG_ON_NOTIFICATION_CLICKED: { SomeArgs args = (SomeArgs) msg.obj; String key = (String) args.arg1; args.recycle(); onNotificationClicked(key); break; } } } } Loading Loading
core/api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -9743,6 +9743,7 @@ package android.service.notification { method public void onActionInvoked(@NonNull String, @NonNull android.app.Notification.Action, int); method public void onAllowedAdjustmentsChanged(); method @NonNull public final android.os.IBinder onBind(@Nullable android.content.Intent); method public void onNotificationClicked(@NonNull String); method public void onNotificationDirectReplied(@NonNull String); method @Nullable public abstract android.service.notification.Adjustment onNotificationEnqueued(@NonNull android.service.notification.StatusBarNotification); method @Nullable public android.service.notification.Adjustment onNotificationEnqueued(@NonNull android.service.notification.StatusBarNotification, @NonNull android.app.NotificationChannel);
core/api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -292,6 +292,7 @@ package android.app { } public class StatusBarManager { method public void clickNotification(@Nullable String, int, int, boolean); method @RequiresPermission(android.Manifest.permission.STATUS_BAR) public void collapsePanels(); method public void expandNotificationsPanel(); method @RequiresPermission(android.Manifest.permission.STATUS_BAR) public void setExpansionDisabledForSimNetworkLock(boolean); Loading
core/java/android/app/StatusBarManager.java +23 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ import android.util.Slog; import android.view.View; import com.android.internal.statusbar.IStatusBarService; import com.android.internal.statusbar.NotificationVisibility; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; Loading Loading @@ -262,6 +263,28 @@ public class StatusBarManager { } } /** * Simulate notification click for testing * * @hide */ @TestApi public void clickNotification(@Nullable String key, int rank, int count, boolean visible) { clickNotificationInternal(key, rank, count, visible); } private void clickNotificationInternal(String key, int rank, int count, boolean visible) { try { final IStatusBarService svc = getService(); if (svc != null) { svc.onNotificationClick(key, NotificationVisibility.obtain(key, rank, count, visible)); } } catch (RemoteException ex) { throw ex.rethrowFromSystemServer(); } } /** * Expand the notifications panel. * Loading
core/java/android/service/notification/INotificationListener.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -56,5 +56,6 @@ oneway interface INotificationListener void onNotificationDirectReply(String key); void onSuggestedReplySent(String key, in CharSequence reply, int source); void onActionClicked(String key, in Notification.Action action, int source); void onNotificationClicked(String key); void onAllowedAdjustmentsChanged(); }
core/java/android/service/notification/NotificationAssistantService.java +22 −0 Original line number Diff line number Diff line Loading @@ -241,6 +241,13 @@ public abstract class NotificationAssistantService extends NotificationListenerS @Source int source) { } /** * Implement this to know when a notification is clicked by user. * @param key the notification key */ public void onNotificationClicked(@NonNull String key) { } /** * Implement this to know when a user has changed which features of * their notifications the assistant can modify. Loading Loading @@ -421,6 +428,13 @@ public abstract class NotificationAssistantService extends NotificationListenerS mHandler.obtainMessage(MyHandler.MSG_ON_ACTION_INVOKED, args).sendToTarget(); } @Override public void onNotificationClicked(String key) { SomeArgs args = SomeArgs.obtain(); args.arg1 = key; mHandler.obtainMessage(MyHandler.MSG_ON_NOTIFICATION_CLICKED, args).sendToTarget(); } @Override public void onAllowedAdjustmentsChanged() { mHandler.obtainMessage(MyHandler.MSG_ON_ALLOWED_ADJUSTMENTS_CHANGED).sendToTarget(); Loading @@ -445,6 +459,7 @@ public abstract class NotificationAssistantService extends NotificationListenerS public static final int MSG_ON_PANEL_REVEALED = 9; public static final int MSG_ON_PANEL_HIDDEN = 10; public static final int MSG_ON_NOTIFICATION_VISIBILITY_CHANGED = 11; public static final int MSG_ON_NOTIFICATION_CLICKED = 12; public MyHandler(Looper looper) { super(looper, null, false); Loading Loading @@ -550,6 +565,13 @@ public abstract class NotificationAssistantService extends NotificationListenerS onNotificationVisibilityChanged(key, isVisible); break; } case MSG_ON_NOTIFICATION_CLICKED: { SomeArgs args = (SomeArgs) msg.obj; String key = (String) args.arg1; args.recycle(); onNotificationClicked(key); break; } } } } Loading