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
82c48b2a
Commit
82c48b2a
authored
Aug 24, 2022
by
刘鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 云信权限判断修改
parent
48afe0f2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
28 deletions
+30
-28
build.gradle
build.gradle
+1
-1
AVChatActivity.java
m-im/src/main/java/com/yidianling/avchatkit/activity/AVChatActivity.java
+13
-9
AVChatAudioUI.java
m-im/src/main/java/com/yidianling/avchatkit/ui/AVChatAudioUI.java
+16
-18
No files found.
build.gradle
View file @
82c48b2a
...
...
@@ -14,7 +14,7 @@ buildscript {
ydlrouter_version
=
'1.2.3'
constrait_support_version
=
'1.0.2'
componentVersion
=
"0.3.0.42.
1
-SNAPSHOT"
componentVersion
=
"0.3.0.42.
2
-SNAPSHOT"
}
repositories
{
mavenCentral
()
...
...
m-im/src/main/java/com/yidianling/avchatkit/activity/AVChatActivity.java
View file @
82c48b2a
package
com
.
yidianling
.
avchatkit
.
activity
;
import
android.Manifest
;
import
android.annotation.SuppressLint
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.os.SystemClock
;
import
android.view.LayoutInflater
;
...
...
@@ -118,13 +120,7 @@ public class AVChatActivity extends AVChatBaseUI implements AVChatVideoUI.TouchZ
// 接听来电
public
static
void
incomingCall
(
Context
context
,
AVChatData
config
,
String
displayName
,
int
source
)
{
needFinish
=
false
;
Intent
intent
=
new
Intent
();
intent
.
setClass
(
context
,
AVChatActivity
.
class
);
intent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_SINGLE_TOP
|
Intent
.
FLAG_ACTIVITY_NEW_TASK
);
intent
.
putExtra
(
KEY_CALL_CONFIG
,
config
);
intent
.
putExtra
(
KEY_DISPLAY_NAME
,
displayName
);
intent
.
putExtra
(
KEY_IN_CALLING
,
true
);
intent
.
putExtra
(
KEY_SOURCE
,
source
);
Intent
intent
=
incomingCallIntent
(
context
,
config
,
displayName
,
source
);
context
.
startActivity
(
intent
);
}
@NonNull
...
...
@@ -143,6 +139,10 @@ public class AVChatActivity extends AVChatBaseUI implements AVChatVideoUI.TouchZ
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
if
(
getIntent
().
hasExtra
(
KEY_NEED_FINISH
))
{
needFinish
=
getIntent
().
getBooleanExtra
(
KEY_NEED_FINISH
,
false
);
}
// 若来电或去电未接通时,点击home。另外一方挂断通话。从最近任务列表恢复,则finish
if
(
needFinish
)
{
finish
();
...
...
@@ -184,7 +184,6 @@ public class AVChatActivity extends AVChatBaseUI implements AVChatVideoUI.TouchZ
protected
void
onPause
()
{
super
.
onPause
();
hasOnPause
=
true
;
}
@Override
...
...
@@ -662,6 +661,7 @@ public class AVChatActivity extends AVChatBaseUI implements AVChatVideoUI.TouchZ
avChatData
!=
null
?
avChatData
.
getAccount
()
:
receiverId
);
}
@SuppressLint
(
"CheckResult"
)
@Override
public
void
onAudioToVideo
()
{
new
RxPermissions
(
this
)
...
...
@@ -729,7 +729,11 @@ public class AVChatActivity extends AVChatBaseUI implements AVChatVideoUI.TouchZ
@Override
public
void
finish
()
{
isUserFinish
=
true
;
super
.
finish
();
if
(
mIsInComingCall
&&
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
super
.
finishAndRemoveTask
();
}
else
{
super
.
finish
();
}
}
...
...
m-im/src/main/java/com/yidianling/avchatkit/ui/AVChatAudioUI.java
View file @
82c48b2a
package
com
.
yidianling
.
avchatkit
.
ui
;
import
android.Manifest
;
import
android.annotation.SuppressLint
;
import
android.app.Activity
;
import
android.content.Context
;
...
...
@@ -10,13 +9,13 @@ import android.widget.Button;
import
android.widget.Chronometer
;
import
android.widget.TextView
;
import
com.blankj.utilcode.constant.PermissionConstants
;
import
com.blankj.utilcode.util.PermissionUtils
;
import
com.netease.nimlib.sdk.avchat.AVChatCallback
;
import
com.netease.nimlib.sdk.avchat.AVChatManager
;
import
com.netease.nimlib.sdk.avchat.constant.AVChatControlCommand
;
import
com.netease.nimlib.sdk.avchat.constant.AVChatType
;
import
com.netease.nimlib.sdk.avchat.model.AVChatData
;
import
com.tbruyelle.rxpermissions2.Permission
;
import
com.tbruyelle.rxpermissions2.RxPermissions
;
import
com.ydl.ydlcommon.utils.DeviceTool
;
import
com.yidianling.avchatkit.AVChatKit
;
import
com.yidianling.avchatkit.activity.AVChatActivity
;
...
...
@@ -34,7 +33,7 @@ import com.yidianling.avchatkit.module.AVSwitchListener;
import
com.yidianling.common.tools.ToastUtil
;
import
com.yidianling.im.R
;
import
io.reactivex.functions.Consumer
;
import
java.util.List
;
/**
* 音频界面显示变化以及点击事件
...
...
@@ -383,22 +382,21 @@ public class AVChatAudioUI implements View.OnClickListener, ToggleListener {
@SuppressLint
(
"CheckResult"
)
private
void
requestPermission
()
{
new
RxPermissions
((
Activity
)
this
.
context
)
.
requestEach
(
Manifest
.
permission
.
RECORD_AUDIO
,
Manifest
.
permission
.
CAMERA
)
.
subscribe
(
new
Consumer
<
Permission
>
()
{
PermissionUtils
.
permission
(
PermissionConstants
.
MICROPHONE
,
PermissionConstants
.
CAMERA
)
.
callback
(
new
PermissionUtils
.
FullCallback
()
{
@Override
public
void
accept
(
Permission
permission
)
throws
Exception
{
if
(
permission
.
granted
)
{
doReceiveCall
();
}
else
if
(
permission
.
shouldShowRequestPermissionRationale
){
requestPermission
();
}
else
{
ToastUtil
.
toastLong
(
context
,
"请开启相机和麦克风权限后重试"
);
DeviceTool
.
openPersisonSetting
((
Activity
)
AVChatAudioUI
.
this
.
context
);
((
Activity
)
AVChatAudioUI
.
this
.
context
).
finish
();
}
public
void
onGranted
(
List
<
String
>
permissionsGranted
)
{
doReceiveCall
();
}
}
);
@Override
public
void
onDenied
(
List
<
String
>
permissionsDeniedForever
,
List
<
String
>
permissionsDenied
)
{
ToastUtil
.
toastLong
(
context
,
"请开启相机和麦克风权限后重试"
);
DeviceTool
.
openPersisonSetting
((
Activity
)
AVChatAudioUI
.
this
.
context
);
((
Activity
)
AVChatAudioUI
.
this
.
context
).
finish
();
}
}).
request
();
}
// 接听来电
...
...
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