CEC: Make deviceSelect to active device a no-op
Changing input to already the active source should return immediately without initiating routing control. This is also required for processing the incoming <Active Source> Also set the flag in intent for input change to start a new activity from a service. The service fails to launch an activity without it. Bug: 15570939 Change-Id: I9b20b31137dfa4dc847bc43cc7fd35e669d0dec7
This commit is contained in:
@@ -165,6 +165,11 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice {
|
||||
@ServiceThreadOnly
|
||||
void deviceSelect(int targetAddress, IHdmiControlCallback callback) {
|
||||
assertRunOnServiceThread();
|
||||
ActiveSource active = getActiveSource();
|
||||
if (active.isValid() && targetAddress == active.logicalAddress) {
|
||||
invokeCallback(callback, HdmiControlManager.RESULT_SUCCESS);
|
||||
return;
|
||||
}
|
||||
if (targetAddress == Constants.ADDR_INTERNAL) {
|
||||
handleSelectInternalSource();
|
||||
// Switching to internal source is always successful even when CEC control is disabled.
|
||||
|
||||
@@ -930,6 +930,7 @@ class TvInputHardwareManager implements TvInputHal.Callback {
|
||||
if (inputId != null) {
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW);
|
||||
intent.setData(TvContract.buildChannelUriForPassthroughTvInput(inputId));
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
mContext.startActivity(intent);
|
||||
} else {
|
||||
Slog.w(TAG, "onChanged: InputId cannot be found for :" + device);
|
||||
|
||||
Reference in New Issue
Block a user