Merge "Enable to set canRecord and tunerCount statically" into nyc-dev

This commit is contained in:
Jae Seo
2016-02-24 17:53:46 +00:00
committed by Android (Google) Code Review
8 changed files with 33 additions and 22 deletions

View File

@@ -338,6 +338,7 @@ package android {
field public static final int calendarViewStyle = 16843613; // 0x101035d
field public static final int canControlMagnification = 16844040; // 0x1010508
field public static final int canPerformGestures = 16844046; // 0x101050e
field public static final int canRecord = 16844061; // 0x101051d
field public static final int canRequestEnhancedWebAccessibility = 16843736; // 0x10103d8
field public static final int canRequestFilterKeyEvents = 16843737; // 0x10103d9
field public static final int canRequestTouchExplorationMode = 16843735; // 0x10103d7
@@ -1359,6 +1360,7 @@ package android {
field public static final int trimPathEnd = 16843785; // 0x1010409
field public static final int trimPathOffset = 16843786; // 0x101040a
field public static final int trimPathStart = 16843784; // 0x1010408
field public static final int tunerCount = 16844062; // 0x101051e
field public static final int type = 16843169; // 0x10101a1
field public static final int typeface = 16842902; // 0x1010096
field public static final int uiOptions = 16843672; // 0x1010398

View File

@@ -433,6 +433,7 @@ package android {
field public static final int calendarViewStyle = 16843613; // 0x101035d
field public static final int canControlMagnification = 16844040; // 0x1010508
field public static final int canPerformGestures = 16844046; // 0x101050e
field public static final int canRecord = 16844061; // 0x101051d
field public static final int canRequestEnhancedWebAccessibility = 16843736; // 0x10103d8
field public static final int canRequestFilterKeyEvents = 16843737; // 0x10103d9
field public static final int canRequestTouchExplorationMode = 16843735; // 0x10103d7
@@ -1458,6 +1459,7 @@ package android {
field public static final int trimPathEnd = 16843785; // 0x1010409
field public static final int trimPathOffset = 16843786; // 0x101040a
field public static final int trimPathStart = 16843784; // 0x1010408
field public static final int tunerCount = 16844062; // 0x101051e
field public static final int type = 16843169; // 0x10101a1
field public static final int typeface = 16842902; // 0x1010096
field public static final int uiOptions = 16843672; // 0x1010398

View File

@@ -338,6 +338,7 @@ package android {
field public static final int calendarViewStyle = 16843613; // 0x101035d
field public static final int canControlMagnification = 16844040; // 0x1010508
field public static final int canPerformGestures = 16844046; // 0x101050e
field public static final int canRecord = 16844061; // 0x101051d
field public static final int canRequestEnhancedWebAccessibility = 16843736; // 0x10103d8
field public static final int canRequestFilterKeyEvents = 16843737; // 0x10103d9
field public static final int canRequestTouchExplorationMode = 16843735; // 0x10103d7
@@ -1359,6 +1360,7 @@ package android {
field public static final int trimPathEnd = 16843785; // 0x1010409
field public static final int trimPathOffset = 16843786; // 0x101040a
field public static final int trimPathStart = 16843784; // 0x1010408
field public static final int tunerCount = 16844062; // 0x101051e
field public static final int type = 16843169; // 0x10101a1
field public static final int typeface = 16842902; // 0x1010096
field public static final int uiOptions = 16843672; // 0x1010398

View File

@@ -8048,12 +8048,19 @@ i
{@link android.media.tv.TvInputService#SERVICE_META_DATA} meta-data entry.
Described here are the attributes that can be included in that tag. -->
<declare-styleable name="TvInputService">
<!-- Component name of an activity for setup of this service.
The setup includes scanning channels and registering EPG data. -->
<!-- Component name of an activity that allows the user to set up this service. -->
<attr name="setupActivity" format="string" />
<!-- Component name of an activity that allows the user to modify
the settings for this service. -->
<!-- Component name of an activity that allows the user to modify the settings for this
service. -->
<attr name="settingsActivity" />
<!-- Attribute whether the TV input service can record programs. This value can be changed
at runtime by calling
{@link android.media.tv.TvInputService#updateTvInputInfo(android.content.Context, android.media.tv.TvInputInfo)}. -->
<attr name="canRecord" format="boolean" />
<!-- The number of tuners that the TV input service is associated with. This value can be
changed at runtime by calling
{@link android.media.tv.TvInputService#updateTvInputInfo(android.content.Context, android.media.tv.TvInputInfo)}. -->
<attr name="tunerCount" format="integer" />
</declare-styleable>
<!-- Attributes that can be used with <code>rating-system-definition</code> tags inside of the

View File

@@ -2703,6 +2703,8 @@
<public type="attr" name="version" />
<public type="attr" name="backupInForeground" />
<public type="attr" name="countDown" />
<public type="attr" name="canRecord" />
<public type="attr" name="tunerCount" />
<public type="style" name="Theme.Material.Light.DialogWhenLarge.DarkActionBar" />
<public type="style" name="Widget.Material.SeekBar.Discrete" />

View File

@@ -113,14 +113,14 @@ public final class TvInputInfo implements Parcelable {
private final String mId;
private final String mParentId;
private final int mType;
private final int mTunerCount;
private final boolean mCanRecord;
private final boolean mIsHardwareInput;
private final Bundle mExtras;
// Attributes from XML meta data.
private String mSetupActivity;
private String mSettingsActivity;
private boolean mCanRecord;
private int mTunerCount;
private HdmiDeviceInfo mHdmiDeviceInfo;
private int mLabelResId;
@@ -250,21 +250,17 @@ public final class TvInputInfo implements Parcelable {
* {@code false} otherwise.
* @param isConnectedToHdmiSwitch Whether a CEC device for this TV input is connected to an HDMI
* switch, i.e., the device isn't directly connected to a HDMI port.
* @param tunerCount The number of tuners this TV input has.
* @param canRecord Whether this TV input can record TV programs.
*/
private TvInputInfo(ResolveInfo service, String id, String parentId, int type,
boolean isHardwareInput, boolean isConnectedToHdmiSwitch, int tunerCount,
boolean canRecord, Bundle extras) {
boolean isHardwareInput, boolean isConnectedToHdmiSwitch, Bundle extras) {
mService = service;
mId = id;
mParentId = parentId;
mType = type;
mIsHardwareInput = isHardwareInput;
mIsConnectedToHdmiSwitch = isConnectedToHdmiSwitch;
mTunerCount = tunerCount;
mCanRecord = canRecord;
mExtras = extras;
mTunerCount = type == TYPE_TUNER ? 1 : 0;
}
/**
@@ -791,19 +787,17 @@ public final class TvInputInfo implements Parcelable {
type = TYPE_HDMI;
isHardwareInput = true;
isConnectedToHdmiSwitch = (mHdmiDeviceInfo.getPhysicalAddress() & 0x0FFF) != 0;
mTunerCount = 0;
} else if (mTvInputHardwareInfo != null) {
id = generateInputId(componentName, mTvInputHardwareInfo);
type = sHardwareTypeToTvInputType.get(mTvInputHardwareInfo.getType(), TYPE_TUNER);
isHardwareInput = true;
mTunerCount = 0;
} else {
id = generateInputId(componentName);
type = TYPE_TUNER;
}
TvInputInfo info = new TvInputInfo(mResolveInfo, id, mParentId, type, isHardwareInput,
isConnectedToHdmiSwitch, mTunerCount, mCanRecord, mExtras);
isConnectedToHdmiSwitch, mExtras);
return parseServiceMetadata(type, info);
}
@@ -868,6 +862,12 @@ public final class TvInputInfo implements Parcelable {
Log.d(TAG, "Settings activity loaded. [" + info.mSettingsActivity + "] for "
+ si.name);
}
info.mCanRecord = sa.getBoolean(
com.android.internal.R.styleable.TvInputService_canRecord, false);
info.mTunerCount = sa.getInt(
com.android.internal.R.styleable.TvInputService_tunerCount,
info.mTunerCount);
sa.recycle();
} catch (NameNotFoundException e) {
throw new XmlPullParserException("Unable to create context for: " + si.packageName);

View File

@@ -731,9 +731,7 @@ public final class TvInputManager {
*
* <p>Because the system automatically creates a <code>TvInputInfo</code> object for each TV
* input based on the information collected from the <code>AndroidManifest.xml</code>, this
* method is only called back when such information has changed dynamically or when the TV
* input service implementation wants to pass additional information that is not specified
* by the manifest file, such as ability to record and tuner count.
* method is only called back when such information has changed dynamically.
*
* @param inputInfo The <code>TvInputInfo</code> object that contains new information.
*/

View File

@@ -262,10 +262,8 @@ public abstract class TvInputService extends Service {
*
* <p>The system automatically creates a <code>TvInputInfo</code> object for each TV input,
* based on the information collected from the <code>AndroidManifest.xml</code>, thus it is not
* necessary to call this method unless such information has changed dynamically. This may be
* also used to pass additional information that is not specified by the manifest file, such as
* ability to record and tuner count. Use {@link TvInputInfo.Builder} to build a new
* <code>TvInputInfo</code> object.
* necessary to call this method unless such information has changed dynamically.
* Use {@link TvInputInfo.Builder} to build a new <code>TvInputInfo</code> object.
*
* <p>Attempting to change information about a TV input that the calling package does not own
* does nothing.