Merge "Don\'t throw RemoteException from new NLS APIs" into nyc-dev am: 28d9ef8112
am: ec2e36a485
* commit 'ec2e36a4851780219e342c545467fb433ef16fd6':
Don't throw RemoteException from new NLS APIs
Change-Id: If4175e64a71b2b02306f9eb579f9755492ea6dfd
This commit is contained in:
@@ -34737,8 +34737,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
|
||||
|
||||
@@ -37463,8 +37463,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;
|
||||
|
||||
@@ -34815,8 +34815,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