summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/util/ContentWriter.java
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2017-01-11 10:48:34 -0800
committerSunny Goyal <sunnygoyal@google.com>2017-01-11 12:52:03 -0800
commit87f784c285fdeed9091a4de8b9b44db3eca677d8 (patch)
tree94870e68378e8d0e1fb09555fc1be4ca149ba99b /src/com/android/launcher3/util/ContentWriter.java
parent41307051416b3e027d89e72301704432bd1c5eb3 (diff)
downloadandroid_packages_apps_Trebuchet-87f784c285fdeed9091a4de8b9b44db3eca677d8.tar.gz
android_packages_apps_Trebuchet-87f784c285fdeed9091a4de8b9b44db3eca677d8.tar.bz2
android_packages_apps_Trebuchet-87f784c285fdeed9091a4de8b9b44db3eca677d8.zip
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
Diffstat (limited to 'src/com/android/launcher3/util/ContentWriter.java')
-rw-r--r--src/com/android/launcher3/util/ContentWriter.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/com/android/launcher3/util/ContentWriter.java b/src/com/android/launcher3/util/ContentWriter.java
index 76ba9d63a..438432891 100644
--- a/src/com/android/launcher3/util/ContentWriter.java
+++ b/src/com/android/launcher3/util/ContentWriter.java
@@ -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;