Update the logic of isFeatureEnabled and isFeatureNotChickenedOut
If the flag value is unset or 0, isFeatureEnabled return false and isFeatureNotChickenedOut return true. If the flag value is -1 (force disable), both return false. If the flag value is other values, both query the package version and return `flagValue <= packageVersion` Now the only difference is a default behavior when the flag is not set or 0. So isFeatureEnabled and isFeatureNotChickenedOut can use the same flag. This CL also fixes the issue in rollback. Before this CL, isFeatureNotChickenedOut did not check the module version and could have a issue if there is a rollback. Test: NetworkStaticLibsTests Bug: 279108992 Change-Id: I12d6ebadff3aee7b7c614aca4eb0a34ef0db9857
This commit is contained in:
parent
d196fab898
commit
ed4e7ec954
1 changed files with 138 additions and 61 deletions
|
|
@ -254,7 +254,7 @@ public class BpfNetMaps {
|
|||
if (sInitialized) return;
|
||||
if (sEnableJavaBpfMap == null) {
|
||||
sEnableJavaBpfMap = SdkLevel.isAtLeastU() ||
|
||||
DeviceConfigUtils.isTetheringFeatureNotChickenedOut(
|
||||
DeviceConfigUtils.isTetheringFeatureNotChickenedOut(context,
|
||||
BPF_NET_MAPS_FORCE_DISABLE_JAVA_BPF_MAP);
|
||||
}
|
||||
Log.d(TAG, "BpfNetMaps is initialized with sEnableJavaBpfMap=" + sEnableJavaBpfMap);
|
||||
|
|
|
|||
Loading…
Reference in a new issue