Send context object to FeatureFlagUtils.

Bug: 36222960
Test: robotests
Change-Id: I9ca2d8c679474e545988f518eaf32acf459abd2c
This commit is contained in:
Fan Zhang
2017-11-13 17:37:53 -08:00
parent 4f74ed2d07
commit 06b0d5b564
19 changed files with 61 additions and 63 deletions

View File

@@ -16,6 +16,7 @@
package android.util;
import android.content.Context;
import android.os.SystemProperties;
import android.text.TextUtils;
@@ -35,7 +36,7 @@ public class FeatureFlagUtils {
* @param feature the flag name
* @return true if the flag is enabled (either by default in system, or override by user)
*/
public static boolean isEnabled(String feature) {
public static boolean isEnabled(Context context, String feature) {
// Tries to get feature flag from system property.
// Step 1: check if feature flag has any override. Flag name: sys.fflag.override.<feature>
String value = SystemProperties.get(FFLAG_OVERRIDE_PREFIX + feature);
@@ -54,7 +55,6 @@ public class FeatureFlagUtils {
SystemProperties.set(FFLAG_OVERRIDE_PREFIX + feature, enabled ? "true" : "false");
}
public static Map<String, String> getAllFeatureFlags() {
final Map<String, String> features = new HashMap<>();
features.put(FFLAG_PREFIX + "abc", "false");