Merge "Fix the NPE in the Settings Tile lib"

This commit is contained in:
Treehugger Robot
2023-07-05 05:16:43 +00:00
committed by Android (Google) Code Review

View File

@@ -284,10 +284,10 @@ public abstract class Tile implements Parcelable {
* Optional key to use for this tile.
*/
public String getKey(Context context) {
ensureMetadataNotStale(context);
if (!hasKey()) {
return null;
}
ensureMetadataNotStale(context);
if (mMetaData.get(META_DATA_PREFERENCE_KEYHINT) instanceof Integer) {
return context.getResources().getString(mMetaData.getInt(META_DATA_PREFERENCE_KEYHINT));
} else {