From 025087c2da124a085cb3c2d53e414de5eda6331e Mon Sep 17 00:00:00 2001 From: Anay Wadhera Date: Wed, 13 Apr 2022 03:58:29 +0900 Subject: [PATCH] google_pixel: ThemePickerGoogle: Implement dummy recent wallpapers provider * To appease Pixel Launcher. Change-Id: I7d092aadcbc1a360ff9ec95c81d6c6cf5cbc4a96 --- ThemePickerGoogle/Android.bp | 1 + ThemePickerGoogle/AndroidManifest.xml | 4 ++ .../provider/RecentWallpapersProvider.java | 49 +++++++++++++++++++ 3 files changed, 54 insertions(+) create mode 100644 ThemePickerGoogle/src/com/google/android/apps/wallpaper/provider/RecentWallpapersProvider.java diff --git a/ThemePickerGoogle/Android.bp b/ThemePickerGoogle/Android.bp index 4b04d48..b80f1e8 100644 --- a/ThemePickerGoogle/Android.bp +++ b/ThemePickerGoogle/Android.bp @@ -55,6 +55,7 @@ android_app { static_libs: [ "wallpaper-common-deps", "SettingsLibSettingsTheme", + "SystemUIFlagsLib", "SystemUI-statsd", "styleprotoslite", ], diff --git a/ThemePickerGoogle/AndroidManifest.xml b/ThemePickerGoogle/AndroidManifest.xml index 8f00c0f..82cbcb4 100644 --- a/ThemePickerGoogle/AndroidManifest.xml +++ b/ThemePickerGoogle/AndroidManifest.xml @@ -35,6 +35,10 @@ + diff --git a/ThemePickerGoogle/src/com/google/android/apps/wallpaper/provider/RecentWallpapersProvider.java b/ThemePickerGoogle/src/com/google/android/apps/wallpaper/provider/RecentWallpapersProvider.java new file mode 100644 index 0000000..c633269 --- /dev/null +++ b/ThemePickerGoogle/src/com/google/android/apps/wallpaper/provider/RecentWallpapersProvider.java @@ -0,0 +1,49 @@ +package com.google.android.apps.wallpaper.provider; + +import android.content.ContentProvider; +import android.content.ContentValues; +import android.database.Cursor; +import android.database.MatrixCursor; +import android.net.Uri; + +import com.android.systemui.flags.FlagManager; + +public class RecentWallpapersProvider extends ContentProvider { + + @Override // android.content.ContentProvider + public boolean onCreate() { + return true; + } + + @Override // android.content.ContentProvider + public String getType(Uri uri) { + return "vnd.android.cursor.dir/recent_wallpapers"; + } + + @Override // android.content.ContentProvider + public Cursor query(Uri uri, String[] strArr, String str, String[] strArr2, String str2) { + if (!"/list_recent".equals(uri.getPath())) { + return null; + } + MatrixCursor matrixCursor = new MatrixCursor(new String[]{FlagManager.FIELD_ID, "placeholder_color", "component", "title"}); + return matrixCursor; + } + + @Override // android.content.ContentProvider + public int update(Uri uri, ContentValues contentValues, String str, String[] strArr) { + if (!"/set_recent_wallpaper".equals(uri.getPath())) { + return 0; + } + return 1; + } + + @Override // android.content.ContentProvider + public int delete(Uri uri, String str, String[] strArr) { + return 0; + } + + @Override // android.content.ContentProvider + public Uri insert(Uri uri, ContentValues contentValues) { + return null; + } +}