Merge "Fix NPE that netd callback call null TetheringConfiguration object"
This commit is contained in:
@@ -272,13 +272,6 @@ public class Tethering {
|
|||||||
|
|
||||||
mStateReceiver = new StateReceiver();
|
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(
|
final UserManager userManager = (UserManager) mContext.getSystemService(
|
||||||
Context.USER_SERVICE);
|
Context.USER_SERVICE);
|
||||||
mTetheringRestriction = new UserRestrictionActionListener(userManager, this);
|
mTetheringRestriction = new UserRestrictionActionListener(userManager, this);
|
||||||
@@ -287,6 +280,14 @@ public class Tethering {
|
|||||||
|
|
||||||
// Load tethering configuration.
|
// Load tethering configuration.
|
||||||
updateConfiguration();
|
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);
|
startStateMachineUpdaters(mHandler);
|
||||||
startTrackDefaultNetwork();
|
startTrackDefaultNetwork();
|
||||||
|
|||||||
Reference in New Issue
Block a user