|
|
@ -184,6 +184,8 @@ public class BrowserActivity extends ThemableActivity implements BrowserControll |
|
|
|
|
|
|
|
|
|
|
|
// Helper
|
|
|
|
// Helper
|
|
|
|
private I2PAndroidHelper mI2PHelper; |
|
|
|
private I2PAndroidHelper mI2PHelper; |
|
|
|
|
|
|
|
private boolean mI2PHelperBound; |
|
|
|
|
|
|
|
private boolean mI2PProxyInitialized; |
|
|
|
|
|
|
|
|
|
|
|
// Constant
|
|
|
|
// Constant
|
|
|
|
private static final int API = android.os.Build.VERSION.SDK_INT; |
|
|
|
private static final int API = android.os.Build.VERSION.SDK_INT; |
|
|
@ -626,7 +628,8 @@ public class BrowserActivity extends ThemableActivity implements BrowserControll |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
case 2: |
|
|
|
case 2: |
|
|
|
if (!mI2PHelper.isI2PAndroidRunning()) { |
|
|
|
mI2PProxyInitialized = true; |
|
|
|
|
|
|
|
if (mI2PHelperBound && !mI2PHelper.isI2PAndroidRunning()) { |
|
|
|
mI2PHelper.requestI2PAndroidStart(this); |
|
|
|
mI2PHelper.requestI2PAndroidStart(this); |
|
|
|
} |
|
|
|
} |
|
|
|
host = "localhost"; |
|
|
|
host = "localhost"; |
|
|
@ -807,6 +810,7 @@ public class BrowserActivity extends ThemableActivity implements BrowserControll |
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
e.printStackTrace(); |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
mI2PProxyInitialized = false; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -1468,6 +1472,7 @@ public class BrowserActivity extends ThemableActivity implements BrowserControll |
|
|
|
protected void onStop() { |
|
|
|
protected void onStop() { |
|
|
|
super.onStop(); |
|
|
|
super.onStop(); |
|
|
|
mI2PHelper.unbind(); |
|
|
|
mI2PHelper.unbind(); |
|
|
|
|
|
|
|
mI2PHelperBound = false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -1484,7 +1489,14 @@ public class BrowserActivity extends ThemableActivity implements BrowserControll |
|
|
|
super.onStart(); |
|
|
|
super.onStart(); |
|
|
|
if (mPreferences.getProxyChoice() == 2) { |
|
|
|
if (mPreferences.getProxyChoice() == 2) { |
|
|
|
// Try to bind to I2P Android
|
|
|
|
// Try to bind to I2P Android
|
|
|
|
mI2PHelper.bind(); |
|
|
|
mI2PHelper.bind(new I2PAndroidHelper.Callback() { |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void onI2PAndroidBound() { |
|
|
|
|
|
|
|
mI2PHelperBound = true; |
|
|
|
|
|
|
|
if (mI2PProxyInitialized && !mI2PHelper.isI2PAndroidRunning()) |
|
|
|
|
|
|
|
mI2PHelper.requestI2PAndroidStart(BrowserActivity.this); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|