Merge "TIF: Address comments on hardware manager related system APIs" into nyc-dev
am: 8904a1a
* commit '8904a1a1df404149be94ee7df600eda1de177ff4':
TIF: Address comments on hardware manager related system APIs
Change-Id: I0ef721b3b15a3c6358cb8f34cd2427bd311ce738
This commit is contained in:
@@ -94,6 +94,10 @@ package android.media {
|
|||||||
|
|
||||||
package android.media.tv {
|
package android.media.tv {
|
||||||
|
|
||||||
|
public final class TvInputManager {
|
||||||
|
method public android.media.tv.TvInputManager.Hardware acquireTvInputHardware(int, android.media.tv.TvInputManager.HardwareCallback, android.media.tv.TvInputInfo);
|
||||||
|
}
|
||||||
|
|
||||||
public class TvView extends android.view.ViewGroup {
|
public class TvView extends android.view.ViewGroup {
|
||||||
method public void requestUnblockContent(android.media.tv.TvContentRating);
|
method public void requestUnblockContent(android.media.tv.TvContentRating);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24638,7 +24638,7 @@ package android.media.tv {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public final class TvInputManager {
|
public final class TvInputManager {
|
||||||
method public android.media.tv.TvInputManager.Hardware acquireTvInputHardware(int, android.media.tv.TvInputManager.HardwareCallback, android.media.tv.TvInputInfo);
|
method public android.media.tv.TvInputManager.Hardware acquireTvInputHardware(int, android.media.tv.TvInputInfo, android.media.tv.TvInputManager.HardwareCallback);
|
||||||
method public void addBlockedRating(android.media.tv.TvContentRating);
|
method public void addBlockedRating(android.media.tv.TvContentRating);
|
||||||
method public boolean captureFrame(java.lang.String, android.view.Surface, android.media.tv.TvStreamConfig);
|
method public boolean captureFrame(java.lang.String, android.view.Surface, android.media.tv.TvStreamConfig);
|
||||||
method public java.util.List<android.media.tv.TvStreamConfig> getAvailableTvStreamConfigList(java.lang.String);
|
method public java.util.List<android.media.tv.TvStreamConfig> getAvailableTvStreamConfigList(java.lang.String);
|
||||||
|
|||||||
@@ -92,6 +92,10 @@ package android.media {
|
|||||||
|
|
||||||
package android.media.tv {
|
package android.media.tv {
|
||||||
|
|
||||||
|
public final class TvInputManager {
|
||||||
|
method public android.media.tv.TvInputManager.Hardware acquireTvInputHardware(int, android.media.tv.TvInputManager.HardwareCallback, android.media.tv.TvInputInfo);
|
||||||
|
}
|
||||||
|
|
||||||
public class TvView extends android.view.ViewGroup {
|
public class TvView extends android.view.ViewGroup {
|
||||||
method public void requestUnblockContent(android.media.tv.TvContentRating);
|
method public void requestUnblockContent(android.media.tv.TvContentRating);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -94,6 +94,10 @@ package android.media {
|
|||||||
|
|
||||||
package android.media.tv {
|
package android.media.tv {
|
||||||
|
|
||||||
|
public final class TvInputManager {
|
||||||
|
method public android.media.tv.TvInputManager.Hardware acquireTvInputHardware(int, android.media.tv.TvInputManager.HardwareCallback, android.media.tv.TvInputInfo);
|
||||||
|
}
|
||||||
|
|
||||||
public class TvView extends android.view.ViewGroup {
|
public class TvView extends android.view.ViewGroup {
|
||||||
method public void requestUnblockContent(android.media.tv.TvContentRating);
|
method public void requestUnblockContent(android.media.tv.TvContentRating);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -843,11 +843,21 @@ public final class TvInputManager {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface used to receive events from Hardware objects.
|
* Interface used to receive events from Hardware objects.
|
||||||
|
*
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@SystemApi
|
@SystemApi
|
||||||
public abstract static class HardwareCallback {
|
public abstract static class HardwareCallback {
|
||||||
|
/**
|
||||||
|
* This is called when {@link Hardware} is no longer available for the client.
|
||||||
|
*/
|
||||||
public abstract void onReleased();
|
public abstract void onReleased();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is called when the underlying {@link TvStreamConfig} has been changed.
|
||||||
|
*
|
||||||
|
* @param configs A list of new {@link TvStreamConfig}s.
|
||||||
|
*/
|
||||||
public abstract void onStreamConfigChanged(TvStreamConfig[] configs);
|
public abstract void onStreamConfigChanged(TvStreamConfig[] configs);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1489,18 +1499,41 @@ public final class TvInputManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns acquired TvInputManager.Hardware object for given deviceId.
|
* Acquires {@link Hardware} object for the given device ID.
|
||||||
*
|
*
|
||||||
* If there are other Hardware object acquired for the same deviceId, calling this method will
|
* <p>A subsequent call to this method on the same {@code deviceId} will release the currently
|
||||||
* preempt the previously acquired object and report {@link HardwareCallback#onReleased} to the
|
* acquired Hardware.
|
||||||
* old object.
|
*
|
||||||
|
* @param deviceId The device ID to acquire Hardware for.
|
||||||
|
* @param callback A callback to receive updates on Hardware.
|
||||||
|
* @param info The TV input which will use the acquired Hardware.
|
||||||
|
* @return Hardware on success, {@code null} otherwise.
|
||||||
|
*
|
||||||
|
* @removed
|
||||||
|
*/
|
||||||
|
@RequiresPermission(android.Manifest.permission.TV_INPUT_HARDWARE)
|
||||||
|
public Hardware acquireTvInputHardware(int deviceId, final HardwareCallback callback,
|
||||||
|
TvInputInfo info) {
|
||||||
|
return acquireTvInputHardware(deviceId, info, callback);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Acquires {@link Hardware} object for the given device ID.
|
||||||
|
*
|
||||||
|
* <p>A subsequent call to this method on the same {@code deviceId} will release the currently
|
||||||
|
* acquired Hardware.
|
||||||
|
*
|
||||||
|
* @param deviceId The device ID to acquire Hardware for.
|
||||||
|
* @param callback A callback to receive updates on Hardware.
|
||||||
|
* @param info The TV input which will use the acquired Hardware.
|
||||||
|
* @return Hardware on success, {@code null} otherwise.
|
||||||
*
|
*
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@SystemApi
|
@SystemApi
|
||||||
@RequiresPermission(android.Manifest.permission.TV_INPUT_HARDWARE)
|
@RequiresPermission(android.Manifest.permission.TV_INPUT_HARDWARE)
|
||||||
public Hardware acquireTvInputHardware(int deviceId, final HardwareCallback callback,
|
public Hardware acquireTvInputHardware(int deviceId, TvInputInfo info,
|
||||||
TvInputInfo info) {
|
final HardwareCallback callback) {
|
||||||
try {
|
try {
|
||||||
return new Hardware(
|
return new Hardware(
|
||||||
mService.acquireTvInputHardware(deviceId, new ITvInputHardwareCallback.Stub() {
|
mService.acquireTvInputHardware(deviceId, new ITvInputHardwareCallback.Stub() {
|
||||||
@@ -1522,6 +1555,9 @@ public final class TvInputManager {
|
|||||||
/**
|
/**
|
||||||
* Releases previously acquired hardware object.
|
* Releases previously acquired hardware object.
|
||||||
*
|
*
|
||||||
|
* @param deviceId The device ID this Hardware was acquired for
|
||||||
|
* @param hardware Hardware to release.
|
||||||
|
*
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@SystemApi
|
@SystemApi
|
||||||
|
|||||||
Reference in New Issue
Block a user