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

Commit 3461bb46 authored by Matthew Fritze's avatar Matthew Fritze
Browse files

Add utility methods to AmbientDisplayConfig

The added utility methods are to enable increased
granularity in determinining the availability of gesture
settings dependant on Always on Display.

Bug: 79779562
Test: robotests
Change-Id: Ib54a867ca554d44ee4190706805fa8545aec9fa0
parent 69e88693
Loading
Loading
Loading
Loading
+11 −4
Original line number Diff line number Diff line
@@ -59,8 +59,11 @@ public class AmbientDisplayConfiguration {
    }

    public boolean pulseOnPickupAvailable() {
        return mContext.getResources().getBoolean(R.bool.config_dozePulsePickup)
                && ambientDisplayAvailable();
        return dozePulsePickupSensorAvailable() && ambientDisplayAvailable();
    }

    public boolean dozePulsePickupSensorAvailable() {
        return mContext.getResources().getBoolean(R.bool.config_dozePulsePickup);
    }

    public boolean pulseOnPickupCanBeModified(int user) {
@@ -73,7 +76,11 @@ public class AmbientDisplayConfiguration {
    }

    public boolean pulseOnDoubleTapAvailable() {
        return !TextUtils.isEmpty(doubleTapSensorType()) && ambientDisplayAvailable();
        return doubleTapSensorAvailable() && ambientDisplayAvailable();
    }

    public boolean doubleTapSensorAvailable() {
        return !TextUtils.isEmpty(doubleTapSensorType());
    }

    public String doubleTapSensorType() {
@@ -115,7 +122,7 @@ public class AmbientDisplayConfiguration {
        return boolSettingDefaultOff(Settings.Secure.ACCESSIBILITY_DISPLAY_INVERSION_ENABLED, user);
    }

    private boolean ambientDisplayAvailable() {
    public boolean ambientDisplayAvailable() {
        return !TextUtils.isEmpty(ambientDisplayComponent());
    }