chore(#AlwaysOnMagnification): hardcode the feature flag default true

Set the feature flag default to be true to rollout to public, also keep
the feature flag file existing so that it's still remote controllable.

Bug: 281788002
Test: manually test with adb command
Change-Id: I71210e2d82b2c67be078cf4532b3434c084404af
This commit is contained in:
Roy Chou
2023-05-12 03:26:26 +00:00
parent 40e35dfad3
commit 59874f8789
4 changed files with 17 additions and 2 deletions

View File

@@ -3711,6 +3711,10 @@
magnification settings and adjust the default magnification capability. -->
<bool name="config_magnification_area">true</bool>
<!-- The default value for always on magnification feature flag if the remote feature
flag does not exist -->
<bool name="config_magnification_always_on_enabled">true</bool>
<!-- If true, the display will be shifted around in ambient mode. -->
<bool name="config_enableBurnInProtection">false</bool>

View File

@@ -4528,6 +4528,7 @@
<java-symbol type="string" name="dismiss_action" />
<java-symbol type="bool" name="config_magnification_area" />
<java-symbol type="bool" name="config_magnification_always_on_enabled" />
<java-symbol type="bool" name="config_trackerAppNeedsPermissions"/>
<!-- FullScreenMagnification thumbnail -->

View File

@@ -16,6 +16,8 @@
package com.android.server.accessibility.magnification;
import android.annotation.NonNull;
import android.content.Context;
import android.provider.DeviceConfig;
/**
@@ -29,6 +31,13 @@ public class AlwaysOnMagnificationFeatureFlag extends MagnificationFeatureFlagBa
private static final String FEATURE_NAME_ENABLE_ALWAYS_ON_MAGNIFICATION =
"AlwaysOnMagnifier__enable_always_on_magnifier";
private @NonNull Context mContext;
AlwaysOnMagnificationFeatureFlag(@NonNull Context context) {
super();
mContext = context;
}
@Override
String getNamespace() {
return NAMESPACE;
@@ -41,6 +50,7 @@ public class AlwaysOnMagnificationFeatureFlag extends MagnificationFeatureFlagBa
@Override
boolean getDefaultValue() {
return false;
return mContext.getResources().getBoolean(
com.android.internal.R.bool.config_magnification_always_on_enabled);
}
}

View File

@@ -152,7 +152,7 @@ public class MagnificationController implements WindowMagnificationManager.Callb
mSupportWindowMagnification = context.getPackageManager().hasSystemFeature(
FEATURE_WINDOW_MAGNIFICATION);
mAlwaysOnMagnificationFeatureFlag = new AlwaysOnMagnificationFeatureFlag();
mAlwaysOnMagnificationFeatureFlag = new AlwaysOnMagnificationFeatureFlag(context);
mAlwaysOnMagnificationFeatureFlag.addOnChangedListener(
ConcurrentUtils.DIRECT_EXECUTOR, mAms::updateAlwaysOnMagnification);
}