Search in sources :

Example 1 with SettingNotFoundException

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);
}
Also used : SettingNotFoundException(android.provider.Settings.SettingNotFoundException) ContentResolver(android.content.ContentResolver)

Example 2 with SettingNotFoundException

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();
    }
}
Also used : InputDevice(android.view.InputDevice) Vibrator(android.os.Vibrator) SettingNotFoundException(android.provider.Settings.SettingNotFoundException)

Example 3 with SettingNotFoundException

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) {
    }
}
Also used : SettingNotFoundException(android.provider.Settings.SettingNotFoundException) ContentResolver(android.content.ContentResolver)

Example 4 with SettingNotFoundException

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;
    }
}
Also used : SettingNotFoundException(android.provider.Settings.SettingNotFoundException) ContentResolver(android.content.ContentResolver)

Example 5 with SettingNotFoundException

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();
    }
}
Also used : InputDevice(android.view.InputDevice) Vibrator(android.os.Vibrator) SettingNotFoundException(android.provider.Settings.SettingNotFoundException)

Aggregations

SettingNotFoundException (android.provider.Settings.SettingNotFoundException)29 ContentResolver (android.content.ContentResolver)17 RemoteException (android.os.RemoteException)7 UserInfo (android.content.pm.UserInfo)6 Vibrator (android.os.Vibrator)6 InputDevice (android.view.InputDevice)6 IOException (java.io.IOException)5 KeyStoreException (java.security.KeyStoreException)5 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)5 CertificateException (java.security.cert.CertificateException)5 SharedPreferences (android.content.SharedPreferences)2 SimpleHogBug (edu.berkeley.cs.amplab.carat.android.storage.SimpleHogBug)2 ContentValues (android.content.ContentValues)1 Context (android.content.Context)1 ApplicationInfo (android.content.pm.ApplicationInfo)1 UserManager (android.os.UserManager)1 ListPreference (android.preference.ListPreference)1 Settings (android.provider.Settings)1 SubscriptionInfo (android.telephony.SubscriptionInfo)1 TelephonyManager (android.telephony.TelephonyManager)1