summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Steven Moreland <smoreland@google.com> 2019-08-30 11:48:29 -0700
committer android-build-merger <android-build-merger@google.com> 2019-08-30 11:48:29 -0700
commitfac32905f9e99151e6dc0fb6a99540bac22b00c9 (patch)
treec14da2a54ce844098b0090e7f91e9fc0d84939be
parentecce45c3ab8b6b4f0497bb15f856697fff7942d8 (diff)
parent11912440c5c6347e69141540fa935e955b5ca7a2 (diff)
Merge changes from topic "wait-for-aidl" into stage-aosp-master am: d6b5bdf07d am: 4955049ace
am: 11912440c5 Change-Id: I9997004285d1299742c50b222edf9301be09fc98
-rw-r--r--core/java/android/os/ServiceManagerNative.java10
-rw-r--r--services/core/jni/com_android_server_power_PowerManagerService.cpp9
2 files changed, 12 insertions, 7 deletions
diff --git a/core/java/android/os/ServiceManagerNative.java b/core/java/android/os/ServiceManagerNative.java
index 7991cd46b65c..f641731fa08f 100644
--- a/core/java/android/os/ServiceManagerNative.java
+++ b/core/java/android/os/ServiceManagerNative.java
@@ -76,6 +76,16 @@ class ServiceManagerProxy implements IServiceManager {
return mServiceManager.listServices(dumpPriority);
}
+ public void registerForNotifications(String name, IServiceCallback cb)
+ throws RemoteException {
+ throw new RemoteException();
+ }
+
+ public void unregisterForNotifications(String name, IServiceCallback cb)
+ throws RemoteException {
+ throw new RemoteException();
+ }
+
/**
* Same as mServiceManager but used by apps.
*
diff --git a/services/core/jni/com_android_server_power_PowerManagerService.cpp b/services/core/jni/com_android_server_power_PowerManagerService.cpp
index 73bb579bd274..4e0434873944 100644
--- a/services/core/jni/com_android_server_power_PowerManagerService.cpp
+++ b/services/core/jni/com_android_server_power_PowerManagerService.cpp
@@ -201,13 +201,8 @@ sp<ISystemSuspend> getSuspendHal() {
sp<ISuspendControlService> getSuspendControl() {
static std::once_flag suspendControlFlag;
std::call_once(suspendControlFlag, [](){
- while(gSuspendControl == nullptr) {
- sp<IBinder> control =
- defaultServiceManager()->getService(String16("suspend_control"));
- if (control != nullptr) {
- gSuspendControl = interface_cast<ISuspendControlService>(control);
- }
- }
+ gSuspendControl = waitForService<ISuspendControlService>(String16("suspend_control"));
+ LOG_ALWAYS_FATAL_IF(gSuspendControl == nullptr);
});
return gSuspendControl;
}