Merge "[TIAF] Add null checks to avoid NPEs" into udc-dev
This commit is contained in:
@@ -269,6 +269,10 @@ class TvInputHardwareManager implements TvInputHal.Callback {
|
|||||||
@Override
|
@Override
|
||||||
public void onTvMessage(int deviceId, int type, Bundle data) {
|
public void onTvMessage(int deviceId, int type, Bundle data) {
|
||||||
synchronized (mLock) {
|
synchronized (mLock) {
|
||||||
|
String inputId = mHardwareInputIdMap.get(deviceId);
|
||||||
|
if (inputId == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
SomeArgs args = SomeArgs.obtain();
|
SomeArgs args = SomeArgs.obtain();
|
||||||
args.arg1 = mHardwareInputIdMap.get(deviceId);
|
args.arg1 = mHardwareInputIdMap.get(deviceId);
|
||||||
args.arg2 = data;
|
args.arg2 = data;
|
||||||
|
|||||||
@@ -4152,6 +4152,10 @@ public final class TvInputManagerService extends SystemService {
|
|||||||
synchronized (mLock) {
|
synchronized (mLock) {
|
||||||
UserState userState = getOrCreateUserStateLocked(mCurrentUserId);
|
UserState userState = getOrCreateUserStateLocked(mCurrentUserId);
|
||||||
TvInputState inputState = userState.inputMap.get(inputId);
|
TvInputState inputState = userState.inputMap.get(inputId);
|
||||||
|
if (inputState == null) {
|
||||||
|
Slog.e(TAG, "failed to send TV message - unknown input id " + inputId);
|
||||||
|
return;
|
||||||
|
}
|
||||||
ServiceState serviceState = userState.serviceStateMap.get(inputState.info
|
ServiceState serviceState = userState.serviceStateMap.get(inputState.info
|
||||||
.getComponent());
|
.getComponent());
|
||||||
for (IBinder token : serviceState.sessionTokens) {
|
for (IBinder token : serviceState.sessionTokens) {
|
||||||
|
|||||||
Reference in New Issue
Block a user