Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
permission_handler
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
songyanzhi
permission_handler
Commits
4b16c483
Commit
4b16c483
authored
Mar 16, 2020
by
Sebastian Roth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve ServiceManager issue for Android 4.4+ to <Pie
parent
d4e35128
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
permission_handler/android/src/main/java/com/baseflow/permissionhandler/ServiceManager.java
+4
-3
No files found.
permission_handler/android/src/main/java/com/baseflow/permissionhandler/ServiceManager.java
View file @
4b16c483
...
@@ -80,7 +80,7 @@ final class ServiceManager {
...
@@ -80,7 +80,7 @@ final class ServiceManager {
return
locationManager
.
isLocationEnabled
();
return
locationManager
.
isLocationEnabled
();
}
else
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
)
{
}
else
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
)
{
return
isLocationServiceEnable
PrePie
(
context
);
return
isLocationServiceEnable
dKitKat
(
context
);
}
else
{
}
else
{
return
isLocationServiceEnablePreKitKat
(
context
);
return
isLocationServiceEnablePreKitKat
(
context
);
}
}
...
@@ -89,10 +89,11 @@ final class ServiceManager {
...
@@ -89,10 +89,11 @@ final class ServiceManager {
// Suppress deprecation warnings since it's purpose is to support to be backwards compatible with
// Suppress deprecation warnings since it's purpose is to support to be backwards compatible with
// pre Pie versions of Android.
// pre Pie versions of Android.
@SuppressWarnings
(
"deprecation"
)
@SuppressWarnings
(
"deprecation"
)
private
static
boolean
isLocationServiceEnable
PrePie
(
Context
context
)
private
static
boolean
isLocationServiceEnable
dKitKat
(
Context
context
)
{
{
if
(
VERSION
.
SDK_INT
<
VERSION_CODES
.
P
)
if
(
Build
.
VERSION
.
SDK_INT
<
VERSION_CODES
.
KITKAT
)
{
return
false
;
return
false
;
}
final
int
locationMode
;
final
int
locationMode
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment