Use obtainMessageO for sendTimeShiftMode

It seems the obtainMessageI doesn't work for single argument results for some reason. Using obtainMessageO is more consistent with the rest of the implementations anyway. This fixes a crash when trying to access the args, which are null.

Bug: 269185572
Test: atest TvInteractiveAppServiceTest
Change-Id: I94fd4b87dbe09b282541785718996263170c85da
This commit is contained in:
David Zhao
2023-02-17 14:32:38 -08:00
parent b89917c0ee
commit bed9c323ee

View File

@@ -190,9 +190,7 @@ public class ITvInteractiveAppSessionWrapper
break;
}
case DO_SEND_TIME_SHIFT_MODE: {
SomeArgs args = (SomeArgs) msg.obj;
mSessionImpl.sendTimeShiftMode(args.argi1);
args.recycle();
mSessionImpl.sendTimeShiftMode((Integer) msg.obj);
break;
}
case DO_SEND_AVAILABLE_SPEEDS: {
@@ -447,7 +445,7 @@ public class ITvInteractiveAppSessionWrapper
@Override
public void sendTimeShiftMode(int mode) {
mCaller.executeOrSendMessage(mCaller.obtainMessageI(DO_SEND_TIME_SHIFT_MODE, mode));
mCaller.executeOrSendMessage(mCaller.obtainMessageO(DO_SEND_TIME_SHIFT_MODE, mode));
}
@Override