use of android.app.WallpaperManager in project packages_apps_AicpExtras by AICP.
the class Lockscreen method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Context mContext = getContext();
PreferenceScreen prefSet = getPreferenceScreen();
ContentResolver resolver = getActivity().getContentResolver();
WallpaperManager manager = WallpaperManager.getInstance(mContext);
try {
mFingerprintManager = (FingerprintManager) getActivity().getSystemService(Context.FINGERPRINT_SERVICE);
} catch (Exception e) {
// ignore
}
// Fingerprint vibration
mFingerprintVib = (SwitchPreference) prefSet.findPreference(FP_SUCCESS_VIBRATION);
if (mFingerprintManager == null || !mFingerprintManager.isHardwareDetected()) {
mFingerprintVib.getParent().removePreference(mFingerprintVib);
}
Util.requireConfig(getActivity(), findPreference(KEY_AOD_SCHEDULE), com.android.internal.R.bool.config_dozeAlwaysOnDisplayAvailable, true, false);
// Lockscreen blur
Preference lockscreenBlur = (Preference) findPreference(KEY_LOCKSCREEN_BLUR);
ParcelFileDescriptor pfd = manager.getWallpaperFile(WallpaperManager.FLAG_LOCK);
if (!AicpUtils.supportsBlur() || pfd != null) {
lockscreenBlur.setEnabled(false);
lockscreenBlur.setSummary(getResources().getString(R.string.lockscreen_blur_disabled));
}
// FOD category
PreferenceCategory fodIconPickerCategory = (PreferenceCategory) findPreference(FOD_ICON_PICKER_CATEGORY);
PackageManager packageManager = getContext().getPackageManager();
boolean supportsFod = packageManager.hasSystemFeature(AicpContextConstants.Features.FOD);
if (fodIconPickerCategory != null && !supportsFod) {
fodIconPickerCategory.getParent().removePreference(fodIconPickerCategory);
}
}
Aggregations