HDLLinphoneSDKDemoNew/.idea/compiler.xml
@@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <project version="4"> <component name="CompilerConfiguration"> <bytecodeTargetLevel target="11" /> <bytecodeTargetLevel target="17" /> </component> </project> HDLLinphoneSDKDemoNew/.idea/deploymentTargetSelector.xml
New file @@ -0,0 +1,10 @@ <?xml version="1.0" encoding="UTF-8"?> <project version="4"> <component name="deploymentTargetSelector"> <selectionStates> <SelectionState runConfigName="app"> <option name="selectionMode" value="DROPDOWN" /> </SelectionState> </selectionStates> </component> </project> HDLLinphoneSDKDemoNew/.idea/jarRepositories.xml
@@ -26,5 +26,25 @@ <option name="name" value="maven" /> <option name="url" value="https://linphone.org/maven_repository" /> </remote-repository> <remote-repository> <option name="id" value="MavenRepo" /> <option name="name" value="MavenRepo" /> <option name="url" value="https://repo.maven.apache.org/maven2/" /> </remote-repository> <remote-repository> <option name="id" value="maven2" /> <option name="name" value="maven2" /> <option name="url" value="https://plugins.gradle.org/m2/" /> </remote-repository> <remote-repository> <option name="id" value="maven" /> <option name="name" value="maven" /> <option name="url" value="https://maven.aliyun.com/nexus/content/groups/public/" /> </remote-repository> <remote-repository> <option name="id" value="maven3" /> <option name="name" value="maven3" /> <option name="url" value="https://jitpack.io" /> </remote-repository> </component> </project> HDLLinphoneSDKDemoNew/.idea/migrations.xml
New file @@ -0,0 +1,10 @@ <?xml version="1.0" encoding="UTF-8"?> <project version="4"> <component name="ProjectMigrations"> <option name="MigrateToGradleLocalJavaHome"> <set> <option value="$PROJECT_DIR$" /> </set> </option> </component> </project> HDLLinphoneSDKDemoNew/.idea/misc.xml
@@ -1,10 +1,20 @@ <?xml version="1.0" encoding="UTF-8"?> <project version="4"> <component name="DesignSurface"> <option name="filePathToZoomLevelMap"> <map> <entry key="..\:/HDL/ProjectCode/AndroidLinphoneSdk/HDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/res/layout/activity_hdllinphone_intercom.xml" value="0.178125" /> <entry key="..\:/HDL/ProjectCode/AndroidLinphoneSdk/HDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/res/layout/activity_hdllinphone_monitor.xml" value="0.16354166666666667" /> <entry key="..\:/HDL/ProjectCode/AndroidLinphoneSdk/HDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/res/drawable/btn_click_lp_screenshot.xml" value="0.1785" /> <entry key="..\:/HDL/ProjectCode/AndroidLinphoneSdk/HDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/res/drawable/btn_click_lp_unlock.xml" value="0.188" /> <entry key="..\:/HDL/ProjectCode/AndroidLinphoneSdk/HDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/res/drawable/dialog_cancel_btn_normal_bg.xml" value="0.1695" /> <entry key="..\:/HDL/ProjectCode/AndroidLinphoneSdk/HDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/res/drawable/dialog_cancel_btn_press_bg.xml" value="0.1695" /> <entry key="..\:/HDL/ProjectCode/AndroidLinphoneSdk/HDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/res/drawable/dialog_cancel_btn_selector.xml" value="0.1695" /> <entry key="..\:/HDL/ProjectCode/AndroidLinphoneSdk/HDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/res/drawable/dialog_ok_btn_normal_bg.xml" value="0.1695" /> <entry key="..\:/HDL/ProjectCode/AndroidLinphoneSdk/HDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/res/drawable/dialog_ok_btn_press_bg.xml" value="0.1695" /> <entry key="..\:/HDL/ProjectCode/AndroidLinphoneSdk/HDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/res/drawable/dialog_ok_btn_selector.xml" value="0.1695" /> <entry key="..\:/HDL/ProjectCode/AndroidLinphoneSdk/HDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/res/drawable/lp_dialog_background.xml" value="0.159" /> <entry key="..\:/HDL/ProjectCode/AndroidLinphoneSdk/HDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/res/drawable/oval_color_white_18.xml" value="0.1695" /> <entry key="..\:/HDL/ProjectCode/AndroidLinphoneSdk/HDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/res/layout/activity_hdllinphone_intercom.xml" value="0.33" /> <entry key="..\:/HDL/ProjectCode/AndroidLinphoneSdk/HDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/res/layout/activity_hdllinphone_monitor.xml" value="0.5" /> <entry key="..\:/HDL/ProjectCode/AndroidLinphoneSdk/HDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/res/layout/linphone_dialog_content_and_twobutton.xml" value="0.3536458333333333" /> <entry key="..\:/HDL/ProjectCode/AndroidLinphoneSdk/HDLLinphoneSDKDemoNew/app/src/main/res/layout/activity_linphone_test.xml" value="0.3536458333333333" /> <entry key="..\:/HDL/ProjectCode/AndroidLinphoneSdk/HDLLinphoneSDKDemoNew/app/src/main/res/layout/activity_main.xml" value="0.3536458333333333" /> <entry key="HDLLinphoneSDK/src/main/res/drawable/lp_dialog_background.xml" value="0.22291666666666668" /> @@ -14,7 +24,7 @@ </option> </component> <component name="ExternalStorageConfigurationManager" enabled="true" /> <component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="11" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK"> <output url="file://$PROJECT_DIR$/build/classes" /> </component> <component name="ProjectType"> HDLLinphoneSDKDemoNew/HDLLinphoneSDK/build.gradle
@@ -4,14 +4,18 @@ apply plugin: 'com.kezong.fat-aar' android { compileSdkVersion 28 compileSdkVersion 31 buildToolsVersion "28.0.0" defaultConfig { minSdkVersion 23 targetSdkVersion 28 versionCode 1 versionName "1.0.3" targetSdkVersion 31 versionCode 5 versionName "1.0.7" ndk { abiFilters 'arm64-v8a' } // consumerProguardFiles "consumer-rules.pro" } @@ -42,8 +46,19 @@ } repositories { google() /*google() jcenter() maven { // Replace snapshots by releases for releases ! url "https://linphone.org/maven_repository" }*/ google() mavenCentral() maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' } maven { url = uri("https://plugins.gradle.org/m2/") } maven { url "https://jitpack.io" } maven { // Replace snapshots by releases for releases ! url "https://linphone.org/maven_repository" @@ -51,14 +66,14 @@ } dependencies { // implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar']) implementation 'com.android.support:appcompat-v7:28.0.0' implementation 'com.android.support.constraint:constraint-layout:2.0.4' // implementation "org.linphone:linphone-sdk-android:4.5.0" embed "org.linphone:linphone-sdk-android:4.5.0" implementation 'com.google.code.gson:gson:2.9.0' // implementation 'com.android.support.constraint:constraint-layout:2.0.4' embed 'com.tencent.tinker:tinker-patch-gradle-plugin:1.9.1' embed 'com.tencent.tinker:tinker-android-lib:1.9.1' //添加StatusBarUtil的依赖 implementation 'com.jaeger.statusbarutil:library:1.5.1' } HDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/AndroidManifest.xml
@@ -19,17 +19,34 @@ <application android:allowBackup="true" android:exported="true" android:label="@string/app_name" android:supportsRtl="true"> <activity android:name=".activity.HDLLinphoneReverseCallActivity"> <activity android:name=".activity.HDLLinphoneReverseCallActivity" android:exported="true"> <intent-filter> <action android:name="android.intent.action.MAIN" /> </intent-filter> </activity> <activity android:name=".activity.HDLLinphoneMonitorActivity" /> <activity android:name=".activity.HDLLinphoneIntercomActivity" /> <activity android:name=".activity.HDLLinphoneMonitorActivity" android:exported="true" /> <activity android:name=".activity.HDLLinphoneIntercomActivity" android:exported="true" /> <service android:name=".core.service.HDLLinphoneService" android:exported="true" /> <service android:name=".core.service.HDLLinphoneService" /> <receiver android:name=".receiver.CallBroadcastReceiver" android:enabled="true" android:exported="true"> <intent-filter> <action android:name="com.hdl.homepro.call.action" /> </intent-filter> </receiver> </application> </manifest> HDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/java/com/hdl/hdllinphonesdk/HDLLinphoneKit.java
@@ -1,17 +1,17 @@ package com.hdl.hdllinphonesdk; import static java.lang.Thread.sleep; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.ServiceConnection; import android.os.Build; import android.os.IBinder; import android.util.Log; import android.view.TextureView; import android.widget.Toast; import com.hdl.hdllinphonesdk.activity.HDLLinphoneIntercomActivity; import com.hdl.hdllinphonesdk.activity.HDLLinphoneReverseCallActivity; import com.hdl.hdllinphonesdk.callback.OnHDLLinphoneCallListener; import com.hdl.hdllinphonesdk.callback.OnLPOpenDoorCallBack; import com.hdl.hdllinphonesdk.core.callback.PhoneCallback; @@ -25,16 +25,13 @@ import org.linphone.core.AuthInfo; import org.linphone.core.Call; import org.linphone.core.CallParams; import org.linphone.core.ChatMessage; import org.linphone.core.ChatRoom; import org.linphone.core.Core; import org.linphone.core.CoreException; import org.linphone.core.Factory; import org.linphone.core.ProxyConfig; import org.linphone.core.TransportType; import java.io.FileOutputStream; import java.io.InputStream; import static java.lang.Thread.sleep; /** * Created by jlchen on 2021/8/4. @@ -64,6 +61,7 @@ public static final String KEY_TITLE_NAME = "lpTitleName"; public static final String KEY_SIP_ACCOUNT = "lpSipAccount"; public static final String HDLLinphoneKitNAME = "HDLLinphoneKit"; public static final String KEY_CALL_ALL_REJECTION = "callAllRejection"; private volatile static HDLLinphoneKit instance; private Context viewContext; private ServiceWaitThread mServiceWaitThread; @@ -411,7 +409,7 @@ mAccountCreator.setUsername(name); mAccountCreator.setDomain(host); mAccountCreator.setPassword(password); mAccountCreator.setTransport(TransportType.Udp); mAccountCreator.setTransport(TransportType.Tcp); ProxyConfig prxCfg = mAccountCreator.createProxyConfig(); prxCfg.enableQualityReporting(false); @@ -446,7 +444,7 @@ prxCfg.setQualityReportingInterval(0); prxCfg.enableRegister(true); //全视通需要设置固定代理服务器ip prxCfg.setServerAddr("sip:139.159.157.75:46000;transport=udp"); prxCfg.setServerAddr("sip:" + domain + ";transport=udp"); mLinphoneCore.addProxyConfig(prxCfg);//添加代理配置。如果启用了注册,这将开始在代理上注册。 mLinphoneCore.addAuthInfo(authInfo);//添加认证信息到,该信息片段将在所有需要的SIP事务中使用身份验证 @@ -478,10 +476,12 @@ if (addressToCall != null) { call = core.inviteAddressWithParams(addressToCall, params); // 设置外放 for (AudioDevice audioDevice : HDLLinphoneService.getCore().getAudioDevices()) { if (audioDevice.getType() == AudioDevice.Type.Speaker) { call.setOutputAudioDevice(audioDevice); if (call != null) { // 设置外放 for (AudioDevice audioDevice : HDLLinphoneService.getCore().getAudioDevices()) { if (audioDevice.getType() == AudioDevice.Type.Speaker) { call.setOutputAudioDevice(audioDevice); } } } } @@ -555,6 +555,28 @@ } } public void sendSipMessage(String sipAccount, String sipAddress, String message) { try { Core mLinphoneCore = HDLLinphoneService.getCore(); if (mLinphoneCore == null) return; //对方的sip地址,sipAddress:"sip:对方账号@服务器地址" Address address = mLinphoneCore.interpretUrl("sip:" + sipAccount + "@" + sipAddress); //建立对话 ChatRoom chatRoom = mLinphoneCore.getChatRoom(address); //创建消息 ChatMessage chatMessage = chatRoom.createMessageFromUtf8(message); //发送消息 chatMessage.send(); } catch (Exception e) { e.printStackTrace(); } } /** * 是否静音 * HDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/java/com/hdl/hdllinphonesdk/activity/HDLLinphoneIntercomActivity.java
@@ -1,10 +1,9 @@ package com.hdl.hdllinphonesdk.activity; import android.content.BroadcastReceiver; import android.Manifest; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.IntentFilter; import android.content.pm.PackageManager; import android.graphics.Bitmap; import android.media.AudioAttributes; import android.os.Build; @@ -12,7 +11,9 @@ import android.os.CountDownTimer; import android.os.SystemClock; import android.os.Vibrator; import android.support.v7.app.AlertDialog; import android.support.annotation.NonNull; import android.support.v4.app.ActivityCompat; import android.support.v4.content.ContextCompat; import android.text.TextUtils; import android.util.DisplayMetrics; import android.util.Log; @@ -28,12 +29,15 @@ import android.widget.Toast; import com.hdl.hdllinphonesdk.HDLLinphoneKit; import com.hdl.hdllinphonesdk.callback.OnLPOpenDoorCallBack; import com.hdl.hdllinphonesdk.R; import com.hdl.hdllinphonesdk.callback.OnLPOpenDoorCallBack; import com.hdl.hdllinphonesdk.dialog.LinphoneCommonDialog; import com.hdl.hdllinphonesdk.receiver.CallBroadcastReceiver; import com.hdl.hdllinphonesdk.utils.HDLImageUtils; import com.hdl.hdllinphonesdk.utils.HDLLog; import org.linphone.core.Call; import org.linphone.core.CallParams; import org.linphone.core.Core; import org.linphone.core.CoreListenerStub; @@ -43,6 +47,7 @@ public class HDLLinphoneIntercomActivity extends LPCheckPermissionsActivity implements View.OnClickListener { private static final String TAG = "HDLLinphoneIntercomActivity"; private RelativeLayout ll_lp_btn_back; //控件 private TextView tv_lp_title; private ImageView iv_lp_screenshot; @@ -74,7 +79,10 @@ //Linphone private CoreListenerStub mCoreListener; private boolean enableVideo = false; private CallBroadcastReceiver callBroadcastReceiver; private IntentFilter callFilter; @Override protected void onCreate(Bundle savedInstanceState) { @@ -117,6 +125,11 @@ //5. onDestroyLinphone(); if (callBroadcastReceiver != null) { unregisterReceiver(callBroadcastReceiver); callBroadcastReceiver = null; } HDLLog.i(TAG, "onDestroy"); } @@ -126,6 +139,7 @@ * initView */ private void initView() { ll_lp_btn_back = findViewById(R.id.ll_lp_btn_back); tv_lp_title = findViewById(R.id.tv_lp_title); iv_lp_screenshot = findViewById(R.id.iv_lp_screenshot); iv_lp_unlock = findViewById(R.id.iv_lp_unlock); @@ -151,11 +165,33 @@ */ private void initData() { Bundle extras = getIntent().getExtras(); String interphoneType = ""; if (extras != null) { String titleName = extras.getString(HDLLinphoneKit.KEY_TITLE_NAME); if (!TextUtils.isEmpty(titleName)) { tv_lp_title.setText(titleName); } interphoneType = extras.getString("interphoneType"); } //监听呼叫广播 callFilter = new IntentFilter(); callFilter.addAction("com.hdl.homepro.call.action"); callBroadcastReceiver = new CallBroadcastReceiver(); registerReceiver(callBroadcastReceiver, callFilter); if (callBroadcastReceiver != null) { String finalInterphoneType = interphoneType; callBroadcastReceiver.setOnReceivedCallBroadcastListener(new CallBroadcastReceiver.CallBroadcastListener() { @Override public void onReceived(String callFrom) { //如果收到推送通知把监视页面finish if (!TextUtils.isEmpty(callFrom) && !finalInterphoneType.equals(callFrom)) { Log.d("panlili", "HDLLinphoneIntercomActivity.java:onReceived-----> " + callFrom); finish();//结束当前页面 } } }); } } @@ -181,6 +217,7 @@ * init OnClickListener */ private void initOnClick() { ll_lp_btn_back.setOnClickListener(this); iv_lp_screenshot.setOnClickListener(this); iv_lp_unlock.setOnClickListener(this); iv_lp_hangUp.setOnClickListener(this); @@ -232,8 +269,14 @@ public void onClick(View view) { int id = view.getId(); if (id == R.id.iv_lp_screenshot) { //截图 onClickScreenshot(); //动态权限申请 if (ContextCompat.checkSelfPermission(HDLLinphoneIntercomActivity.this, Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(HDLLinphoneIntercomActivity.this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { ActivityCompat.requestPermissions(HDLLinphoneIntercomActivity.this, new String[]{Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE}, 1); } else { //截图 onClickScreenshot(); } } else if (id == R.id.iv_lp_unlock) { //开锁 onClickUnlock(); @@ -243,6 +286,28 @@ } else if (id == R.id.iv_lp_answer || id == R.id.tv_lp_answer) { //接听 onClickAnswer(); } else if (id == R.id.ll_lp_btn_back) { //返回按钮 挂断 if (isAnswer) { HDLLinphoneKit.getInstance().hangUp(); } finish(); } } @Override public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { super.onRequestPermissionsResult(requestCode, permissions, grantResults); switch (requestCode) { case 1: if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { //截图 onClickScreenshot(); } else { LinphoneCommonDialog.getInstance().showSettingPermissionDialog(HDLLinphoneIntercomActivity.this, getString(R.string.open_save_permission)); } break; default: } } @@ -265,38 +330,14 @@ * 开锁点击事件 */ private void onClickUnlock() { try { AlertDialog.Builder builder = new AlertDialog.Builder(this,R.style.CustomAlertDialog); builder.setTitle(R.string.lp_tipStr); builder.setMessage(R.string.tip_confirm_unlock); builder.setPositiveButton(R.string.lp_confirm, new DialogInterface.OnClickListener() { LinphoneCommonDialog.getInstance().showDialog(HDLLinphoneIntercomActivity.this, getString(R.string.tip_confirm_unlock), getString(R.string.lp_confirm), new LinphoneCommonDialog.OnOKClickListener() { @Override public void onClick(DialogInterface dialog, int which) { // 在确定按钮被点击时执行的操作 // 可以在这里添加你想要执行的逻辑 public void onOKClick() { if (HDLLinphoneKit.getInstance().getOnHDLLinphoneCallListener() != null) { HDLLinphoneKit.getInstance().getOnHDLLinphoneCallListener().onUnlockAction(); } dialog.dismiss(); // 关闭弹窗 } }); builder.setNegativeButton(R.string.lp_cancel, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { // 在取消按钮被点击时执行的操作 // 可以在这里添加你想要执行的逻辑 dialog.dismiss(); // 关闭弹窗 } }); AlertDialog dialog = builder.create(); dialog.show(); }catch (Exception exception) { Log.e(TAG, exception.getMessage()); } } /** @@ -417,6 +458,7 @@ // Once call is finished (end state), terminate the activity // We also check for released state (called a few seconds later) just in case // we missed the first one enableVideo = false; showToast(getString(R.string.lp_endOfCallStr)); finish(); } @@ -432,7 +474,20 @@ core.addListener(mCoreListener); core.enableMic(true);//开启麦克风 } } void enableVideo(Core core, Call call) { // Call currentCall = HDLLinphoneService.getCore().getCurrentCall(); CallParams params = call.getCurrentParams(); if (params == null) { params = core.createCallParams(call); } params.enableVideo(true); params.enableLowBandwidth(false); params.setAudioBandwidthLimit(0); // disable limitation call.update(params); } /** HDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/java/com/hdl/hdllinphonesdk/activity/HDLLinphoneMonitorActivity.java
@@ -1,15 +1,15 @@ package com.hdl.hdllinphonesdk.activity; import android.Manifest; import android.annotation.SuppressLint; import android.content.BroadcastReceiver; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.IntentFilter; import android.content.pm.PackageManager; import android.graphics.Bitmap; import android.os.CountDownTimer; import android.os.Bundle; import android.support.v7.app.AlertDialog; import android.os.CountDownTimer; import android.support.annotation.NonNull; import android.support.v4.app.ActivityCompat; import android.support.v4.content.ContextCompat; import android.text.TextUtils; import android.util.DisplayMetrics; import android.util.Log; @@ -26,6 +26,8 @@ import com.hdl.hdllinphonesdk.HDLLinphoneKit; import com.hdl.hdllinphonesdk.R; import com.hdl.hdllinphonesdk.callback.OnLPOpenDoorCallBack; import com.hdl.hdllinphonesdk.dialog.LinphoneCommonDialog; import com.hdl.hdllinphonesdk.receiver.CallBroadcastReceiver; import com.hdl.hdllinphonesdk.utils.HDLImageUtils; import com.hdl.hdllinphonesdk.utils.HDLLog; @@ -43,11 +45,9 @@ private RelativeLayout ll_lp_btn_back; //控件 private TextView tv_lp_title; private ImageView iv_lp_screenshot; private TextView tv_lp_screenshot; private ImageView iv_lp_screenshot; private ImageView iv_lp_unlock; private TextView tv_lp_unlock; private LinearLayout ll_video_lp_rendering; private TextureView video_lp_rendering; @@ -58,6 +58,9 @@ //Linphone private CoreListenerStub mCoreListener; private boolean enableVideo = false; private CallBroadcastReceiver callBroadcastReceiver; private IntentFilter callFilter; @Override protected void onCreate(Bundle savedInstanceState) { @@ -94,6 +97,11 @@ onDestroyLinphone(); if (callBroadcastReceiver != null) { unregisterReceiver(callBroadcastReceiver); callBroadcastReceiver = null; } HDLLog.i(TAG, "onDestroy"); } @@ -105,10 +113,7 @@ ll_lp_btn_back = findViewById(R.id.ll_lp_btn_back); tv_lp_title = findViewById(R.id.tv_lp_title); iv_lp_screenshot = findViewById(R.id.iv_lp_screenshot); tv_lp_screenshot = findViewById(R.id.tv_lp_screenshot); iv_lp_unlock = findViewById(R.id.iv_lp_unlock); tv_lp_unlock = findViewById(R.id.tv_lp_unlock); ll_video_lp_rendering = findViewById(R.id.ll_video_lp_rendering); video_lp_rendering = findViewById(R.id.video_lp_rendering); @@ -122,11 +127,33 @@ */ private void initData() { Bundle extras = getIntent().getExtras(); String interphoneType = ""; if (extras != null) { String titleName = extras.getString(HDLLinphoneKit.KEY_TITLE_NAME); if (!TextUtils.isEmpty(titleName)) { tv_lp_title.setText(titleName); } interphoneType = extras.getString("interphoneType"); } //监听呼叫广播 callFilter = new IntentFilter(); callFilter.addAction("com.hdl.homepro.call.action"); callBroadcastReceiver = new CallBroadcastReceiver(); registerReceiver(callBroadcastReceiver, callFilter); if (callBroadcastReceiver != null) { String finalInterphoneType = interphoneType; callBroadcastReceiver.setOnReceivedCallBroadcastListener(new CallBroadcastReceiver.CallBroadcastListener() { @Override public void onReceived(String callFrom) { //如果收到推送通知把监视页面finish if (!TextUtils.isEmpty(callFrom) && !finalInterphoneType.equals(callFrom)) { Log.d("panlili", "HDLLinphoneMonitorActivity finish-----> "); finish();//结束当前页面 } } }); } } @@ -153,12 +180,8 @@ */ private void initOnClick() { ll_lp_btn_back.setOnClickListener(this); iv_lp_screenshot.setOnClickListener(this); tv_lp_screenshot.setOnClickListener(this); iv_lp_unlock.setOnClickListener(this); tv_lp_unlock.setOnClickListener(this); } /** @@ -206,14 +229,36 @@ public void onClick(View view) { int id = view.getId(); if (id == R.id.iv_lp_screenshot) { //截图 onClickScreenshot(); //动态权限申请 if (ContextCompat.checkSelfPermission(HDLLinphoneMonitorActivity.this, Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(HDLLinphoneMonitorActivity.this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { ActivityCompat.requestPermissions(HDLLinphoneMonitorActivity.this, new String[]{Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE}, 1); } else { //截图 onClickScreenshot(); } } else if (id == R.id.iv_lp_unlock) { //开锁 onClickUnlock(); } else if (id == R.id.ll_lp_btn_back) { //返回按钮 挂断 onClickHangUp(); //返回按钮 finish(); } } @Override public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { super.onRequestPermissionsResult(requestCode, permissions, grantResults); switch (requestCode) { case 1: if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { //截图 onClickScreenshot(); } else { LinphoneCommonDialog.getInstance().showSettingPermissionDialog(HDLLinphoneMonitorActivity.this, getString(R.string.open_save_permission)); } break; default: } } @@ -236,47 +281,16 @@ * 开锁点击事件 */ private void onClickUnlock() { try { AlertDialog.Builder builder = new AlertDialog.Builder(this, R.style.CustomAlertDialog); builder.setTitle(R.string.lp_tipStr); builder.setMessage(R.string.tip_confirm_unlock); builder.setPositiveButton(R.string.lp_confirm, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { // 在确定按钮被点击时执行的操作 // 可以在这里添加你想要执行的逻辑 if (HDLLinphoneKit.getInstance().getOnHDLLinphoneCallListener() != null) { HDLLinphoneKit.getInstance().getOnHDLLinphoneCallListener().onUnlockAction(); } dialog.dismiss(); // 关闭弹窗 LinphoneCommonDialog.getInstance().showDialog(HDLLinphoneMonitorActivity.this, getString(R.string.tip_confirm_unlock), getString(R.string.lp_confirm), new LinphoneCommonDialog.OnOKClickListener() { @Override public void onOKClick() { if (HDLLinphoneKit.getInstance().getOnHDLLinphoneCallListener() != null) { HDLLinphoneKit.getInstance().getOnHDLLinphoneCallListener().onUnlockAction(); } }); builder.setNegativeButton(R.string.lp_cancel, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { // 在取消按钮被点击时执行的操作 // 可以在这里添加你想要执行的逻辑 dialog.dismiss(); // 关闭弹窗 } }); } }); AlertDialog dialog = builder.create(); dialog.show(); } catch (Exception exception) { Log.e(TAG, exception.getMessage()); } } /** * 挂断点击事件 */ private void onClickHangUp() { //1.挂断 HDLLinphoneKit.getInstance().hangUp(); //2.页面关闭 finish(); } /****************开锁成功********/ @@ -338,13 +352,6 @@ enableVideo = false; showToast(getString(R.string.lp_endMonitoringStr)); finish(); } else if (state == Call.State.StreamsRunning) { if (HDLLinphoneKit.getInstance().getIntercomeType().equals(HDLLinphoneKit.INTER_PHONE_TYPE_HDL)) { if (!enableVideo) { enableVideo(core, call); enableVideo = true; } } } } }; HDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/java/com/hdl/hdllinphonesdk/activity/HDLLinphoneReverseCallActivity.java
@@ -1,16 +1,19 @@ package com.hdl.hdllinphonesdk.activity; import android.Manifest; import android.content.Context; import android.content.DialogInterface; import android.content.IntentFilter; import android.content.pm.PackageManager; import android.graphics.Bitmap; import android.media.AudioAttributes; import android.os.Build; import android.os.Bundle; import android.os.CountDownTimer; import android.os.SystemClock; import android.os.Vibrator; import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.v4.app.ActivityCompat; import android.support.v4.content.ContextCompat; import android.text.TextUtils; import android.util.DisplayMetrics; import android.util.Log; @@ -28,6 +31,8 @@ import com.hdl.hdllinphonesdk.HDLLinphoneKit; import com.hdl.hdllinphonesdk.R; import com.hdl.hdllinphonesdk.callback.OnLPOpenDoorCallBack; import com.hdl.hdllinphonesdk.dialog.LinphoneCommonDialog; import com.hdl.hdllinphonesdk.receiver.CallBroadcastReceiver; import com.hdl.hdllinphonesdk.utils.HDLImageUtils; import com.hdl.hdllinphonesdk.utils.HDLLog; @@ -42,6 +47,7 @@ public class HDLLinphoneReverseCallActivity extends LPCheckPermissionsActivity implements View.OnClickListener { private static final String TAG = "HDLLinphoneReverseCallActivity"; private RelativeLayout ll_lp_btn_back; //控件 private TextView tv_lp_title; private ImageView iv_lp_screenshot; @@ -53,6 +59,10 @@ private ImageView iv_lp_answer; private TextView tv_lp_answer; private RelativeLayout rl_lp_answerView; private ImageView iv_lp_rejectall; private TextView tv_lp_rejectall; private RelativeLayout rl_lp_rejectallView; private LinearLayout ll_video_lp_rendering; private TextureView video_lp_rendering; @@ -77,6 +87,11 @@ private String deviceSipAccount;//设备SIP账号 private boolean enableVideo = false; private CallBroadcastReceiver callBroadcastReceiver; private IntentFilter callFilter; private boolean callAllRejection = false;//自研门口机是否支持全部拒接 @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -90,7 +105,6 @@ initCallBack(); initCountDownTimer(); initLinphone(); // initVibrator(); } /** @@ -107,14 +121,19 @@ } //3.注销callBack HDLLinphoneKit.getInstance().setOpenOpenDoorCallBack(null); //4.取消震动器 cancelVibrator(); //5. //4. if (mCountDownTimer != null) { mCountDownTimer.cancel(); mCountDownTimer = null; } onDestroyLinphone(); if (callBroadcastReceiver != null) { unregisterReceiver(callBroadcastReceiver); callBroadcastReceiver = null; } HDLLog.i(TAG, "onDestroy"); } @@ -122,6 +141,7 @@ * initView */ private void initView() { ll_lp_btn_back = findViewById(R.id.ll_lp_btn_back); tv_lp_title = findViewById(R.id.tv_lp_title); iv_lp_screenshot = findViewById(R.id.iv_lp_screenshot); iv_lp_unlock = findViewById(R.id.iv_lp_unlock); @@ -130,6 +150,9 @@ iv_lp_answer = findViewById(R.id.iv_lp_answer); tv_lp_answer = findViewById(R.id.tv_lp_answer); rl_lp_answerView = findViewById(R.id.rl_lp_answerView); iv_lp_rejectall = findViewById(R.id.iv_lp_hangUpall); tv_lp_rejectall = findViewById(R.id.tv_lp_hangUpall); rl_lp_rejectallView = findViewById(R.id.rl_lp_hangUpallView); ll_video_lp_rendering = findViewById(R.id.ll_video_lp_rendering); video_lp_rendering = findViewById(R.id.video_lp_rendering); video_lp_rendering2 = findViewById(R.id.video_lp_rendering2); @@ -147,12 +170,37 @@ */ private void initData() { Bundle extras = getIntent().getExtras(); String interphoneType = ""; if (extras != null) { String titleName = extras.getString(HDLLinphoneKit.KEY_TITLE_NAME); if (!TextUtils.isEmpty(titleName)) { tv_lp_title.setText(titleName); } deviceSipAccount = extras.getString(HDLLinphoneKit.KEY_SIP_ACCOUNT); interphoneType = extras.getString("interphoneType"); callAllRejection = extras.getBoolean(HDLLinphoneKit.KEY_CALL_ALL_REJECTION); } rl_lp_rejectallView.setVisibility(callAllRejection ? View.VISIBLE : View.GONE); //监听呼叫广播 callFilter = new IntentFilter(); callFilter.addAction("com.hdl.homepro.call.action"); callBroadcastReceiver = new CallBroadcastReceiver(); registerReceiver(callBroadcastReceiver, callFilter); if (callBroadcastReceiver != null) { String finalInterphoneType = interphoneType; callBroadcastReceiver.setOnReceivedCallBroadcastListener(new CallBroadcastReceiver.CallBroadcastListener() { @Override public void onReceived(String callFrom) { //如果收到推送通知把监视页面finish if (!TextUtils.isEmpty(callFrom) && !finalInterphoneType.equals(callFrom)) { Log.d("panlili", "HDLLinphoneIntercomActivity.java:onReceived-----> " + callFrom); finish();//结束当前页面 } } }); } } @@ -178,12 +226,15 @@ * init OnClickListener */ private void initOnClick() { ll_lp_btn_back.setOnClickListener(this); iv_lp_screenshot.setOnClickListener(this); iv_lp_unlock.setOnClickListener(this); iv_lp_hangUp.setOnClickListener(this); tv_lp_hangUp.setOnClickListener(this); iv_lp_answer.setOnClickListener(this); tv_lp_answer.setOnClickListener(this); iv_lp_rejectall.setOnClickListener(this); tv_lp_rejectall.setOnClickListener(this); } /** @@ -232,8 +283,14 @@ public void onClick(View view) { int id = view.getId(); if (id == R.id.iv_lp_screenshot) { //截图 onClickScreenshot(); //动态权限申请 if (ContextCompat.checkSelfPermission(HDLLinphoneReverseCallActivity.this, Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(HDLLinphoneReverseCallActivity.this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { ActivityCompat.requestPermissions(HDLLinphoneReverseCallActivity.this, new String[]{Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE}, 1); } else { //截图 onClickScreenshot(); } } else if (id == R.id.iv_lp_unlock) { //开锁 onClickUnlock(); @@ -243,6 +300,31 @@ } else if (id == R.id.iv_lp_answer || id == R.id.tv_lp_answer) { //接听 onClickAnswer(); } else if (id == R.id.iv_lp_hangUpall || id == R.id.tv_lp_hangUpall) { //拒接全部 onClickRejectAll(); } else if (id == R.id.ll_lp_btn_back) { //返回按钮 挂断 if (isAnswer) { HDLLinphoneKit.getInstance().hangUp(); } finish(); } } @Override public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { super.onRequestPermissionsResult(requestCode, permissions, grantResults); switch (requestCode) { case 1: if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { //截图 onClickScreenshot(); } else { LinphoneCommonDialog.getInstance().showSettingPermissionDialog(HDLLinphoneReverseCallActivity.this, getString(R.string.open_save_permission)); } break; default: } } @@ -266,37 +348,14 @@ * 开锁点击事件 */ private void onClickUnlock() { try { AlertDialog.Builder builder = new AlertDialog.Builder(this, R.style.CustomAlertDialog); builder.setTitle(R.string.lp_tipStr); builder.setMessage(R.string.tip_confirm_unlock); builder.setPositiveButton(R.string.lp_confirm, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { // 在确定按钮被点击时执行的操作 // 可以在这里添加你想要执行的逻辑 if (HDLLinphoneKit.getInstance().getOnHDLLinphoneCallListener() != null) { HDLLinphoneKit.getInstance().getOnHDLLinphoneCallListener().onUnlockAction(); } dialog.dismiss(); // 关闭弹窗 LinphoneCommonDialog.getInstance().showDialog(HDLLinphoneReverseCallActivity.this, getString(R.string.tip_confirm_unlock), getString(R.string.lp_confirm), new LinphoneCommonDialog.OnOKClickListener() { @Override public void onOKClick() { if (HDLLinphoneKit.getInstance().getOnHDLLinphoneCallListener() != null) { HDLLinphoneKit.getInstance().getOnHDLLinphoneCallListener().onUnlockAction(); } }); builder.setNegativeButton(R.string.lp_cancel, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { // 在取消按钮被点击时执行的操作 // 可以在这里添加你想要执行的逻辑 dialog.dismiss(); // 关闭弹窗 } }); AlertDialog dialog = builder.create(); dialog.show(); } catch (Exception exception) { Log.e(TAG, exception.getMessage()); } } }); } /** @@ -319,6 +378,19 @@ finish(); } /** * 拒接全部点击事件 */ private void onClickRejectAll() { //1.回调事件 if (HDLLinphoneKit.getInstance().getOnHDLLinphoneCallListener() != null) { HDLLinphoneKit.getInstance().getOnHDLLinphoneCallListener().onRejectCallAllAction(); } //2.页面关闭 finish(); } /** * 接听按钮点击事件 */ @@ -330,12 +402,11 @@ } HDLLinphoneKit.getInstance().callTo(deviceSipAccount, true); //2.取消震动 cancelVibrator(); //3.修改UI //2.修改UI isAnswer = true; tv_lp_hangUp.setText(getString(R.string.lp_hangupStr)); setViewGone(rl_lp_answerView); setViewGone(rl_lp_rejectallView); setViewGone(tv_lp_calltime); setViewVisible(timer_lp_calltime); startCallTimeCountdown(); @@ -419,15 +490,9 @@ // Once call is finished (end state), terminate the activity // We also check for released state (called a few seconds later) just in case // we missed the first one enableVideo = false; showToast(getString(R.string.lp_endOfCallStr)); finish(); } else if (state == Call.State.StreamsRunning) { if (HDLLinphoneKit.getInstance().getIntercomeType().equals(HDLLinphoneKit.INTER_PHONE_TYPE_HDL)) { if (!enableVideo) { enableVideo(core, call); enableVideo = true; } } } } }; @@ -473,36 +538,4 @@ video_lp_rendering2 = null; } /** * 初始化震动器 */ void initVibrator() { mVibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE); if (mVibrator.hasVibrator()) { long[] patern = {0, 1000, 1000}; AudioAttributes audioAttributes = null; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { audioAttributes = new AudioAttributes.Builder() .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION) .setUsage(AudioAttributes.USAGE_NOTIFICATION_RINGTONE) //key .build(); mVibrator.vibrate(patern, 1, audioAttributes); } else { mVibrator.vibrate(patern, 1); } } else { HDLLog.E("当前手机没有震动器"); } } /** * 关闭震动器 */ void cancelVibrator() { if (mVibrator != null) { mVibrator.cancel(); mVibrator = null; } } } HDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/java/com/hdl/hdllinphonesdk/activity/LPCheckPermissionsActivity.java
@@ -13,6 +13,8 @@ import android.provider.Settings; import android.view.KeyEvent; import com.jaeger.library.StatusBarUtil; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.List; @@ -33,14 +35,10 @@ * 需要进行检测的权限数组 */ protected String[] needPermissions = { Manifest.permission.INTERNET, Manifest.permission.ACCESS_NETWORK_STATE, Manifest.permission.WAKE_LOCK, Manifest.permission.RECORD_AUDIO, Manifest.permission.MODIFY_AUDIO_SETTINGS, Manifest.permission.CAMERA, Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.CAMERA }; public static final int PERMISSON_REQUESTCODE = 0; @@ -51,16 +49,13 @@ if(Build.VERSION.SDK_INT > 28 && getApplicationContext().getApplicationInfo().targetSdkVersion > 28) { needPermissions = new String[] { Manifest.permission.INTERNET, Manifest.permission.ACCESS_NETWORK_STATE, Manifest.permission.WAKE_LOCK, Manifest.permission.RECORD_AUDIO, Manifest.permission.MODIFY_AUDIO_SETTINGS, Manifest.permission.CAMERA, Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.CAMERA }; } setStatusBarTranslucent(); } /** @@ -158,53 +153,6 @@ return true; } // @TargetApi(23) // public void onRequestPermissionsResult(int requestCode, // String[] permissions, int[] paramArrayOfInt) { // if (requestCode == PERMISSON_REQUESTCODE) { // if (!verifyPermissions(paramArrayOfInt)) { // showMissingPermissionDialog(); // isNeedCheck = false; // }else{ // //授权成功 // // } // } // } // /** // * 显示提示信息 // * // * @since 2.5.0 // * // */ // public void showMissingPermissionDialog() { // AlertDialog.Builder builder = new AlertDialog.Builder(this); // builder.setTitle(R.string.gd_notifyTitle); // builder.setMessage(R.string.gd_notifyMsg); // // // 拒绝, 退出应用 // builder.setNegativeButton(R.string.gd_cancel, // new DialogInterface.OnClickListener() { // @Override // public void onClick(DialogInterface dialog, int which) { // finish(); // } // }); // // builder.setPositiveButton(R.string.gd_setting, // new DialogInterface.OnClickListener() { // @Override // public void onClick(DialogInterface dialog, int which) { // startAppSettings(); // } // }); // // builder.setCancelable(false); // // builder.show(); // } /** * 启动应用的设置 * @@ -240,4 +188,11 @@ public void setRequestPermissionsListener(RequestPermissionsListener mRequestPermissionsListener) { mRequestPermissionsListener = mRequestPermissionsListener; } // 将StatusBar设置为透明 public void setStatusBarTranslucent() { StatusBarUtil.setTranslucentForImageViewInFragment(this, 0, null); StatusBarUtil.setLightMode(this); } } HDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/java/com/hdl/hdllinphonesdk/callback/OnHDLLinphoneCallListener.java
@@ -15,6 +15,10 @@ */ void onRejectCallAction(); /** * 拒接全部回调 */ void onRejectCallAllAction(); /** * 开锁回调 */ void onUnlockAction(); HDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/java/com/hdl/hdllinphonesdk/core/service/HDLLinphoneService.java
@@ -1,15 +1,12 @@ package com.hdl.hdllinphonesdk.core.service; import static com.hdl.hdllinphonesdk.HDLLinphoneKit.HDLLinphoneKitNAME; import android.app.AlarmManager; import android.app.Notification; import android.app.NotificationChannel; import android.app.NotificationManager; import android.app.PendingIntent; import android.app.Service; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.ServiceConnection; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.os.Binder; @@ -17,14 +14,9 @@ import android.os.Handler; import android.os.IBinder; import android.os.SystemClock; import android.support.v4.app.NotificationCompat; import android.telecom.ConnectionService; import com.google.gson.Gson; import com.hdl.hdllinphonesdk.R; import com.hdl.hdllinphonesdk.activity.HDLLinphoneIntercomActivity; import com.hdl.hdllinphonesdk.activity.HDLLinphoneReverseCallActivity; import com.hdl.hdllinphonesdk.core.callback.PhoneCallback; import com.hdl.hdllinphonesdk.core.callback.RegistrationCallback; import com.hdl.hdllinphonesdk.core.linphone.KeepAliveHandler; @@ -38,7 +30,6 @@ import org.linphone.core.PayloadType; import org.linphone.core.ProxyConfig; import org.linphone.core.RegistrationState; import org.linphone.core.ToneID; import org.linphone.core.VideoActivationPolicy; import org.linphone.core.VideoDefinition; import org.linphone.core.tools.Log; @@ -50,8 +41,6 @@ import java.io.InputStream; import java.util.Timer; import java.util.TimerTask; import static com.hdl.hdllinphonesdk.HDLLinphoneKit.HDLLinphoneKitNAME; public class HDLLinphoneService extends Service { private static final String START_LINPHONE_LOGS = " ==== HDLLinphoneService ===="; @@ -147,7 +136,14 @@ hdlStartForeground(); initLinphone(); Intent intent = new Intent(this, KeepAliveHandler.class); mKeepAlivePendingIntent = PendingIntent.getBroadcast(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT); // mKeepAlivePendingIntent = PendingIntent.getBroadcast(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT); if (android.os.Build.VERSION.SDK_INT >= 31) { mKeepAlivePendingIntent = PendingIntent.getBroadcast(this, 0, intent, PendingIntent.FLAG_IMMUTABLE); } else { mKeepAlivePendingIntent = PendingIntent.getBroadcast(this, 0, intent, PendingIntent.FLAG_ONE_SHOT); } ((AlarmManager) this.getSystemService(Context.ALARM_SERVICE)).setRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime() + 60000, 60000, mKeepAlivePendingIntent); } @@ -399,8 +395,12 @@ //2.设置VP8、H264、H265 等启用 PayloadType[] ptVideoList = mCore.getVideoPayloadTypes(); for (PayloadType pt : ptVideoList) { // HDLLog.i("VideoPayload", pt.getMimeType()); pt.enable(true); HDLLog.i("VideoPayload", pt.getMimeType()); if ("VP8".equals(pt.getMimeType())){ pt.enable(false); }else { pt.enable(true); } } mCore.setVideoPayloadTypes(ptVideoList); } HDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/java/com/hdl/hdllinphonesdk/dialog/LinphoneCommonDialog.java
New file @@ -0,0 +1,110 @@ package com.hdl.hdllinphonesdk.dialog; import android.app.Dialog; import android.content.Context; import android.content.Intent; import android.net.Uri; import android.provider.Settings; import android.util.Log; import android.view.Display; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.WindowManager; import android.widget.TextView; import com.hdl.hdllinphonesdk.R; public class LinphoneCommonDialog { private Dialog commonPd; private volatile static LinphoneCommonDialog mInstance; public LinphoneCommonDialog() { } public static LinphoneCommonDialog getInstance() { if (mInstance == null) { synchronized (LinphoneCommonDialog.class) { if (mInstance == null) { mInstance = new LinphoneCommonDialog(); } } } return mInstance; } public void showDialog(Context context, String tip, String okButton, OnOKClickListener listener) { if (commonPd != null) { try { commonPd.show(); } catch (Exception e) { } } else { Dialog dialog = new Dialog(context, R.style.common_dialog); View view = LayoutInflater.from(context).inflate(R.layout.linphone_dialog_content_and_twobutton, null); dialog.setContentView(view, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT)); TextView tvTitle = view.findViewById(R.id.tv_content_tip); tvTitle.setText(tip); TextView tvCancel = view.findViewById(R.id.dialog_cancel_btn); TextView tvOk = view.findViewById(R.id.dialog_ok_btn); tvOk.setText(okButton); tvCancel.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { dismiss(); } }); tvOk.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { dismiss(); listener.onOKClick(); } }); WindowManager windowManager = dialog.getWindow().getWindowManager(); Display display = windowManager.getDefaultDisplay(); WindowManager.LayoutParams lp = dialog.getWindow().getAttributes(); lp.width = (int) (display.getWidth() * 0.8); //设置宽度 dialog.getWindow().setAttributes(lp); commonPd = dialog; commonPd.show(); } } public void dismiss() { try { if (commonPd != null) { commonPd.dismiss(); commonPd = null; } } catch (Exception e) { e.printStackTrace(); } } public interface OnOKClickListener { void onOKClick(); } public void showSettingPermissionDialog(Context context, String permission) { Log.d("panlili", "LinphoneCommonDialog.java:showSettingPermissionDialog-----> "); showDialog(context, permission, context.getString(R.string.linphone_text_open_settings), new LinphoneCommonDialog.OnOKClickListener() { @Override public void onOKClick() { Intent intent = new Intent(); intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS); Uri uri = Uri.fromParts("package", context.getPackageName(), null); intent.setData(uri); context.startActivity(intent); } }); } } HDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/java/com/hdl/hdllinphonesdk/receiver/CallBroadcastReceiver.java
New file @@ -0,0 +1,37 @@ package com.hdl.hdllinphonesdk.receiver; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.text.TextUtils; /** * Created by panlili on 2023/10/11 * description: */ public class CallBroadcastReceiver extends BroadcastReceiver { private static CallBroadcastListener listener; public static final String CALL_RECEIVED_ACTION = "com.hdl.homepro.call.action"; @Override public void onReceive(Context context, Intent intent) { if (intent.getAction().equals(CALL_RECEIVED_ACTION)) { String callFrom = intent.getStringExtra("callFrom"); if (!TextUtils.isEmpty(callFrom)) { if (listener != null) { listener.onReceived(callFrom); } } } } //回调接口 public interface CallBroadcastListener { public void onReceived(String callFrom); } public void setOnReceivedCallBroadcastListener(CallBroadcastListener listener) { this.listener = listener; } } HDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/res/drawable/dialog_cancel_btn_normal_bg.xml
New file @@ -0,0 +1,10 @@ <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <!-- 圆角 --> <corners android:bottomLeftRadius="18dp" /> <!-- 填充 --> <solid android:color="@android:color/white" /><!-- 填充的颜色 --> </shape> HDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/res/drawable/dialog_cancel_btn_press_bg.xml
New file @@ -0,0 +1,10 @@ <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <!-- 圆角 --> <corners android:bottomLeftRadius="18dp" /> <!-- 填充 --> <solid android:color="@color/color_F5F5F5" /><!-- 填充的颜色 --> </shape> HDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/res/drawable/dialog_cancel_btn_selector.xml
New file @@ -0,0 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/dialog_cancel_btn_press_bg" android:state_pressed="true" /> <item android:drawable="@drawable/dialog_cancel_btn_press_bg" android:state_focused="true" /> <item android:drawable="@drawable/dialog_cancel_btn_normal_bg" /> </selector> HDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/res/drawable/dialog_ok_btn_normal_bg.xml
New file @@ -0,0 +1,10 @@ <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <!-- 圆角 --> <corners android:bottomRightRadius="18dp" /> <!-- 填充 --> <solid android:color="@android:color/white" /><!-- 填充的颜色 --> </shape> HDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/res/drawable/dialog_ok_btn_press_bg.xml
New file @@ -0,0 +1,10 @@ <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <!-- 圆角 --> <corners android:bottomRightRadius="18dp" /> <!-- 填充 --> <solid android:color="@color/color_F5F5F5" /><!-- 填充的颜色 --> </shape> HDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/res/drawable/dialog_ok_btn_selector.xml
New file @@ -0,0 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/dialog_ok_btn_press_bg" android:state_pressed="true" /> <item android:drawable="@drawable/dialog_ok_btn_press_bg" android:state_focused="true" /> <item android:drawable="@drawable/dialog_ok_btn_normal_bg" /> </selector> HDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/res/drawable/ic_esvideo_on_hangup.pngHDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/res/drawable/ic_esvideo_on_hangupall.png
HDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/res/drawable/oval_color_white_18.xml
New file @@ -0,0 +1,12 @@ <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item> <shape> <solid android:color="@color/white" /> <corners android:topLeftRadius="18dp" android:topRightRadius="18dp" android:bottomLeftRadius="18dp" android:bottomRightRadius="18dp"/> </shape> </item> </selector> HDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/res/layout/activity_hdllinphone_intercom.xml
@@ -5,11 +5,31 @@ android:background="@android:color/white" android:orientation="vertical"> <View android:id="@+id/id_top" android:layout_width="match_parent" android:layout_height="44dp" android:background="@color/white" /> <RelativeLayout android:id="@+id/rl_lp_topView" android:layout_width="match_parent" android:layout_height="44dp" android:background="@color/lpsdk_app_bg"> android:background="@color/white"> <RelativeLayout android:id="@+id/ll_lp_btn_back" android:layout_width="64dp" android:layout_height="44dp"> <ImageView android:layout_width="20dp" android:layout_height="20dp" android:layout_centerVertical="true" android:layout_marginStart="16dp" android:src="@drawable/ic_esvideo_on_back" /> </RelativeLayout> <TextView android:id="@+id/tv_lp_title" @@ -21,7 +41,7 @@ android:gravity="center" android:text="室内机" android:textColor="@color/lpsdk_textColor" android:textSize="18sp"/> android:textSize="18sp"></TextView> </RelativeLayout> @@ -44,6 +64,7 @@ android:orientation="horizontal"> <RelativeLayout android:id="@+id/rl_lp_screenshot" android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1"> @@ -62,6 +83,7 @@ </RelativeLayout> <RelativeLayout android:id="@+id/rl_lp_unlock" android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1"> @@ -155,6 +177,32 @@ </RelativeLayout> <RelativeLayout android:id="@+id/rl_lp_hangUpallView" android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1"> <ImageView android:id="@+id/iv_lp_hangUpall" android:layout_width="66dp" android:layout_height="66dp" android:layout_centerHorizontal="true" android:scaleType="fitCenter" android:src="@drawable/ic_esvideo_on_hangupall" /> <TextView android:id="@+id/tv_lp_hangUpall" android:layout_width="match_parent" android:layout_height="20dp" android:layout_alignParentBottom="true" android:gravity="center" android:text="@string/lp_hangupStr_all" android:textColor="@color/lpsdk_textColor" android:textSize="14sp" /> </RelativeLayout> <RelativeLayout android:id="@+id/rl_lp_answerView" android:layout_width="0dp" android:layout_height="match_parent" HDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/res/layout/activity_hdllinphone_monitor.xml
@@ -1,26 +1,33 @@ <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@android:color/white" android:orientation="vertical"> <View android:id="@+id/id_top" android:layout_width="match_parent" android:layout_height="44dp" android:background="@color/white" /> <RelativeLayout android:id="@+id/rl_lp_topView" android:layout_width="match_parent" android:background="@color/lpsdk_app_bg" android:layout_height="44dp"> android:layout_height="44dp" android:background="@color/white"> <RelativeLayout android:id="@+id/ll_lp_btn_back" android:layout_width="44dp" android:layout_width="64dp" android:layout_height="44dp"> <ImageView android:layout_width="20dp" android:layout_height="20dp" android:layout_centerInParent="true" android:src="@drawable/ic_esvideo_on_back"/> android:layout_centerVertical="true" android:layout_marginStart="16dp" android:src="@drawable/ic_esvideo_on_back" /> </RelativeLayout> @@ -28,14 +35,13 @@ android:id="@+id/tv_lp_title" android:layout_width="match_parent" android:layout_height="25dp" android:layout_marginTop="10dp" android:layout_marginLeft="50dp" android:layout_marginTop="10dp" android:layout_marginRight="50dp" android:gravity="center" android:textColor="@color/lpsdk_textColor" android:textSize="18sp" android:text="室内机" ></TextView> android:textColor="@color/lpsdk_textColor" android:textSize="18sp"></TextView> </RelativeLayout> @@ -45,10 +51,11 @@ android:layout_width="wrap_content" android:layout_height="210dp" android:background="@android:color/black"> <TextureView android:id="@+id/video_lp_rendering" android:layout_width="match_parent" android:layout_height="match_parent"/> android:layout_height="match_parent" /> </LinearLayout> <RelativeLayout @@ -58,7 +65,7 @@ <TextureView android:id="@+id/video_lp_rendering2" android:layout_width="1dp" android:layout_height="1dp"/> android:layout_height="1dp" /> <LinearLayout @@ -68,51 +75,54 @@ android:layout_marginTop="66dp"> <RelativeLayout android:id="@+id/rl_screenshot" android:layout_width="0dp" android:layout_weight="1" android:layout_height="match_parent"> android:layout_height="match_parent" android:layout_weight="1"> <ImageView android:id="@+id/iv_lp_screenshot" android:layout_width="66dp" android:layout_height="66dp" android:scaleType="fitCenter" android:layout_centerHorizontal="true" android:background="@drawable/btn_click_lp_screenshot" android:layout_centerHorizontal="true"/> android:scaleType="fitCenter" /> <TextView android:id="@+id/tv_lp_screenshot" android:layout_width="match_parent" android:layout_height="20dp" android:text="@string/lp_screenshotStr" android:layout_alignParentBottom="true" android:gravity="center" android:text="@string/lp_screenshotStr" android:textColor="@color/lpsdk_textColor" android:textSize="14sp" android:layout_alignParentBottom="true"/> android:textSize="14sp" /> </RelativeLayout> <RelativeLayout android:id="@+id/rl_lp_unlock" android:id="@+id/rl_unlock" android:layout_width="0dp" android:layout_weight="1" android:layout_height="match_parent"> android:layout_height="match_parent" android:layout_weight="1"> <ImageView android:id="@+id/iv_lp_unlock" android:layout_width="66dp" android:layout_height="66dp" android:scaleType="fitCenter" android:background="@drawable/btn_click_lp_unlock" android:layout_centerHorizontal="true" ></ImageView> android:background="@drawable/btn_click_lp_unlock" android:scaleType="fitCenter"></ImageView> <TextView android:id="@+id/tv_lp_unlock" android:layout_width="match_parent" android:layout_height="20dp" android:text="@string/lp_unlockStr" android:gravity="center" android:textColor="@color/lpsdk_textColor" android:textSize="14sp" android:layout_alignParentBottom="true" ></TextView> android:gravity="center" android:text="@string/lp_unlockStr" android:textColor="@color/lpsdk_textColor" android:textSize="14sp"></TextView> </RelativeLayout> HDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/res/layout/linphone_dialog_content_and_twobutton.xml
New file @@ -0,0 +1,65 @@ <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" android:background="@drawable/oval_color_white_18"> <TextView android:id="@+id/tv_content_tip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:layout_marginTop="43dp" android:textColor="@color/color_222222" android:textSize="18sp" /> <View android:id="@+id/view_split" android:layout_width="match_parent" android:layout_height="1dp" android:layout_below="@id/tv_content_tip" android:layout_marginTop="56dp" android:background="@color/white" /> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@id/view_split" android:gravity="center_vertical" android:orientation="horizontal"> <TextView android:id="@+id/dialog_cancel_btn" android:layout_width="0dp" android:layout_height="52dp" android:layout_weight="1" android:background="@drawable/dialog_cancel_btn_selector" android:gravity="center" android:text="@string/lp_cancel" android:textColor="@color/color_999999" android:textSize="18sp" /> <View android:layout_width="1dp" android:layout_height="23dp" android:background="@color/color_E1E1E1" /> <TextView android:id="@+id/dialog_ok_btn" android:layout_width="0dp" android:layout_height="52dp" android:layout_weight="1" android:background="@drawable/dialog_ok_btn_selector" android:gravity="center" android:textColor="@color/color_5C62FE" android:textSize="18sp" /> </LinearLayout> </RelativeLayout> </RelativeLayout> HDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/res/values-zh/strings.xml
@@ -3,11 +3,12 @@ <string name="lp_tipStr">提示</string> <string name="lp_okStr">确认</string> <string name="lp_saveToTheAlbumsStr">已保存至手机相册."</string> <string name="lp_saveToTheAlbumsStr">已保存至手机相册</string> <string name="lp_operationFailedStr">操作失败</string> <string name="lp_refuseStr">拒绝</string> <string name="lp_refuseStr">拒接</string> <string name="lp_answerStr">接听</string> <string name="lp_hangupStr">挂断</string> <string name="lp_hangupStr_all">全部拒接</string> <string name="lp_unlockSuccessfullyStr">开锁成功</string> <string name="lp_unlockfailureStr">开锁失败</string> <string name="lp_callingStr">来电中...</string> @@ -23,4 +24,6 @@ <string name="lp_confirm">确认</string> <string name="tip_confirm_unlock">确定打开门锁吗?</string> <string name="open_save_permission">请先开启存储授权</string> <string name="linphone_text_open_settings">设置</string> </resources> HDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/res/values/colors.xml
@@ -5,5 +5,12 @@ <color name="lpsdk_app_line">#6D798D</color> <color name="lpsdk_textColor">#1B2D4D</color> <color name="lpsdk_color_white">#FFFFFF</color> <color name="transparent">#00000000</color> <color name="white">#FFFFFFFF</color> <color name="color_222222">#222222</color> <color name="color_F5F5F5">#F5F5F5</color> <color name="color_999999">#999999</color> <color name="color_E1E1E1">#E1E1E1</color> <color name="color_5C62FE">#5C62FE</color> </resources> HDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/res/values/strings.xml
@@ -2,11 +2,12 @@ <string name="app_name">HDLLinphoneSDK</string> <string name="lp_tipStr">Prompt</string> <string name="lp_okStr">OK</string> <string name="lp_saveToTheAlbumsStr">Saved to the albums.</string> <string name="lp_operationFailedStr">Operation failed.</string> <string name="lp_refuseStr">Refuse</string> <string name="lp_saveToTheAlbumsStr">Saved to the albums</string> <string name="lp_operationFailedStr">Operation failed</string> <string name="lp_refuseStr">Reject</string> <string name="lp_answerStr">Answer</string> <string name="lp_hangupStr">Hang up</string> <string name="lp_hangupStr_all">Reject All</string> <string name="lp_unlockSuccessfullyStr">Unlock successfully</string> <string name="lp_unlockfailureStr">Unlock failure</string> <string name="lp_callingStr">Incoming call</string> @@ -21,5 +22,7 @@ <string name="lp_confirm">Confirm</string> <string name="tip_confirm_unlock">Are you sure to open the door lock?</string> <string name="open_save_permission">Please enable storage authorization first</string> <string name="linphone_text_open_settings">Settings</string> </resources> HDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/res/values/styles.xml
@@ -29,5 +29,22 @@ <item name="android:windowMinWidthMinor">75%</item> </style> <style name="common_dialog" parent="@android:style/Theme.Dialog"> <!-- 背景颜色及和透明程度 --> <item name="android:windowBackground">@color/transparent</item> <!-- 是否去除标题 --> <item name="android:windowNoTitle">true</item> <!-- 是否去除边框 --> <item name="android:windowFrame">@null</item> <!-- 是否浮现在activity之上 --> <item name="android:windowIsFloating">true</item> <item name="android:windowIsTranslucent">true</item> <!-- 是否开启半透明的背景 --> <item name="android:backgroundDimEnabled">true</item> <!-- 半透明的背景的透明度 --> <item name="android:backgroundDimAmount">0.2</item> <item name="android:background">@color/transparent</item> </style> </resources> HDLLinphoneSDKDemoNew/app/src/main/AndroidManifest.xml
@@ -11,7 +11,7 @@ android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/Theme.HDLLinphoneSDKDemo"> <activity android:name=".LinphoneTestActivity"> <activity android:name=".MainActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> HDLLinphoneSDKDemoNew/app/src/main/java/com/example/hdllinphonesdkdemo/LinphoneTestActivity.java
@@ -16,7 +16,7 @@ public class LinphoneTestActivity extends Activity { private static final String password = "xFNxyrTIM8gLAOGDw3OiuzV5F"; private static final String password = "Wc7SeYXb0oyGOXVvtUYtju2Dy"; private static final String serverIP = "47.96.88.250:25060";//""116.62.26.215:35060"; private String account = ""; @@ -26,7 +26,7 @@ // 呼叫 private EditText numberEdit; private Button callBtn,monitorBtn; private Button callBtn, monitorBtn; @Override protected void onCreate(Bundle savedInstanceState) { @@ -54,7 +54,6 @@ intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.putExtra(HDLLinphoneKit.KEY_SIP_ACCOUNT, number); startActivity(intent); // HDLLinphoneKit.getInstance().callTo(number, true); }); monitorBtn = findViewById(R.id.monitor_btn); @@ -88,6 +87,11 @@ } @Override public void onRejectCallAllAction() { } @Override public void onUnlockAction() { // } HDLLinphoneSDKDemoNew/app/src/main/java/com/example/hdllinphonesdkdemo/MainActivity.java
@@ -48,11 +48,11 @@ HDLLinphoneKit.INTER_PHONE_TYPE_HDL )); mTextView4.setOnClickListener(v -> HDLLinphoneKit.getInstance().setAccountAndLogin("8888", "85521566", "47.96.88.250:35060", HDLLinphoneKit.INTER_PHONE_TYPE_FREEVIEW)); mTextView4.setOnClickListener(v -> HDLLinphoneKit.getInstance().setAccountAndLogin("A183372453821457", "592436", "139.159.157.75:47000", HDLLinphoneKit.INTER_PHONE_TYPE_FREEVIEW)); mMonitorText.setOnClickListener(v -> { // String sip_account = "sip:D" + space_code + "@yun"; HDLLinphoneKit.getInstance().callTo("sip:D22-1-21-1@139.159.157.75:46000", true); HDLLinphoneKit.getInstance().callTo("sip:D26-11-1@139.159.157.75:46000", true); // HDLLinphoneKit.getInstance().callTo("D22-1-21-1", true); startActivity(HDLLinphoneMonitorActivity.class); }); @@ -87,6 +87,11 @@ } @Override public void onRejectCallAllAction() { } @Override public void onUnlockAction() { // } HDLLinphoneSDKDemoNew/app/src/main/res/layout/activity_linphone_test.xml
@@ -28,7 +28,7 @@ android:layout_height="wrap_content" android:layout_weight="1" android:inputType="number" android:text="1677890543690887170" android:text="1701147661269118978" /> <Button @@ -64,7 +64,7 @@ android:layout_height="wrap_content" android:layout_weight="1" android:inputType="number" android:text="1684889786171437057" android:text="1701147553936879618" /> <Button HDLLinphoneSDKDemoNew/app/src/main/res/layout/activity_main.xml
@@ -22,7 +22,7 @@ android:layout_marginTop="30dp" android:background="@android:color/holo_blue_light" android:gravity="center" android:text="登录2" android:text="全视通登录" android:textColor="@android:color/white" /> <TextView HDLLinphoneSDKDemoNew/gradle.properties
@@ -10,4 +10,10 @@ # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # org.gradle.parallel=true # org.gradle.parallel=true #android.useAndroidX=true ## Enables namespacing of each library's R class so that its R class includes only the ## resources declared in the library itself and none from the library's dependencies, ## thereby reducing the size of the R class for that library #android.nonTransitiveRClass=true #android.enableJetifier=true HDLLinphoneSDKDemoNew/gradle/wrapper/gradle-wrapper.properties
@@ -1,7 +1,5 @@ #Tue Aug 03 14:20:14 CST 2021 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists #distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip