Add setting for main RC profile
For TV panel and source devices. Bug: 169121289 Test: atest HdmiCecLocalDevicePlaybackTest and HdmiCecLocalDeviceTvTest Change-Id: I6e870a35bcaf55153eaa2274c9f2d8b8f7bf1dda
This commit is contained in:
@@ -473,7 +473,7 @@ public final class HdmiControlManager {
|
||||
* @see HdmiControlManager#CEC_SETTING_NAME_VOLUME_CONTROL_MODE
|
||||
* @hide
|
||||
*/
|
||||
@IntDef({
|
||||
@IntDef(prefix = { "VOLUME_CONTROL_" }, value = {
|
||||
VOLUME_CONTROL_ENABLED,
|
||||
VOLUME_CONTROL_DISABLED
|
||||
})
|
||||
@@ -503,6 +503,168 @@ public final class HdmiControlManager {
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface TvWakeOnOneTouchPlay {}
|
||||
|
||||
// -- The RC profile of a TV panel.
|
||||
/**
|
||||
* RC profile none.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
public static final int RC_PROFILE_TV_NONE = 0x0;
|
||||
/**
|
||||
* RC profile 1.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
public static final int RC_PROFILE_TV_ONE = 0x2;
|
||||
/**
|
||||
* RC profile 2.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
public static final int RC_PROFILE_TV_TWO = 0x6;
|
||||
/**
|
||||
* RC profile 3.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
public static final int RC_PROFILE_TV_THREE = 0xA;
|
||||
/**
|
||||
* RC profile 4.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
public static final int RC_PROFILE_TV_FOUR = 0xE;
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
@IntDef(prefix = { "RC_PROFILE_TV_" }, value = {
|
||||
RC_PROFILE_TV_NONE,
|
||||
RC_PROFILE_TV_ONE,
|
||||
RC_PROFILE_TV_TWO,
|
||||
RC_PROFILE_TV_THREE,
|
||||
RC_PROFILE_TV_FOUR
|
||||
})
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface RcProfileTv {}
|
||||
|
||||
// -- RC profile parameter defining if a source handles the root menu.
|
||||
/**
|
||||
* Handles the root menu.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
public static final int RC_PROFILE_SOURCE_ROOT_MENU_HANDLED = 1;
|
||||
/**
|
||||
* Doesn't handle the root menu.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
public static final int RC_PROFILE_SOURCE_ROOT_MENU_NOT_HANDLED = 0;
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
@IntDef(prefix = { "RC_PROFILE_SOURCE_ROOT_MENU_" }, value = {
|
||||
RC_PROFILE_SOURCE_ROOT_MENU_HANDLED,
|
||||
RC_PROFILE_SOURCE_ROOT_MENU_NOT_HANDLED
|
||||
})
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface RcProfileSourceHandlesRootMenu {}
|
||||
|
||||
// -- RC profile parameter defining if a source handles the setup menu.
|
||||
/**
|
||||
* Handles the setup menu.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
public static final int RC_PROFILE_SOURCE_SETUP_MENU_HANDLED = 1;
|
||||
/**
|
||||
* Doesn't handle the setup menu.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
public static final int RC_PROFILE_SOURCE_SETUP_MENU_NOT_HANDLED = 0;
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
@IntDef(prefix = { "RC_PROFILE_SOURCE_SETUP_MENU_" }, value = {
|
||||
RC_PROFILE_SOURCE_SETUP_MENU_HANDLED,
|
||||
RC_PROFILE_SOURCE_SETUP_MENU_NOT_HANDLED
|
||||
})
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface RcProfileSourceHandlesSetupMenu {}
|
||||
|
||||
|
||||
// -- RC profile parameter defining if a source handles the contents menu.
|
||||
/**
|
||||
* Handles the contents menu.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
public static final int RC_PROFILE_SOURCE_CONTENTS_MENU_HANDLED = 1;
|
||||
/**
|
||||
* Doesn't handle the contents menu.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
public static final int RC_PROFILE_SOURCE_CONTENTS_MENU_NOT_HANDLED = 0;
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
@IntDef(prefix = { "RC_PROFILE_SOURCE_CONTENTS_MENU_" }, value = {
|
||||
RC_PROFILE_SOURCE_CONTENTS_MENU_HANDLED,
|
||||
RC_PROFILE_SOURCE_CONTENTS_MENU_NOT_HANDLED
|
||||
})
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface RcProfileSourceHandlesContentsMenu {}
|
||||
|
||||
|
||||
// -- RC profile parameter defining if a source handles the top menu.
|
||||
/**
|
||||
* Handles the top menu.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
public static final int RC_PROFILE_SOURCE_TOP_MENU_HANDLED = 1;
|
||||
/**
|
||||
* Doesn't handle the top menu.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
public static final int RC_PROFILE_SOURCE_TOP_MENU_NOT_HANDLED = 0;
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
@IntDef(prefix = { "RC_PROFILE_SOURCE_TOP_MENU_" }, value = {
|
||||
RC_PROFILE_SOURCE_TOP_MENU_HANDLED,
|
||||
RC_PROFILE_SOURCE_TOP_MENU_NOT_HANDLED
|
||||
})
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface RcProfileSourceHandlesTopMenu {}
|
||||
|
||||
|
||||
// -- RC profile parameter defining if a source handles the media context sensitive menu.
|
||||
/**
|
||||
* Handles the media context sensitive menu.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
public static final int RC_PROFILE_SOURCE_MEDIA_CONTEXT_SENSITIVE_MENU_HANDLED = 1;
|
||||
/**
|
||||
* Doesn't handle the media context sensitive menu.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
public static final int RC_PROFILE_SOURCE_MEDIA_CONTEXT_SENSITIVE_MENU_NOT_HANDLED = 0;
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
@IntDef(prefix = { "RC_PROFILE_SOURCE_MEDIA_CONTEXT_SENSITIVE_" }, value = {
|
||||
RC_PROFILE_SOURCE_MEDIA_CONTEXT_SENSITIVE_MENU_HANDLED,
|
||||
RC_PROFILE_SOURCE_MEDIA_CONTEXT_SENSITIVE_MENU_NOT_HANDLED
|
||||
})
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface RcProfileSourceHandlesMediaContextSensitiveMenu {}
|
||||
|
||||
// -- Settings available in the CEC Configuration.
|
||||
/**
|
||||
* Name of a setting deciding whether the CEC is enabled.
|
||||
@@ -584,6 +746,54 @@ public final class HdmiControlManager {
|
||||
*/
|
||||
public static final String CEC_SETTING_NAME_TV_WAKE_ON_ONE_TOUCH_PLAY =
|
||||
"tv_wake_on_one_touch_play";
|
||||
/**
|
||||
* Name of a setting representing the RC profile of a TV panel.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
public static final String CEC_SETTING_NAME_RC_PROFILE_TV =
|
||||
"rc_profile_tv";
|
||||
/**
|
||||
* Name of a setting representing the RC profile parameter defining if a source handles the root
|
||||
* menu.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
public static final String CEC_SETTING_NAME_RC_PROFILE_SOURCE_HANDLES_ROOT_MENU =
|
||||
"rc_profile_source_handles_root_menu";
|
||||
/**
|
||||
* Name of a setting representing the RC profile parameter defining if a source handles the
|
||||
* setup menu.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
public static final String CEC_SETTING_NAME_RC_PROFILE_SOURCE_HANDLES_SETUP_MENU =
|
||||
"rc_profile_source_handles_setup_menu";
|
||||
/**
|
||||
* Name of a setting representing the RC profile parameter defining if a source handles the
|
||||
* contents menu.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
public static final String CEC_SETTING_NAME_RC_PROFILE_SOURCE_HANDLES_CONTENTS_MENU =
|
||||
"rc_profile_source_handles_contents_menu";
|
||||
/**
|
||||
* Name of a setting representing the RC profile parameter defining if a source handles the top
|
||||
* menu.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
public static final String CEC_SETTING_NAME_RC_PROFILE_SOURCE_HANDLES_TOP_MENU =
|
||||
"rc_profile_source_handles_top_menu";
|
||||
/**
|
||||
* Name of a setting representing the RC profile parameter defining if a source handles the
|
||||
* media context sensitive menu.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
public static final String
|
||||
CEC_SETTING_NAME_RC_PROFILE_SOURCE_HANDLES_MEDIA_CONTEXT_SENSITIVE_MENU =
|
||||
"rc_profile_source_handles_media_context_sensitive_menu";
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
@@ -595,6 +805,12 @@ public final class HdmiControlManager {
|
||||
CEC_SETTING_NAME_SYSTEM_AUDIO_MODE_MUTING,
|
||||
CEC_SETTING_NAME_VOLUME_CONTROL_MODE,
|
||||
CEC_SETTING_NAME_TV_WAKE_ON_ONE_TOUCH_PLAY,
|
||||
CEC_SETTING_NAME_RC_PROFILE_TV,
|
||||
CEC_SETTING_NAME_RC_PROFILE_SOURCE_HANDLES_ROOT_MENU,
|
||||
CEC_SETTING_NAME_RC_PROFILE_SOURCE_HANDLES_SETUP_MENU,
|
||||
CEC_SETTING_NAME_RC_PROFILE_SOURCE_HANDLES_CONTENTS_MENU,
|
||||
CEC_SETTING_NAME_RC_PROFILE_SOURCE_HANDLES_TOP_MENU,
|
||||
CEC_SETTING_NAME_RC_PROFILE_SOURCE_HANDLES_MEDIA_CONTEXT_SENSITIVE_MENU
|
||||
})
|
||||
public @interface CecSettingName {}
|
||||
|
||||
|
||||
@@ -303,6 +303,19 @@ public class HdmiCecConfig {
|
||||
return STORAGE_SHARED_PREFS;
|
||||
case HdmiControlManager.CEC_SETTING_NAME_TV_WAKE_ON_ONE_TOUCH_PLAY:
|
||||
return STORAGE_GLOBAL_SETTINGS;
|
||||
case HdmiControlManager.CEC_SETTING_NAME_RC_PROFILE_TV:
|
||||
return STORAGE_SHARED_PREFS;
|
||||
case HdmiControlManager.CEC_SETTING_NAME_RC_PROFILE_SOURCE_HANDLES_ROOT_MENU:
|
||||
return STORAGE_SHARED_PREFS;
|
||||
case HdmiControlManager.CEC_SETTING_NAME_RC_PROFILE_SOURCE_HANDLES_SETUP_MENU:
|
||||
return STORAGE_SHARED_PREFS;
|
||||
case HdmiControlManager.CEC_SETTING_NAME_RC_PROFILE_SOURCE_HANDLES_CONTENTS_MENU:
|
||||
return STORAGE_SHARED_PREFS;
|
||||
case HdmiControlManager.CEC_SETTING_NAME_RC_PROFILE_SOURCE_HANDLES_TOP_MENU:
|
||||
return STORAGE_SHARED_PREFS;
|
||||
case HdmiControlManager
|
||||
.CEC_SETTING_NAME_RC_PROFILE_SOURCE_HANDLES_MEDIA_CONTEXT_SENSITIVE_MENU:
|
||||
return STORAGE_SHARED_PREFS;
|
||||
default:
|
||||
throw new RuntimeException("Invalid CEC setting '" + setting.getName()
|
||||
+ "' storage.");
|
||||
@@ -325,6 +338,19 @@ public class HdmiCecConfig {
|
||||
return setting.getName();
|
||||
case HdmiControlManager.CEC_SETTING_NAME_TV_WAKE_ON_ONE_TOUCH_PLAY:
|
||||
return Global.HDMI_CONTROL_AUTO_WAKEUP_ENABLED;
|
||||
case HdmiControlManager.CEC_SETTING_NAME_RC_PROFILE_TV:
|
||||
return setting.getName();
|
||||
case HdmiControlManager.CEC_SETTING_NAME_RC_PROFILE_SOURCE_HANDLES_ROOT_MENU:
|
||||
return setting.getName();
|
||||
case HdmiControlManager.CEC_SETTING_NAME_RC_PROFILE_SOURCE_HANDLES_SETUP_MENU:
|
||||
return setting.getName();
|
||||
case HdmiControlManager.CEC_SETTING_NAME_RC_PROFILE_SOURCE_HANDLES_CONTENTS_MENU:
|
||||
return setting.getName();
|
||||
case HdmiControlManager.CEC_SETTING_NAME_RC_PROFILE_SOURCE_HANDLES_TOP_MENU:
|
||||
return setting.getName();
|
||||
case HdmiControlManager
|
||||
.CEC_SETTING_NAME_RC_PROFILE_SOURCE_HANDLES_MEDIA_CONTEXT_SENSITIVE_MENU:
|
||||
return setting.getName();
|
||||
default:
|
||||
throw new RuntimeException("Invalid CEC setting '" + setting.getName()
|
||||
+ "' storage key.");
|
||||
|
||||
@@ -30,6 +30,7 @@ import com.android.server.hdmi.HdmiAnnotations.ServiceThreadOnly;
|
||||
|
||||
import com.google.android.collect.Lists;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -304,8 +305,34 @@ abstract class HdmiCecLocalDeviceSource extends HdmiCecLocalDevice {
|
||||
|
||||
@Override
|
||||
protected List<Integer> getRcFeatures() {
|
||||
return Lists.newArrayList(Constants.RC_PROFILE_SOURCE_HANDLES_ROOT_MENU,
|
||||
Constants.RC_PROFILE_SOURCE_HANDLES_SETUP_MENU);
|
||||
List<Integer> features = new ArrayList<>();
|
||||
HdmiCecConfig hdmiCecConfig = mService.getHdmiCecConfig();
|
||||
if (hdmiCecConfig.getIntValue(
|
||||
HdmiControlManager.CEC_SETTING_NAME_RC_PROFILE_SOURCE_HANDLES_ROOT_MENU)
|
||||
== HdmiControlManager.RC_PROFILE_SOURCE_ROOT_MENU_HANDLED) {
|
||||
features.add(Constants.RC_PROFILE_SOURCE_HANDLES_ROOT_MENU);
|
||||
}
|
||||
if (hdmiCecConfig.getIntValue(
|
||||
HdmiControlManager.CEC_SETTING_NAME_RC_PROFILE_SOURCE_HANDLES_SETUP_MENU)
|
||||
== HdmiControlManager.RC_PROFILE_SOURCE_SETUP_MENU_HANDLED) {
|
||||
features.add(Constants.RC_PROFILE_SOURCE_HANDLES_SETUP_MENU);
|
||||
}
|
||||
if (hdmiCecConfig.getIntValue(
|
||||
HdmiControlManager.CEC_SETTING_NAME_RC_PROFILE_SOURCE_HANDLES_CONTENTS_MENU)
|
||||
== HdmiControlManager.RC_PROFILE_SOURCE_CONTENTS_MENU_HANDLED) {
|
||||
features.add(Constants.RC_PROFILE_SOURCE_HANDLES_CONTENTS_MENU);
|
||||
}
|
||||
if (hdmiCecConfig.getIntValue(
|
||||
HdmiControlManager.CEC_SETTING_NAME_RC_PROFILE_SOURCE_HANDLES_TOP_MENU)
|
||||
== HdmiControlManager.RC_PROFILE_SOURCE_TOP_MENU_HANDLED) {
|
||||
features.add(Constants.RC_PROFILE_SOURCE_HANDLES_TOP_MENU);
|
||||
}
|
||||
if (hdmiCecConfig.getIntValue(HdmiControlManager
|
||||
.CEC_SETTING_NAME_RC_PROFILE_SOURCE_HANDLES_MEDIA_CONTEXT_SENSITIVE_MENU)
|
||||
== HdmiControlManager.RC_PROFILE_SOURCE_MEDIA_CONTEXT_SENSITIVE_MENU_HANDLED) {
|
||||
features.add(Constants.RC_PROFILE_SOURCE_HANDLES_MEDIA_CONTEXT_SENSITIVE_MENU);
|
||||
}
|
||||
return features;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -51,8 +51,6 @@ import com.android.server.hdmi.DeviceDiscoveryAction.DeviceDiscoveryCallback;
|
||||
import com.android.server.hdmi.HdmiAnnotations.ServiceThreadOnly;
|
||||
import com.android.server.hdmi.HdmiControlService.SendMessageCallback;
|
||||
|
||||
import com.google.android.collect.Lists;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
@@ -1486,7 +1484,11 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice {
|
||||
|
||||
@Override
|
||||
protected List<Integer> getRcFeatures() {
|
||||
return Lists.newArrayList(Constants.RC_PROFILE_TV_NONE);
|
||||
List<Integer> features = new ArrayList<>();
|
||||
@HdmiControlManager.RcProfileTv int profile = mService.getHdmiCecConfig().getIntValue(
|
||||
HdmiControlManager.CEC_SETTING_NAME_RC_PROFILE_TV);
|
||||
features.add(profile);
|
||||
return features;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -64,4 +64,61 @@
|
||||
</allowed-values>
|
||||
<default-value int-value="1" />
|
||||
</setting>
|
||||
<setting name="rc_profile_tv"
|
||||
value-type="int"
|
||||
user-configurable="false">
|
||||
<allowed-values>
|
||||
<value int-value="0x0" />
|
||||
<value int-value="0x2" />
|
||||
<value int-value="0x6" />
|
||||
<value int-value="0xA" />
|
||||
<value int-value="0xE" />
|
||||
</allowed-values>
|
||||
<default-value int-value="0x0" />
|
||||
</setting>
|
||||
<setting name="rc_profile_source_handles_root_menu"
|
||||
value-type="int"
|
||||
user-configurable="false">
|
||||
<allowed-values>
|
||||
<value int-value="0" />
|
||||
<value int-value="1" />
|
||||
</allowed-values>
|
||||
<default-value int-value="1" />
|
||||
</setting>
|
||||
<setting name="rc_profile_source_handles_setup_menu"
|
||||
value-type="int"
|
||||
user-configurable="false">
|
||||
<allowed-values>
|
||||
<value int-value="0" />
|
||||
<value int-value="1" />
|
||||
</allowed-values>
|
||||
<default-value int-value="1" />
|
||||
</setting>
|
||||
<setting name="rc_profile_source_handles_contents_menu"
|
||||
value-type="int"
|
||||
user-configurable="false">
|
||||
<allowed-values>
|
||||
<value int-value="0" />
|
||||
<value int-value="1" />
|
||||
</allowed-values>
|
||||
<default-value int-value="0" />
|
||||
</setting>
|
||||
<setting name="rc_profile_source_handles_top_menu"
|
||||
value-type="int"
|
||||
user-configurable="false">
|
||||
<allowed-values>
|
||||
<value int-value="0" />
|
||||
<value int-value="1" />
|
||||
</allowed-values>
|
||||
<default-value int-value="0" />
|
||||
</setting>
|
||||
<setting name="rc_profile_source_handles_media_context_sensitive_menu"
|
||||
value-type="int"
|
||||
user-configurable="false">
|
||||
<allowed-values>
|
||||
<value int-value="0" />
|
||||
<value int-value="1" />
|
||||
</allowed-values>
|
||||
<default-value int-value="0" />
|
||||
</setting>
|
||||
</cec-settings>
|
||||
|
||||
@@ -113,6 +113,63 @@ final class FakeHdmiCecConfig extends HdmiCecConfig {
|
||||
+ " </allowed-values>"
|
||||
+ " <default-value int-value=\"1\" />"
|
||||
+ " </setting>"
|
||||
+ " <setting name=\"rc_profile_tv\""
|
||||
+ " value-type=\"int\""
|
||||
+ " user-configurable=\"false\">"
|
||||
+ " <allowed-values>"
|
||||
+ " <value int-value=\"0x0\" />"
|
||||
+ " <value int-value=\"0x2\" />"
|
||||
+ " <value int-value=\"0x6\" />"
|
||||
+ " <value int-value=\"0xA\" />"
|
||||
+ " <value int-value=\"0xE\" />"
|
||||
+ " </allowed-values>"
|
||||
+ " <default-value int-value=\"0x0\" />"
|
||||
+ " </setting>"
|
||||
+ " <setting name=\"rc_profile_source_handles_root_menu\""
|
||||
+ " value-type=\"int\""
|
||||
+ " user-configurable=\"false\">"
|
||||
+ " <allowed-values>"
|
||||
+ " <value int-value=\"0\" />"
|
||||
+ " <value int-value=\"1\" />"
|
||||
+ " </allowed-values>"
|
||||
+ " <default-value int-value=\"1\" />"
|
||||
+ " </setting>"
|
||||
+ " <setting name=\"rc_profile_source_handles_setup_menu\""
|
||||
+ " value-type=\"int\""
|
||||
+ " user-configurable=\"false\">"
|
||||
+ " <allowed-values>"
|
||||
+ " <value int-value=\"0\" />"
|
||||
+ " <value int-value=\"1\" />"
|
||||
+ " </allowed-values>"
|
||||
+ " <default-value int-value=\"1\" />"
|
||||
+ " </setting>"
|
||||
+ " <setting name=\"rc_profile_source_handles_contents_menu\""
|
||||
+ " value-type=\"int\""
|
||||
+ " user-configurable=\"false\">"
|
||||
+ " <allowed-values>"
|
||||
+ " <value int-value=\"0\" />"
|
||||
+ " <value int-value=\"1\" />"
|
||||
+ " </allowed-values>"
|
||||
+ " <default-value int-value=\"0\" />"
|
||||
+ " </setting>"
|
||||
+ " <setting name=\"rc_profile_source_handles_top_menu\""
|
||||
+ " value-type=\"int\""
|
||||
+ " user-configurable=\"false\">"
|
||||
+ " <allowed-values>"
|
||||
+ " <value int-value=\"0\" />"
|
||||
+ " <value int-value=\"1\" />"
|
||||
+ " </allowed-values>"
|
||||
+ " <default-value int-value=\"0\" />"
|
||||
+ " </setting>"
|
||||
+ " <setting name=\"rc_profile_source_handles_media_context_sensitive_menu\""
|
||||
+ " value-type=\"int\""
|
||||
+ " user-configurable=\"false\">"
|
||||
+ " <allowed-values>"
|
||||
+ " <value int-value=\"0\" />"
|
||||
+ " <value int-value=\"1\" />"
|
||||
+ " </allowed-values>"
|
||||
+ " <default-value int-value=\"0\" />"
|
||||
+ " </setting>"
|
||||
+ "</cec-settings>";
|
||||
|
||||
FakeHdmiCecConfig(@NonNull Context context) {
|
||||
|
||||
@@ -1371,4 +1371,15 @@ public class HdmiCecLocalDevicePlaybackTest {
|
||||
HdmiControlManager.POWER_CONTROL_MODE_TV);
|
||||
assertThat(mHdmiControlService.shouldHandleTvPowerKey()).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getRcFeatures() {
|
||||
ArrayList<Integer> features = new ArrayList<>(mHdmiCecLocalDevicePlayback.getRcFeatures());
|
||||
assertThat(features.contains(Constants.RC_PROFILE_SOURCE_HANDLES_ROOT_MENU)).isTrue();
|
||||
assertThat(features.contains(Constants.RC_PROFILE_SOURCE_HANDLES_SETUP_MENU)).isTrue();
|
||||
assertThat(features.contains(Constants.RC_PROFILE_SOURCE_HANDLES_CONTENTS_MENU)).isFalse();
|
||||
assertThat(features.contains(Constants.RC_PROFILE_SOURCE_HANDLES_TOP_MENU)).isFalse();
|
||||
assertThat(features.contains(
|
||||
Constants.RC_PROFILE_SOURCE_HANDLES_MEDIA_CONTEXT_SENSITIVE_MENU)).isFalse();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -267,4 +267,14 @@ public class HdmiCecLocalDeviceTvTest {
|
||||
mTestLooper.dispatchAll();
|
||||
assertThat(mWokenUp).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getRcFeatures() {
|
||||
ArrayList<Integer> features = new ArrayList<>(mHdmiCecLocalDeviceTv.getRcFeatures());
|
||||
assertThat(features.contains(Constants.RC_PROFILE_TV_NONE)).isTrue();
|
||||
assertThat(features.contains(Constants.RC_PROFILE_TV_ONE)).isFalse();
|
||||
assertThat(features.contains(Constants.RC_PROFILE_TV_TWO)).isFalse();
|
||||
assertThat(features.contains(Constants.RC_PROFILE_TV_THREE)).isFalse();
|
||||
assertThat(features.contains(Constants.RC_PROFILE_TV_FOUR)).isFalse();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user