summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/Utilities.java
diff options
context:
space:
mode:
authorcretin45 <cretin45@gmail.com>2016-01-05 12:00:09 -0800
committerTom Powell <zifnab@zifnab06.net>2017-03-26 16:13:55 -0700
commit5ea26f008de5f11c568745657a421420b19e1936 (patch)
treeca2bff7e8db12f9f0d7db7e9429bb570ef4c5f89 /src/com/android/launcher3/Utilities.java
parentc362c7c38db40649675ab85363c455abd6d580c1 (diff)
downloadandroid_packages_apps_Trebuchet-5ea26f008de5f11c568745657a421420b19e1936.tar.gz
android_packages_apps_Trebuchet-5ea26f008de5f11c568745657a421420b19e1936.tar.bz2
android_packages_apps_Trebuchet-5ea26f008de5f11c568745657a421420b19e1936.zip
Trebuchet: Move allow rotation pref to overlay panel
Change-Id: I83feccbf5aac5de53ca578c4d62a25561d72b3ee
Diffstat (limited to 'src/com/android/launcher3/Utilities.java')
-rw-r--r--src/com/android/launcher3/Utilities.java14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/com/android/launcher3/Utilities.java b/src/com/android/launcher3/Utilities.java
index d2c182c67..b51ef168a 100644
--- a/src/com/android/launcher3/Utilities.java
+++ b/src/com/android/launcher3/Utilities.java
@@ -25,7 +25,6 @@ import android.content.ActivityNotFoundException;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
-import android.content.SharedPreferences;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
@@ -56,6 +55,8 @@ import android.util.TypedValue;
import android.view.View;
import android.widget.Toast;
+import com.android.launcher3.settings.SettingsProvider;
+
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.ArrayList;
@@ -110,22 +111,19 @@ public final class Utilities {
private static final String FORCE_ENABLE_ROTATION_PROPERTY = "launcher_force_rotate";
private static boolean sForceEnableRotation = isPropertyEnabled(FORCE_ENABLE_ROTATION_PROPERTY);
- public static final String ALLOW_ROTATION_PREFERENCE_KEY = "pref_allowRotation";
-
public static boolean isPropertyEnabled(String propertyName) {
return Log.isLoggable(propertyName, Log.VERBOSE);
}
public static boolean isAllowRotationPrefEnabled(Context context, boolean multiProcess) {
- SharedPreferences sharedPrefs = context.getSharedPreferences(
- LauncherAppState.getSharedPreferencesKey(), Context.MODE_PRIVATE | (multiProcess ?
- Context.MODE_MULTI_PROCESS : 0));
- boolean allowRotationPref = sharedPrefs.getBoolean(ALLOW_ROTATION_PREFERENCE_KEY, false);
+ boolean allowRotationPref = SettingsProvider.getBoolean(context,
+ SettingsProvider.SETTINGS_UI_ALLOW_ROTATION,
+ R.bool.preferences_interface_allow_rotation);
return sForceEnableRotation || allowRotationPref;
}
public static boolean isRotationAllowedForDevice(Context context) {
- return sForceEnableRotation || context.getResources().getBoolean(R.bool.allow_rotation);
+ return sForceEnableRotation || context.getResources().getBoolean(R.bool.preferences_interface_allow_rotation);
}
public static Bitmap createIconBitmap(Cursor c, int iconIndex, Context context) {