Loading packages/SystemUI/src/com/android/keyguard/CarrierTextController.java +3 −3 Original line number Diff line number Diff line Loading @@ -22,8 +22,8 @@ import static android.telephony.PhoneStateListener.LISTEN_NONE; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.content.pm.PackageManager; import android.content.res.Resources; import android.net.ConnectivityManager; import android.net.wifi.WifiManager; import android.os.Handler; import android.telephony.PhoneStateListener; Loading Loading @@ -179,8 +179,8 @@ public class CarrierTextController { mBgHandler = new Handler(Dependency.get(Dependency.BG_LOOPER)); mKeyguardUpdateMonitor = Dependency.get(KeyguardUpdateMonitor.class); mBgHandler.post(() -> { boolean supported = ConnectivityManager.from(mContext).isNetworkSupported( ConnectivityManager.TYPE_MOBILE); boolean supported = mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_TELEPHONY); if (supported && mNetworkSupported.compareAndSet(false, supported)) { // This will set/remove the listeners appropriately. Note that it will never double // add the listeners. Loading packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java +3 −1 Original line number Diff line number Diff line Loading @@ -50,6 +50,7 @@ import android.content.DialogInterface; import android.content.Intent; import android.content.IntentFilter; import android.content.SharedPreferences; import android.content.pm.PackageManager; import android.content.pm.UserInfo; import android.content.res.ColorStateList; import android.content.res.Configuration; Loading Loading @@ -356,7 +357,8 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, filter.addAction(TelephonyManager.ACTION_EMERGENCY_CALLBACK_MODE_CHANGED); mBroadcastDispatcher.registerReceiver(mBroadcastReceiver, filter); mHasTelephony = connectivityManager.isNetworkSupported(ConnectivityManager.TYPE_MOBILE); mHasTelephony = context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_TELEPHONY); // get notified of phone state changes telephonyManager.listen(mPhoneStateListener, PhoneStateListener.LISTEN_SERVICE_STATE); Loading packages/SystemUI/src/com/android/systemui/statusbar/OperatorNameView.java +1 −3 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ package com.android.systemui.statusbar; import android.content.Context; import android.graphics.Rect; import android.net.ConnectivityManager; import android.os.Bundle; import android.telephony.ServiceState; import android.telephony.SubscriptionInfo; Loading Loading @@ -123,8 +122,7 @@ public class OperatorNameView extends TextView implements DemoModeCommandReceive .getValue(KEY_SHOW_OPERATOR_NAME, 1) != 0; setVisibility(showOperatorName ? VISIBLE : GONE); boolean hasMobile = ConnectivityManager.from(mContext) .isNetworkSupported(ConnectivityManager.TYPE_MOBILE); boolean hasMobile = mContext.getSystemService(TelephonyManager.class).isDataCapable(); boolean airplaneMode = WirelessUtils.isAirplaneModeOn(mContext); if (!hasMobile || airplaneMode) { setText(null); Loading packages/SystemUI/src/com/android/systemui/statusbar/policy/EmergencyCryptkeeperText.java +1 −3 Original line number Diff line number Diff line Loading @@ -21,7 +21,6 @@ import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.net.ConnectivityManager; import android.provider.Settings; import android.telephony.SubscriptionInfo; import android.telephony.TelephonyManager; Loading Loading @@ -95,8 +94,7 @@ public class EmergencyCryptkeeperText extends TextView { } public void update() { boolean hasMobile = ConnectivityManager.from(mContext) .isNetworkSupported(ConnectivityManager.TYPE_MOBILE); boolean hasMobile = mContext.getSystemService(TelephonyManager.class).isDataCapable(); boolean airplaneMode = (Settings.Global.getInt(mContext.getContentResolver(), Settings.Global.AIRPLANE_MODE_ON, 0) == 1); Loading packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java +16 −9 Original line number Diff line number Diff line Loading @@ -79,6 +79,7 @@ import java.io.FileDescriptor; import java.io.PrintWriter; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Arrays; import java.util.BitSet; import java.util.Collections; import java.util.Comparator; Loading Loading @@ -241,8 +242,7 @@ public class NetworkControllerImpl extends BroadcastReceiver mSubscriptionManager = subManager; mSubDefaults = defaultsHandler; mConnectivityManager = connectivityManager; mHasMobileDataFeature = mConnectivityManager.isNetworkSupported(ConnectivityManager.TYPE_MOBILE); mHasMobileDataFeature = telephonyManager.isDataCapable(); mDemoModeController = demoModeController; // telephony Loading Loading @@ -337,11 +337,20 @@ public class NetworkControllerImpl extends BroadcastReceiver // This callback is invoked a lot (i.e. when RSSI changes), so avoid updating // icons when connectivity state has remained the same. if (network.equals(mLastNetwork) && networkCapabilities.equalsTransportTypes(mLastNetworkCapabilities) && validated == lastValidated) { if (network.equals(mLastNetwork) && validated == lastValidated) { // Should not rely on getTransportTypes() returning the same order of transport // types. So sort the array before comparing. int[] newTypes = networkCapabilities.getTransportTypes(); Arrays.sort(newTypes); int[] lastTypes = (mLastNetworkCapabilities != null) ? mLastNetworkCapabilities.getTransportTypes() : null; if (lastTypes != null) Arrays.sort(lastTypes); if (Arrays.equals(newTypes, lastTypes)) { return; } } mLastNetwork = network; mLastNetworkCapabilities = networkCapabilities; mLastDefaultNetworkCapabilities = networkCapabilities; Loading Loading @@ -430,14 +439,13 @@ public class NetworkControllerImpl extends BroadcastReceiver filter.addAction(Intent.ACTION_SERVICE_STATE); filter.addAction(TelephonyManager.ACTION_SERVICE_PROVIDERS_UPDATED); filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION); filter.addAction(ConnectivityManager.INET_CONDITION_ACTION); filter.addAction(Intent.ACTION_AIRPLANE_MODE_CHANGED); filter.addAction(CarrierConfigManager.ACTION_CARRIER_CONFIG_CHANGED); mBroadcastDispatcher.registerReceiverWithHandler(this, filter, mReceiverHandler); mListening = true; // Initial setup of connectivity. Handled as if we had received a sticky broadcast of // ConnectivityManager.CONNECTIVITY_ACTION or ConnectivityManager.INET_CONDITION_ACTION. // ConnectivityManager.CONNECTIVITY_ACTION. mReceiverHandler.post(this::updateConnectivity); // Initial setup of WifiSignalController. Handled as if we had received a sticky broadcast Loading Loading @@ -682,7 +690,6 @@ public class NetworkControllerImpl extends BroadcastReceiver final String action = intent.getAction(); switch (action) { case ConnectivityManager.CONNECTIVITY_ACTION: case ConnectivityManager.INET_CONDITION_ACTION: updateConnectivity(); break; case Intent.ACTION_AIRPLANE_MODE_CHANGED: Loading Loading
packages/SystemUI/src/com/android/keyguard/CarrierTextController.java +3 −3 Original line number Diff line number Diff line Loading @@ -22,8 +22,8 @@ import static android.telephony.PhoneStateListener.LISTEN_NONE; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.content.pm.PackageManager; import android.content.res.Resources; import android.net.ConnectivityManager; import android.net.wifi.WifiManager; import android.os.Handler; import android.telephony.PhoneStateListener; Loading Loading @@ -179,8 +179,8 @@ public class CarrierTextController { mBgHandler = new Handler(Dependency.get(Dependency.BG_LOOPER)); mKeyguardUpdateMonitor = Dependency.get(KeyguardUpdateMonitor.class); mBgHandler.post(() -> { boolean supported = ConnectivityManager.from(mContext).isNetworkSupported( ConnectivityManager.TYPE_MOBILE); boolean supported = mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_TELEPHONY); if (supported && mNetworkSupported.compareAndSet(false, supported)) { // This will set/remove the listeners appropriately. Note that it will never double // add the listeners. Loading
packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java +3 −1 Original line number Diff line number Diff line Loading @@ -50,6 +50,7 @@ import android.content.DialogInterface; import android.content.Intent; import android.content.IntentFilter; import android.content.SharedPreferences; import android.content.pm.PackageManager; import android.content.pm.UserInfo; import android.content.res.ColorStateList; import android.content.res.Configuration; Loading Loading @@ -356,7 +357,8 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, filter.addAction(TelephonyManager.ACTION_EMERGENCY_CALLBACK_MODE_CHANGED); mBroadcastDispatcher.registerReceiver(mBroadcastReceiver, filter); mHasTelephony = connectivityManager.isNetworkSupported(ConnectivityManager.TYPE_MOBILE); mHasTelephony = context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_TELEPHONY); // get notified of phone state changes telephonyManager.listen(mPhoneStateListener, PhoneStateListener.LISTEN_SERVICE_STATE); Loading
packages/SystemUI/src/com/android/systemui/statusbar/OperatorNameView.java +1 −3 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ package com.android.systemui.statusbar; import android.content.Context; import android.graphics.Rect; import android.net.ConnectivityManager; import android.os.Bundle; import android.telephony.ServiceState; import android.telephony.SubscriptionInfo; Loading Loading @@ -123,8 +122,7 @@ public class OperatorNameView extends TextView implements DemoModeCommandReceive .getValue(KEY_SHOW_OPERATOR_NAME, 1) != 0; setVisibility(showOperatorName ? VISIBLE : GONE); boolean hasMobile = ConnectivityManager.from(mContext) .isNetworkSupported(ConnectivityManager.TYPE_MOBILE); boolean hasMobile = mContext.getSystemService(TelephonyManager.class).isDataCapable(); boolean airplaneMode = WirelessUtils.isAirplaneModeOn(mContext); if (!hasMobile || airplaneMode) { setText(null); Loading
packages/SystemUI/src/com/android/systemui/statusbar/policy/EmergencyCryptkeeperText.java +1 −3 Original line number Diff line number Diff line Loading @@ -21,7 +21,6 @@ import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.net.ConnectivityManager; import android.provider.Settings; import android.telephony.SubscriptionInfo; import android.telephony.TelephonyManager; Loading Loading @@ -95,8 +94,7 @@ public class EmergencyCryptkeeperText extends TextView { } public void update() { boolean hasMobile = ConnectivityManager.from(mContext) .isNetworkSupported(ConnectivityManager.TYPE_MOBILE); boolean hasMobile = mContext.getSystemService(TelephonyManager.class).isDataCapable(); boolean airplaneMode = (Settings.Global.getInt(mContext.getContentResolver(), Settings.Global.AIRPLANE_MODE_ON, 0) == 1); Loading
packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java +16 −9 Original line number Diff line number Diff line Loading @@ -79,6 +79,7 @@ import java.io.FileDescriptor; import java.io.PrintWriter; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Arrays; import java.util.BitSet; import java.util.Collections; import java.util.Comparator; Loading Loading @@ -241,8 +242,7 @@ public class NetworkControllerImpl extends BroadcastReceiver mSubscriptionManager = subManager; mSubDefaults = defaultsHandler; mConnectivityManager = connectivityManager; mHasMobileDataFeature = mConnectivityManager.isNetworkSupported(ConnectivityManager.TYPE_MOBILE); mHasMobileDataFeature = telephonyManager.isDataCapable(); mDemoModeController = demoModeController; // telephony Loading Loading @@ -337,11 +337,20 @@ public class NetworkControllerImpl extends BroadcastReceiver // This callback is invoked a lot (i.e. when RSSI changes), so avoid updating // icons when connectivity state has remained the same. if (network.equals(mLastNetwork) && networkCapabilities.equalsTransportTypes(mLastNetworkCapabilities) && validated == lastValidated) { if (network.equals(mLastNetwork) && validated == lastValidated) { // Should not rely on getTransportTypes() returning the same order of transport // types. So sort the array before comparing. int[] newTypes = networkCapabilities.getTransportTypes(); Arrays.sort(newTypes); int[] lastTypes = (mLastNetworkCapabilities != null) ? mLastNetworkCapabilities.getTransportTypes() : null; if (lastTypes != null) Arrays.sort(lastTypes); if (Arrays.equals(newTypes, lastTypes)) { return; } } mLastNetwork = network; mLastNetworkCapabilities = networkCapabilities; mLastDefaultNetworkCapabilities = networkCapabilities; Loading Loading @@ -430,14 +439,13 @@ public class NetworkControllerImpl extends BroadcastReceiver filter.addAction(Intent.ACTION_SERVICE_STATE); filter.addAction(TelephonyManager.ACTION_SERVICE_PROVIDERS_UPDATED); filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION); filter.addAction(ConnectivityManager.INET_CONDITION_ACTION); filter.addAction(Intent.ACTION_AIRPLANE_MODE_CHANGED); filter.addAction(CarrierConfigManager.ACTION_CARRIER_CONFIG_CHANGED); mBroadcastDispatcher.registerReceiverWithHandler(this, filter, mReceiverHandler); mListening = true; // Initial setup of connectivity. Handled as if we had received a sticky broadcast of // ConnectivityManager.CONNECTIVITY_ACTION or ConnectivityManager.INET_CONDITION_ACTION. // ConnectivityManager.CONNECTIVITY_ACTION. mReceiverHandler.post(this::updateConnectivity); // Initial setup of WifiSignalController. Handled as if we had received a sticky broadcast Loading Loading @@ -682,7 +690,6 @@ public class NetworkControllerImpl extends BroadcastReceiver final String action = intent.getAction(); switch (action) { case ConnectivityManager.CONNECTIVITY_ACTION: case ConnectivityManager.INET_CONDITION_ACTION: updateConnectivity(); break; case Intent.ACTION_AIRPLANE_MODE_CHANGED: Loading