Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Faisal Alanzi
Nebulo
Commits
a58f51b6
Commit
a58f51b6
authored
Dec 25, 2020
by
Daniel Wolf
Browse files
Don't show battery optimization dialog when already ignoring battery optimizations
parent
3dba5c48
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/src/main/java/com/frostnerd/smokescreen/activity/MainActivity.kt
View file @
a58f51b6
...
...
@@ -5,7 +5,9 @@ import android.content.Context
import
android.content.Intent
import
android.graphics.Color
import
android.net.*
import
android.os.Build
import
android.os.Bundle
import
android.os.PowerManager
import
android.widget.Toast
import
androidx.appcompat.app.AlertDialog
import
com.frostnerd.general.service.isServiceRunning
...
...
@@ -209,7 +211,9 @@ class MainActivity : NavigationDrawerActivity() {
!
getPreferences
().
ignoreServiceKilled
&&
getPreferences
().
vpnLaunchLastVersion
==
BuildConfig
.
VERSION_CODE
)
{
getPreferences
().
vpnServiceState
=
VpnServiceState
.
STOPPED
BatteryOptimizationInfoDialog
(
this
).
show
()
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
M
||
!(
getSystemService
(
POWER_SERVICE
)
as
PowerManager
).
isIgnoringBatteryOptimizations
(
packageName
))
{
BatteryOptimizationInfoDialog
(
this
).
show
()
}
}
registerLocalReceiver
(
listOf
(
BROADCAST_RELOAD_MENU
),
true
)
{
reloadMenuItems
()
...
...
Write
Preview
Supports
Markdown
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