summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/display/SmartAutoRotatePreferenceController.java
diff options
context:
space:
mode:
authorAbel Tesfaye <tesfaye@google.com>2021-03-11 20:16:30 +0000
committerAbel Tesfaye <tesfaye@google.com>2021-03-13 02:14:57 +0000
commite57c87528dd9ef44bdf15236e93b791121fa3cac (patch)
tree5d23f05030ca5ba846fae71db8a46a1281dbc02c /src/com/android/settings/display/SmartAutoRotatePreferenceController.java
parent38e0dae43954dc51d6835ebefcbba252ca71f122 (diff)
downloadpackages_apps_Settings-e57c87528dd9ef44bdf15236e93b791121fa3cac.tar.gz
packages_apps_Settings-e57c87528dd9ef44bdf15236e93b791121fa3cac.tar.bz2
packages_apps_Settings-e57c87528dd9ef44bdf15236e93b791121fa3cac.zip
Fix auto-rotate summary not updating on devices without smart-auto-rotate
Test: locally with crosshatch Bug: 181585193 Change-Id: I571b10556ff2f4f4d6ff960fcfdf7866405d5ee5
Diffstat (limited to 'src/com/android/settings/display/SmartAutoRotatePreferenceController.java')
-rw-r--r--src/com/android/settings/display/SmartAutoRotatePreferenceController.java19
1 files changed, 6 insertions, 13 deletions
diff --git a/src/com/android/settings/display/SmartAutoRotatePreferenceController.java b/src/com/android/settings/display/SmartAutoRotatePreferenceController.java
index 01c8379f5e..0e2e013c6e 100644
--- a/src/com/android/settings/display/SmartAutoRotatePreferenceController.java
+++ b/src/com/android/settings/display/SmartAutoRotatePreferenceController.java
@@ -21,7 +21,6 @@ import static android.provider.Settings.Secure.CAMERA_AUTOROTATE;
import android.content.Context;
import android.os.UserHandle;
import android.provider.Settings;
-import android.util.Log;
import androidx.preference.Preference;
@@ -34,8 +33,6 @@ import com.android.settings.core.BasePreferenceController;
*/
public class SmartAutoRotatePreferenceController extends BasePreferenceController {
- private static final String TAG = "SmartAutoRotatePreferenceController";
-
public SmartAutoRotatePreferenceController(Context context, String preferenceKey) {
super(context, preferenceKey);
}
@@ -54,16 +51,12 @@ public class SmartAutoRotatePreferenceController extends BasePreferenceControlle
public CharSequence getSummary() {
int activeStringId = R.string.auto_rotate_option_off;
if (!RotationPolicy.isRotationLocked(mContext)) {
- try {
- final int cameraRotate = Settings.Secure.getIntForUser(
- mContext.getContentResolver(),
- CAMERA_AUTOROTATE,
- UserHandle.USER_CURRENT);
- activeStringId = cameraRotate == 1 ? R.string.auto_rotate_option_face_based
- : R.string.auto_rotate_option_on;
- } catch (Settings.SettingNotFoundException e) {
- Log.w(TAG, "CAMERA_AUTOROTATE setting not found", e);
- }
+ final int cameraRotate = Settings.Secure.getIntForUser(
+ mContext.getContentResolver(),
+ CAMERA_AUTOROTATE,
+ 0, UserHandle.USER_CURRENT);
+ activeStringId = cameraRotate == 1 ? R.string.auto_rotate_option_face_based
+ : R.string.auto_rotate_option_on;
}
return mContext.getString(activeStringId);
}