Merge branch 'fix_bug_63' of https://github.com/arrase/orbot into arrase-fix_bug_63

Conflicts:
	app/src/main/java/org/torproject/android/OrbotMainActivity.java
This commit is contained in:
Nathan Freitas 2017-01-14 06:45:43 -05:00
commit cb2c5fe661
1 changed files with 14 additions and 5 deletions

View File

@ -114,7 +114,7 @@ public class OrbotMainActivity extends AppCompatActivity
private ActionBarDrawerToggle mDrawerToggle;
/* Some tracking bits */
private String torStatus = TorServiceConstants.STATUS_OFF; //latest status reported from the tor service
private String torStatus = null; //latest status reported from the tor service
private Intent lastStatusIntent; // the last ACTION_STATUS Intent received
private SharedPreferences mPrefs = null;
@ -1288,8 +1288,17 @@ public class OrbotMainActivity extends AppCompatActivity
{
autoStartFromIntent = false;
Intent resultIntent = lastStatusIntent;
resultIntent.putExtra(TorServiceConstants.EXTRA_STATUS, torStatus);
if (resultIntent == null)
resultIntent = new Intent(TorServiceConstants.ACTION_START);
resultIntent.putExtra(
TorServiceConstants.EXTRA_STATUS,
torStatus == null?TorServiceConstants.STATUS_OFF:torStatus
);
setResult(RESULT_OK, resultIntent);
finish();
Log.d(TAG, "autoStartFromIntent finish");
}