Loading src/com/android/settings/display/AmbientDisplayNotificationsPreferenceController.java +11 −5 Original line number Diff line number Diff line Loading @@ -68,7 +68,7 @@ public class AmbientDisplayNotificationsPreferenceController extends @Override public boolean isChecked() { return mConfig.pulseOnNotificationEnabled(MY_USER); return getAmbientConfig().pulseOnNotificationEnabled(MY_USER); } @Override Loading @@ -79,14 +79,20 @@ public class AmbientDisplayNotificationsPreferenceController extends @Override public int getAvailabilityStatus() { if (mConfig == null) { mConfig = new AmbientDisplayConfiguration(mContext); } return mConfig.pulseOnNotificationAvailable() ? AVAILABLE : UNSUPPORTED_ON_DEVICE; return getAmbientConfig().pulseOnNotificationAvailable() ? AVAILABLE : UNSUPPORTED_ON_DEVICE; } @Override public boolean isSliceable() { return TextUtils.equals(getPreferenceKey(), "ambient_display_notification"); } private AmbientDisplayConfiguration getAmbientConfig() { if (mConfig == null) { mConfig = new AmbientDisplayConfiguration(mContext); } return mConfig; } } src/com/android/settings/gestures/PickupGesturePreferenceController.java +12 −8 Original line number Diff line number Diff line Loading @@ -62,17 +62,13 @@ public class PickupGesturePreferenceController extends GesturePreferenceControll @Override public int getAvailabilityStatus() { if (mAmbientConfig == null) { mAmbientConfig = new AmbientDisplayConfiguration(mContext); } // No hardware support for Pickup Gesture if (!mAmbientConfig.dozePulsePickupSensorAvailable()) { if (!getAmbientConfig().dozePulsePickupSensorAvailable()) { return UNSUPPORTED_ON_DEVICE; } // Can't change Pickup Gesture when AOD is enabled. if (!mAmbientConfig.ambientDisplayAvailable()) { if (!getAmbientConfig().ambientDisplayAvailable()) { return DISABLED_DEPENDENT_SETTING; } Loading @@ -91,7 +87,7 @@ public class PickupGesturePreferenceController extends GesturePreferenceControll @Override public boolean isChecked() { return mAmbientConfig.pulseOnPickupEnabled(mUserId); return getAmbientConfig().pulseOnPickupEnabled(mUserId); } @Override Loading @@ -112,6 +108,14 @@ public class PickupGesturePreferenceController extends GesturePreferenceControll @VisibleForTesting boolean pulseOnPickupCanBeModified() { return mAmbientConfig.pulseOnPickupCanBeModified(mUserId); return getAmbientConfig().pulseOnPickupCanBeModified(mUserId); } private AmbientDisplayConfiguration getAmbientConfig() { if (mAmbientConfig == null) { mAmbientConfig = new AmbientDisplayConfiguration(mContext); } return mAmbientConfig; } } Loading
src/com/android/settings/display/AmbientDisplayNotificationsPreferenceController.java +11 −5 Original line number Diff line number Diff line Loading @@ -68,7 +68,7 @@ public class AmbientDisplayNotificationsPreferenceController extends @Override public boolean isChecked() { return mConfig.pulseOnNotificationEnabled(MY_USER); return getAmbientConfig().pulseOnNotificationEnabled(MY_USER); } @Override Loading @@ -79,14 +79,20 @@ public class AmbientDisplayNotificationsPreferenceController extends @Override public int getAvailabilityStatus() { if (mConfig == null) { mConfig = new AmbientDisplayConfiguration(mContext); } return mConfig.pulseOnNotificationAvailable() ? AVAILABLE : UNSUPPORTED_ON_DEVICE; return getAmbientConfig().pulseOnNotificationAvailable() ? AVAILABLE : UNSUPPORTED_ON_DEVICE; } @Override public boolean isSliceable() { return TextUtils.equals(getPreferenceKey(), "ambient_display_notification"); } private AmbientDisplayConfiguration getAmbientConfig() { if (mConfig == null) { mConfig = new AmbientDisplayConfiguration(mContext); } return mConfig; } }
src/com/android/settings/gestures/PickupGesturePreferenceController.java +12 −8 Original line number Diff line number Diff line Loading @@ -62,17 +62,13 @@ public class PickupGesturePreferenceController extends GesturePreferenceControll @Override public int getAvailabilityStatus() { if (mAmbientConfig == null) { mAmbientConfig = new AmbientDisplayConfiguration(mContext); } // No hardware support for Pickup Gesture if (!mAmbientConfig.dozePulsePickupSensorAvailable()) { if (!getAmbientConfig().dozePulsePickupSensorAvailable()) { return UNSUPPORTED_ON_DEVICE; } // Can't change Pickup Gesture when AOD is enabled. if (!mAmbientConfig.ambientDisplayAvailable()) { if (!getAmbientConfig().ambientDisplayAvailable()) { return DISABLED_DEPENDENT_SETTING; } Loading @@ -91,7 +87,7 @@ public class PickupGesturePreferenceController extends GesturePreferenceControll @Override public boolean isChecked() { return mAmbientConfig.pulseOnPickupEnabled(mUserId); return getAmbientConfig().pulseOnPickupEnabled(mUserId); } @Override Loading @@ -112,6 +108,14 @@ public class PickupGesturePreferenceController extends GesturePreferenceControll @VisibleForTesting boolean pulseOnPickupCanBeModified() { return mAmbientConfig.pulseOnPickupCanBeModified(mUserId); return getAmbientConfig().pulseOnPickupCanBeModified(mUserId); } private AmbientDisplayConfiguration getAmbientConfig() { if (mAmbientConfig == null) { mAmbientConfig = new AmbientDisplayConfiguration(mContext); } return mAmbientConfig; } }