Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a82d5e7b authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Remove "Always show icon when in vibrate mode"" into tm-qpr-dev

parents e899b4c9 90650497
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.settings.notification;
import static com.android.settings.notification.SettingPref.TYPE_SECURE;

import android.content.Context;
import android.os.Vibrator;
import android.provider.Settings.Secure;

import com.android.settings.SettingsPreferenceFragment;
@@ -27,16 +28,18 @@ import com.android.settingslib.core.lifecycle.Lifecycle;
public class VibrateIconPreferenceController extends SettingPrefController {

    private static final String KEY_VIBRATE_ICON = "vibrate_icon";
    private final boolean mHasVibrator;

    public VibrateIconPreferenceController(Context context, SettingsPreferenceFragment parent,
            Lifecycle lifecycle) {
        super(context, parent, lifecycle);
        mHasVibrator = context.getSystemService(Vibrator.class).hasVibrator();
        mPreference = new SettingPref(
            TYPE_SECURE, KEY_VIBRATE_ICON, Secure.STATUS_BAR_SHOW_VIBRATE_ICON, 0 /*default off*/);
    }

    @Override
    public boolean isAvailable() {
        return true;
        return mHasVibrator;
    }
}