Merge "Set active port path to HdmiControlService" into lmp-dev

This commit is contained in:
Jungshik Jang
2014-08-12 05:26:01 +00:00
committed by Android (Google) Code Review
2 changed files with 13 additions and 5 deletions

View File

@@ -631,6 +631,7 @@ abstract class HdmiCecLocalDevice {
synchronized (mLock) {
mActiveRoutingPath = path;
}
mService.setActivePortId(pathToPortId(path));
}
/**
@@ -649,11 +650,9 @@ abstract class HdmiCecLocalDevice {
* @param portId the new active port id
*/
void setActivePortId(int portId) {
synchronized (mLock) {
// We update active routing path instead, since we get the active port id from
// the active routing path.
mActiveRoutingPath = mService.portIdToPath(portId);
}
// We update active routing path instead, since we get the active port id from
// the active routing path.
setActivePath(mService.portIdToPath(portId));
}
@ServiceThreadOnly

View File

@@ -239,6 +239,9 @@ public final class HdmiControlService extends SystemService {
@ServiceThreadOnly
private boolean mWakeUpMessageReceived = false;
@ServiceThreadOnly
private int mActivePortId = Constants.INVALID_PORT_ID;
public HdmiControlService(Context context) {
super(context);
mLocalDevices = HdmiUtils.asImmutableList(getContext().getResources().getIntArray(
@@ -1718,4 +1721,10 @@ public final class HdmiControlService extends SystemService {
});
}
}
@ServiceThreadOnly
void setActivePortId(int portId) {
assertRunOnServiceThread();
mActivePortId = portId;
}
}