aboutsummaryrefslogtreecommitdiff
path: root/common/src/com/android/tv/common/feature/PropertyFeature.java
diff options
context:
space:
mode:
Diffstat (limited to 'common/src/com/android/tv/common/feature/PropertyFeature.java')
-rw-r--r--common/src/com/android/tv/common/feature/PropertyFeature.java17
1 files changed, 12 insertions, 5 deletions
diff --git a/common/src/com/android/tv/common/feature/PropertyFeature.java b/common/src/com/android/tv/common/feature/PropertyFeature.java
index fdcffa04..0cf36317 100644
--- a/common/src/com/android/tv/common/feature/PropertyFeature.java
+++ b/common/src/com/android/tv/common/feature/PropertyFeature.java
@@ -17,7 +17,6 @@
package com.android.tv.common.feature;
import android.content.Context;
-
import com.android.tv.common.BooleanSystemProperty;
/**
@@ -26,21 +25,29 @@ import com.android.tv.common.BooleanSystemProperty;
* <p>See {@link BooleanSystemProperty} for instructions on how to set using adb.
*/
public final class PropertyFeature implements Feature {
+
+ public static PropertyFeature create(String key, boolean defaultValue) {
+ return new PropertyFeature(key, defaultValue);
+ }
+
private final BooleanSystemProperty mProperty;
/**
* Create System Property backed feature.
*
- * @param key the system property key. Length must be <= 31 characters.
+ * @param key the system property key. Length must be <= 31 characters.
* @param defaultValue the value to return if the property is undefined or empty.
*/
- public PropertyFeature(String key, boolean defaultValue) {
+ private PropertyFeature(String key, boolean defaultValue) {
if (key.length() > 31) {
// Since Features are initialized at startup and the keys are static go ahead and kill
// the application.
throw new IllegalArgumentException(
- "Property keys have a max length of 31 characters but '" + key + "' is " + key
- .length() + " characters.");
+ "Property keys have a max length of 31 characters but '"
+ + key
+ + "' is "
+ + key.length()
+ + " characters.");
}
mProperty = new BooleanSystemProperty(key, defaultValue);
}