diff options
| author | 2019-09-20 16:37:38 -0700 | |
|---|---|---|
| committer | 2019-09-20 16:37:38 -0700 | |
| commit | d4e05271f7aeb1c46188296708148fafcb2aabc4 (patch) | |
| tree | c038d13468c983a016d58acee03d1f21fcc852ae | |
| parent | 39485717f10554ba149327e93f35f0b93247be8b (diff) | |
| parent | 77e15050c501771bbbe3d986348ddc00581bc84b (diff) | |
Merge "libbinder: __ANDROID_HOST__ => !__ANDROID__" am: 0aee1e883f am: 65bb4fcab1 am: 05eeea722d
am: 77e15050c5
Change-Id: I3332848b46e8efb08bc719ff88e4827ac6106d52
| -rw-r--r-- | libs/binder/Android.bp | 3 | ||||
| -rw-r--r-- | libs/binder/IServiceManager.cpp | 12 | ||||
| -rw-r--r-- | libs/binder/include/private/binder/binder_module.h | 2 |
3 files changed, 7 insertions, 10 deletions
diff --git a/libs/binder/Android.bp b/libs/binder/Android.bp index 8af2872152..f3d4b7e3c4 100644 --- a/libs/binder/Android.bp +++ b/libs/binder/Android.bp @@ -102,9 +102,6 @@ cc_library_shared { android: { srcs: libbinder_device_interface_sources, }, - host: { - cflags: ["-D__ANDROID_HOST__"], - }, vendor: { exclude_srcs: libbinder_device_interface_sources, }, diff --git a/libs/binder/IServiceManager.cpp b/libs/binder/IServiceManager.cpp index b6f3d7b266..f3e8f45909 100644 --- a/libs/binder/IServiceManager.cpp +++ b/libs/binder/IServiceManager.cpp @@ -30,7 +30,7 @@ #include <binder/IPermissionController.h> #endif -#ifndef __ANDROID_HOST__ +#ifdef __ANDROID__ #include <cutils/properties.h> #endif @@ -63,7 +63,7 @@ sp<IServiceManager> defaultServiceManager() return gDefaultServiceManager; } -#if !defined(__ANDROID_VNDK__) && !defined(__ANDROID_HOST__) +#if !defined(__ANDROID_VNDK__) && defined(__ANDROID__) // IPermissionController is not accessible to vendors bool checkCallingPermission(const String16& permission) @@ -166,14 +166,14 @@ public: const bool isVendorService = strcmp(ProcessState::self()->getDriverName().c_str(), "/dev/vndbinder") == 0; const long timeout = uptimeMillis() + 5000; + // Vendor code can't access system properties if (!gSystemBootCompleted && !isVendorService) { -#ifdef __ANDROID_HOST__ - gSystemBootCompleted = true; -#else - // Vendor code can't access system properties +#ifdef __ANDROID__ char bootCompleted[PROPERTY_VALUE_MAX]; property_get("sys.boot_completed", bootCompleted, "0"); gSystemBootCompleted = strcmp(bootCompleted, "1") == 0 ? true : false; +#else + gSystemBootCompleted = true; #endif } // retry interval in millisecond; note that vendor services stay at 100ms diff --git a/libs/binder/include/private/binder/binder_module.h b/libs/binder/include/private/binder/binder_module.h index 09e6ba0104..c22be9f786 100644 --- a/libs/binder/include/private/binder/binder_module.h +++ b/libs/binder/include/private/binder/binder_module.h @@ -24,7 +24,7 @@ namespace android { /* obtain structures and constants from the kernel header */ // TODO(b/31559095): bionic on host -#ifdef __ANDROID_HOST__ +#ifndef __ANDROID__ #define __packed __attribute__((__packed__)) #endif |