Merge "Fixes for null WifiManager." into rvc-dev-plus-aosp am: 7e2e20538e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11336055 Change-Id: If1392627b8ba0a6051e5f5e83d8087dff57c0406
This commit is contained in:
@@ -214,6 +214,9 @@ public class WifiStatusTracker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void updateStatusLabel() {
|
private void updateStatusLabel() {
|
||||||
|
if (mWifiManager == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
NetworkCapabilities networkCapabilities;
|
NetworkCapabilities networkCapabilities;
|
||||||
final Network currentWifiNetwork = mWifiManager.getCurrentNetwork();
|
final Network currentWifiNetwork = mWifiManager.getCurrentNetwork();
|
||||||
if (currentWifiNetwork != null && currentWifiNetwork.equals(mDefaultNetwork)) {
|
if (currentWifiNetwork != null && currentWifiNetwork.equals(mDefaultNetwork)) {
|
||||||
|
|||||||
@@ -312,6 +312,7 @@ public class SystemServicesModule {
|
|||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
|
@Nullable
|
||||||
static WifiManager provideWifiManager(Context context) {
|
static WifiManager provideWifiManager(Context context) {
|
||||||
return context.getSystemService(WifiManager.class);
|
return context.getSystemService(WifiManager.class);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ import static android.net.wifi.WifiManager.TrafficStateCallback.DATA_ACTIVITY_NO
|
|||||||
import static android.net.wifi.WifiManager.TrafficStateCallback.DATA_ACTIVITY_OUT;
|
import static android.net.wifi.WifiManager.TrafficStateCallback.DATA_ACTIVITY_OUT;
|
||||||
import static android.telephony.PhoneStateListener.LISTEN_ACTIVE_DATA_SUBSCRIPTION_ID_CHANGE;
|
import static android.telephony.PhoneStateListener.LISTEN_ACTIVE_DATA_SUBSCRIPTION_ID_CHANGE;
|
||||||
|
|
||||||
|
import android.annotation.Nullable;
|
||||||
import android.content.BroadcastReceiver;
|
import android.content.BroadcastReceiver;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
@@ -175,7 +176,7 @@ public class NetworkControllerImpl extends BroadcastReceiver
|
|||||||
public NetworkControllerImpl(Context context, @Background Looper bgLooper,
|
public NetworkControllerImpl(Context context, @Background Looper bgLooper,
|
||||||
DeviceProvisionedController deviceProvisionedController,
|
DeviceProvisionedController deviceProvisionedController,
|
||||||
BroadcastDispatcher broadcastDispatcher, ConnectivityManager connectivityManager,
|
BroadcastDispatcher broadcastDispatcher, ConnectivityManager connectivityManager,
|
||||||
TelephonyManager telephonyManager, WifiManager wifiManager,
|
TelephonyManager telephonyManager, @Nullable WifiManager wifiManager,
|
||||||
NetworkScoreManager networkScoreManager) {
|
NetworkScoreManager networkScoreManager) {
|
||||||
this(context, connectivityManager,
|
this(context, connectivityManager,
|
||||||
telephonyManager,
|
telephonyManager,
|
||||||
|
|||||||
Reference in New Issue
Block a user