#30239: TBA: Gracefully handle auto-restart after crash -------------------------------------------------+------------------------- Reporter: sysrqb | Owner: tbb- | team Type: defect | Status: new Priority: Medium | Milestone: Component: Applications/Tor Browser | Version: Severity: Normal | Resolution: Keywords: tbb-mobile tbb-8.5-must | Actual Points: TorBrowserTeam201904 | Parent ID: | Points: Reviewer: | Sponsor: -------------------------------------------------+-------------------------
Comment (by sisbell): Replying to [comment:4 sysrqb]: > Shane, I'll create a patch for the tor-android-service project in tor- browser-build for this, but do you think this is reasonable? I haven't tested it yet (so this is a little bit of a guess). Essentially, I'm thinking about this: > > {{{ > diff --git a/service/src/main/java/org/torproject/android/service/TorService.java b/service/src/main/java/org/torproject/android/service/TorService.java > index a748241..80c1dfa 100644 > --- a/service/src/main/java/org/torproject/android/service/TorService.java > +++ b/service/src/main/java/org/torproject/android/service/TorService.java > @@ -270,7 +270,7 @@ public final class TorService extends Service implements TorServiceConstants, Or > mExecutor.execute(new IncomingIntentRouter(intent)); > else > Log.d(OrbotConstants.TAG, "Got null onStartCommand() intent"); > - return Service.START_STICKY; > + return Service.START_NOT_STICKY; > } > > @Override > }}} Looking through the code, It looks like a restart is essentially a NOOP. A sticky restart will restart with a null intent, which essentially does nothing. This is not what we want, since it leaves the event handlers to still receive events from the main app, even though a tor process is not running. Good catch. One alternative to removing the STICKY flag would be to startTor on a null intent so it also starts up with the Android service. This really depends on what the main app is expecting. Without the sticky flag the main app will need to detect the crash and restart the service. -- Ticket URL: <https://trac.torproject.org/projects/tor/ticket/30239#comment:5> Tor Bug Tracker & Wiki <https://trac.torproject.org/> The Tor Project: anonymity online
_______________________________________________ tor-bugs mailing list tor-bugs@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs