diff --git a/media/java/android/media/tv/tuner/ITunerResourceManager.aidl b/media/java/android/media/tv/tuner/ITunerResourceManager.aidl index 148383b00e58a..7c33e93f45f93 100644 --- a/media/java/android/media/tv/tuner/ITunerResourceManager.aidl +++ b/media/java/android/media/tv/tuner/ITunerResourceManager.aidl @@ -21,6 +21,7 @@ import android.media.tv.tuner.ITunerResourceManagerListener; import android.media.tv.tuner.ResourceClientProfile; import android.media.tv.tuner.TunerFrontendInfo; import android.media.tv.tuner.TunerFrontendRequest; +import android.media.tv.tuner.TunerLnbRequest; /** * Interface of the Tuner Resource Manager. It manages resources used by TV Tuners. @@ -99,6 +100,16 @@ interface ITunerResourceManager { */ void updateCasInfo(in int casSystemId, in int maxSessionNum); + /* + * Updates the available Lnb resource information on the current device. + * + *
Note: This update must happen before the first + * {@link #requestLnb(TunerLnbRequest, int[])} and {@link #releaseLnb(int)} call. + * + * @param lnbIds ids of the updating lnbs. + */ + void setLnbInfoList(in int[] lnbIds); + /* * This API is used by the Tuner framework to request an available frontend from the TunerHAL. * @@ -162,6 +173,30 @@ interface ITunerResourceManager { */ boolean requestCasSession(in CasSessionRequest request, out int[] sessionResourceId); + /* + * This API is used by the Tuner framework to request an available Lnb from the TunerHAL. + * + *
There are three possible scenarios: + *
Note: {@link #setLnbInfos(int[])} must be called before this request. + * + * @param request {@link TunerLnbRequest} information of the current request. + * @param lnbId a one-element array to return the granted Lnb id. + * + * @return true if there is Lnb granted. + */ + boolean requestLnb(in TunerLnbRequest request, out int[] lnbId); + /* * Notifies the TRM that the given frontend has been released. * @@ -184,4 +219,15 @@ interface ITunerResourceManager { * @param sessionResourceId the id of the released CAS session. */ void releaseCasSession(in int sessionResourceId); + + /* + * Notifies the TRM that the Lnb with the given id was released. + * + *
Client must call this whenever it releases an Lnb. + * + *
Note: {@link #setLnbInfos(int[])} must be called before this release.
+ *
+ * @param lnbId the id of the released Tuner Lnb.
+ */
+ void releaseLnb(in int lnbId);
}
diff --git a/media/java/android/media/tv/tuner/TunerLnbRequest.aidl b/media/java/android/media/tv/tuner/TunerLnbRequest.aidl
new file mode 100644
index 0000000000000..b811e3922252f
--- /dev/null
+++ b/media/java/android/media/tv/tuner/TunerLnbRequest.aidl
@@ -0,0 +1,24 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.media.tv.tuner;
+
+/**
+ * Information required to request a Tuner Lnb.
+ *
+ * @hide
+ */
+parcelable TunerLnbRequest;
\ No newline at end of file
diff --git a/media/java/android/media/tv/tuner/TunerLnbRequest.java b/media/java/android/media/tv/tuner/TunerLnbRequest.java
new file mode 100644
index 0000000000000..60cd7903b1761
--- /dev/null
+++ b/media/java/android/media/tv/tuner/TunerLnbRequest.java
@@ -0,0 +1,96 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.media.tv.tuner;
+
+import android.annotation.NonNull;
+import android.os.Parcel;
+import android.os.Parcelable;
+import android.util.Log;
+
+/**
+ * Information required to request a Tuner Lnb.
+ *
+ * @hide
+ */
+public final class TunerLnbRequest implements Parcelable {
+ static final String TAG = "TunerLnbRequest";
+
+ public static final
+ @NonNull
+ Parcelable.Creator