google_pixel: ThemePickerGoogle: Implement dummy recent wallpapers provider

* To appease Pixel Launcher.

Change-Id: I7d092aadcbc1a360ff9ec95c81d6c6cf5cbc4a96
lineage-19.1
Anay Wadhera 3 years ago committed by Nolen Johnson
parent 57f523082d
commit 025087c2da
  1. 1
      ThemePickerGoogle/Android.bp
  2. 4
      ThemePickerGoogle/AndroidManifest.xml
  3. 49
      ThemePickerGoogle/src/com/google/android/apps/wallpaper/provider/RecentWallpapersProvider.java

@ -55,6 +55,7 @@ android_app {
static_libs: [
"wallpaper-common-deps",
"SettingsLibSettingsTheme",
"SystemUIFlagsLib",
"SystemUI-statsd",
"styleprotoslite",
],

@ -35,6 +35,10 @@
</intent-filter>
</activity-alias>
<provider android:name="com.google.android.apps.wallpaper.provider.RecentWallpapersProvider"
android:permission="android.permission.MONITOR_INPUT"
android:exported="true"
android:authorities="com.google.android.apps.wallpaper.recents"/>
</application>
</manifest>

@ -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;
}
}
Loading…
Cancel
Save