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
d0622f49
Commit
d0622f49
authored
Aug 24, 2022
by
刘鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 去掉声网自定义service
parent
b92178ac
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
92 deletions
+0
-92
AudioHomeActivity.kt
m-audioim/src/main/java/com/ydl/audioim/AudioHomeActivity.kt
+0
-9
FloatService.kt
m-audioim/src/main/java/com/ydl/audioim/notification/FloatService.kt
+0
-73
ConsultantAudioHomeActivity.kt
m-audioim/src/main/java/com/ydl/consultantim/ConsultantAudioHomeActivity.kt
+0
-10
No files found.
m-audioim/src/main/java/com/ydl/audioim/AudioHomeActivity.kt
View file @
d0622f49
...
@@ -33,7 +33,6 @@ import com.ydl.audioim.http.command.ConnectExceptionCommand
...
@@ -33,7 +33,6 @@ import com.ydl.audioim.http.command.ConnectExceptionCommand
import
com.ydl.audioim.http.command.NoticePushCommand
import
com.ydl.audioim.http.command.NoticePushCommand
import
com.ydl.audioim.http.command.PayLoad
import
com.ydl.audioim.http.command.PayLoad
import
com.ydl.audioim.listener.IntentConstants
import
com.ydl.audioim.listener.IntentConstants
import
com.ydl.audioim.notification.FloatService
import
com.ydl.audioim.player.AudioPlayer
import
com.ydl.audioim.player.AudioPlayer
import
com.ydl.audioim.presenter.AudioHomePresenterImpl
import
com.ydl.audioim.presenter.AudioHomePresenterImpl
import
com.ydl.audioim.router.AudioImIn
import
com.ydl.audioim.router.AudioImIn
...
@@ -234,7 +233,6 @@ class AudioHomeActivity :
...
@@ -234,7 +233,6 @@ class AudioHomeActivity :
private
var
canChangeRoute
:
Boolean
=
false
private
var
canChangeRoute
:
Boolean
=
false
private
var
hasHandleRefused
=
false
private
var
hasHandleRefused
=
false
private
var
mServiceIntent
:
Intent
?
=
null
private
val
notificationCallback
=
object
:
IMRegisterObserverCustomNotificationCallBack
{
private
val
notificationCallback
=
object
:
IMRegisterObserverCustomNotificationCallBack
{
override
fun
onObserverCustomNotification
(
fromUid
:
String
,
toUid
:
String
,
content
:
String
)
{
override
fun
onObserverCustomNotification
(
fromUid
:
String
,
toUid
:
String
,
content
:
String
)
{
if
(
fromUid
==
listenerUid
)
{
if
(
fromUid
==
listenerUid
)
{
...
@@ -522,12 +520,6 @@ class AudioHomeActivity :
...
@@ -522,12 +520,6 @@ class AudioHomeActivity :
override
fun
initDataAndEvent
()
{
override
fun
initDataAndEvent
()
{
//状态栏颜色
//状态栏颜色
setWindowStatusBarColor
()
setWindowStatusBarColor
()
mServiceIntent
=
Intent
(
this
@AudioHomeActivity
,
FloatService
::
class
.
java
)
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
O
)
{
startForegroundService
(
mServiceIntent
)
}
else
{
startService
(
mServiceIntent
)
}
//初始化传感器
//初始化传感器
initSensorManager
()
initSensorManager
()
//页面传递数据初始化
//页面传递数据初始化
...
@@ -1607,7 +1599,6 @@ class AudioHomeActivity :
...
@@ -1607,7 +1599,6 @@ class AudioHomeActivity :
override
fun
onDestroy
()
{
override
fun
onDestroy
()
{
super
.
onDestroy
()
super
.
onDestroy
()
stopService
(
mServiceIntent
)
findRouteService
(
IImService
::
class
.
java
).
unregisterObserveCustomNotification
(
notificationCallback
)
findRouteService
(
IImService
::
class
.
java
).
unregisterObserveCustomNotification
(
notificationCallback
)
uploadLog
()
uploadLog
()
phoneHandler
?.
removeCallbacksAndMessages
(
null
)
phoneHandler
?.
removeCallbacksAndMessages
(
null
)
...
...
m-audioim/src/main/java/com/ydl/audioim/notification/FloatService.kt
deleted
100644 → 0
View file @
b92178ac
package
com.ydl.audioim.notification
import
android.app.*
import
android.content.Context
import
android.content.Intent
import
android.os.Build
import
android.os.IBinder
import
com.ydl.audioim.R
class
FloatService
:
Service
()
{
var
notificationManager
:
NotificationManager
?
=
null
;
var
notificationId
=
"audio_av"
;
var
notificationName
=
"正在通话中"
;
override
fun
onBind
(
intent
:
Intent
?):
IBinder
?
{
return
null
}
override
fun
onCreate
()
{
super
.
onCreate
()
notificationManager
=
getSystemService
(
Context
.
NOTIFICATION_SERVICE
)
as
NotificationManager
//创建NotificationChannel
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
O
)
{
var
channel
=
NotificationChannel
(
notificationId
,
notificationName
,
NotificationManager
.
IMPORTANCE_HIGH
);
//不震动
channel
.
enableVibration
(
false
);
//静音
channel
.
setSound
(
null
,
null
);
notificationManager
?.
createNotificationChannel
(
channel
);
}
//创建服务后,五秒内调用该方法
startForeground
(
1
,
getNotification
());
}
/**
* 获取通知(Android8.0后需要)
* @return
*/
fun
getNotification
():
Notification
{
var
builder
=
Notification
.
Builder
(
this
)
.
setSmallIcon
(
R
.
drawable
.
dialog_list_bg
)
.
setContentTitle
(
"壹点灵"
)
.
setContentIntent
(
getIntent
())
.
setContentText
(
"正在通话中"
);
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
O
)
{
builder
.
setChannelId
(
notificationId
);
}
return
builder
.
build
();
}
/**
* 点击后,直接打开app(之前的页面),不跳转特定activity
* @return
*/
fun
getIntent
():
PendingIntent
{
var
msgIntent
=
applicationContext
.
packageManager
.
getLaunchIntentForPackage
(
packageName
);
//获取启动Activity
var
pendingIntent
=
PendingIntent
.
getActivity
(
applicationContext
,
1
,
msgIntent
,
PendingIntent
.
FLAG_UPDATE_CURRENT
);
return
pendingIntent
;
}
}
\ No newline at end of file
m-audioim/src/main/java/com/ydl/consultantim/ConsultantAudioHomeActivity.kt
View file @
d0622f49
...
@@ -11,7 +11,6 @@ import android.hardware.SensorEvent
...
@@ -11,7 +11,6 @@ import android.hardware.SensorEvent
import
android.hardware.SensorEventListener
import
android.hardware.SensorEventListener
import
android.hardware.SensorManager
import
android.hardware.SensorManager
import
android.net.Uri
import
android.net.Uri
import
android.os.Build
import
android.os.PowerManager
import
android.os.PowerManager
import
android.provider.Settings
import
android.provider.Settings
import
android.text.TextUtils
import
android.text.TextUtils
...
@@ -27,7 +26,6 @@ import com.ydl.audioim.R
...
@@ -27,7 +26,6 @@ import com.ydl.audioim.R
import
com.ydl.audioim.YDLavManager
import
com.ydl.audioim.YDLavManager
import
com.ydl.audioim.http.command.ConnectExceptionCommand
import
com.ydl.audioim.http.command.ConnectExceptionCommand
import
com.ydl.audioim.http.command.PayLoad
import
com.ydl.audioim.http.command.PayLoad
import
com.ydl.audioim.notification.FloatService
import
com.ydl.audioim.player.AudioPlayer
import
com.ydl.audioim.player.AudioPlayer
import
com.ydl.audioim.utils.AudioLogUtils
import
com.ydl.audioim.utils.AudioLogUtils
import
com.ydl.audioim.utils.DateUtils
import
com.ydl.audioim.utils.DateUtils
...
@@ -120,7 +118,6 @@ class ConsultantAudioHomeActivity :
...
@@ -120,7 +118,6 @@ class ConsultantAudioHomeActivity :
* 是否连接成功
* 是否连接成功
*/
*/
private
var
isConnectSuccess
:
Boolean
=
false
private
var
isConnectSuccess
:
Boolean
=
false
private
var
mServiceIntent
:
Intent
?
=
null
companion
object
{
companion
object
{
const
val
PARAM
:
String
=
"param"
const
val
PARAM
:
String
=
"param"
...
@@ -501,12 +498,6 @@ class ConsultantAudioHomeActivity :
...
@@ -501,12 +498,6 @@ class ConsultantAudioHomeActivity :
override
fun
initDataAndEvent
()
{
override
fun
initDataAndEvent
()
{
EventBus
.
getDefault
().
register
(
this
)
EventBus
.
getDefault
().
register
(
this
)
callEventSave
(
"30"
,
"进入接听界面"
)
callEventSave
(
"30"
,
"进入接听界面"
)
mServiceIntent
=
Intent
(
this
@ConsultantAudioHomeActivity
,
FloatService
::
class
.
java
)
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
O
)
{
startForegroundService
(
mServiceIntent
)
}
else
{
startService
(
mServiceIntent
)
}
//状态栏颜色
//状态栏颜色
setWindowStatusBarColor
()
setWindowStatusBarColor
()
//点亮屏幕 并解锁
//点亮屏幕 并解锁
...
@@ -1123,7 +1114,6 @@ class ConsultantAudioHomeActivity :
...
@@ -1123,7 +1114,6 @@ class ConsultantAudioHomeActivity :
}
}
override
fun
onDestroy
()
{
override
fun
onDestroy
()
{
stopService
(
mServiceIntent
)
LogUtil
.
e
(
"http-------------onDestory"
)
LogUtil
.
e
(
"http-------------onDestory"
)
AliYunRichLogsHelper
.
getInstance
().
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"咨询用户端:onDestroy channelId:${mAudioMessageBean?.channelId}"
)
AliYunRichLogsHelper
.
getInstance
().
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"咨询用户端:onDestroy channelId:${mAudioMessageBean?.channelId}"
)
...
...
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