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

Commit 9cdd5d6e authored by Daniel Sheng's avatar Daniel Sheng Committed by Android (Google) Code Review
Browse files

Merge "Camera lift settings are now default-on."

parents 62dded44 dab739ac
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -61,7 +61,8 @@ public class CameraLiftTriggerPreferenceController extends GesturePreferenceCont
    @Override
    protected boolean isSwitchPrefEnabled() {
        final int triggerEnabled = Settings.Secure.getInt(mContext.getContentResolver(),
                Settings.Secure.CAMERA_LIFT_TRIGGER_ENABLED, 0);
                Settings.Secure.CAMERA_LIFT_TRIGGER_ENABLED,
                Settings.Secure.CAMERA_LIFT_TRIGGER_ENABLED_DEFAULT);
        return triggerEnabled == 1;
    }
}
+9 −0
Original line number Diff line number Diff line
@@ -74,6 +74,15 @@ public class CameraLiftTriggerPreferenceControllerTest {
        assertThat(mController.isAvailable()).isFalse();
    }

    @Test
    public void testSwitchEnabled_defaultConfig_shouldReturnTrue() {
        final Context context = RuntimeEnvironment.application;
        mController = new CameraLiftTriggerPreferenceController(context, null,
                KEY_CAMERA_LIFT_TRIGGER);

        assertThat(mController.isSwitchPrefEnabled()).isTrue();
    }

    @Test
    public void testSwitchEnabled_configIsNotSet_shouldReturnFalse() {
        // Set the setting to be enabled.