Skip to content

Commit

Permalink
Merge branch 'master' of github.com:guardianproject/orbot
Browse files Browse the repository at this point in the history
  • Loading branch information
n8fr8 committed Nov 16, 2020
2 parents 3afa761 + 4a39df4 commit e81e50c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 20 deletions.
5 changes: 3 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="18" />
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />

<application
Expand Down Expand Up @@ -151,7 +152,7 @@
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.LOCKED_BOOT_COMPLETED" />
<action android:name="android.intent.action.QUICKBOOT_POWERON" />
<action android:name="android.intent.action.REBOOT"/>
<action android:name="android.intent.action.REBOOT" />
</intent-filter>
</receiver>

Expand Down
2 changes: 0 additions & 2 deletions app/src/main/java/org/torproject/android/MainConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,4 @@ public interface MainConstants {

String EMAIL_TOR_BRIDGES = "bridges@torproject.org";

int RESULT_CLOSE_ALL = 0;

}
11 changes: 3 additions & 8 deletions app/src/main/java/org/torproject/android/OrbotMainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@

import static androidx.core.content.FileProvider.getUriForFile;
import static org.torproject.android.MainConstants.COUNTRY_CODES;
import static org.torproject.android.MainConstants.RESULT_CLOSE_ALL;
import static org.torproject.android.MainConstants.URL_TOR_CHECK;
import static org.torproject.android.service.TorServiceConstants.ACTION_START;
import static org.torproject.android.service.TorServiceConstants.ACTION_START_VPN;
Expand All @@ -108,7 +107,6 @@ public class OrbotMainActivity extends AppCompatActivity implements OrbotConstan
private final static int REQUEST_VPN = 8888;
private final static int REQUEST_SETTINGS = 0x9874;
private final static int REQUEST_VPN_APPS_SELECT = 8889;
private final static int LOG_DRAWER_GRAVITY = GravityCompat.END;
// message types for mStatusUpdateHandler
private final static int STATUS_UPDATE = 1;
private static final int MESSAGE_TRAFFIC_COUNT = 2;
Expand Down Expand Up @@ -143,7 +141,7 @@ public class OrbotMainActivity extends AppCompatActivity implements OrbotConstan
* so local ones are used here so other apps cannot interfere with Orbot's
* operation.
*/
private BroadcastReceiver mLocalBroadcastReceiver = new BroadcastReceiver() {
private final BroadcastReceiver mLocalBroadcastReceiver = new BroadcastReceiver() {

@Override
public void onReceive(Context context, Intent intent) {
Expand Down Expand Up @@ -296,7 +294,7 @@ private void doLayout() {
mTxtOrbotLog = findViewById(R.id.orbotLog);

lblStatus = findViewById(R.id.lblStatus);
lblStatus.setOnClickListener(v -> mDrawer.openDrawer(LOG_DRAWER_GRAVITY));
lblStatus.setOnClickListener(v -> mDrawer.openDrawer(GravityCompat.END));

lblPorts = findViewById(R.id.lblPorts);

Expand Down Expand Up @@ -481,9 +479,6 @@ public boolean onOptionsItemSelected(MenuItem item) {
**/
private void doExit() {
stopTor();

// Kill all the wizard activities
setResult(RESULT_CLOSE_ALL);
finish();
}

Expand All @@ -501,7 +496,7 @@ protected void onPause() {
@Override
public void onBackPressed() {
// check to see if the log is open, if so close it
if (mDrawer.isDrawerOpen(LOG_DRAWER_GRAVITY)) {
if (mDrawer.isDrawerOpen(GravityCompat.END)) {
mDrawer.closeDrawers();
} else {
super.onBackPressed();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,15 +186,10 @@ private boolean findExistingTorDaemon() {
return false;
}

/* (non-Javadoc)
* @see android.app.Service#onLowMemory()
*/
@Override
public void onLowMemory() {
super.onLowMemory();

logNotice("Low Memory Warning!");

}

private void clearNotifications() {
Expand Down Expand Up @@ -267,9 +262,6 @@ protected void showToolbarNotification(String notifyMsg, int notifyType, int ico
mNotificationShowing = true;
}

/* (non-Javadoc)
* @see android.app.Service#onStart(android.content.Intent, int)
*/
public int onStartCommand(Intent intent, int flags, int startId) {

showToolbarNotification("", NOTIFY_ID, R.drawable.ic_stat_tor);
Expand Down

0 comments on commit e81e50c

Please sign in to comment.