summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
authorChris Wren <cwren@android.com>2016-05-20 14:53:16 -0400
committerChris Wren <cwren@android.com>2016-05-20 14:53:16 -0400
commitcf548bfad62b06fd9ad1cf2f1a67bd57a8471c28 (patch)
tree63f0d2ed797dfb3cba4f18931ffb7bb2b65a9ff6 /core/java
parent5a68af384037f2980215dd45b91c5165c779d4e8 (diff)
Don't throw RemoteException from new NLS APIs
Bug: 28820058 Change-Id: If4a290ab7549aa999cee348bf0db85b70cb57553
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/service/notification/NotificationListenerService.java21
1 files changed, 14 insertions, 7 deletions
diff --git a/core/java/android/service/notification/NotificationListenerService.java b/core/java/android/service/notification/NotificationListenerService.java
index 25fe4ffaa471..1557a2718b55 100644
--- a/core/java/android/service/notification/NotificationListenerService.java
+++ b/core/java/android/service/notification/NotificationListenerService.java
@@ -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();
+ }
}
}