Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 27089aad authored by Jeremy Klein's avatar Jeremy Klein Committed by Lorenzo Colitti
Browse files

DO NOT MERGE: Add a null check for the OnStartTetheringCallback.

This avoids a NullPointerException when trying to call the callback
and gives a more readable error message.

(cherry picked from commit 5f277e16)

(cherry picked from commit c8e4cc8e)

Change-Id: Ia5f328c4b25aa6624dc3c8493eb0c7bbab99904c
parent 4fde1674
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2093,6 +2093,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) {
@@ -2103,6 +2105,7 @@ public class ConnectivityManager {
                }
            }
        };

        try {
            mService.startTethering(type, wrappedCallback, showProvisioningUi);
        } catch (RemoteException e) {