Merge "Don't throw RemoteException from new NLS APIs" into nyc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
28d9ef8112
@@ -34633,8 +34633,8 @@ package android.service.notification {
|
||||
method public void onNotificationRemoved(android.service.notification.StatusBarNotification, android.service.notification.NotificationListenerService.RankingMap);
|
||||
method public final void requestInterruptionFilter(int);
|
||||
method public final void requestListenerHints(int);
|
||||
method public static void requestRebind(android.content.ComponentName) throws android.os.RemoteException;
|
||||
method public final void requestUnbind() throws android.os.RemoteException;
|
||||
method public static void requestRebind(android.content.ComponentName);
|
||||
method public final void requestUnbind();
|
||||
method public final void setNotificationsShown(java.lang.String[]);
|
||||
field public static final int HINT_HOST_DISABLE_CALL_EFFECTS = 4; // 0x4
|
||||
field public static final int HINT_HOST_DISABLE_EFFECTS = 1; // 0x1
|
||||
|
||||
@@ -37359,8 +37359,8 @@ package android.service.notification {
|
||||
method public void registerAsSystemService(android.content.Context, android.content.ComponentName, int) throws android.os.RemoteException;
|
||||
method public final void requestInterruptionFilter(int);
|
||||
method public final void requestListenerHints(int);
|
||||
method public static void requestRebind(android.content.ComponentName) throws android.os.RemoteException;
|
||||
method public final void requestUnbind() throws android.os.RemoteException;
|
||||
method public static void requestRebind(android.content.ComponentName);
|
||||
method public final void requestUnbind();
|
||||
method public final void setNotificationsShown(java.lang.String[]);
|
||||
method public final void setOnNotificationPostedTrim(int);
|
||||
method public void unregisterAsSystemService() throws android.os.RemoteException;
|
||||
|
||||
@@ -34710,8 +34710,8 @@ package android.service.notification {
|
||||
method public void onNotificationRemoved(android.service.notification.StatusBarNotification, android.service.notification.NotificationListenerService.RankingMap);
|
||||
method public final void requestInterruptionFilter(int);
|
||||
method public final void requestListenerHints(int);
|
||||
method public static void requestRebind(android.content.ComponentName) throws android.os.RemoteException;
|
||||
method public final void requestUnbind() throws android.os.RemoteException;
|
||||
method public static void requestRebind(android.content.ComponentName);
|
||||
method public final void requestUnbind();
|
||||
method public final void setNotificationsShown(java.lang.String[]);
|
||||
field public static final int HINT_HOST_DISABLE_CALL_EFFECTS = 4; // 0x4
|
||||
field public static final int HINT_HOST_DISABLE_EFFECTS = 1; // 0x1
|
||||
|
||||
@@ -790,11 +790,14 @@ public abstract class NotificationListenerService extends Service {
|
||||
* <p>This method will fail for listeners that have
|
||||
* not been granted the permission by the user.
|
||||
*/
|
||||
public static void requestRebind(ComponentName componentName)
|
||||
throws RemoteException {
|
||||
public static void requestRebind(ComponentName componentName) {
|
||||
INotificationManager noMan = INotificationManager.Stub.asInterface(
|
||||
ServiceManager.getService(Context.NOTIFICATION_SERVICE));
|
||||
noMan.requestBindListener(componentName);
|
||||
try {
|
||||
noMan.requestBindListener(componentName);
|
||||
} catch (RemoteException ex) {
|
||||
throw ex.rethrowFromSystemServer();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -807,12 +810,16 @@ public abstract class NotificationListenerService extends Service {
|
||||
* <p>The service should wait for the {@link #onListenerConnected()} event
|
||||
* before performing this operation. I know it's tempting, but you must wait.
|
||||
*/
|
||||
public final void requestUnbind() throws RemoteException {
|
||||
public final void requestUnbind() {
|
||||
if (mWrapper != null) {
|
||||
INotificationManager noMan = getNotificationInterface();
|
||||
noMan.requestUnbindListener(mWrapper);
|
||||
// Disable future messages.
|
||||
isConnected = false;
|
||||
try {
|
||||
noMan.requestUnbindListener(mWrapper);
|
||||
// Disable future messages.
|
||||
isConnected = false;
|
||||
} catch (RemoteException ex) {
|
||||
throw ex.rethrowFromSystemServer();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user