mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-03 17:36:49 +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:
@@ -93,9 +93,9 @@ public class ContentWriter {
|
||||
* Commits any pending validation and returns the final values.
|
||||
* Must not be called on UI thread.
|
||||
*/
|
||||
public ContentValues getValues() {
|
||||
public ContentValues getValues(Context context) {
|
||||
Preconditions.assertNonUiThread();
|
||||
if (mIcon != null && !LauncherAppState.getInstance().getIconCache()
|
||||
if (mIcon != null && !LauncherAppState.getInstance(context).getIconCache()
|
||||
.isDefaultIcon(mIcon, mUser)) {
|
||||
mValues.put(LauncherSettings.Favorites.ICON, Utilities.flattenBitmap(mIcon));
|
||||
mIcon = null;
|
||||
@@ -105,7 +105,7 @@ public class ContentWriter {
|
||||
|
||||
public int commit() {
|
||||
if (mCommitParams != null) {
|
||||
return mContext.getContentResolver().update(mCommitParams.mUri, getValues(),
|
||||
return mContext.getContentResolver().update(mCommitParams.mUri, getValues(mContext),
|
||||
mCommitParams.mWhere, mCommitParams.mSelectionArgs);
|
||||
}
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user