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

Commit 4770588b authored by Mark Chien's avatar Mark Chien Committed by Gerrit Code Review
Browse files

Merge "Fix NPE that netd callback call null TetheringConfiguration object"

parents 0daef814 e67c5643
Loading
Loading
Loading
Loading
+8 −7
Original line number Diff line number Diff line
@@ -272,13 +272,6 @@ public class Tethering {

        mStateReceiver = new StateReceiver();

        mNetdCallback = new NetdCallback();
        try {
            mNetd.registerUnsolicitedEventListener(mNetdCallback);
        } catch (RemoteException e) {
            mLog.e("Unable to register netd UnsolicitedEventListener");
        }

        final UserManager userManager = (UserManager) mContext.getSystemService(
                Context.USER_SERVICE);
        mTetheringRestriction = new UserRestrictionActionListener(userManager, this);
@@ -287,6 +280,14 @@ public class Tethering {

        // Load tethering configuration.
        updateConfiguration();
        // NetdCallback should be registered after updateConfiguration() to ensure
        // TetheringConfiguration is created.
        mNetdCallback = new NetdCallback();
        try {
            mNetd.registerUnsolicitedEventListener(mNetdCallback);
        } catch (RemoteException e) {
            mLog.e("Unable to register netd UnsolicitedEventListener");
        }

        startStateMachineUpdaters(mHandler);
        startTrackDefaultNetwork();