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 e70a06a5d5
commit 8d973761ad
7 changed files with 56 additions and 6 deletions

View File

@@ -71,6 +71,8 @@ public abstract class GesturePreferenceController extends AbstractPreferenceCont
? R.string.gesture_setting_on
: R.string.gesture_setting_off);
}
// Different meanings of "Enabled" for the Preference and Controller.
preference.setEnabled(canHandleClicks());
}
}
@@ -106,4 +108,8 @@ public abstract class GesturePreferenceController extends AbstractPreferenceCont
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);
}
}