TalkBackPreferencesActivity.java 文件源码

java
阅读 30 收藏 0 点赞 0 评论 0

项目:talkback 作者:
/**
 * Ensure that the vibration setting does not appear on devices without a
 * vibrator.
 */
private void checkVibrationSupport() {
    Activity activity = getActivity();
    if (activity == null) {
        return;
    }

    final Vibrator vibrator = (Vibrator) activity.getSystemService(VIBRATOR_SERVICE);

    if (vibrator != null && vibrator.hasVibrator()) {
        return;
    }

    final PreferenceGroup category =
            (PreferenceGroup) findPreferenceByResId(R.string.pref_category_feedback_key);
    final TwoStatePreference prefVibration =
            (TwoStatePreference) findPreferenceByResId(R.string.pref_vibration_key);

    if (prefVibration != null) {
        prefVibration.setChecked(false);
        category.removePreference(prefVibration);
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号