From e67d3bb2bab3156e1128e1fc066ddb836efda62e Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Thu, 16 Mar 2017 16:10:24 -0700 Subject: [PATCH] IUsb uses "default" service name The getService() and registerAsService() methods of interface objects now have default parameters of "default" for the service name. HALs will not have to use any service name unless they want to register more than one service. Test: pass Bug: 33844934 Change-Id: I7c1691daf029fb426873be79553a235c43df9f42 --- .../java/com/android/server/usb/UsbPortManager.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/services/usb/java/com/android/server/usb/UsbPortManager.java b/services/usb/java/com/android/server/usb/UsbPortManager.java index 86f4a0168650c..27297951cb6e4 100644 --- a/services/usb/java/com/android/server/usb/UsbPortManager.java +++ b/services/usb/java/com/android/server/usb/UsbPortManager.java @@ -92,9 +92,6 @@ public class UsbPortManager { // Cookie sent for usb hal death notification. private static final int USB_HAL_DEATH_COOKIE = 1000; - // Usb hal service name. - private static String sServiceName = "usb_hal"; - // Used as the key while sending the bundle to Main thread. private static final String PORT_INFO = "port_info"; @@ -499,16 +496,15 @@ public class UsbPortManager { } try { - mProxy = IUsb.getService(sServiceName); + mProxy = IUsb.getService(); mProxy.linkToDeath(new DeathRecipient(pw), USB_HAL_DEATH_COOKIE); mProxy.setCallback(mHALCallback); mProxy.queryPortStatus(); } catch (NoSuchElementException e) { - logAndPrintException(pw, sServiceName + " not found." + logAndPrintException(pw, "connectToProxy: usb hal service not found." + " Did the service fail to start?", e); } catch (RemoteException e) { - logAndPrintException(pw, sServiceName - + " connectToProxy: Service not responding", e); + logAndPrintException(pw, "connectToProxy: usb hal service not responding", e); } } }