Delete SmartAutoRotatePreference and move callback logic to controller
This CL was merged before then reverted because it had a runtime error in the xml file Test: locally with flame Bug: 200111886 Change-Id: I986340c361c7a8a32cfce0d3040ee25d62c3c64e
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