Update Wi-Fi Wakeup setting to check whether the feature is available.

Bug: 38037361
Test: make ROBOTEST_FILTER=WifiWakeupPreferenceControllerTest
RunSettingsRoboTests -j40

Change-Id: I1c1b930546cc090d72f3047058a428acd1b2883a
This commit is contained in:
Stephen Chen
2017-05-09 12:50:42 -07:00
parent 6c0f337d52
commit a99b86c56a
4 changed files with 48 additions and 10 deletions

View File

@@ -70,7 +70,10 @@ public class WifiWakeupPreferenceController extends PreferenceController impleme
@Override
public boolean isAvailable() {
return true;
final int defaultValue = mContext.getResources().getInteger(
com.android.internal.R.integer.config_wifi_wakeup_available);
return Settings.Global.getInt(mContext.getContentResolver(),
Settings.Global.WIFI_WAKEUP_AVAILABLE, defaultValue) == 1;
}
@Override