Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
Public Mesh Testbed
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
briar
Public Mesh Testbed
Commits
ac5bf8eb
Commit
ac5bf8eb
authored
3 years ago
by
akwizgran
Browse files
Options
Downloads
Patches
Plain Diff
Add missing permission, small code cleanups.
parent
901b1f81
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/src/main/AndroidManifest.xml
+1
-0
1 addition, 0 deletions
app/src/main/AndroidManifest.xml
app/src/main/java/org/briarproject/publicmesh/wifidirect/WifiDirectServiceImpl.java
+5
-8
5 additions, 8 deletions
...rproject/publicmesh/wifidirect/WifiDirectServiceImpl.java
with
6 additions
and
8 deletions
app/src/main/AndroidManifest.xml
+
1
−
0
View file @
ac5bf8eb
...
...
@@ -5,6 +5,7 @@
<uses-permission
android:name=
"android.permission.ACCESS_COARSE_LOCATION"
/>
<uses-permission
android:name=
"android.permission.ACCESS_FINE_LOCATION"
/>
<uses-permission
android:name=
"android.permission.ACCESS_NETWORK_STATE"
/>
<uses-permission
android:name=
"android.permission.CHANGE_NETWORK_STATE"
/>
<uses-permission
android:name=
"android.permission.ACCESS_WIFI_STATE"
/>
<uses-permission
android:name=
"android.permission.CHANGE_WIFI_STATE"
/>
<uses-permission
android:name=
"android.permission.FOREGROUND_SERVICE"
/>
...
...
This diff is collapsed.
Click to expand it.
app/src/main/java/org/briarproject/publicmesh/wifidirect/WifiDirectServiceImpl.java
+
5
−
8
View file @
ac5bf8eb
...
...
@@ -504,10 +504,7 @@ class WifiDirectServiceImpl implements WifiDirectService, Service {
removeServiceRequest
();
if
(
SDK_INT
>=
27
)
requireNonNull
(
channel
).
close
();
channel
=
null
;
if
(
networkId
!=
-
1
)
{
removeNetwork
();
networkId
=
-
1
;
}
removeNetwork
();
releaseLock
();
discoveryStatus
.
postValue
(
STOPPED
);
LOG
.
info
(
"Released service discovery"
);
...
...
@@ -556,14 +553,12 @@ class WifiDirectServiceImpl implements WifiDirectService, Service {
ActionListener
listener
=
new
ActionListener
()
{
@Override
public
void
onSuccess
()
{
LOG
.
info
(
"Removed group"
);
connectionInProgress
=
false
;
LOG
.
info
(
"Removed service request"
);
}
@Override
public
void
onFailure
(
int
reason
)
{
LOG
.
info
(
"Failed to remove group: "
+
reason
);
connectionInProgress
=
false
;
LOG
.
info
(
"Failed to remove service request: "
+
reason
);
}
};
try
{
...
...
@@ -576,12 +571,14 @@ class WifiDirectServiceImpl implements WifiDirectService, Service {
}
private
void
removeNetwork
()
{
if
(
networkId
==
-
1
)
return
;
try
{
if
(
requireNonNull
(
wifiManager
).
removeNetwork
(
networkId
))
LOG
.
info
(
"Removed network"
);
else
LOG
.
info
(
"Failed to remove network"
);
}
catch
(
SecurityException
e
)
{
LOG
.
info
(
"Failed to remove network: "
+
e
);
}
networkId
=
-
1
;
}
@Override
...
...
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