Skip to content

Commit

Permalink
Android: More robust check for whether to sync channels
Browse files Browse the repository at this point in the history
This changes channel syncing to happen when the operating system is
Android TV rather than when TvMainActivity is launched. (You can run
TvMainActivity on a phone by specifying a launch activity manually
in Android Studio, which I do sometimes for testing purposes. Without
this change, you get an exception when channel syncing runs.)
  • Loading branch information
JosJuice committed Feb 1, 2020
1 parent f8f9dbd commit 64953bb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ protected void onCreate(Bundle savedInstanceState)
{
StartupHandler.HandleInit(this);
}
// Setup and/or sync channels
TvUtil.scheduleSyncingChannel(getApplicationContext());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ public static void HandleInit(FragmentActivity parent)
// Ask the user if he wants to enable analytics if we haven't yet.
Analytics.checkAnalyticsInit(parent);

// Set up and/or sync Android TV channels
if (TvUtil.isLeanback(parent))
TvUtil.scheduleSyncingChannel(parent);

String[] start_files = null;
Bundle extras = parent.getIntent().getExtras();
if (extras != null)
Expand Down

0 comments on commit 64953bb

Please sign in to comment.