Getting rid of BrowserApp.get method
This commit is contained in:
parent
61bb99c3be
commit
5af0f5f0c1
@ -1284,7 +1284,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
|
||||
Log.d(TAG, "onPause");
|
||||
mTabsManager.pauseAll();
|
||||
try {
|
||||
BrowserApp.get(this).unregisterReceiver(mNetworkReceiver);
|
||||
getApplication().unregisterReceiver(mNetworkReceiver);
|
||||
} catch (IllegalArgumentException e) {
|
||||
Log.e(TAG, "Receiver was not registered", e);
|
||||
}
|
||||
@ -1349,7 +1349,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
|
||||
|
||||
IntentFilter filter = new IntentFilter();
|
||||
filter.addAction(NETWORK_BROADCAST_ACTION);
|
||||
BrowserApp.get(this).registerReceiver(mNetworkReceiver, filter);
|
||||
getApplication().registerReceiver(mNetworkReceiver, filter);
|
||||
|
||||
mEventBus.register(mBusEventListener);
|
||||
|
||||
|
@ -93,11 +93,6 @@ public class BrowserApp extends Application {
|
||||
});
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static BrowserApp get(@NonNull Context context) {
|
||||
return (BrowserApp) context.getApplicationContext();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static AppComponent getAppComponent() {
|
||||
Preconditions.checkNonNull(sAppComponent);
|
||||
|
@ -202,9 +202,8 @@ public class ProxyUtils {
|
||||
Utils.showSnackbar(activity, R.string.install_orbot);
|
||||
}
|
||||
break;
|
||||
|
||||
case Constants.PROXY_I2P:
|
||||
I2PAndroidHelper ih = new I2PAndroidHelper(BrowserApp.get(activity));
|
||||
I2PAndroidHelper ih = new I2PAndroidHelper(activity.getApplication());
|
||||
if (!ih.isI2PAndroidInstalled()) {
|
||||
choice = Constants.NO_PROXY;
|
||||
ih.promptToInstall(activity);
|
||||
|
Loading…
x
Reference in New Issue
Block a user