This avoids a NullPointerException when trying to call the callback
and gives a more readable error message.
(cherry picked from commit
5f277e1667b49976a77c9fa79b9a04d775f3b49e)
Change-Id: Ia419ff68ef10f308f9e44be47420e27099ee6070
@SystemApi
public void startTethering(int type, boolean showProvisioningUi,
final OnStartTetheringCallback callback, Handler handler) {
+ checkNotNull(callback, "OnStartTetheringCallback cannot be null.");
+
ResultReceiver wrappedCallback = new ResultReceiver(handler) {
@Override
protected void onReceiveResult(int resultCode, Bundle resultData) {
}
}
};
+
try {
mService.startTethering(type, wrappedCallback, showProvisioningUi);
} catch (RemoteException e) {