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
committercretin45 <cretin45@gmail.com>2016-01-05 12:15:33 -0800
commit72f2ccb08f297836d18b61d5d80de9fcd7a69042 (patch)
tree4a500db5fa5bf3c87167fe2252e0e4db9dcb95e9 /src/com/android/launcher3/Utilities.java
parenta20b046db71039ee581bb80274cf1fc450b3fd99 (diff)
downloadandroid_packages_apps_Trebuchet-72f2ccb08f297836d18b61d5d80de9fcd7a69042.tar.gz
android_packages_apps_Trebuchet-72f2ccb08f297836d18b61d5d80de9fcd7a69042.tar.bz2
android_packages_apps_Trebuchet-72f2ccb08f297836d18b61d5d80de9fcd7a69042.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) {