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
Imre Kristoffer Eilertsen
Nebulo
Commits
da4f1b94
Commit
da4f1b94
authored
Jan 03, 2021
by
Daniel Wolf
Browse files
Do not show battery optimization dialog after update
parent
1d718ffd
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/src/main/java/com/frostnerd/smokescreen/activity/MainActivity.kt
View file @
da4f1b94
...
...
@@ -144,6 +144,7 @@ class MainActivity : NavigationDrawerActivity() {
view
}
supportActionBar
?.
elevation
=
0f
val
previousInstalledVersion
=
getPreferences
().
previousInstalledVersion
ChangelogDialog
.
showNewVersionChangelog
(
this
)
getPreferences
().
totalAppLaunches
+=
1
if
(
getPreferences
().
totalAppLaunches
>=
7
&&
...
...
@@ -208,8 +209,12 @@ class MainActivity : NavigationDrawerActivity() {
!
getPreferences
().
ignoreServiceKilled
&&
getPreferences
().
vpnLaunchLastVersion
==
BuildConfig
.
VERSION_CODE
)
{
getPreferences
().
vpnServiceState
=
VpnServiceState
.
STOPPED
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
M
||
!(
getSystemService
(
POWER_SERVICE
)
as
PowerManager
).
isIgnoringBatteryOptimizations
(
packageName
))
{
if
((
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
M
||
!(
getSystemService
(
POWER_SERVICE
)
as
PowerManager
).
isIgnoringBatteryOptimizations
(
packageName
))
&&
previousInstalledVersion
==
BuildConfig
.
VERSION_CODE
)
{
BatteryOptimizationInfoDialog
(
this
).
show
()
}
else
if
(
previousInstalledVersion
!=
BuildConfig
.
VERSION_CODE
)
{
getPreferences
().
vpnServiceState
=
VpnServiceState
.
STOPPED
}
}
registerLocalReceiver
(
listOf
(
BROADCAST_RELOAD_MENU
),
true
)
{
...
...
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