From 848cbfebefab08cc49b0285155edb84463aed862 Mon Sep 17 00:00:00 2001 From: panlili2024 <14743743+panlili2024@user.noreply.gitee.com> Date: 星期三, 13 十一月 2024 17:19:53 +0800 Subject: [PATCH] 提交home项目所用可视对讲sdk --- HDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/java/com/hdl/hdllinphonesdk/core/service/HDLLinphoneService.java | 32 ++++++++++++++++---------------- 1 files changed, 16 insertions(+), 16 deletions(-) diff --git a/HDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/java/com/hdl/hdllinphonesdk/core/service/HDLLinphoneService.java b/HDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/java/com/hdl/hdllinphonesdk/core/service/HDLLinphoneService.java index dacd5a1..ada707d 100644 --- a/HDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/java/com/hdl/hdllinphonesdk/core/service/HDLLinphoneService.java +++ b/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銆丠264銆丠265 绛夊惎鐢� 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); } -- Gitblit v1.8.0