Merge "Add a null check for the OnStartTetheringCallback."

This commit is contained in:
Jeremy Klein
2016-03-23 18:52:14 +00:00
committed by Android (Google) Code Review

View File

@@ -1987,6 +1987,8 @@ public class ConnectivityManager {
@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) {
@@ -1997,6 +1999,7 @@ public class ConnectivityManager {
}
}
};
try {
mService.startTethering(type, wrappedCallback, showProvisioningUi);
} catch (RemoteException e) {