Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9d621c49 authored by Shahriyar Amini's avatar Shahriyar Amini Committed by Android (Google) Code Review
Browse files

Merge "Make methods for Tile content provider data public."

parents 17f739d9 1fc3aee9
Loading
Loading
Loading
Loading
+17 −2
Original line number Diff line number Diff line
@@ -414,13 +414,28 @@ public class TileUtils {
        return false;
    }

    private static int getIconFromUri(Context context, String uriString,
    /**
     * Gets the icon resource id from content provider.
     * @param Context context
     * @param uriString URI for the content provider
     * @param providerMap Maps URI authorities to providers
     * @return Resource id if returned by the content provider, otherwise 0
     */
    public static int getIconFromUri(Context context, String uriString,
            Map<String, IContentProvider> providerMap) {
        Bundle bundle = getBundleFromUri(context, uriString, providerMap);
        return (bundle != null) ? bundle.getInt(META_DATA_PREFERENCE_ICON, 0) : 0;
    }

    private static String getTextFromUri(Context context, String uriString,
    /**
     * Gets text associated with the input key from the content provider.
     * @param Context context
     * @param uriString URI for the content provider
     * @param providerMap Maps URI authorities to providers
     * @param key Key mapping to the text in bundle returned by the content provider
     * @return Text associated with the key, if returned by the content provider
     */
    public static String getTextFromUri(Context context, String uriString,
            Map<String, IContentProvider> providerMap, String key) {
        Bundle bundle = getBundleFromUri(context, uriString, providerMap);
        return (bundle != null) ? bundle.getString(key) : null;