Use PackageManager.FEATURE_CONTROLS to decide availability
Using this features, some of the Preference in Power Menu Settings can change their availability and their summary. Test: Robotest Settings Fixes: 157244528 Change-Id: I704438dda181aa6347c3f168ac5ef6bd16148993
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
package com.android.settings.gestures;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
|
||||
@@ -37,7 +38,9 @@ public class DeviceControlsPreferenceController extends GesturePreferenceControl
|
||||
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
return AVAILABLE;
|
||||
boolean available = mContext.getPackageManager().hasSystemFeature(
|
||||
PackageManager.FEATURE_CONTROLS);
|
||||
return available ? AVAILABLE : CONDITIONALLY_UNAVAILABLE;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user