mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-27 15:26:58 +00:00
Removing static Context access using LauncherAppState
> This ensures that LauncherAppState is only accessed in the presence of a valid context Bug: 33032833 Change-Id: I955e5cb022f8bd6374681ae6c0720a2666d5b750
This commit is contained in:
@@ -31,16 +31,16 @@ public class WidgetItem extends ComponentKey implements Comparable<WidgetItem> {
|
||||
public final String label;
|
||||
public final int spanX, spanY;
|
||||
|
||||
public WidgetItem(LauncherAppWidgetProviderInfo info, PackageManager pm) {
|
||||
public WidgetItem(LauncherAppWidgetProviderInfo info, PackageManager pm,
|
||||
InvariantDeviceProfile idp) {
|
||||
super(info.provider, info.getProfile());
|
||||
|
||||
label = Utilities.trim(info.getLabel(pm));
|
||||
widgetInfo = info;
|
||||
activityInfo = null;
|
||||
|
||||
InvariantDeviceProfile idv = LauncherAppState.getInstance().getInvariantDeviceProfile();
|
||||
spanX = Math.min(info.spanX, idv.numColumns);
|
||||
spanY = Math.min(info.spanY, idv.numRows);
|
||||
spanX = Math.min(info.spanX, idp.numColumns);
|
||||
spanY = Math.min(info.spanY, idp.numRows);
|
||||
}
|
||||
|
||||
public WidgetItem(ResolveInfo info, PackageManager pm) {
|
||||
|
||||
Reference in New Issue
Block a user