Merge "add a method for non session" into tm-dev
This commit is contained in:
@@ -6789,7 +6789,8 @@ package android.media.tv {
|
|||||||
method @NonNull @RequiresPermission(android.Manifest.permission.TIS_EXTENSION_INTERFACE) public java.util.List<java.lang.String> getAvailableExtensionInterfaceNames(@NonNull String);
|
method @NonNull @RequiresPermission(android.Manifest.permission.TIS_EXTENSION_INTERFACE) public java.util.List<java.lang.String> getAvailableExtensionInterfaceNames(@NonNull String);
|
||||||
method @RequiresPermission(android.Manifest.permission.CAPTURE_TV_INPUT) public java.util.List<android.media.tv.TvStreamConfig> getAvailableTvStreamConfigList(String);
|
method @RequiresPermission(android.Manifest.permission.CAPTURE_TV_INPUT) public java.util.List<android.media.tv.TvStreamConfig> getAvailableTvStreamConfigList(String);
|
||||||
method @RequiresPermission("android.permission.TUNER_RESOURCE_ACCESS") public int getClientPid(@NonNull String);
|
method @RequiresPermission("android.permission.TUNER_RESOURCE_ACCESS") public int getClientPid(@NonNull String);
|
||||||
method @RequiresPermission("android.permission.TUNER_RESOURCE_ACCESS") public int getClientPriority(int, @Nullable String);
|
method @RequiresPermission("android.permission.TUNER_RESOURCE_ACCESS") public int getClientPriority(int, @NonNull String);
|
||||||
|
method @RequiresPermission("android.permission.TUNER_RESOURCE_ACCESS") public int getClientPriority(int);
|
||||||
method @NonNull @RequiresPermission(android.Manifest.permission.ACCESS_TUNED_INFO) public java.util.List<android.media.tv.TunedInfo> getCurrentTunedInfos();
|
method @NonNull @RequiresPermission(android.Manifest.permission.ACCESS_TUNED_INFO) public java.util.List<android.media.tv.TunedInfo> getCurrentTunedInfos();
|
||||||
method @NonNull @RequiresPermission("android.permission.DVB_DEVICE") public java.util.List<android.media.tv.DvbDeviceInfo> getDvbDeviceList();
|
method @NonNull @RequiresPermission("android.permission.DVB_DEVICE") public java.util.List<android.media.tv.DvbDeviceInfo> getDvbDeviceList();
|
||||||
method @Nullable @RequiresPermission(android.Manifest.permission.TIS_EXTENSION_INTERFACE) public android.os.IBinder getExtensionInterface(@NonNull String, @NonNull String);
|
method @Nullable @RequiresPermission(android.Manifest.permission.TIS_EXTENSION_INTERFACE) public android.os.IBinder getExtensionInterface(@NonNull String, @NonNull String);
|
||||||
|
|||||||
@@ -1863,12 +1863,9 @@ public final class TvInputManager {
|
|||||||
* Returns a priority for the given use case type and the client's foreground or background
|
* Returns a priority for the given use case type and the client's foreground or background
|
||||||
* status.
|
* status.
|
||||||
*
|
*
|
||||||
* @param useCase the use case type of the client. When the given use case type is invalid,
|
* @param useCase the use case type of the client.
|
||||||
* the default use case type will be used. {@see TvInputService#PriorityHintUseCaseType}.
|
* {@see TvInputService#PriorityHintUseCaseType}.
|
||||||
* @param sessionId the unique id of the session owned by the client. When {@code null},
|
* @param sessionId the unique id of the session owned by the client.
|
||||||
* the caller will be used as a client. When the session is invalid, background status
|
|
||||||
* will be used as a client's status. Otherwise, TV app corresponding to the given
|
|
||||||
* session id will be used as a client.
|
|
||||||
* {@see TvInputService#onCreateSession(String, String)}.
|
* {@see TvInputService#onCreateSession(String, String)}.
|
||||||
*
|
*
|
||||||
* @return the use case priority value for the given use case type and the client's foreground
|
* @return the use case priority value for the given use case type and the client's foreground
|
||||||
@@ -1879,10 +1876,34 @@ public final class TvInputManager {
|
|||||||
@SystemApi
|
@SystemApi
|
||||||
@RequiresPermission(android.Manifest.permission.TUNER_RESOURCE_ACCESS)
|
@RequiresPermission(android.Manifest.permission.TUNER_RESOURCE_ACCESS)
|
||||||
public int getClientPriority(@TvInputService.PriorityHintUseCaseType int useCase,
|
public int getClientPriority(@TvInputService.PriorityHintUseCaseType int useCase,
|
||||||
@Nullable String sessionId) {
|
@NonNull String sessionId) {
|
||||||
|
Preconditions.checkNotNull(sessionId);
|
||||||
|
if (!isValidUseCase(useCase)) {
|
||||||
|
throw new IllegalArgumentException("Invalid use case: " + useCase);
|
||||||
|
}
|
||||||
return getClientPriorityInternal(useCase, sessionId);
|
return getClientPriorityInternal(useCase, sessionId);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a priority for the given use case type and the caller's foreground or background
|
||||||
|
* status.
|
||||||
|
*
|
||||||
|
* @param useCase the use case type of the caller.
|
||||||
|
* {@see TvInputService#PriorityHintUseCaseType}.
|
||||||
|
*
|
||||||
|
* @return the use case priority value for the given use case type and the caller's foreground
|
||||||
|
* or background status.
|
||||||
|
*
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
@SystemApi
|
||||||
|
@RequiresPermission(android.Manifest.permission.TUNER_RESOURCE_ACCESS)
|
||||||
|
public int getClientPriority(@TvInputService.PriorityHintUseCaseType int useCase) {
|
||||||
|
if (!isValidUseCase(useCase)) {
|
||||||
|
throw new IllegalArgumentException("Invalid use case: " + useCase);
|
||||||
|
}
|
||||||
|
return getClientPriorityInternal(useCase, null);
|
||||||
|
};
|
||||||
/**
|
/**
|
||||||
* Creates a recording {@link Session} for a given TV input.
|
* Creates a recording {@link Session} for a given TV input.
|
||||||
*
|
*
|
||||||
@@ -1935,6 +1956,14 @@ public final class TvInputManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean isValidUseCase(int useCase) {
|
||||||
|
return useCase == TvInputService.PRIORITY_HINT_USE_CASE_TYPE_BACKGROUND
|
||||||
|
|| useCase == TvInputService.PRIORITY_HINT_USE_CASE_TYPE_SCAN
|
||||||
|
|| useCase == TvInputService.PRIORITY_HINT_USE_CASE_TYPE_PLAYBACK
|
||||||
|
|| useCase == TvInputService.PRIORITY_HINT_USE_CASE_TYPE_LIVE
|
||||||
|
|| useCase == TvInputService.PRIORITY_HINT_USE_CASE_TYPE_RECORD;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the TvStreamConfig list of the given TV input.
|
* Returns the TvStreamConfig list of the given TV input.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user