Hook up native mhl api to HdmiControl Service.
This change hooks up all apis defined in mhl hal to
java layer's HdmiMhlController and HdmiControlService.
Along with HdmiMhlController, this change includes followings.
1. HdmiMhlLocalDevice
A logical container for a mhl device connected to specific hdmi port
2. HdmiMhlFeatureAction
A base feature action class for mhl's state behaviors like RAP and RCP.
Bug: 16215362
Change-Id: If177999853f60b68bd079549660a3f4982cb9d9e
diff --git a/services/core/java/com/android/server/hdmi/HdmiCecController.java b/services/core/java/com/android/server/hdmi/HdmiCecController.java
index 10e4b6e..cf06ca8 100644
--- a/services/core/java/com/android/server/hdmi/HdmiCecController.java
+++ b/services/core/java/com/android/server/hdmi/HdmiCecController.java
@@ -94,13 +94,14 @@
// interacts with HAL.
private volatile long mNativePtr;
- private HdmiControlService mService;
+ private final HdmiControlService mService;
// Stores the local CEC devices in the system. Device type is used for key.
private final SparseArray<HdmiCecLocalDevice> mLocalDevices = new SparseArray<>();
// Private constructor. Use HdmiCecController.create().
- private HdmiCecController() {
+ private HdmiCecController(HdmiControlService service) {
+ mService = service;
}
/**
@@ -114,21 +115,20 @@
* returns {@code null}.
*/
static HdmiCecController create(HdmiControlService service) {
- HdmiCecController controller = new HdmiCecController();
+ HdmiCecController controller = new HdmiCecController(service);
long nativePtr = nativeInit(controller, service.getServiceLooper().getQueue());
if (nativePtr == 0L) {
controller = null;
return null;
}
- controller.init(service, nativePtr);
+ controller.init(nativePtr);
return controller;
}
- private void init(HdmiControlService service, long nativePtr) {
- mService = service;
- mIoHandler = new Handler(service.getServiceLooper());
- mControlHandler = new Handler(service.getServiceLooper());
+ private void init(long nativePtr) {
+ mIoHandler = new Handler(mService.getServiceLooper());
+ mControlHandler = new Handler(mService.getServiceLooper());
mNativePtr = nativePtr;
}