use of android.provider.Settings.SettingNotFoundException in project android_frameworks_base by ParanoidAndroid.
the class QuickSettingsModel method onBugreportChanged.
// SettingsObserver callback
public void onBugreportChanged() {
final ContentResolver cr = mContext.getContentResolver();
boolean enabled = false;
try {
enabled = (Settings.Global.getInt(cr, Settings.Global.BUGREPORT_IN_POWER_MENU) != 0);
} catch (SettingNotFoundException e) {
}
mBugreportState.enabled = enabled;
mBugreportCallback.refreshView(mBugreportTile, mBugreportState);
}
use of android.provider.Settings.SettingNotFoundException in project android_frameworks_base by ParanoidAndroid.
the class VibratorService method updateInputDeviceVibrators.
private void updateInputDeviceVibrators() {
synchronized (mVibrations) {
doCancelVibrateLocked();
synchronized (mInputDeviceVibrators) {
mVibrateInputDevicesSetting = false;
try {
mVibrateInputDevicesSetting = Settings.System.getIntForUser(mContext.getContentResolver(), Settings.System.VIBRATE_INPUT_DEVICES, UserHandle.USER_CURRENT) > 0;
} catch (SettingNotFoundException snfe) {
}
if (mVibrateInputDevicesSetting) {
if (!mInputDeviceListenerRegistered) {
mInputDeviceListenerRegistered = true;
mIm.registerInputDeviceListener(this, mH);
}
} else {
if (mInputDeviceListenerRegistered) {
mInputDeviceListenerRegistered = false;
mIm.unregisterInputDeviceListener(this);
}
}
mInputDeviceVibrators.clear();
if (mVibrateInputDevicesSetting) {
int[] ids = mIm.getInputDeviceIds();
for (int i = 0; i < ids.length; i++) {
InputDevice device = mIm.getInputDevice(ids[i]);
Vibrator vibrator = device.getVibrator();
if (vibrator.hasVibrator()) {
mInputDeviceVibrators.add(vibrator);
}
}
}
}
startNextVibrationLocked();
}
}
use of android.provider.Settings.SettingNotFoundException in project android_frameworks_base by ParanoidAndroid.
the class BugReportTile method updateTile.
private synchronized void updateTile() {
mLabel = mContext.getString(R.string.quick_settings_report_bug);
mDrawable = com.android.internal.R.drawable.stat_sys_adb;
final ContentResolver cr = mContext.getContentResolver();
try {
enabled = (Settings.Secure.getInt(cr, Settings.Secure.BUGREPORT_IN_POWER_MENU) != 0);
} catch (SettingNotFoundException e) {
}
}
use of android.provider.Settings.SettingNotFoundException in project android_frameworks_base by ResurrectionRemix.
the class MediaScanner method wasRingtoneAlreadySet.
private boolean wasRingtoneAlreadySet(String name) {
ContentResolver cr = mContext.getContentResolver();
String indicatorName = settingSetIndicatorName(name);
try {
return Settings.System.getInt(cr, indicatorName) != 0;
} catch (SettingNotFoundException e) {
return false;
}
}
use of android.provider.Settings.SettingNotFoundException in project android_frameworks_base by DirtyUnicorns.
the class VibratorService method updateInputDeviceVibrators.
private void updateInputDeviceVibrators() {
synchronized (mVibrations) {
doCancelVibrateLocked();
synchronized (mInputDeviceVibrators) {
mVibrateInputDevicesSetting = false;
try {
mVibrateInputDevicesSetting = Settings.System.getIntForUser(mContext.getContentResolver(), Settings.System.VIBRATE_INPUT_DEVICES, UserHandle.USER_CURRENT) > 0;
} catch (SettingNotFoundException snfe) {
}
mLowPowerMode = mPowerManagerInternal.getLowPowerModeEnabled();
if (mVibrateInputDevicesSetting) {
if (!mInputDeviceListenerRegistered) {
mInputDeviceListenerRegistered = true;
mIm.registerInputDeviceListener(this, mH);
}
} else {
if (mInputDeviceListenerRegistered) {
mInputDeviceListenerRegistered = false;
mIm.unregisterInputDeviceListener(this);
}
}
mInputDeviceVibrators.clear();
if (mVibrateInputDevicesSetting) {
int[] ids = mIm.getInputDeviceIds();
for (int i = 0; i < ids.length; i++) {
InputDevice device = mIm.getInputDevice(ids[i]);
Vibrator vibrator = device.getVibrator();
if (vibrator.hasVibrator()) {
mInputDeviceVibrators.add(vibrator);
}
}
}
}
startNextVibrationLocked();
}
}
Aggregations