Revert "Migrate to CompoundButton.OnCheckedChangeListener"

Revert submission 25147565-onSwitchChanged-CompoundButton

Reason for revert: breaking builds 

Bug:309601476

Reverted changes: /q/submissionid:25147565-onSwitchChanged-CompoundButton

Change-Id: Ie746db87d9c642599593aa3d5e5baf6b7ba89c0e
This commit is contained in:
Sebastian Pickl
2023-11-07 13:26:36 +00:00
committed by Android (Google) Code Review
parent 71d1f021af
commit 8979681a8d
49 changed files with 188 additions and 174 deletions

View File

@@ -20,8 +20,7 @@ import android.app.settings.SettingsEnums;
import android.content.Context;
import android.os.SystemProperties;
import android.provider.Settings;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.Switch;
import androidx.fragment.app.FragmentManager;
import androidx.preference.Preference;
@@ -30,10 +29,11 @@ import com.android.internal.util.Preconditions;
import com.android.settings.widget.SettingsMainSwitchBar;
import com.android.settingslib.Utils;
import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
import com.android.settingslib.widget.OnMainSwitchChangeListener;
/** Handles the logic for flipping the storage management toggle on a {@link SwitchBar}. */
public class AutomaticStorageManagerSwitchBarController
implements OnCheckedChangeListener {
implements OnMainSwitchChangeListener {
private static final String STORAGE_MANAGER_ENABLED_BY_DEFAULT_PROPERTY =
"ro.storage_manager.enabled";
@@ -64,7 +64,7 @@ public class AutomaticStorageManagerSwitchBarController
}
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
public void onSwitchChanged(Switch switchView, boolean isChecked) {
mMetrics.action(mContext, SettingsEnums.ACTION_TOGGLE_STORAGE_MANAGER, isChecked);
mDaysToRetainPreference.setEnabled(isChecked);
Settings.Secure.putInt(