Cleaning Utilities.java

> Removing some unused methods
> Moving some specialized methods to corresponding classes
> Removing GridProvider check as it is released

Bug: 257555083
Test: Presubmit
Change-Id: Ib0f8c673d018071d3f4b7d9247e0a35718ab009c
Merged-In: Ib0f8c673d018071d3f4b7d9247e0a35718ab009c
This commit is contained in:
Sunny Goyal
2022-11-04 16:43:42 -07:00
parent 50306445a1
commit 47d4d81b4f
12 changed files with 110 additions and 269 deletions
@@ -15,8 +15,6 @@
*/
package com.android.launcher3.model;
import static com.android.launcher3.Utilities.isValidExtraType;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
@@ -149,4 +147,12 @@ public class ModelUtils {
info.intent = launchIntent;
return info;
}
/**
* @return true if the extra is either null or is of type {@param type}
*/
private static boolean isValidExtraType(Intent intent, String key, Class type) {
Object extra = intent.getParcelableExtra(key);
return extra == null || type.isInstance(extra);
}
}