Loading services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceAudioSystem.java +21 −12 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import static com.android.server.hdmi.Constants.PROPERTY_SYSTEM_AUDIO_CONTROL_ON import static com.android.server.hdmi.Constants.USE_LAST_STATE_SYSTEM_AUDIO_CONTROL_ON_POWER_ON; import android.annotation.Nullable; import android.content.ActivityNotFoundException; import android.content.Intent; import android.hardware.hdmi.HdmiControlManager; import android.hardware.hdmi.HdmiDeviceInfo; Loading Loading @@ -1075,13 +1076,18 @@ public class HdmiCecLocalDeviceAudioSystem extends HdmiCecLocalDeviceSource { // For device to switch to specific TvInput with corresponding URI. private void switchToTvInput(String uri) { try { mService.getContext().startActivity(new Intent(Intent.ACTION_VIEW, TvContract.buildChannelUriForPassthroughInput(uri)) .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)); } catch (ActivityNotFoundException e) { Slog.e(TAG, "Can't find activity to switch to " + uri, e); } } // For device using TvInput to switch to Home. private void switchToHomeTvInput() { try { Intent activityIntent = new Intent(Intent.ACTION_MAIN) .addCategory(Intent.CATEGORY_HOME) .setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP Loading @@ -1089,6 +1095,9 @@ public class HdmiCecLocalDeviceAudioSystem extends HdmiCecLocalDeviceSource { | Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_NO_ANIMATION); mService.getContext().startActivity(activityIntent); } catch (ActivityNotFoundException e) { Slog.e(TAG, "Can't find activity to switch to HOME", e); } } @Override Loading Loading @@ -1131,7 +1140,8 @@ public class HdmiCecLocalDeviceAudioSystem extends HdmiCecLocalDeviceSource { if (routingInformationPath == mService.getPhysicalAddress()) { HdmiLogger.debug("Current device can't assign valid physical address" + "to devices under it any more. " + "It's physical address is " + routingInformationPath); + "It's physical address is " + routingInformationPath); return; } // Otherwise will switch to the current active port and broadcast routing information. Loading Loading @@ -1208,5 +1218,4 @@ public class HdmiCecLocalDeviceAudioSystem extends HdmiCecLocalDeviceSource { pw.decreaseIndent(); super.dump(pw); } } Loading
services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceAudioSystem.java +21 −12 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import static com.android.server.hdmi.Constants.PROPERTY_SYSTEM_AUDIO_CONTROL_ON import static com.android.server.hdmi.Constants.USE_LAST_STATE_SYSTEM_AUDIO_CONTROL_ON_POWER_ON; import android.annotation.Nullable; import android.content.ActivityNotFoundException; import android.content.Intent; import android.hardware.hdmi.HdmiControlManager; import android.hardware.hdmi.HdmiDeviceInfo; Loading Loading @@ -1075,13 +1076,18 @@ public class HdmiCecLocalDeviceAudioSystem extends HdmiCecLocalDeviceSource { // For device to switch to specific TvInput with corresponding URI. private void switchToTvInput(String uri) { try { mService.getContext().startActivity(new Intent(Intent.ACTION_VIEW, TvContract.buildChannelUriForPassthroughInput(uri)) .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)); } catch (ActivityNotFoundException e) { Slog.e(TAG, "Can't find activity to switch to " + uri, e); } } // For device using TvInput to switch to Home. private void switchToHomeTvInput() { try { Intent activityIntent = new Intent(Intent.ACTION_MAIN) .addCategory(Intent.CATEGORY_HOME) .setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP Loading @@ -1089,6 +1095,9 @@ public class HdmiCecLocalDeviceAudioSystem extends HdmiCecLocalDeviceSource { | Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_NO_ANIMATION); mService.getContext().startActivity(activityIntent); } catch (ActivityNotFoundException e) { Slog.e(TAG, "Can't find activity to switch to HOME", e); } } @Override Loading Loading @@ -1131,7 +1140,8 @@ public class HdmiCecLocalDeviceAudioSystem extends HdmiCecLocalDeviceSource { if (routingInformationPath == mService.getPhysicalAddress()) { HdmiLogger.debug("Current device can't assign valid physical address" + "to devices under it any more. " + "It's physical address is " + routingInformationPath); + "It's physical address is " + routingInformationPath); return; } // Otherwise will switch to the current active port and broadcast routing information. Loading Loading @@ -1208,5 +1218,4 @@ public class HdmiCecLocalDeviceAudioSystem extends HdmiCecLocalDeviceSource { pw.decreaseIndent(); super.dump(pw); } }