Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e0ba7eb3 authored by Chris Wren's avatar Chris Wren
Browse files

rename the asisstant service for the ranker

Bug: 22960980
Change-Id: Ibe57933303a488b01c43a7621a488d425d6f707d
parent 19f47929
Loading
Loading
Loading
Loading
+31 −31
Original line number Diff line number Diff line
@@ -36944,37 +36944,6 @@ package android.service.notification {
    field public static final java.lang.String SERVICE_INTERFACE = "android.service.notification.ConditionProviderService";
  }
  public abstract class NotificationAssistantService extends android.service.notification.NotificationListenerService {
    ctor public NotificationAssistantService();
    method public final void adjustImportance(java.lang.String, android.service.notification.NotificationAssistantService.Adjustment);
    method public final android.os.IBinder onBind(android.content.Intent);
    method public void onNotificationActionClick(java.lang.String, long, int);
    method public void onNotificationClick(java.lang.String, long);
    method public abstract android.service.notification.NotificationAssistantService.Adjustment onNotificationEnqueued(android.service.notification.StatusBarNotification, int, boolean);
    method public void onNotificationRemoved(java.lang.String, long, int);
    method public void onNotificationVisibilityChanged(java.lang.String, long, boolean);
    field public static final int REASON_APP_CANCEL = 8; // 0x8
    field public static final int REASON_APP_CANCEL_ALL = 9; // 0x9
    field public static final int REASON_DELEGATE_CANCEL = 2; // 0x2
    field public static final int REASON_DELEGATE_CANCEL_ALL = 3; // 0x3
    field public static final int REASON_DELEGATE_CLICK = 1; // 0x1
    field public static final int REASON_DELEGATE_ERROR = 4; // 0x4
    field public static final int REASON_GROUP_OPTIMIZATION = 13; // 0xd
    field public static final int REASON_GROUP_SUMMARY_CANCELED = 12; // 0xc
    field public static final int REASON_LISTENER_CANCEL = 10; // 0xa
    field public static final int REASON_LISTENER_CANCEL_ALL = 11; // 0xb
    field public static final int REASON_PACKAGE_BANNED = 7; // 0x7
    field public static final int REASON_PACKAGE_CHANGED = 5; // 0x5
    field public static final int REASON_PACKAGE_SUSPENDED = 14; // 0xe
    field public static final int REASON_PROFILE_TURNED_OFF = 15; // 0xf
    field public static final int REASON_USER_STOPPED = 6; // 0x6
    field public static final java.lang.String SERVICE_INTERFACE = "android.service.notification.NotificationAssistantService";
  }
  public class NotificationAssistantService.Adjustment {
    ctor public NotificationAssistantService.Adjustment(int, java.lang.CharSequence, android.net.Uri);
  }
  public abstract class NotificationListenerService extends android.app.Service {
    ctor public NotificationListenerService();
    method public final void cancelAllNotifications();
@@ -37045,6 +37014,37 @@ package android.service.notification {
    field public static final android.os.Parcelable.Creator<android.service.notification.NotificationListenerService.RankingMap> CREATOR;
  }
  public abstract class NotificationRankerService extends android.service.notification.NotificationListenerService {
    ctor public NotificationRankerService();
    method public final void adjustImportance(java.lang.String, android.service.notification.NotificationRankerService.Adjustment);
    method public final android.os.IBinder onBind(android.content.Intent);
    method public void onNotificationActionClick(java.lang.String, long, int);
    method public void onNotificationClick(java.lang.String, long);
    method public abstract android.service.notification.NotificationRankerService.Adjustment onNotificationEnqueued(android.service.notification.StatusBarNotification, int, boolean);
    method public void onNotificationRemoved(java.lang.String, long, int);
    method public void onNotificationVisibilityChanged(java.lang.String, long, boolean);
    field public static final int REASON_APP_CANCEL = 8; // 0x8
    field public static final int REASON_APP_CANCEL_ALL = 9; // 0x9
    field public static final int REASON_DELEGATE_CANCEL = 2; // 0x2
    field public static final int REASON_DELEGATE_CANCEL_ALL = 3; // 0x3
    field public static final int REASON_DELEGATE_CLICK = 1; // 0x1
    field public static final int REASON_DELEGATE_ERROR = 4; // 0x4
    field public static final int REASON_GROUP_OPTIMIZATION = 13; // 0xd
    field public static final int REASON_GROUP_SUMMARY_CANCELED = 12; // 0xc
    field public static final int REASON_LISTENER_CANCEL = 10; // 0xa
    field public static final int REASON_LISTENER_CANCEL_ALL = 11; // 0xb
    field public static final int REASON_PACKAGE_BANNED = 7; // 0x7
    field public static final int REASON_PACKAGE_CHANGED = 5; // 0x5
    field public static final int REASON_PACKAGE_SUSPENDED = 14; // 0xe
    field public static final int REASON_PROFILE_TURNED_OFF = 15; // 0xf
    field public static final int REASON_USER_STOPPED = 6; // 0x6
    field public static final java.lang.String SERVICE_INTERFACE = "android.service.notification.NotificationRankerService";
  }
  public class NotificationRankerService.Adjustment {
    ctor public NotificationRankerService.Adjustment(int, java.lang.CharSequence, android.net.Uri);
  }
  public class StatusBarNotification implements android.os.Parcelable {
    ctor public StatusBarNotification(java.lang.String, java.lang.String, int, java.lang.String, int, int, int, android.app.Notification, android.os.UserHandle, long);
    ctor public StatusBarNotification(android.os.Parcel);
+2 −2
Original line number Diff line number Diff line
@@ -61,7 +61,7 @@ interface INotificationManager
    StatusBarNotification[] getActiveNotifications(String callingPkg);
    StatusBarNotification[] getHistoricalNotifications(String callingPkg, int count);

    void registerListener(in INotificationListener listener, in ComponentName component, int userid);
    void registerListener(in INotificationListener listener, in ComponentName component, int userid, boolean asRanker);
    void unregisterListener(in INotificationListener listener, int userid);

    void cancelNotificationFromListener(in INotificationListener token, String pkg, String tag, int id);
@@ -80,7 +80,7 @@ interface INotificationManager
    void setOnNotificationPostedTrimFromListener(in INotificationListener token, int trim);
    void setInterruptionFilter(String pkg, int interruptionFilter);

    void setImportanceFromAssistant(in INotificationListener token, String key, int importance, CharSequence explanation);
    void setImportanceFromRankerService(in INotificationListener token, String key, int importance, CharSequence explanation);

    ComponentName getEffectsSuppressor();
    boolean matchesCallFilter(in Bundle extras);
+0 −9
Original line number Diff line number Diff line
@@ -5840,15 +5840,6 @@ public final class Settings {
         */
        public static final String ASSIST_SCREENSHOT_ENABLED = "assist_screenshot_enabled";

        /**
         * Names of the service component that the current user has explicitly allowed to
         * see and change the importance of all of the user's notifications.
         *
         * @hide
         */
        public static final String ENABLED_NOTIFICATION_ASSISTANT
                = "enabled_notification_assistant";

        /**
         * Names of the service components that the current user has explicitly allowed to
         * see all of the user's notifications, separated by ':'.
+2 −2
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ import android.service.notification.NotificationRankingUpdate;
/** @hide */
oneway interface INotificationListener
{
    // listeners and assistants
    // listeners and rankers
    void onListenerConnected(in NotificationRankingUpdate update);
    void onNotificationPosted(in IStatusBarNotificationHolder notificationHolder,
            in NotificationRankingUpdate update);
@@ -33,7 +33,7 @@ oneway interface INotificationListener
    void onListenerHintsChanged(int hints);
    void onInterruptionFilterChanged(int interruptionFilter);

    // assistants only
    // rankers only
    void onNotificationEnqueued(in IStatusBarNotificationHolder notificationHolder, int importance, boolean user);
    void onNotificationVisibilityChanged(String key, long time, boolean visible);
    void onNotificationClick(String key, long time);
+18 −7
Original line number Diff line number Diff line
@@ -180,13 +180,18 @@ public abstract class NotificationListenerService extends Service {

    private INotificationManager mNoMan;

    /** Only valid after a successful call to (@link registerAsService}. */
    private int mCurrentUser;

    /**
     * Only valid after a successful call to (@link registerAsService}.
     * @hide
     */
    protected int mCurrentUser;

    // This context is required for system services since NotificationListenerService isn't
    // started as a real Service and hence no context is available.
    private Context mSystemContext;
    /**
     * This context is required for system services since NotificationListenerService isn't
     * started as a real Service and hence no context is available..
     * @hide
     */
    protected Context mSystemContext;

    /**
     * The {@link Intent} that must be declared as handled by the service.
@@ -696,12 +701,18 @@ public abstract class NotificationListenerService extends Service {
    @SystemApi
    public void registerAsSystemService(Context context, ComponentName componentName,
            int currentUser) throws RemoteException {
        registerAsSystemServiceImpl(context, componentName, currentUser, false /* asRanker */);
    }

    /** @hide */
    protected void registerAsSystemServiceImpl(Context context, ComponentName componentName,
            int currentUser, boolean asRanker) throws RemoteException {
        mSystemContext = context;
        if (mWrapper == null) {
            mWrapper = new NotificationListenerWrapper();
        }
        INotificationManager noMan = getNotificationInterface();
        noMan.registerListener(mWrapper, componentName, currentUser);
        noMan.registerListener(mWrapper, componentName, currentUser, asRanker);
        mCurrentUser = currentUser;
        mHandler = new MyHandler(context.getMainLooper());
    }
Loading