Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
Tor Android
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
leap
Android Libs
Tor Android
Commits
b1b7eef8
Commit
b1b7eef8
authored
3 years ago
by
akwizgran
Browse files
Options
Downloads
Patches
Plain Diff
Add a new key rather that reusing the EXTRA_PACKAGE_NAME key.
parent
2894edd9
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tor-android-binary/src/main/java/org/torproject/jni/TorService.java
+9
-1
9 additions, 1 deletion
...d-binary/src/main/java/org/torproject/jni/TorService.java
with
9 additions
and
1 deletion
tor-android-binary/src/main/java/org/torproject/jni/TorService.java
+
9
−
1
View file @
b1b7eef8
...
...
@@ -83,6 +83,13 @@ public class TorService extends Service {
*/
public
final
static
String
EXTRA_PACKAGE_NAME
=
"org.torproject.android.intent.extra.PACKAGE_NAME"
;
/**
* The {@link String} {@code packageName} of the app to which this {@code TorService} belongs.
* This allows broadcast receivers to distinguish between broadcasts from different apps that
* use {@code TorService}.
*/
public
final
static
String
EXTRA_SERVICE_PACKAGE_NAME
=
"org.torproject.android.intent.extra.SERVICE_PACKAGE_NAME"
;
/**
* All tor-related services and daemons are stopped
*/
...
...
@@ -447,6 +454,7 @@ public class TorService extends Service {
*/
static
void
sendBroadcastStatusIntent
(
Context
context
)
{
Intent
intent
=
getBroadcastIntent
(
ACTION_STATUS
,
currentStatus
);
intent
.
putExtra
(
EXTRA_SERVICE_PACKAGE_NAME
,
context
.
getPackageName
());
context
.
sendBroadcast
(
intent
);
}
...
...
@@ -457,7 +465,7 @@ public class TorService extends Service {
static
void
broadcastStatus
(
Context
context
,
String
currentStatus
)
{
TorService
.
currentStatus
=
currentStatus
;
Intent
intent
=
getBroadcastIntent
(
ACTION_STATUS
,
currentStatus
);
intent
.
putExtra
(
EXTRA_PACKAGE_NAME
,
context
.
getPackageName
());
intent
.
putExtra
(
EXTRA_
SERVICE_
PACKAGE_NAME
,
context
.
getPackageName
());
LocalBroadcastManager
.
getInstance
(
context
).
sendBroadcast
(
intent
);
context
.
sendBroadcast
(
intent
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment