StatixThemePicker: implement dummy recent wallpapers provider for Pixel Launcher
Change-Id: I7d092aadcbc1a360ff9ec95c81d6c6cf5cbc4a96 Reviewed-on: https://review.statixos.com/c/android_packages_apps_Statix_ThemePicker/+/7570 Reviewed-by: Anay Wadhera <anay1018@gmail.com> Tested-by: Anay Wadhera <anay1018@gmail.com>
This commit is contained in:
parent
1c8558f4f4
commit
fab9ccb786
|
@ -57,6 +57,7 @@ android_app {
|
|||
"themelib",
|
||||
"wallpaper-common-deps",
|
||||
"SettingsLibSettingsTheme",
|
||||
"SystemUIFlagsLib",
|
||||
"SystemUI-statsd",
|
||||
"styleprotoslite",
|
||||
],
|
||||
|
|
|
@ -51,6 +51,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…
Reference in New Issue