OSDN Git Service

TIF: exclude tuner TV input not having a setup activity in the input list.
authorDongwon Kang <dwkang@google.com>
Thu, 23 Oct 2014 08:56:31 +0000 (17:56 +0900)
committerDongwon Kang <dwkang@google.com>
Fri, 24 Oct 2014 01:23:13 +0000 (10:23 +0900)
By doing this, developers can notice the flaw of the input in advance.

Bug: 17647146
Change-Id: I123a5538566959320a6201a4d7952e205602a28a

media/java/android/media/tv/TvInputInfo.java

index 54ebc6a..b9e99d2 100644 (file)
@@ -241,6 +241,9 @@ public final class TvInputInfo implements Parcelable {
             if (DEBUG) {
                 Log.d(TAG, "Setup activity loaded. [" + input.mSetupActivity + "] for " + si.name);
             }
+            if (inputType == TYPE_TUNER && TextUtils.isEmpty(input.mSetupActivity)) {
+                throw new XmlPullParserException("Setup activity not found in " + si.name);
+            }
             input.mSettingsActivity = sa.getString(
                     com.android.internal.R.styleable.TvInputService_settingsActivity);
             if (DEBUG) {