diff --git a/core/api/system-current.txt b/core/api/system-current.txt index 2ebcb1984ae03..b4a9939ec7305 100644 --- a/core/api/system-current.txt +++ b/core/api/system-current.txt @@ -5350,9 +5350,9 @@ package android.media.tv.tuner { method public int disconnectFrontendToCiCam(int); method public int getAvSyncHwId(@NonNull android.media.tv.tuner.filter.Filter); method public long getAvSyncTime(int); + method @Nullable public java.util.List getAvailableFrontendInfos(); method @Nullable public android.media.tv.tuner.DemuxCapabilities getDemuxCapabilities(); method @Nullable public android.media.tv.tuner.frontend.FrontendInfo getFrontendInfo(); - method @Nullable public java.util.List getFrontendInfoList(); method @Nullable public android.media.tv.tuner.frontend.FrontendStatus getFrontendStatus(@NonNull int[]); method @Nullable @RequiresPermission(android.Manifest.permission.ACCESS_TV_DESCRAMBLER) public android.media.tv.tuner.Descrambler openDescrambler(); method @Nullable public android.media.tv.tuner.dvr.DvrPlayback openDvrPlayback(long, @NonNull java.util.concurrent.Executor, @NonNull android.media.tv.tuner.dvr.OnPlaybackStatusChangedListener); diff --git a/media/java/android/media/tv/tuner/Tuner.java b/media/java/android/media/tv/tuner/Tuner.java index 46b29f5bc90a4..7192c0737b777 100644 --- a/media/java/android/media/tv/tuner/Tuner.java +++ b/media/java/android/media/tv/tuner/Tuner.java @@ -988,9 +988,11 @@ public class Tuner implements AutoCloseable { } /** - * Gets the initialized frontend information. + * Gets the currently initialized and activated frontend information. To get all the available + * frontend info on the device, use {@link getAvailableFrontendInfos()}. * - * @return The frontend information. {@code null} if the operation failed. + * @return The active frontend information. {@code null} if the operation failed. + * @throws IllegalStateException if there is no active frontend currently. */ @Nullable public FrontendInfo getFrontendInfo() { @@ -1007,13 +1009,20 @@ public class Tuner implements AutoCloseable { } /** - * Get a list all the existed frontend information. + * Gets a list of all the available frontend information on the device. To get the information + * of the currently active frontend, use {@link getFrontendInfo()}. The active frontend + * information is also included in the list of the available frontend information. * - * @return The list of all the frontend information. {@code null} if the operation failed. + * @return The list of all the available frontend information. {@code null} if the operation + * failed. */ @Nullable - public List getFrontendInfoList() { - return Arrays.asList(getFrontendInfoListInternal()); + public List getAvailableFrontendInfos() { + FrontendInfo[] feInfoList = getFrontendInfoListInternal(); + if (feInfoList == null) { + return null; + } + return Arrays.asList(feInfoList); } /** @hide */