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
|
||||
public void onTvMessage(int deviceId, int type, Bundle data) {
|
||||
synchronized (mLock) {
|
||||
String inputId = mHardwareInputIdMap.get(deviceId);
|
||||
if (inputId == null) {
|
||||
return;
|
||||
}
|
||||
SomeArgs args = SomeArgs.obtain();
|
||||
args.arg1 = mHardwareInputIdMap.get(deviceId);
|
||||
args.arg2 = data;
|
||||
|
||||
@@ -4152,6 +4152,10 @@ public final class TvInputManagerService extends SystemService {
|
||||
synchronized (mLock) {
|
||||
UserState userState = getOrCreateUserStateLocked(mCurrentUserId);
|
||||
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
|
||||
.getComponent());
|
||||
for (IBinder token : serviceState.sessionTokens) {
|
||||
|
||||
Reference in New Issue
Block a user