Merge "TIF: Notify of visibility or label changes of TvInputInfo" into nyc-dev
am: d26ee11
* commit 'd26ee111720aebcad486dd1a37b5338040a4f915':
TIF: Notify of visibility or label changes of TvInputInfo
This commit is contained in:
@@ -1039,6 +1039,15 @@ public final class TvInputInfo implements Parcelable {
|
|||||||
}
|
}
|
||||||
Settings.Secure.putStringForUser(context.getContentResolver(),
|
Settings.Secure.putStringForUser(context.getContentResolver(),
|
||||||
Settings.Secure.TV_INPUT_HIDDEN_INPUTS, builder.toString(), userId);
|
Settings.Secure.TV_INPUT_HIDDEN_INPUTS, builder.toString(), userId);
|
||||||
|
|
||||||
|
// Notify of the TvInputInfo changes.
|
||||||
|
TvInputManager tm = (TvInputManager) context.getSystemService(Context.TV_INPUT_SERVICE);
|
||||||
|
for (String inputId : hiddenInputIds) {
|
||||||
|
TvInputInfo info = tm.getTvInputInfo(inputId);
|
||||||
|
if (info != null) {
|
||||||
|
tm.updateTvInputInfo(info);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1069,6 +1078,15 @@ public final class TvInputInfo implements Parcelable {
|
|||||||
}
|
}
|
||||||
Settings.Secure.putStringForUser(context.getContentResolver(),
|
Settings.Secure.putStringForUser(context.getContentResolver(),
|
||||||
Settings.Secure.TV_INPUT_CUSTOM_LABELS, builder.toString(), userId);
|
Settings.Secure.TV_INPUT_CUSTOM_LABELS, builder.toString(), userId);
|
||||||
|
|
||||||
|
// Notify of the TvInputInfo changes.
|
||||||
|
TvInputManager tm = (TvInputManager) context.getSystemService(Context.TV_INPUT_SERVICE);
|
||||||
|
for (String inputId : customLabels.keySet()) {
|
||||||
|
TvInputInfo info = tm.getTvInputInfo(inputId);
|
||||||
|
if (info != null) {
|
||||||
|
tm.updateTvInputInfo(info);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void ensureValidField(String value) {
|
private static void ensureValidField(String value) {
|
||||||
|
|||||||
Reference in New Issue
Block a user