Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YDL-Component-Medical
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨凯
YDL-Component-Medical
Commits
084a60cb
Commit
084a60cb
authored
2 years ago
by
范玉宾
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix hw foreground anr
parent
5ac59c8a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
13 deletions
+9
-13
config.gradle
config.gradle
+2
-2
AndroidManifest.xml
m-muse/src/main/AndroidManifest.xml
+1
-0
MeditationWindowService.kt
m-muse/src/main/java/com/yidianling/muse/service/MeditationWindowService.kt
+6
-11
No files found.
config.gradle
View file @
084a60cb
...
...
@@ -16,7 +16,7 @@ ext {
"m-dynamic"
:
"0.0.7.73"
,
"m-article"
:
"0.0.0.10"
,
"m-muse"
:
"0.0.28.
64
"
,
"m-muse"
:
"0.0.28.
70
"
,
"m-tests"
:
"0.0.24.18"
,
"m-course"
:
"0.0.43.37"
,
...
...
@@ -103,7 +103,7 @@ ext {
"m-dynamic"
:
"0.0.7.73"
,
"m-article"
:
"0.0.0.8"
,
"m-muse"
:
"0.0.28.
64
"
,
"m-muse"
:
"0.0.28.
70
"
,
"m-tests"
:
"0.0.24.18"
,
"m-course"
:
"0.0.43.37"
,
//-------------- 业务模块 API 层 --------------
...
...
This diff is collapsed.
Click to expand it.
m-muse/src/main/AndroidManifest.xml
View file @
084a60cb
...
...
@@ -3,6 +3,7 @@
<uses-permission
android:name=
"android.permission.SYSTEM_ALERT_WINDOW"
/>
<uses-permission
android:name=
"android.permission.SYSTEM_OVERLAY_WINDOW"
/>
<uses-permission
android:name=
"android.permission.FOREGROUND_SERVICE"
/>
<application>
<activity
...
...
This diff is collapsed.
Click to expand it.
m-muse/src/main/java/com/yidianling/muse/service/MeditationWindowService.kt
View file @
084a60cb
...
...
@@ -80,17 +80,6 @@ class MeditationWindowService : Service() {
override
fun
onCreate
()
{
super
.
onCreate
()
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
ECLAIR
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
O
){
val
manager
=
getSystemService
(
Context
.
NOTIFICATION_SERVICE
)
as
NotificationManager
val
channel
=
NotificationChannel
(
"壹点灵"
,
"play"
,
NotificationManager
.
IMPORTANCE_LOW
)
manager
.
createNotificationChannel
(
channel
)
val
notification
=
NotificationCompat
.
Builder
(
this
,
"壹点灵"
).
build
()
startForeground
(
1
,
notification
)
}
}
EventBus
.
getDefault
().
register
(
this
)
}
...
...
@@ -322,6 +311,12 @@ class MeditationWindowService : Service() {
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
ECLAIR
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
O
){
val
manager
=
getSystemService
(
Context
.
NOTIFICATION_SERVICE
)
as
NotificationManager
val
channel
=
NotificationChannel
(
"壹点灵"
,
"play"
,
NotificationManager
.
IMPORTANCE_HIGH
)
manager
.
createNotificationChannel
(
channel
)
val
notification
=
NotificationCompat
.
Builder
(
this
,
"壹点灵"
).
build
()
startForeground
(
1
,
notification
)
startForegroundService
(
intent
)
}
else
{
startService
(
intent
)
...
...
This diff is collapsed.
Click to expand it.
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