TIF: Enable inflating class android.media.tv.TvView on non-TV devices

Needed to pass the CTS for those devices.

Bug: 17455222
Change-Id: Ief9a76835418906d9e8e06d4e5ddc71a3370055d
This commit is contained in:
Jae Seo
2014-09-10 13:11:13 -07:00
parent fc81bfe3fb
commit 9127e4580c
2 changed files with 6 additions and 2 deletions

View File

@@ -709,7 +709,9 @@ public final class TvInputManager {
}
};
try {
mService.registerCallback(mManagerCallback, mUserId);
if (mService != null) {
mService.registerCallback(mManagerCallback, mUserId);
}
} catch (RemoteException e) {
Log.e(TAG, "mService.registerCallback failed: " + e);
}

View File

@@ -312,7 +312,9 @@ public class TvView extends ViewGroup {
// is newly assigned for every createSession request and compared with
// MySessionCreateCallback.this.
mSessionCallback = new MySessionCallback(inputId, channelUri, params);
mTvInputManager.createSession(inputId, mSessionCallback, mHandler);
if (mTvInputManager != null) {
mTvInputManager.createSession(inputId, mSessionCallback, mHandler);
}
}
}