Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
com.ccwangluo.accelerator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sheteng
com.ccwangluo.accelerator
Commits
f9b29acd
Commit
f9b29acd
authored
Jan 14, 2018
by
Mygod
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update notification channels on configuration change
parent
4e943bc7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
mobile/src/main/java/com/github/shadowsocks/App.kt
mobile/src/main/java/com/github/shadowsocks/App.kt
+10
-5
No files found.
mobile/src/main/java/com/github/shadowsocks/App.kt
View file @
f9b29acd
...
@@ -203,6 +203,16 @@ class App : Application() {
...
@@ -203,6 +203,16 @@ class App : Application() {
DataStore
.
publicStore
.
putLong
(
Key
.
assetUpdateTime
,
info
.
lastUpdateTime
)
DataStore
.
publicStore
.
putLong
(
Key
.
assetUpdateTime
,
info
.
lastUpdateTime
)
}
}
updateNotificationChannels
()
}
override
fun
onConfigurationChanged
(
newConfig
:
Configuration
)
{
super
.
onConfigurationChanged
(
newConfig
)
checkChineseLocale
(
newConfig
)
updateNotificationChannels
()
}
private
fun
updateNotificationChannels
()
{
if
(
Build
.
VERSION
.
SDK_INT
>=
26
)
@RequiresApi
(
26
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
26
)
@RequiresApi
(
26
)
{
val
nm
=
getSystemService
(
NotificationManager
::
class
.
java
)
val
nm
=
getSystemService
(
NotificationManager
::
class
.
java
)
nm
.
createNotificationChannels
(
listOf
(
nm
.
createNotificationChannels
(
listOf
(
...
@@ -216,11 +226,6 @@ class App : Application() {
...
@@ -216,11 +226,6 @@ class App : Application() {
}
}
}
}
override
fun
onConfigurationChanged
(
newConfig
:
Configuration
)
{
super
.
onConfigurationChanged
(
newConfig
)
checkChineseLocale
(
newConfig
)
}
fun
listenForPackageChanges
(
callback
:
()
->
Unit
):
BroadcastReceiver
{
fun
listenForPackageChanges
(
callback
:
()
->
Unit
):
BroadcastReceiver
{
val
filter
=
IntentFilter
(
Intent
.
ACTION_PACKAGE_ADDED
)
val
filter
=
IntentFilter
(
Intent
.
ACTION_PACKAGE_ADDED
)
filter
.
addAction
(
Intent
.
ACTION_PACKAGE_REMOVED
)
filter
.
addAction
(
Intent
.
ACTION_PACKAGE_REMOVED
)
...
...
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