aboutsummaryrefslogtreecommitdiff
path: root/src/com/android/tv/util
diff options
context:
space:
mode:
authorHongguang Chen <hgchen@google.com>2023-06-21 11:12:43 -0700
committerHongguang Chen <hgchen@google.com>2023-06-23 01:49:40 +0000
commit81b8210608241334a323e38e38441ce4f575f235 (patch)
tree080b36ead3c67879837468caeb746a9e01e3accb /src/com/android/tv/util
parent244887ae33906645a9164e5e51b4135bf1c468dd (diff)
downloadTV-81b8210608241334a323e38e38441ce4f575f235.tar.gz
Do not mark new channels to be browsable by default.
Do not change channel browsable state and count non browsable channels while setup. It will only be changed by TIS or in the EPG page after this change. When there is no any browsable channels, show setting. Bug: 288499376 Fix: 285657669 Test: setup LiveTV, check EPG and live tab Change-Id: I8a3c4e6074360f6daf256282e18f28e40b744c55
Diffstat (limited to 'src/com/android/tv/util')
-rw-r--r--src/com/android/tv/util/SetupUtils.java16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/com/android/tv/util/SetupUtils.java b/src/com/android/tv/util/SetupUtils.java
index aaee1047..858114d5 100644
--- a/src/com/android/tv/util/SetupUtils.java
+++ b/src/com/android/tv/util/SetupUtils.java
@@ -63,6 +63,8 @@ public class SetupUtils {
// Recognized inputs means that the user already knows the inputs are installed.
private static final String PREF_KEY_RECOGNIZED_INPUTS = "recognized_inputs";
private static final String PREF_KEY_IS_FIRST_TUNE = "is_first_tune";
+ // Whether to mark new channels to browsable.
+ private static final boolean MARK_NEW_CHANNELS_BROWSABLE = false;
private final Context mContext;
private final SharedPreferences mSharedPreferences;
@@ -132,11 +134,11 @@ public class SetupUtils {
boolean browsableChanged = false;
for (Channel channel : manager.getChannelList()) {
if (channel.getInputId().equals(inputId)) {
- if (!channel.isBrowsable()) {
+ if (!channel.isBrowsable() && MARK_NEW_CHANNELS_BROWSABLE) {
manager.updateBrowsable(channel.getId(), true, true);
browsableChanged = true;
}
- if (firstChannelForInput == null) {
+ if (firstChannelForInput == null && channel.isBrowsable()) {
firstChannelForInput = channel;
}
}
@@ -154,9 +156,15 @@ public class SetupUtils {
});
}
- /** Marks the channels in newly installed inputs browsable. */
+ /** Marks the channels in newly installed inputs browsable if enabled. */
@UiThread
- public void markNewChannelsBrowsable() {
+ public void markNewChannelsBrowsableIfEnabled() {
+ // TODO(b/288499376): Handle browsable field for channels added outside Live TV app in a
+ // better way.
+ if (!MARK_NEW_CHANNELS_BROWSABLE) {
+ return;
+ }
+
Set<String> newInputsWithChannels = new HashSet<>();
TvSingletons singletons = TvSingletons.getSingletons(mContext);
TvInputManagerHelper tvInputManagerHelper = singletons.getTvInputManagerHelper();