Disable lift-to-wake when always-on is checked

The setting has little to no meaning when AOD is on.

Test: make
ROBOTEST_FILTER=AmbientDisplayAlwaysOnPreferenceControllerTest
RunSettingsRoboTests -j
Bug:62391405
Change-Id:If5492227755ca81ec0bcf921a81e2bfd33a85b9c
This commit is contained in:
Geoffrey Pitsch
2017-07-10 10:30:05 -04:00
parent 75bcd075f2
commit 57adc290d2
7 changed files with 56 additions and 6 deletions

View File

@@ -61,6 +61,8 @@ public abstract class GesturePreferenceController extends PreferenceController
? R.string.gesture_setting_on
: R.string.gesture_setting_off);
}
// Different meanings of "Enabled" for the Preference and Controller.
preference.setEnabled(canHandleClicks());
}
}
@@ -81,4 +83,8 @@ public abstract class GesturePreferenceController extends PreferenceController
protected abstract String getVideoPrefKey();
protected abstract boolean isSwitchPrefEnabled();
protected boolean canHandleClicks() {
return true;
}
}

View File

@@ -76,4 +76,9 @@ public class PickupGesturePreferenceController extends GesturePreferenceControll
Settings.Secure.DOZE_PULSE_ON_PICK_UP, enabled ? 1 : 0);
return true;
}
@Override
public boolean canHandleClicks() {
return mAmbientConfig.pulseOnPickupCanBeModified(mUserId);
}
}