am 40277df7
: Merge "Add "television" mode." into honeycomb-mr2
* commit '40277df7c33c0fc381eec589c768fe86de4b4404': Add "television" mode.
This commit is contained in:
@ -64149,6 +64149,17 @@
|
||||
visibility="public"
|
||||
>
|
||||
</field>
|
||||
<field name="UI_MODE_TYPE_TELEVISION"
|
||||
type="int"
|
||||
transient="false"
|
||||
volatile="false"
|
||||
value="4"
|
||||
static="true"
|
||||
final="true"
|
||||
deprecated="not deprecated"
|
||||
visibility="public"
|
||||
>
|
||||
</field>
|
||||
<field name="UI_MODE_TYPE_UNDEFINED"
|
||||
type="int"
|
||||
transient="false"
|
||||
|
@ -167,7 +167,8 @@ public class UiModeManager {
|
||||
* Return the current running mode type. May be one of
|
||||
* {@link Configuration#UI_MODE_TYPE_NORMAL Configuration.UI_MODE_TYPE_NORMAL},
|
||||
* {@link Configuration#UI_MODE_TYPE_DESK Configuration.UI_MODE_TYPE_DESK}, or
|
||||
* {@link Configuration#UI_MODE_TYPE_CAR Configuration.UI_MODE_TYPE_CAR},
|
||||
* {@link Configuration#UI_MODE_TYPE_CAR Configuration.UI_MODE_TYPE_CAR}, or
|
||||
* {@link Configuration#UI_MODE_TYPE_TELEVISION Configuration.UI_MODE_TYPE_TV}.
|
||||
*/
|
||||
public int getCurrentModeType() {
|
||||
if (mService != null) {
|
||||
|
@ -226,6 +226,7 @@ public final class Configuration implements Parcelable, Comparable<Configuration
|
||||
public static final int UI_MODE_TYPE_NORMAL = 0x01;
|
||||
public static final int UI_MODE_TYPE_DESK = 0x02;
|
||||
public static final int UI_MODE_TYPE_CAR = 0x03;
|
||||
public static final int UI_MODE_TYPE_TELEVISION = 0x04;
|
||||
|
||||
public static final int UI_MODE_NIGHT_MASK = 0x30;
|
||||
public static final int UI_MODE_NIGHT_UNDEFINED = 0x00;
|
||||
@ -367,6 +368,7 @@ public final class Configuration implements Parcelable, Comparable<Configuration
|
||||
case UI_MODE_TYPE_NORMAL: /* normal is not interesting to print */ break;
|
||||
case UI_MODE_TYPE_DESK: sb.append(" desk"); break;
|
||||
case UI_MODE_TYPE_CAR: sb.append(" car"); break;
|
||||
case UI_MODE_TYPE_TELEVISION: sb.append(" television"); break;
|
||||
default: sb.append(" uimode="); sb.append(uiMode&UI_MODE_TYPE_MASK); break;
|
||||
}
|
||||
switch ((uiMode&UI_MODE_NIGHT_MASK)) {
|
||||
|
@ -953,6 +953,7 @@ struct ResTable_config
|
||||
UI_MODE_TYPE_NORMAL = ACONFIGURATION_UI_MODE_TYPE_NORMAL,
|
||||
UI_MODE_TYPE_DESK = ACONFIGURATION_UI_MODE_TYPE_DESK,
|
||||
UI_MODE_TYPE_CAR = ACONFIGURATION_UI_MODE_TYPE_CAR,
|
||||
UI_MODE_TYPE_TELEVISION = ACONFIGURATION_UI_MODE_TYPE_TELEVISION,
|
||||
|
||||
// uiMode bits for the night switch.
|
||||
MASK_UI_MODE_NIGHT = 0x30,
|
||||
|
@ -77,6 +77,7 @@ enum {
|
||||
ACONFIGURATION_UI_MODE_TYPE_NORMAL = 0x01,
|
||||
ACONFIGURATION_UI_MODE_TYPE_DESK = 0x02,
|
||||
ACONFIGURATION_UI_MODE_TYPE_CAR = 0x03,
|
||||
ACONFIGURATION_UI_MODE_TYPE_TELEVISION = 0x04,
|
||||
|
||||
ACONFIGURATION_UI_MODE_NIGHT_ANY = 0x00,
|
||||
ACONFIGURATION_UI_MODE_NIGHT_NO = 0x1,
|
||||
|
@ -913,6 +913,11 @@ bool AaptGroupEntry::getUiModeTypeName(const char* name,
|
||||
(out->uiMode&~ResTable_config::MASK_UI_MODE_TYPE)
|
||||
| ResTable_config::UI_MODE_TYPE_CAR;
|
||||
return true;
|
||||
} else if (strcmp(name, "television") == 0) {
|
||||
if (out) out->uiMode =
|
||||
(out->uiMode&~ResTable_config::MASK_UI_MODE_TYPE)
|
||||
| ResTable_config::UI_MODE_TYPE_TELEVISION;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user