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

Commit c3089b08 authored by Jae Seo's avatar Jae Seo
Browse files

TIF: Notify of visibility or label changes of TvInputInfo

Bug: 27264461
Change-Id: Iaea9c34855eb7516993e5c92c1e0369d47e59587
parent d0ee17d9
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -1039,6 +1039,15 @@ public final class TvInputInfo implements Parcelable {
            }
            Settings.Secure.putStringForUser(context.getContentResolver(),
                    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.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) {