Merge "Fix availability status for AOD gestures" into pi-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
39f98e9018
@@ -24,6 +24,7 @@ import android.os.UserHandle;
|
||||
import android.provider.Settings;
|
||||
import android.support.v7.preference.Preference;
|
||||
import android.support.annotation.VisibleForTesting;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.android.internal.hardware.AmbientDisplayConfiguration;
|
||||
import com.android.settings.R;
|
||||
@@ -74,7 +75,18 @@ public class DoubleTapScreenPreferenceController extends GesturePreferenceContro
|
||||
if (mAmbientConfig == null) {
|
||||
mAmbientConfig = new AmbientDisplayConfiguration(mContext);
|
||||
}
|
||||
return mAmbientConfig.pulseOnDoubleTapAvailable() ? AVAILABLE : UNSUPPORTED_ON_DEVICE;
|
||||
|
||||
// No hardware support for Double Tap
|
||||
if (!mAmbientConfig.doubleTapSensorAvailable()) {
|
||||
return UNSUPPORTED_ON_DEVICE;
|
||||
}
|
||||
|
||||
// Can't change Double Tap when AOD is enabled.
|
||||
if (!mAmbientConfig.ambientDisplayAvailable()) {
|
||||
return DISABLED_DEPENDENT_SETTING;
|
||||
}
|
||||
|
||||
return AVAILABLE;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -25,6 +25,7 @@ import android.content.SharedPreferences;
|
||||
import android.os.UserHandle;
|
||||
import android.provider.Settings;
|
||||
import android.support.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
|
||||
|
Reference in New Issue
Block a user