Delete SmartAutoRotatePreference and move callback logic to controller
Test: locally with flame Bug: 199914593 Change-Id: I7cbca268dd15738e2ae21c65c3b6b545599e45de
This commit is contained in:
@@ -22,6 +22,7 @@ import static android.provider.Settings.Secure.CAMERA_AUTOROTATE;
|
||||
import static com.android.settings.display.SmartAutoRotateController.hasSufficientPermission;
|
||||
import static com.android.settings.display.SmartAutoRotateController.isRotationResolverServiceAvailable;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import android.app.settings.SettingsEnums;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
@@ -79,6 +80,16 @@ public class SmartAutoRotatePreferenceController extends TogglePreferenceControl
|
||||
? AVAILABLE : UNSUPPORTED_ON_DEVICE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSliceable() {
|
||||
return TextUtils.equals(getPreferenceKey(), "auto_rotate");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPublicSlice() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void displayPreference(PreferenceScreen screen) {
|
||||
super.displayPreference(screen);
|
||||
@@ -100,7 +111,7 @@ public class SmartAutoRotatePreferenceController extends TogglePreferenceControl
|
||||
@Override
|
||||
public void onChange() {
|
||||
if (mPreference != null) {
|
||||
refreshSummary(mPreference);
|
||||
updateState(mPreference);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -163,4 +174,4 @@ public class SmartAutoRotatePreferenceController extends TogglePreferenceControl
|
||||
}
|
||||
return mContext.getString(activeStringId);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user