Skip to content

Commit 4539984

Browse files
committed
frontend/android: remove network state receiver
It is redundant (the current network helper already listens for connectivity changes) and is also deprecated. See https://developer.android.com/reference/android/net/ConnectivityManager#CONNECTIVITY_ACTION
1 parent f944ba6 commit 4539984

File tree

1 file changed

+0
-12
lines changed
  • frontends/android/BitBoxApp/app/src/main/java/ch/shiftcrypto/bitboxapp

1 file changed

+0
-12
lines changed

frontends/android/BitBoxApp/app/src/main/java/ch/shiftcrypto/bitboxapp/MainActivity.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,6 @@ public void onReceive(Context context, Intent intent) {
8787
}
8888
};
8989

90-
private final BroadcastReceiver networkStateReceiver = new BroadcastReceiver() {
91-
@Override
92-
public void onReceive(Context context, Intent intent) {
93-
Mobileserver.usingMobileDataChanged();
94-
}
95-
};
96-
97-
9890
@Override
9991
public void onConfigurationChanged(Configuration newConfig) {
10092
int currentNightMode = newConfig.uiMode & Configuration.UI_MODE_NIGHT_MASK;
@@ -327,9 +319,6 @@ protected void onResume() {
327319
ContextCompat.RECEIVER_NOT_EXPORTED
328320
);
329321

330-
// Listen on changes in the network connection. We are interested in if the user is connected to a mobile data connection.
331-
registerReceiver(this.networkStateReceiver, new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION));
332-
333322
// Trigger connectivity check (as the network may already be unavailable when the app starts).
334323
networkHelper.checkConnectivity();
335324

@@ -342,7 +331,6 @@ protected void onPause() {
342331
super.onPause();
343332
Util.log("lifecycle: onPause");
344333
unregisterReceiver(this.usbStateReceiver);
345-
unregisterReceiver(this.networkStateReceiver);
346334
}
347335

348336
private void handleIntent(Intent intent) {

0 commit comments

Comments
 (0)