aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authornchalko <nchalko@google.com>2019-01-29 16:22:34 -0800
committerNick Chalko <nchalko@google.com>2019-02-12 22:17:51 -0800
commitb7c88fac555da0fbbfc5f7faec5e9daa3955b117 (patch)
tree68e6b5db2e2fd06482653f2e2701b5dff8aefba3 /common
parent56218905e8241821db2429418776ff6f052eeaa9 (diff)
downloadTV-b7c88fac555da0fbbfc5f7faec5e9daa3955b117.tar.gz
Create AOSP_FEATURE
Cloud EPG is not supported in AOSP PiperOrigin-RevId: 231495284 Change-Id: I7e14f84b0c1efb2d047b67f718c9c21772d2db21
Diffstat (limited to 'common')
-rw-r--r--common/src/com/android/tv/common/feature/BuildTypeFeature.java (renamed from common/src/com/android/tv/common/feature/EngOnlyFeature.java)15
-rw-r--r--common/src/com/android/tv/common/feature/CommonFeatures.java2
2 files changed, 11 insertions, 6 deletions
diff --git a/common/src/com/android/tv/common/feature/EngOnlyFeature.java b/common/src/com/android/tv/common/feature/BuildTypeFeature.java
index 5feb5481..9e1704e8 100644
--- a/common/src/com/android/tv/common/feature/EngOnlyFeature.java
+++ b/common/src/com/android/tv/common/feature/BuildTypeFeature.java
@@ -20,18 +20,23 @@ import android.content.Context;
import com.android.tv.common.BuildConfig;
/** A feature that is only available on {@link BuildConfig#ENG} builds. */
-public final class EngOnlyFeature implements Feature {
- public static final Feature ENG_ONLY_FEATURE = new EngOnlyFeature();
+public final class BuildTypeFeature implements Feature {
+ public static final Feature ENG_ONLY_FEATURE = new BuildTypeFeature(BuildConfig.ENG);
+ public static final Feature ASOP_FEATURE = new BuildTypeFeature(BuildConfig.AOSP);
- private EngOnlyFeature() {}
+ private final boolean mIsBuildType;
+
+ private BuildTypeFeature(boolean isBuildType) {
+ mIsBuildType = isBuildType;
+ }
@Override
public boolean isEnabled(Context context) {
- return BuildConfig.ENG;
+ return mIsBuildType;
}
@Override
public String toString() {
- return "EngOnlyFeature(" + BuildConfig.ENG + ")";
+ return getClass().getSimpleName() + "(" + mIsBuildType + ")";
}
}
diff --git a/common/src/com/android/tv/common/feature/CommonFeatures.java b/common/src/com/android/tv/common/feature/CommonFeatures.java
index 62986f37..bccb9e14 100644
--- a/common/src/com/android/tv/common/feature/CommonFeatures.java
+++ b/common/src/com/android/tv/common/feature/CommonFeatures.java
@@ -16,7 +16,7 @@
package com.android.tv.common.feature;
-import static com.android.tv.common.feature.EngOnlyFeature.ENG_ONLY_FEATURE;
+import static com.android.tv.common.feature.BuildTypeFeature.ENG_ONLY_FEATURE;
import static com.android.tv.common.feature.FeatureUtils.and;
import static com.android.tv.common.feature.FeatureUtils.or;
import static com.android.tv.common.feature.TestableFeature.createTestableFeature;