Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 420e45e9 authored by Ashutosh Joshi's avatar Ashutosh Joshi
Browse files

Move ContextHubService to a better location.

Move ContextHub service from system core to a more appropriate place
for a service.

Test: GTS tests pass.

Change-Id: Ie0f25414fc472a0214c0dd94e7ad4564cd38f842
parent 705bcc81
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -362,8 +362,7 @@ public final class ContextHubManager {
    public ContextHubManager(Context context, Looper mainLooper) throws ServiceNotFoundException {
    public ContextHubManager(Context context, Looper mainLooper) throws ServiceNotFoundException {
        mMainLooper = mainLooper;
        mMainLooper = mainLooper;
        mService = IContextHubService.Stub.asInterface(
        mService = IContextHubService.Stub.asInterface(
                ServiceManager.getServiceOrThrow(ContextHubService.CONTEXTHUB_SERVICE));
                ServiceManager.getServiceOrThrow(Context.CONTEXTHUB_SERVICE));

        try {
        try {
            mService.registerCallback(mClientCallback);
            mService.registerCallback(mClientCallback);
        } catch (RemoteException e) {
        } catch (RemoteException e) {
+0 −1
Original line number Original line Diff line number Diff line
@@ -165,7 +165,6 @@ LOCAL_SRC_FILES:= \
    android_hardware_UsbDevice.cpp \
    android_hardware_UsbDevice.cpp \
    android_hardware_UsbDeviceConnection.cpp \
    android_hardware_UsbDeviceConnection.cpp \
    android_hardware_UsbRequest.cpp \
    android_hardware_UsbRequest.cpp \
    android_hardware_location_ContextHubService.cpp \
    android_hardware_location_ActivityRecognitionHardware.cpp \
    android_hardware_location_ActivityRecognitionHardware.cpp \
    android_util_FileObserver.cpp \
    android_util_FileObserver.cpp \
    android/opengl/poly_clip.cpp.arm \
    android/opengl/poly_clip.cpp.arm \
+0 −2
Original line number Original line Diff line number Diff line
@@ -94,7 +94,6 @@ extern int register_android_hardware_UsbDevice(JNIEnv *env);
extern int register_android_hardware_UsbDeviceConnection(JNIEnv *env);
extern int register_android_hardware_UsbDeviceConnection(JNIEnv *env);
extern int register_android_hardware_UsbRequest(JNIEnv *env);
extern int register_android_hardware_UsbRequest(JNIEnv *env);
extern int register_android_hardware_location_ActivityRecognitionHardware(JNIEnv* env);
extern int register_android_hardware_location_ActivityRecognitionHardware(JNIEnv* env);
extern int register_android_hardware_location_ContextHubService(JNIEnv* env);


extern int register_android_media_AudioRecord(JNIEnv *env);
extern int register_android_media_AudioRecord(JNIEnv *env);
extern int register_android_media_AudioSystem(JNIEnv *env);
extern int register_android_media_AudioSystem(JNIEnv *env);
@@ -1380,7 +1379,6 @@ static const RegJNIRec gRegJNI[] = {
    REG_JNI(register_android_hardware_UsbDeviceConnection),
    REG_JNI(register_android_hardware_UsbDeviceConnection),
    REG_JNI(register_android_hardware_UsbRequest),
    REG_JNI(register_android_hardware_UsbRequest),
    REG_JNI(register_android_hardware_location_ActivityRecognitionHardware),
    REG_JNI(register_android_hardware_location_ActivityRecognitionHardware),
    REG_JNI(register_android_hardware_location_ContextHubService),
    REG_JNI(register_android_media_AudioRecord),
    REG_JNI(register_android_media_AudioRecord),
    REG_JNI(register_android_media_AudioSystem),
    REG_JNI(register_android_media_AudioSystem),
    REG_JNI(register_android_media_AudioTrack),
    REG_JNI(register_android_media_AudioTrack),
+0 −1
Original line number Original line Diff line number Diff line
@@ -1006,7 +1006,6 @@ android.hardware.input.InputManager$InputDevicesChangedListener
# android.hardware.location.IActivityRecognitionHardware
# android.hardware.location.IActivityRecognitionHardware
# android.hardware.location.IActivityRecognitionHardware$Stub
# android.hardware.location.IActivityRecognitionHardware$Stub
android.hardware.location.ContextHubManager
android.hardware.location.ContextHubManager
android.hardware.location.ContextHubService
android.hardware.location.IContextHubService
android.hardware.location.IContextHubService
android.hardware.location.IContextHubService$Stub
android.hardware.location.IContextHubService$Stub
android.hardware.radio.RadioManager
android.hardware.radio.RadioManager
+2 −2
Original line number Original line Diff line number Diff line
@@ -16,7 +16,7 @@


package com.android.server;
package com.android.server;


import android.hardware.location.ContextHubService;
import com.android.server.location.ContextHubService;
import android.content.Context;
import android.content.Context;
import android.util.Log;
import android.util.Log;


@@ -37,7 +37,7 @@ class ContextHubSystemService extends SystemService {
    public void onBootPhase(int phase) {
    public void onBootPhase(int phase) {
        if (phase == SystemService.PHASE_SYSTEM_SERVICES_READY) {
        if (phase == SystemService.PHASE_SYSTEM_SERVICES_READY) {
            Log.d(TAG, "onBootPhase: PHASE_SYSTEM_SERVICES_READY");
            Log.d(TAG, "onBootPhase: PHASE_SYSTEM_SERVICES_READY");
            publishBinderService(ContextHubService.CONTEXTHUB_SERVICE, mContextHubService);
            publishBinderService(Context.CONTEXTHUB_SERVICE, mContextHubService);
        }
        }
    }
    }
}
}
Loading