Merge "Removing some duplicate methods" into ub-now-queens
This commit is contained in:
@@ -168,7 +168,6 @@ public class Launcher extends Activity
|
||||
|
||||
// To turn on these properties, type
|
||||
// adb shell setprop log.tag.PROPERTY_NAME [VERBOSE | SUPPRESS]
|
||||
static final String FORCE_ENABLE_ROTATION_PROPERTY = "launcher_force_rotate";
|
||||
static final String DUMP_STATE_PROPERTY = "launcher_dump_state";
|
||||
static final String DISABLE_ALL_APPS_PROPERTY = "launcher_noallapps";
|
||||
|
||||
@@ -371,8 +370,6 @@ public class Launcher extends Activity
|
||||
|
||||
private static PendingAddArguments sPendingAddItem;
|
||||
|
||||
public static boolean sForceEnableRotation = isPropertyEnabled(FORCE_ENABLE_ROTATION_PROPERTY);
|
||||
|
||||
private static class PendingAddArguments {
|
||||
int requestCode;
|
||||
Intent intent;
|
||||
@@ -387,10 +384,6 @@ public class Launcher extends Activity
|
||||
|
||||
FocusIndicatorView mFocusHandler;
|
||||
|
||||
static boolean isPropertyEnabled(String propertyName) {
|
||||
return Log.isLoggable(propertyName, Log.VERBOSE);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
if (DEBUG_STRICT_MODE) {
|
||||
@@ -2494,7 +2487,7 @@ public class Launcher extends Activity
|
||||
case KeyEvent.KEYCODE_HOME:
|
||||
return true;
|
||||
case KeyEvent.KEYCODE_VOLUME_DOWN:
|
||||
if (isPropertyEnabled(DUMP_STATE_PROPERTY)) {
|
||||
if (Utilities.isPropertyEnabled(DUMP_STATE_PROPERTY)) {
|
||||
dumpState();
|
||||
return true;
|
||||
}
|
||||
@@ -5113,19 +5106,14 @@ public class Launcher extends Activity
|
||||
return oriMap[(d.getRotation() + indexOffset) % 4];
|
||||
}
|
||||
|
||||
public boolean isRotationEnabled() {
|
||||
boolean enableRotation = sForceEnableRotation ||
|
||||
getResources().getBoolean(R.bool.allow_rotation);
|
||||
return enableRotation;
|
||||
}
|
||||
public void lockScreenOrientation() {
|
||||
if (isRotationEnabled()) {
|
||||
if (Utilities.isRotationEnabled(this)) {
|
||||
setRequestedOrientation(mapConfigurationOriActivityInfoOri(getResources()
|
||||
.getConfiguration().orientation));
|
||||
}
|
||||
}
|
||||
public void unlockScreenOrientation(boolean immediate) {
|
||||
if (isRotationEnabled()) {
|
||||
if (Utilities.isRotationEnabled(this)) {
|
||||
if (immediate) {
|
||||
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
|
||||
} else {
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package com.android.launcher3;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.SearchManager;
|
||||
import android.content.ComponentName;
|
||||
import android.content.ContentResolver;
|
||||
@@ -26,16 +27,15 @@ import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.database.ContentObserver;
|
||||
import android.graphics.Point;
|
||||
import android.os.Build;
|
||||
import android.os.Handler;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.util.Log;
|
||||
import android.view.Display;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import com.android.launcher3.compat.LauncherAppsCompat;
|
||||
import com.android.launcher3.compat.PackageInstallerCompat;
|
||||
import com.android.launcher3.compat.PackageInstallerCompat.PackageInstallInfo;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -194,6 +194,7 @@ public class LauncherAppState implements DeviceProfile.DeviceProfileCallbacks {
|
||||
return LauncherFiles.SHARED_PREFERENCES_KEY;
|
||||
}
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
|
||||
DeviceProfile initDynamicGrid(Context context) {
|
||||
// Determine the dynamic grid properties
|
||||
WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
|
||||
@@ -269,7 +270,7 @@ public class LauncherAppState implements DeviceProfile.DeviceProfileCallbacks {
|
||||
public static boolean isDisableAllApps() {
|
||||
// Returns false on non-dogfood builds.
|
||||
return getInstance().mBuildInfo.isDogfoodBuild() &&
|
||||
Launcher.isPropertyEnabled(Launcher.DISABLE_ALL_APPS_PROPERTY);
|
||||
Utilities.isPropertyEnabled(Launcher.DISABLE_ALL_APPS_PROPERTY);
|
||||
}
|
||||
|
||||
public static boolean isDogfoodBuild() {
|
||||
|
||||
@@ -93,7 +93,7 @@ public final class Utilities {
|
||||
icon.setBounds(0, 0, sIconWidth, sIconHeight);
|
||||
}
|
||||
|
||||
private static boolean isPropertyEnabled(String propertyName) {
|
||||
public static boolean isPropertyEnabled(String propertyName) {
|
||||
return Log.isLoggable(propertyName, Log.VERBOSE);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user