resolved conflicts for merge of 9fc953b9 to ub-launcher3-master

Change-Id: Ia3e845a2e336c846cceefdc2d1e8c6786753f1b1
This commit is contained in:
Sunny Goyal committed 2015-08-17 14:43:41 -07:00
commit c268148f06
29 files changed
+86 -111

No files matched your search

+21 -20
View File
@@ -90,6 +90,24 @@ public final class Utilities {
private static final int[] sLoc0 = new int[2];
private static final int[] sLoc1 = new int[2];
// TODO: use Build.VERSION_CODES when available
public static final boolean ATLEAST_MARSHMALLOW = Build.VERSION.SDK_INT >= 23;
public static final boolean ATLEAST_LOLLIPOP_MR1 =
Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP_MR1;
public static final boolean ATLEAST_LOLLIPOP =
Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP;
public static final boolean ATLEAST_KITKAT =
Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT;
public static final boolean ATLEAST_JB_MR1 =
Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1;
public static final boolean ATLEAST_JB_MR2 =
Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2;
// To turn on these properties, type
// adb shell setprop log.tag.PROPERTY_NAME [VERBOSE | SUPPRESS]
private static final String FORCE_ENABLE_ROTATION_PROPERTY = "launcher_force_rotate";
@@ -113,23 +131,6 @@ public final class Utilities {
return sForceEnableRotation || context.getResources().getBoolean(R.bool.allow_rotation);
}
/**
* Indicates if the device is running LMP or higher.
*/
public static boolean isLmpOrAbove() {
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP;
}
public static boolean isLmpMR1OrAbove() {
// TODO(adamcohen): update to Build.VERSION_CODES.LOLLIPOP_MR1 once building against 22;
return Build.VERSION.SDK_INT >= 22;
}
public static boolean isLmpMR1() {
// TODO(adamcohen): update to Build.VERSION_CODES.LOLLIPOP_MR1 once building against 22;
return Build.VERSION.SDK_INT == 22;
}
public static boolean isNycOrAbove() {
// TODO(vadimt): Replace using reflection with looking at the API version once
// Build.VERSION.SDK_INT gets bumped to 24. b/22942492.
@@ -530,7 +531,7 @@ public final class Utilities {
@TargetApi(Build.VERSION_CODES.KITKAT)
public static boolean isViewAttachedToWindow(View v) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
if (ATLEAST_KITKAT) {
return v.isAttachedToWindow();
} else {
// A proxy call which returns null, if the view is not attached to the window.
@@ -557,7 +558,7 @@ public final class Utilities {
AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(context);
for (AppWidgetProviderInfo info : appWidgetManager.getInstalledProviders()) {
if (info.provider.getPackageName().equals(providerPkg)) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
if (ATLEAST_JB_MR1) {
if ((info.widgetCategory & AppWidgetProviderInfo.WIDGET_CATEGORY_SEARCHBOX) != 0) {
return info;
} else if (defaultWidgetForSearchPackage == null) {
@@ -668,7 +669,7 @@ public final class Utilities {
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
public static boolean isRtl(Resources res) {
return (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) &&
return ATLEAST_JB_MR1 &&
(res.getConfiguration().getLayoutDirection() == View.LAYOUT_DIRECTION_RTL);
}