make sure we set VPN mode properly before we launch the service
This commit is contained in:
parent
9de4f54e6b
commit
50f33c9ca2
|
@ -5,7 +5,7 @@
|
|||
android:versionCode="15200001"
|
||||
android:installLocation="auto"
|
||||
>
|
||||
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="23"/>
|
||||
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="23"/>
|
||||
<!--
|
||||
<permission android:name="org.torproject.android.MANAGE_TOR"
|
||||
android:label="@string/permission_manage_tor_label"
|
||||
|
|
|
@ -299,6 +299,9 @@ public class OrbotMainActivity extends AppCompatActivity
|
|||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked)
|
||||
{
|
||||
|
||||
Prefs.putUseVpn(isChecked);
|
||||
|
||||
if (isChecked)
|
||||
startActivity(new Intent(OrbotMainActivity.this,VPNEnableActivity.class));
|
||||
else
|
||||
|
@ -828,9 +831,15 @@ public class OrbotMainActivity extends AppCompatActivity
|
|||
|
||||
}
|
||||
}
|
||||
else if (request == REQUEST_VPN && response == RESULT_OK)
|
||||
else if (request == REQUEST_VPN)
|
||||
{
|
||||
if (response == RESULT_OK)
|
||||
sendIntentToService(TorServiceConstants.CMD_VPN);
|
||||
else
|
||||
{
|
||||
Prefs.putUseVpn(false);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
IntentResult scanResult = IntentIntegrator.parseActivityResult(request, response, data);
|
||||
|
|
Loading…
Reference in New Issue