Revert "Use color extraction for arrow popup."
This reverts commit 242c805f82.
Reason for revert: Introduces a leak. I haven't seen a bug for it yet, but this CL is the only in the culprit list; the leak can block multiple teams presubmits, and the leak is via ArrowPopup. Enough evidence.
https://fusion2.corp.google.com/invocations/4b50db71-d598-4e52-9076-e91d42b65014/targets
Change-Id: I1700a9eea8705983598aee43c0a63e67c1d9cf71
Bug: 187075409
This commit is contained in:
1 parent
242c805f82
commit
17fda29bf3
9 files changed
+86
-299
No files matched your search
@@ -33,7 +33,6 @@ import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.ResolveInfo;
|
||||
import android.content.pm.ShortcutInfo;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.database.ContentObserver;
|
||||
import android.graphics.Bitmap;
|
||||
@@ -85,7 +84,6 @@ import com.android.launcher3.shortcuts.ShortcutKey;
|
||||
import com.android.launcher3.shortcuts.ShortcutRequest;
|
||||
import com.android.launcher3.util.IntArray;
|
||||
import com.android.launcher3.util.PackageManagerHelper;
|
||||
import com.android.launcher3.views.BaseDragLayer;
|
||||
import com.android.launcher3.widget.PendingAddShortcutInfo;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
@@ -106,8 +104,6 @@ public final class Utilities {
|
||||
private static final Pattern sTrimPattern =
|
||||
Pattern.compile("^[\\s|\\p{javaSpaceChar}]*(.*)[\\s|\\p{javaSpaceChar}]*$");
|
||||
|
||||
private static final float[] sTmpFloatArray = new float[4];
|
||||
|
||||
private static final int[] sLoc0 = new int[2];
|
||||
private static final int[] sLoc1 = new int[2];
|
||||
private static final Matrix sMatrix = new Matrix();
|
||||
@@ -137,15 +133,6 @@ public final class Utilities {
|
||||
Build.TYPE.toLowerCase(Locale.ROOT).contains("debug") ||
|
||||
Build.TYPE.toLowerCase(Locale.ROOT).equals("eng");
|
||||
|
||||
/**
|
||||
* Returns true if theme is dark.
|
||||
*/
|
||||
public static boolean isDarkTheme(Context context) {
|
||||
Configuration configuration = context.getResources().getConfiguration();
|
||||
int nightMode = configuration.uiMode & Configuration.UI_MODE_NIGHT_MASK;
|
||||
return nightMode == Configuration.UI_MODE_NIGHT_YES;
|
||||
}
|
||||
|
||||
public static boolean isDevelopersOptionsEnabled(Context context) {
|
||||
return Settings.Global.getInt(context.getApplicationContext().getContentResolver(),
|
||||
Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 0) != 0;
|
||||
@@ -231,33 +218,6 @@ public final class Utilities {
|
||||
return scale;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns bounds for a child view of DragLayer, in drag layer coordinates.
|
||||
*
|
||||
* see {@link com.android.launcher3.dragndrop.DragLayer}.
|
||||
*
|
||||
* @param viewBounds Bounds of the view wanted in drag layer coordinates, relative to the view
|
||||
* itself. eg. (0, 0, view.getWidth, view.getHeight)
|
||||
* @param ignoreTransform If true, view transform is ignored
|
||||
* @param outRect The out rect where we return the bounds of {@param view} in drag layer coords.
|
||||
*/
|
||||
public static void getBoundsForViewInDragLayer(BaseDragLayer dragLayer, View view,
|
||||
Rect viewBounds, boolean ignoreTransform, RectF outRect) {
|
||||
float[] points = sTmpFloatArray;
|
||||
points[0] = viewBounds.left;
|
||||
points[1] = viewBounds.top;
|
||||
points[2] = viewBounds.right;
|
||||
points[3] = viewBounds.bottom;
|
||||
|
||||
Utilities.getDescendantCoordRelativeToAncestor(view, dragLayer, points,
|
||||
false, ignoreTransform);
|
||||
outRect.set(
|
||||
Math.min(points[0], points[2]),
|
||||
Math.min(points[1], points[3]),
|
||||
Math.max(points[0], points[2]),
|
||||
Math.max(points[1], points[3]));
|
||||
}
|
||||
|
||||
/**
|
||||
* Inverse of {@link #getDescendantCoordRelativeToAncestor(View, View, float[], boolean)}.
|
||||
*/
|
||||
@@ -313,16 +273,6 @@ public final class Utilities {
|
||||
return new int[] {sLoc1[0] - sLoc0[0], sLoc1[1] - sLoc0[1]};
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method to set rectOut with rectFSrc.
|
||||
*/
|
||||
public static void setRect(RectF rectFSrc, Rect rectOut) {
|
||||
rectOut.left = (int) rectFSrc.left;
|
||||
rectOut.top = (int) rectFSrc.top;
|
||||
rectOut.right = (int) rectFSrc.right;
|
||||
rectOut.bottom = (int) rectFSrc.bottom;
|
||||
}
|
||||
|
||||
public static void scaleRectFAboutCenter(RectF r, float scale) {
|
||||
if (scale != 1.0f) {
|
||||
float cx = r.centerX();
|
||||
|
||||
Reference in new issue
Block a user