mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 18:58:19 +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:
@@ -895,7 +895,7 @@ public class GridSizeMigrationTask {
|
||||
*/
|
||||
public static boolean migrateGridIfNeeded(Context context) {
|
||||
SharedPreferences prefs = Utilities.getPrefs(context);
|
||||
InvariantDeviceProfile idp = LauncherAppState.getInstance().getInvariantDeviceProfile();
|
||||
InvariantDeviceProfile idp = LauncherAppState.getIDP(context);
|
||||
|
||||
String gridSizeString = getPointString(idp.numColumns, idp.numRows);
|
||||
|
||||
@@ -915,8 +915,7 @@ public class GridSizeMigrationTask {
|
||||
if (srcHotseatCount != idp.numHotseatIcons) {
|
||||
// Migrate hotseat.
|
||||
|
||||
dbChanged = new GridSizeMigrationTask(context,
|
||||
LauncherAppState.getInstance().getInvariantDeviceProfile(),
|
||||
dbChanged = new GridSizeMigrationTask(context, LauncherAppState.getIDP(context),
|
||||
validPackages, srcHotseatCount, idp.numHotseatIcons).migrateHotseat();
|
||||
}
|
||||
|
||||
@@ -978,9 +977,9 @@ public class GridSizeMigrationTask {
|
||||
* @return a map with occupied hotseat position set to non-null value.
|
||||
*/
|
||||
public static LongArrayMap<Object> removeBrokenHotseatItems(Context context) throws Exception {
|
||||
GridSizeMigrationTask task = new GridSizeMigrationTask(context,
|
||||
LauncherAppState.getInstance().getInvariantDeviceProfile(),
|
||||
getValidPackages(context), Integer.MAX_VALUE, Integer.MAX_VALUE);
|
||||
GridSizeMigrationTask task = new GridSizeMigrationTask(
|
||||
context, LauncherAppState.getIDP(context), getValidPackages(context),
|
||||
Integer.MAX_VALUE, Integer.MAX_VALUE);
|
||||
|
||||
// Load all the valid entries
|
||||
ArrayList<DbEntry> items = task.loadHotseatEntries();
|
||||
@@ -1038,8 +1037,7 @@ public class GridSizeMigrationTask {
|
||||
}
|
||||
|
||||
protected boolean runStepTask(Point sourceSize, Point nextSize) throws Exception {
|
||||
return new GridSizeMigrationTask(mContext,
|
||||
LauncherAppState.getInstance().getInvariantDeviceProfile(),
|
||||
return new GridSizeMigrationTask(mContext, LauncherAppState.getIDP(mContext),
|
||||
mValidPackages, sourceSize, nextSize).migrateWorkspace();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user