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

Commit c630ba83 authored by Jason Chiu's avatar Jason Chiu Committed by Android (Google) Code Review
Browse files

Merge "Declare a metadata for setting the icon color scheme" into main

parents 39f6dcef e145e987
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -46,6 +46,8 @@ import android.os.UserHandle;
import android.text.TextUtils;
import android.util.Log;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;

import java.util.ArrayList;
@@ -326,6 +328,15 @@ public abstract class Tile implements Parcelable {
        return false;
    }

    /** Returns the icon color scheme. */
    @Nullable
    public String getIconColorScheme(@NonNull Context context) {
        ensureMetadataNotStale(context);
        return mMetaData != null
                ? mMetaData.getString(TileUtils.META_DATA_PREFERENCE_ICON_COLOR_SCHEME, null)
                : null;
    }

    /** Whether the {@link Activity} should be launched in a separate task. */
    public boolean isNewTask() {
        if (mMetaData != null && mMetaData.containsKey(META_DATA_NEW_TASK)) {
+7 −0
Original line number Diff line number Diff line
@@ -134,6 +134,13 @@ public class TileUtils {
     */
    public static final String META_DATA_PREFERENCE_ICON = "com.android.settings.icon";

    /**
     * Name of the meta-data item that should be set in the AndroidManifest.xml to specify the icon
     * color scheme. Only available for preferences on the homepage.
     */
    public static final String META_DATA_PREFERENCE_ICON_COLOR_SCHEME =
            "com.android.settings.icon_color_scheme";

    /**
     * Name of the meta-data item that should be set in the AndroidManifest.xml
     * to specify the icon background color. The value may or may not be used by Settings app.