Loading media/java/android/media/tv/interactive/TvIAppInfo.java +26 −1 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package android.media.tv.interactive; import android.annotation.NonNull; import android.annotation.StringDef; import android.content.ComponentName; import android.content.Context; import android.content.Intent; Loading @@ -35,6 +36,8 @@ import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; import java.io.IOException; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.util.ArrayList; import java.util.List; Loading @@ -46,6 +49,21 @@ public final class TvIAppInfo implements Parcelable { private static final boolean DEBUG = false; private static final String TAG = "TvIAppInfo"; @Retention(RetentionPolicy.SOURCE) @StringDef(prefix = { "INTERACTIVE_APP_TYPE_" }, value = { INTERACTIVE_APP_TYPE_HBBTV, INTERACTIVE_APP_TYPE_ATSC, INTERACTIVE_APP_TYPE_GINGA, }) @interface InteractiveAppType {} /** HbbTV interactive app type */ public static final String INTERACTIVE_APP_TYPE_HBBTV = "hbbtv"; /** ATSC interactive app type */ public static final String INTERACTIVE_APP_TYPE_ATSC = "atsc"; /** Ginga interactive app type */ public static final String INTERACTIVE_APP_TYPE_GINGA = "ginga"; private final ResolveInfo mService; private final String mId; private List<String> mTypes = new ArrayList<>(); Loading Loading @@ -106,6 +124,13 @@ public final class TvIAppInfo implements Parcelable { return mService.serviceInfo; } /** * Gets supported interactive app types */ public List<String> getSupportedTypes() { return new ArrayList<>(mTypes); } /** * A convenience builder for creating {@link TvIAppInfo} objects. */ Loading Loading @@ -186,7 +211,7 @@ public final class TvIAppInfo implements Parcelable { CharSequence[] types = sa.getTextArray( com.android.internal.R.styleable.TvIAppService_supportedTypes); for (CharSequence cs : types) { mTypes.add(cs.toString()); mTypes.add(cs.toString().toLowerCase()); } sa.recycle(); Loading media/java/android/media/tv/interactive/TvIAppView.java +4 −0 Original line number Diff line number Diff line Loading @@ -113,6 +113,10 @@ public class TvIAppView extends ViewGroup { this(context, null, 0); } public TvIAppView(@NonNull Context context, @Nullable AttributeSet attrs) { this(context, attrs, 0); } public TvIAppView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); int sourceResId = Resources.getAttributeSetSourceResId(attrs); Loading Loading
media/java/android/media/tv/interactive/TvIAppInfo.java +26 −1 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package android.media.tv.interactive; import android.annotation.NonNull; import android.annotation.StringDef; import android.content.ComponentName; import android.content.Context; import android.content.Intent; Loading @@ -35,6 +36,8 @@ import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; import java.io.IOException; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.util.ArrayList; import java.util.List; Loading @@ -46,6 +49,21 @@ public final class TvIAppInfo implements Parcelable { private static final boolean DEBUG = false; private static final String TAG = "TvIAppInfo"; @Retention(RetentionPolicy.SOURCE) @StringDef(prefix = { "INTERACTIVE_APP_TYPE_" }, value = { INTERACTIVE_APP_TYPE_HBBTV, INTERACTIVE_APP_TYPE_ATSC, INTERACTIVE_APP_TYPE_GINGA, }) @interface InteractiveAppType {} /** HbbTV interactive app type */ public static final String INTERACTIVE_APP_TYPE_HBBTV = "hbbtv"; /** ATSC interactive app type */ public static final String INTERACTIVE_APP_TYPE_ATSC = "atsc"; /** Ginga interactive app type */ public static final String INTERACTIVE_APP_TYPE_GINGA = "ginga"; private final ResolveInfo mService; private final String mId; private List<String> mTypes = new ArrayList<>(); Loading Loading @@ -106,6 +124,13 @@ public final class TvIAppInfo implements Parcelable { return mService.serviceInfo; } /** * Gets supported interactive app types */ public List<String> getSupportedTypes() { return new ArrayList<>(mTypes); } /** * A convenience builder for creating {@link TvIAppInfo} objects. */ Loading Loading @@ -186,7 +211,7 @@ public final class TvIAppInfo implements Parcelable { CharSequence[] types = sa.getTextArray( com.android.internal.R.styleable.TvIAppService_supportedTypes); for (CharSequence cs : types) { mTypes.add(cs.toString()); mTypes.add(cs.toString().toLowerCase()); } sa.recycle(); Loading
media/java/android/media/tv/interactive/TvIAppView.java +4 −0 Original line number Diff line number Diff line Loading @@ -113,6 +113,10 @@ public class TvIAppView extends ViewGroup { this(context, null, 0); } public TvIAppView(@NonNull Context context, @Nullable AttributeSet attrs) { this(context, attrs, 0); } public TvIAppView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); int sourceResId = Resources.getAttributeSetSourceResId(attrs); Loading