Add null check for the taken callback

The requestTetheredInterface() and releaseTetheredInterface() in
EthernetManager is annotated as @NonNull. Basically, the taken
callback parameter to the service implementation should also be
@NonNull. However, it still possible to use native commands to
call the method in the aidl. If a null callback is taken, it may
cause unexpected results and cause crashes. Add a null check and
throw NPE as a warning.

Bug: 190058445
Test: adb commands
Change-Id: I18fd63aba3f7326597fc3a8c93ba8c9097bf7348
1 file changed
tree: 556919f275bd1dc48e47ec842796ff993265cd1b
  1. service-t/
  2. tests/