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

Commit 9262baf2 authored by Lais Andrade's avatar Lais Andrade
Browse files

[Catalyst] Migrate all vibration slider preferences

Migrate touch, media, notification and alarm vibration slider
preferences.

NO_IFTTT=migration ongoing, no need to update legacy controllers

Bug: 390338213
Flag: com.android.settings.flags.catalyst_vibration_intensity_screen_25q4
Test: *IntensitySliderPreferenceTest
Change-Id: Icc17c2bcaac7668d4f8d3a0b07e8edbeef9e45e6
parent 8d4dcc74
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import android.os.VibrationAttributes;
import android.provider.Settings;

/** Preference controller for alarm vibration intensity */
// LINT.IfChange
public class AlarmVibrationIntensityPreferenceController
        extends VibrationIntensityPreferenceController {

@@ -48,3 +49,4 @@ public class AlarmVibrationIntensityPreferenceController
        return AVAILABLE;
    }
}
// LINT.ThenChange(AlarmVibrationIntensitySliderPreference.kt)
+37 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2025 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.android.settings.accessibility

import android.os.VibrationAttributes
import android.provider.Settings
import com.android.settings.R

/** Accessibility settings for alarm vibration, as a slider. */
// LINT.IfChange
class AlarmVibrationIntensitySliderPreference :
    VibrationIntensitySliderPreference(
        key = KEY,
        vibrationUsage = VibrationAttributes.USAGE_ALARM,
        title = R.string.accessibility_alarm_vibration_title,
    ) {
    override val keywords: Int
        get() = R.string.keywords_alarm_vibration

    companion object {
        const val KEY = Settings.System.ALARM_VIBRATION_INTENSITY
    }
}
// LINT.ThenChange(AlarmVibrationIntensityPreferenceController.java)
+1 −1
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@ import android.os.VibrationAttributes
import android.provider.Settings
import com.android.settings.R

/** Accessibility settings for alarm vibration. */
/** Accessibility settings for alarm vibration, as a switch toggle. */
// LINT.IfChange
class AlarmVibrationIntensitySwitchPreference :
    VibrationIntensitySwitchPreference(
+1 −1
Original line number Diff line number Diff line
@@ -33,4 +33,4 @@ public class AlarmVibrationTogglePreferenceController extends VibrationTogglePre
        return AVAILABLE;
    }
}
// LINT.ThenChange(AlarmVibrationIntensitySwitchPreference.java)
// LINT.ThenChange(AlarmVibrationIntensitySwitchPreference.kt)
+2 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import android.os.Vibrator;
import android.provider.Settings;

/** Preference controller for haptic feedback intensity */
// LINT.IfChange
public class HapticFeedbackIntensityPreferenceController
        extends VibrationIntensityPreferenceController {

@@ -85,3 +86,4 @@ public class HapticFeedbackIntensityPreferenceController
        return AVAILABLE;
    }
}
// LINT.ThenChange(TouchVibrationIntensitySliderPreference.kt)
Loading