Fix availability status for AOD gestures

Double tap screen to wake and lift to check phone
are dependent on AOD - and should return DISABLED DEPENDENT
SETTING when AOD is turned on.

Test: robotests
Change-Id: Ib246070ee853185459628b2584ddbae72e15a2f8
This commit is contained in:
Matthew Fritze
2018-05-17 11:27:46 -07:00
parent 9dd27e3125
commit f59a77ca23
4 changed files with 89 additions and 30 deletions

View File

@@ -25,6 +25,7 @@ import android.content.SharedPreferences;
import android.os.UserHandle;
import android.provider.Settings;
import androidx.annotation.VisibleForTesting;
import android.text.TextUtils;
import com.android.internal.hardware.AmbientDisplayConfiguration;
import com.android.settings.R;
@@ -68,7 +69,18 @@ public class PickupGesturePreferenceController extends GesturePreferenceControll
if (mAmbientConfig == null) {
mAmbientConfig = new AmbientDisplayConfiguration(mContext);
}
return mAmbientConfig.pulseOnPickupAvailable() ? AVAILABLE : UNSUPPORTED_ON_DEVICE;
// No hardware support for Pickup Gesture
if (!mAmbientConfig.dozePulsePickupSensorAvailable()) {
return UNSUPPORTED_ON_DEVICE;
}
// Can't change Pickup Gesture when AOD is enabled.
if (!mAmbientConfig.ambientDisplayAvailable()) {
return DISABLED_DEPENDENT_SETTING;
}
return AVAILABLE;
}
@Override