Handle Aware sensor status for Always On
- "Always On" preference will be hiden when aware sensor is available - Extract NavModeCandidateInfo from SystemNavigationGestureSettings Bug: 136610131 Test: robotest & manual Change-Id: If58c70549339b66116f19df7193d85bb04e3f1b7
This commit is contained in:
@@ -17,6 +17,7 @@ package com.android.settings.display;
|
||||
|
||||
import android.content.Context;
|
||||
import android.hardware.display.AmbientDisplayConfiguration;
|
||||
import android.os.SystemProperties;
|
||||
import android.os.UserHandle;
|
||||
import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
@@ -29,6 +30,7 @@ public class AmbientDisplayAlwaysOnPreferenceController extends TogglePreference
|
||||
private final int OFF = 0;
|
||||
|
||||
private static final int MY_USER = UserHandle.myUserId();
|
||||
private static final String PROP_AWARE_AVAILABLE = "ro.vendor.aware_available";
|
||||
|
||||
private AmbientDisplayConfiguration mConfig;
|
||||
private OnPreferenceChangedCallback mCallback;
|
||||
@@ -43,7 +45,9 @@ public class AmbientDisplayAlwaysOnPreferenceController extends TogglePreference
|
||||
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
return isAvailable(getConfig()) ? AVAILABLE : UNSUPPORTED_ON_DEVICE;
|
||||
return isAvailable(getConfig())
|
||||
&& !SystemProperties.getBoolean(PROP_AWARE_AVAILABLE, false) ?
|
||||
AVAILABLE : UNSUPPORTED_ON_DEVICE;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user