mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-15 08:49:20 +01:00
Merge pull request #10787 from JosJuice/channel-uri
Android: Add app link intent URI to channels projection
This commit is contained in:
commit
4617ee7d89
@ -87,7 +87,7 @@ public class SyncChannelJobService extends JobService
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
subscriptions = TvUtil.createUniversalSubscriptions();
|
subscriptions = TvUtil.createUniversalSubscriptions(context);
|
||||||
for (HomeScreenChannel subscription : subscriptions)
|
for (HomeScreenChannel subscription : subscriptions)
|
||||||
{
|
{
|
||||||
long channelId = createChannel(subscription);
|
long channelId = createChannel(subscription);
|
||||||
|
@ -98,7 +98,8 @@ public class SyncProgramsJobService extends JobService
|
|||||||
Channel channel = TvUtil.getChannelById(context, channelId);
|
Channel channel = TvUtil.getChannelById(context, channelId);
|
||||||
for (Platform platform : Platform.values())
|
for (Platform platform : Platform.values())
|
||||||
{
|
{
|
||||||
if (channel != null && channel.getDisplayName().equals(platform.getIdString()))
|
if (channel != null &&
|
||||||
|
channel.getAppLinkIntentUri().equals(AppLinkHelper.buildBrowseUri(platform)))
|
||||||
{
|
{
|
||||||
getGamesByPlatform(platform);
|
getGamesByPlatform(platform);
|
||||||
syncPrograms(channelId);
|
syncPrograms(channelId);
|
||||||
|
@ -50,8 +50,9 @@ public class TvUtil
|
|||||||
|
|
||||||
private static final String[] CHANNELS_PROJECTION = {
|
private static final String[] CHANNELS_PROJECTION = {
|
||||||
TvContractCompat.Channels._ID,
|
TvContractCompat.Channels._ID,
|
||||||
TvContract.Channels.COLUMN_DISPLAY_NAME,
|
TvContractCompat.Channels.COLUMN_DISPLAY_NAME,
|
||||||
TvContractCompat.Channels.COLUMN_BROWSABLE
|
TvContractCompat.Channels.COLUMN_BROWSABLE,
|
||||||
|
TvContractCompat.Channels.COLUMN_APP_LINK_INTENT_URI
|
||||||
};
|
};
|
||||||
private static final String LEANBACK_PACKAGE = "com.google.android.tvlauncher";
|
private static final String LEANBACK_PACKAGE = "com.google.android.tvlauncher";
|
||||||
|
|
||||||
@ -253,21 +254,19 @@ public class TvUtil
|
|||||||
/**
|
/**
|
||||||
* Generates all subscriptions for homescreen channels.
|
* Generates all subscriptions for homescreen channels.
|
||||||
*/
|
*/
|
||||||
public static List<HomeScreenChannel> createUniversalSubscriptions()
|
public static List<HomeScreenChannel> createUniversalSubscriptions(Context context)
|
||||||
{
|
{
|
||||||
return new ArrayList<>(createPlatformSubscriptions());
|
return new ArrayList<>(createPlatformSubscriptions(context));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static List<HomeScreenChannel> createPlatformSubscriptions()
|
private static List<HomeScreenChannel> createPlatformSubscriptions(Context context)
|
||||||
{
|
{
|
||||||
List<HomeScreenChannel> subs = new ArrayList<>();
|
List<HomeScreenChannel> subs = new ArrayList<>();
|
||||||
for (Platform platform : Platform.values())
|
for (Platform platform : Platform.values())
|
||||||
{
|
{
|
||||||
// TODO: Replace the getIdString calls with getHeaderName to get localized names.
|
|
||||||
// This would require SyncProgramsJobService to stop using the display name as a key
|
|
||||||
subs.add(new HomeScreenChannel(
|
subs.add(new HomeScreenChannel(
|
||||||
platform.getIdString(),
|
context.getString(platform.getHeaderName()),
|
||||||
platform.getIdString(),
|
context.getString(platform.getHeaderName()),
|
||||||
AppLinkHelper.buildBrowseUri(platform)));
|
AppLinkHelper.buildBrowseUri(platform)));
|
||||||
}
|
}
|
||||||
return subs;
|
return subs;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user