Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 59874f87 authored by Roy Chou's avatar Roy Chou
Browse files

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
parent 40e35dfa
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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>

+1 −0
Original line number Diff line number Diff line
@@ -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 -->
+11 −1
Original line number Diff line number Diff line
@@ -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);
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -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);
    }