OSDN Git Service

Revert "HIDL Java getService now the same as C++."
authorSteven Moreland <smoreland@google.com>
Wed, 25 Oct 2017 04:46:26 +0000 (04:46 +0000)
committerSteven Moreland <smoreland@google.com>
Wed, 25 Oct 2017 04:46:26 +0000 (04:46 +0000)
Appears to be causing problems on 2017 devices.

This reverts commit c1f00f8cd895e38c74ed1cb1adff33065ccecd06.

Change-Id: I6c1717a612bfa3fe63f08160a1db652c284f6ba4

core/java/android/os/HwBinder.java
core/jni/android_os_HwBinder.cpp

index c1c65ff..270e63f 100644 (file)
@@ -48,8 +48,7 @@ public abstract class HwBinder implements IHwBinder {
 
     public static native final IHwBinder getService(
             String iface,
-            String serviceName,
-            boolean isTry)
+            String serviceName)
         throws RemoteException, NoSuchElementException;
 
     public static native final void configureRpcThreadpool(
index 7fd97b2..fe14d48 100644 (file)
@@ -303,8 +303,7 @@ static jobject JHwBinder_native_getService(
         JNIEnv *env,
         jclass /* clazzObj */,
         jstring ifaceNameObj,
-        jstring serviceNameObj,
-        jboolean isTry) {
+        jstring serviceNameObj) {
 
     using ::android::hidl::base::V1_0::IBase;
     using ::android::hardware::details::getRawServiceInternal;
@@ -332,7 +331,8 @@ static jobject JHwBinder_native_getService(
     std::string serviceName(serviceNameCStr);
     env->ReleaseStringUTFChars(serviceNameObj, serviceNameCStr);
 
-    sp<IBase> ret = getRawServiceInternal(ifaceName, serviceName, !isTry /* retry */, false /* getStub */);
+    // TODO(b/67981006): true /* retry */
+    sp<IBase> ret = getRawServiceInternal(ifaceName, serviceName, false /* retry */, false /* getStub */); 
     sp<hardware::IBinder> service = hardware::toBinder<hidl::base::V1_0::IBase>(ret);
 
     if (service == NULL) {
@@ -371,7 +371,7 @@ static JNINativeMethod gMethods[] = {
     { "registerService", "(Ljava/lang/String;)V",
         (void *)JHwBinder_native_registerService },
 
-    { "getService", "(Ljava/lang/String;Ljava/lang/String;Z)L" PACKAGE_PATH "/IHwBinder;",
+    { "getService", "(Ljava/lang/String;Ljava/lang/String;)L" PACKAGE_PATH "/IHwBinder;",
         (void *)JHwBinder_native_getService },
 
     { "configureRpcThreadpool", "(JZ)V",