diff --git a/parts/src/org/lineageos/settings/doze/DozeSettingsFragment.java b/parts/src/org/lineageos/settings/doze/DozeSettingsFragment.java index ef31c90..12b1b20 100644 --- a/parts/src/org/lineageos/settings/doze/DozeSettingsFragment.java +++ b/parts/src/org/lineageos/settings/doze/DozeSettingsFragment.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015 The CyanogenMod Project - * 2017-2023 The LineageOS Project + * 2017-2024 The LineageOS Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,7 +26,8 @@ import android.content.DialogInterface; import android.content.SharedPreferences; import android.os.Bundle; import android.os.Handler; -import android.widget.Switch; +import android.widget.CompoundButton; +import android.widget.CompoundButton.OnCheckedChangeListener; import androidx.preference.ListPreference; import androidx.preference.Preference; import androidx.preference.Preference.OnPreferenceChangeListener; @@ -35,13 +36,12 @@ import androidx.preference.PreferenceFragment; import androidx.preference.SwitchPreference; import com.android.settingslib.widget.MainSwitchPreference; -import com.android.settingslib.widget.OnMainSwitchChangeListener; import org.lineageos.settings.R; import org.lineageos.settings.utils.FileUtils; public class DozeSettingsFragment extends PreferenceFragment - implements OnPreferenceChangeListener, OnMainSwitchChangeListener { + implements OnPreferenceChangeListener, OnCheckedChangeListener { private MainSwitchPreference mSwitchBar; private SwitchPreference mAlwaysOnDisplayPreference; @@ -154,7 +154,7 @@ public class DozeSettingsFragment extends PreferenceFragment } @Override - public void onSwitchChanged(Switch switchView, boolean isChecked) { + public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { DozeUtils.enableDoze(getActivity(), isChecked); DozeUtils.checkDozeService(getActivity());