Merge "TIF: Change invalid error code to RECORDING_ERROR_UNKNOWN" into nyc-dev am: ddf44fc7ef
am: e30706819a
* commit 'e30706819a6674a6f56f5cf0e41d8d9667c6e628':
TIF: Change invalid error code to RECORDING_ERROR_UNKNOWN
Change-Id: Ie9bab8eaca180ab122cea8ad187d573f2f147172
This commit is contained in:
@@ -188,6 +188,9 @@ public final class TvInputManager {
|
||||
RECORDING_ERROR_RESOURCE_BUSY})
|
||||
public @interface RecordingError {}
|
||||
|
||||
static final int RECORDING_ERROR_START = 0;
|
||||
static final int RECORDING_ERROR_END = 2;
|
||||
|
||||
/**
|
||||
* Error for {@link TvInputService.RecordingSession#notifyError(int)} and
|
||||
* {@link TvRecordingClient.RecordingCallback#onError(int)}: The requested operation cannot be
|
||||
@@ -195,7 +198,7 @@ public final class TvInputManager {
|
||||
* for the problem is defined on the higher version than application's
|
||||
* <code>android:targetSdkVersion</code>.
|
||||
*/
|
||||
public static final int RECORDING_ERROR_UNKNOWN = 0;
|
||||
public static final int RECORDING_ERROR_UNKNOWN = RECORDING_ERROR_START;
|
||||
|
||||
/**
|
||||
* Error for {@link TvInputService.RecordingSession#notifyError(int)} and
|
||||
@@ -209,7 +212,7 @@ public final class TvInputManager {
|
||||
* {@link TvRecordingClient.RecordingCallback#onError(int)}: Recording cannot proceed because
|
||||
* a required recording resource was not able to be allocated.
|
||||
*/
|
||||
public static final int RECORDING_ERROR_RESOURCE_BUSY = 2;
|
||||
public static final int RECORDING_ERROR_RESOURCE_BUSY = RECORDING_ERROR_END;
|
||||
|
||||
/** @hide */
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
|
||||
@@ -1613,7 +1613,14 @@ public abstract class TvInputService extends Service {
|
||||
* <li>{@link TvInputManager#RECORDING_ERROR_RESOURCE_BUSY}
|
||||
* </ul>
|
||||
*/
|
||||
public void notifyError(@TvInputManager.RecordingError final int error) {
|
||||
public void notifyError(@TvInputManager.RecordingError int error) {
|
||||
if (error < TvInputManager.RECORDING_ERROR_START
|
||||
|| error > TvInputManager.RECORDING_ERROR_END) {
|
||||
Log.w(TAG, "notifyError - invalid error code (" + error
|
||||
+ ") is changed to RECORDING_ERROR_UNKNOWN.");
|
||||
error = TvInputManager.RECORDING_ERROR_UNKNOWN;
|
||||
}
|
||||
final int validError = error;
|
||||
executeOrPostRunnableOnMainThread(new Runnable() {
|
||||
@MainThread
|
||||
@Override
|
||||
@@ -1621,7 +1628,7 @@ public abstract class TvInputService extends Service {
|
||||
try {
|
||||
if (DEBUG) Log.d(TAG, "notifyError");
|
||||
if (mSessionCallback != null) {
|
||||
mSessionCallback.onError(error);
|
||||
mSessionCallback.onError(validError);
|
||||
}
|
||||
} catch (RemoteException e) {
|
||||
Log.w(TAG, "error in notifyError", e);
|
||||
|
||||
Reference in New Issue
Block a user