Search code examples
androidlistscreensaverdaydream

How to get list of all daydreams installed on android phone


I have managed to get list of all live wallpapers installed on phone. But i would like to get the list of all daydreams installed on my android phone. Can someone please help me with the intent that i should use to get this list.


Solution

  • This code prints all the Daydream available in the device:

    PackageManager packageManager = getPackageManager();
    Intent dreamIntent = new Intent(DreamService.SERVICE_INTERFACE);
    List<ResolveInfo> resolveInfoList = packageManager.queryIntentServices(dreamIntent, PackageManager.GET_META_DATA);
    for (ResolveInfo resolveInfo : resolveInfoList) {
        if (resolveInfo.serviceInfo == null) {
            continue;
        }
    
        Log.d(TAG, String.valueOf(resolveInfo.loadLabel(packageManager)));
    }