From 0cfd36495b3f8ab5bba595db75c9d1106534ba62 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Tue, 22 Jun 2021 15:10:50 +0200 Subject: [PATCH] Android: Store HomeScreenChannel's appLinkIntentUri as Uri Cleanup of some code touched by the previous commit. --- .../dolphinemu/model/HomeScreenChannel.java | 15 ++++++--------- .../services/SyncChannelJobService.java | 2 +- .../org/dolphinemu/dolphinemu/utils/TvUtil.java | 2 +- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/HomeScreenChannel.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/HomeScreenChannel.java index ab6a7bb71e..1a38bfbc5e 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/HomeScreenChannel.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/HomeScreenChannel.java @@ -1,21 +1,18 @@ package org.dolphinemu.dolphinemu.model; +import android.net.Uri; + /** * Represents a home screen channel for Android TV api 26+ */ public class HomeScreenChannel { - private long channelId; private String name; private String description; - private String appLinkIntentUri; + private Uri appLinkIntentUri; - public HomeScreenChannel() - { - } - - public HomeScreenChannel(String name, String description, String appLinkIntentUri) + public HomeScreenChannel(String name, String description, Uri appLinkIntentUri) { this.name = name; this.description = description; @@ -52,12 +49,12 @@ public class HomeScreenChannel this.description = description; } - public String getAppLinkIntentUri() + public Uri getAppLinkIntentUri() { return appLinkIntentUri; } - public void setAppLinkIntentUri(String appLinkIntentUri) + public void setAppLinkIntentUri(Uri appLinkIntentUri) { this.appLinkIntentUri = appLinkIntentUri; } diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/services/SyncChannelJobService.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/services/SyncChannelJobService.java index 79e953d163..7b15ea2490 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/services/SyncChannelJobService.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/services/SyncChannelJobService.java @@ -111,7 +111,7 @@ public class SyncChannelJobService extends JobService } // Create the channel since it has not been added to the TV Provider. - Uri appLinkIntentUri = Uri.parse(subscription.getAppLinkIntentUri()); + Uri appLinkIntentUri = subscription.getAppLinkIntentUri(); Channel.Builder builder = new Channel.Builder(); builder.setType(TvContractCompat.Channels.TYPE_PREVIEW) diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/TvUtil.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/TvUtil.java index 4f3965553d..47a1d4943e 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/TvUtil.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/TvUtil.java @@ -264,7 +264,7 @@ public class TvUtil subs.add(new HomeScreenChannel( context.getString(platform.getHeaderName()), context.getString(platform.getHeaderName()), - AppLinkHelper.buildBrowseUri(platform).toString())); + AppLinkHelper.buildBrowseUri(platform))); } return subs; }