Compare commits
8 Commits
contacts-v
...
contacts-v
| Author | SHA1 | Date | |
|---|---|---|---|
| a9570f6d53 | |||
| eb174946b8 | |||
| ec274d113e | |||
| c66dbfd2b4 | |||
| aa27ffb002 | |||
| 2a8404cbbe | |||
| 83b3270ddf | |||
| ac4d34a5f8 |
@@ -1,8 +1,8 @@
|
||||
#Created by .winboll/winboll_app_build.gradle
|
||||
#Wed Jan 07 20:51:46 HKT 2026
|
||||
stageCount=4
|
||||
#Fri Jan 09 20:22:05 HKT 2026
|
||||
stageCount=7
|
||||
libraryProject=
|
||||
baseVersion=15.14
|
||||
publishVersion=15.14.3
|
||||
publishVersion=15.14.6
|
||||
buildCount=0
|
||||
baseBetaVersion=15.14.4
|
||||
baseBetaVersion=15.14.7
|
||||
|
||||
@@ -44,12 +44,19 @@
|
||||
<!-- API 30+ 通话筛选服务权限(替代 PROCESS_OUTGOING_CALLS) -->
|
||||
<uses-permission android:name="android.permission.BIND_CALL_SCREENING_SERVICE"/>
|
||||
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
|
||||
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
||||
|
||||
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/>
|
||||
|
||||
<application
|
||||
android:name=".App"
|
||||
android:allowBackup="true"
|
||||
android:icon="@drawable/ic_winboll"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/MyAppTheme"
|
||||
android:requestLegacyExternalStorage="true"
|
||||
android:supportsRtl="true"
|
||||
android:networkSecurityConfig="@xml/network_security_config">
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ public class NotificationManagerUtils {
|
||||
public static final String TAG = "NotificationManagerUtils";
|
||||
// ********** 新增:通知版本管理常量 **********
|
||||
/** 通知版本标识(源码标记版本,变更时会清理旧渠道) */
|
||||
public static final String NOTIFICATION_VERSION = "v1.0.0";
|
||||
public static final String NOTIFICATION_VERSION = "v1.0.3";
|
||||
/** SP存储键:已保存的通知版本 */
|
||||
private static final String SP_KEY_NOTIFICATION_VERSION = "sp_key_notification_version";
|
||||
/** SP文件名 */
|
||||
@@ -156,10 +156,10 @@ public class NotificationManagerUtils {
|
||||
* 初始化通知渠道:前台服务渠道(无铃声+无振动)、临时提醒渠道(系统默认铃声+无振动)
|
||||
*/
|
||||
private void initNotificationChannels() {
|
||||
LogUtils.d(TAG, "initNotificationChannels() 方法调用");
|
||||
LogUtils.d(TAG, "initNotificationChannels() 执行通知渠道初始化");
|
||||
// API<26 无渠道机制,直接返回
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
|
||||
LogUtils.d(TAG, "initNotificationChannels() API<26,无需创建渠道,直接返回");
|
||||
LogUtils.d(TAG, "initNotificationChannels() API<26,无需创建渠道");
|
||||
return;
|
||||
}
|
||||
// 通知服务为空,避免空指针
|
||||
@@ -168,38 +168,38 @@ public class NotificationManagerUtils {
|
||||
return;
|
||||
}
|
||||
|
||||
// 1. 前台服务渠道(低优先级,后台保活无打扰)
|
||||
// 1. 拨号前台服务渠道(低优先级,后台保活无打扰)
|
||||
NotificationChannel foregroundChannel = new NotificationChannel(
|
||||
CHANNEL_ID_FOREGROUND,
|
||||
"拨号服务保活",
|
||||
"拨号前台服务",
|
||||
NotificationManager.IMPORTANCE_LOW
|
||||
);
|
||||
foregroundChannel.setDescription("拨号服务后台运行,无声音、无振动");
|
||||
foregroundChannel.setDescription("拨号前台服务后台运行,无声音、无振动");
|
||||
foregroundChannel.enableLights(false);
|
||||
foregroundChannel.enableVibration(false);
|
||||
foregroundChannel.setSound(null, null);
|
||||
foregroundChannel.setSound(null, null); // 强制无铃声
|
||||
foregroundChannel.setShowBadge(false);
|
||||
foregroundChannel.setLockscreenVisibility(Notification.VISIBILITY_SECRET);
|
||||
LogUtils.d(TAG, "initNotificationChannels() 前台服务渠道配置完成");
|
||||
LogUtils.d(TAG, "initNotificationChannels() 拨号前台服务渠道配置完成");
|
||||
|
||||
// 2. 临时提醒渠道(中优先级,系统默认铃声,无振动)
|
||||
// 2. 其他临时通知渠道(中优先级,系统默认铃声,无振动)
|
||||
NotificationChannel temporaryChannel = new NotificationChannel(
|
||||
CHANNEL_ID_TEMPORARY,
|
||||
"临时通知提醒",
|
||||
"临时通知",
|
||||
NotificationManager.IMPORTANCE_DEFAULT
|
||||
);
|
||||
temporaryChannel.setDescription("拨号服务临时通知,系统默认铃声,无振动");
|
||||
temporaryChannel.setDescription("其他临时通知,系统默认铃声,无振动");
|
||||
temporaryChannel.enableLights(true);
|
||||
temporaryChannel.enableVibration(false);
|
||||
temporaryChannel.setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION), Notification.AUDIO_ATTRIBUTES_DEFAULT);
|
||||
temporaryChannel.setShowBadge(false);
|
||||
temporaryChannel.setLockscreenVisibility(Notification.VISIBILITY_PUBLIC);
|
||||
LogUtils.d(TAG, "initNotificationChannels() 临时提醒渠道配置完成");
|
||||
LogUtils.d(TAG, "initNotificationChannels() 其他临时通知渠道配置完成");
|
||||
|
||||
// 注册渠道到系统
|
||||
mNotificationManager.createNotificationChannel(foregroundChannel);
|
||||
mNotificationManager.createNotificationChannel(temporaryChannel);
|
||||
LogUtils.d(TAG, "initNotificationChannels() 成功:创建前台服务+临时提醒渠道");
|
||||
LogUtils.d(TAG, "initNotificationChannels() 成功:创建前台服务+其他临时通知渠道");
|
||||
}
|
||||
|
||||
// ================================== 对外核心方法(前台服务通知:启动/更新/取消)=================================
|
||||
|
||||
Reference in New Issue
Block a user