通知类调试完成
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Sat Dec 13 12:30:20 GMT 2025
|
#Sat Dec 13 13:01:24 GMT 2025
|
||||||
stageCount=16
|
stageCount=16
|
||||||
libraryProject=
|
libraryProject=
|
||||||
baseVersion=15.12
|
baseVersion=15.12
|
||||||
publishVersion=15.12.15
|
publishVersion=15.12.15
|
||||||
buildCount=3
|
buildCount=5
|
||||||
baseBetaVersion=15.12.16
|
baseBetaVersion=15.12.16
|
||||||
|
|||||||
@@ -23,15 +23,15 @@ import cc.winboll.studio.libappbase.ToastUtils;
|
|||||||
import cc.winboll.studio.powerbell.App;
|
import cc.winboll.studio.powerbell.App;
|
||||||
import cc.winboll.studio.powerbell.MainActivity;
|
import cc.winboll.studio.powerbell.MainActivity;
|
||||||
import cc.winboll.studio.powerbell.R;
|
import cc.winboll.studio.powerbell.R;
|
||||||
|
import cc.winboll.studio.powerbell.handlers.ControlCenterServiceHandler;
|
||||||
import cc.winboll.studio.powerbell.models.AppConfigBean;
|
import cc.winboll.studio.powerbell.models.AppConfigBean;
|
||||||
import cc.winboll.studio.powerbell.models.NotificationMessage;
|
import cc.winboll.studio.powerbell.models.NotificationMessage;
|
||||||
import cc.winboll.studio.powerbell.handlers.ControlCenterServiceHandler;
|
|
||||||
import cc.winboll.studio.powerbell.receivers.ControlCenterServiceReceiver;
|
import cc.winboll.studio.powerbell.receivers.ControlCenterServiceReceiver;
|
||||||
import cc.winboll.studio.powerbell.services.AssistantService;
|
import cc.winboll.studio.powerbell.services.AssistantService;
|
||||||
import cc.winboll.studio.powerbell.threads.RemindThread;
|
import cc.winboll.studio.powerbell.threads.RemindThread;
|
||||||
import cc.winboll.studio.powerbell.utils.AppCacheUtils;
|
import cc.winboll.studio.powerbell.utils.AppCacheUtils;
|
||||||
import cc.winboll.studio.powerbell.utils.AppConfigUtils;
|
import cc.winboll.studio.powerbell.utils.AppConfigUtils;
|
||||||
import cc.winboll.studio.powerbell.utils.NotificationHelper;
|
import cc.winboll.studio.powerbell.utils.NotificationManagerUtils;
|
||||||
import cc.winboll.studio.powerbell.utils.ServiceUtils;
|
import cc.winboll.studio.powerbell.utils.ServiceUtils;
|
||||||
import cc.winboll.studio.powerbell.utils.StringUtils;
|
import cc.winboll.studio.powerbell.utils.StringUtils;
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@ public class ControlCenterService extends Service {
|
|||||||
AppConfigUtils mAppConfigUtils;
|
AppConfigUtils mAppConfigUtils;
|
||||||
AppCacheUtils mAppCacheUtils;
|
AppCacheUtils mAppCacheUtils;
|
||||||
// 前台服务通知工具
|
// 前台服务通知工具
|
||||||
NotificationHelper mNotificationHelper;
|
NotificationManagerUtils mNotificationManagerUtils;
|
||||||
Notification notification;
|
Notification notification;
|
||||||
RemindThread mRemindThread;
|
RemindThread mRemindThread;
|
||||||
ControlCenterServiceHandler mControlCenterServiceHandler;
|
ControlCenterServiceHandler mControlCenterServiceHandler;
|
||||||
@@ -72,7 +72,7 @@ public class ControlCenterService extends Service {
|
|||||||
isServiceRunning = false;
|
isServiceRunning = false;
|
||||||
mAppConfigUtils = App.getAppConfigUtils(this);
|
mAppConfigUtils = App.getAppConfigUtils(this);
|
||||||
mAppCacheUtils = App.getAppCacheUtils(this);
|
mAppCacheUtils = App.getAppCacheUtils(this);
|
||||||
mNotificationHelper = new NotificationHelper(ControlCenterService.this);
|
mNotificationManagerUtils = new NotificationManagerUtils(ControlCenterService.this);
|
||||||
|
|
||||||
|
|
||||||
if (mMyServiceConnection == null) {
|
if (mMyServiceConnection == null) {
|
||||||
@@ -101,10 +101,10 @@ public class ControlCenterService extends Service {
|
|||||||
wakeupAndBindAssistant();
|
wakeupAndBindAssistant();
|
||||||
// 显示前台通知栏
|
// 显示前台通知栏
|
||||||
// 在Service中
|
// 在Service中
|
||||||
NotificationHelper helper = new NotificationHelper(this);
|
NotificationManagerUtils notificationManagerUtils = new NotificationManagerUtils(this);
|
||||||
Intent intent = new Intent(this, MainActivity.class);
|
//Intent intent = new Intent(this, MainActivity.class);
|
||||||
notification = helper.showForegroundNotification(intent, getString(R.string.app_name), "Service Running, Click to open app");
|
notificationManagerUtils.startForegroundServiceNotify(ControlCenterService.this, new NotificationMessage(getString(R.string.app_name), "Service Running, Click to open app"));
|
||||||
startForeground(NotificationHelper.FOREGROUND_NOTIFICATION_ID, notification);
|
//startForeground(NotificationHelper.FOREGROUND_NOTIFICATION_ID, notification);
|
||||||
|
|
||||||
// NotificationMessage notificationMessage=createNotificationMessage();
|
// NotificationMessage notificationMessage=createNotificationMessage();
|
||||||
// //Toast.makeText(getApplication(), "", Toast.LENGTH_SHORT).show();
|
// //Toast.makeText(getApplication(), "", Toast.LENGTH_SHORT).show();
|
||||||
@@ -260,9 +260,9 @@ public class ControlCenterService extends Service {
|
|||||||
for (int i = 0; i < 20; i++) {
|
for (int i = 0; i < 20; i++) {
|
||||||
msg += szRemindMSG;
|
msg += szRemindMSG;
|
||||||
}
|
}
|
||||||
NotificationHelper helper = new NotificationHelper(ControlCenterService.this);
|
NotificationManagerUtils notificationManagerUtils = new NotificationManagerUtils(ControlCenterService.this);
|
||||||
Intent intent = new Intent(ControlCenterService.this, MainActivity.class);
|
Intent intent = new Intent(ControlCenterService.this, MainActivity.class);
|
||||||
helper.showTemporaryNotification(intent, getString(R.string.app_name), msg);
|
notificationManagerUtils.showTempAlertNotify(intent, getString(R.string.app_name), msg);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -375,7 +375,7 @@ public class NotificationManagerUtils {
|
|||||||
* @param bigContentView 下拉大布局(可选)
|
* @param bigContentView 下拉大布局(可选)
|
||||||
*/
|
*/
|
||||||
public void showCustomLayoutNotify(Intent targetIntent, RemoteViews contentView, RemoteViews bigContentView) {
|
public void showCustomLayoutNotify(Intent targetIntent, RemoteViews contentView, RemoteViews bigContentView) {
|
||||||
LogUtils.d(TAG, "【自定义布局通知】开始构建,布局ID:" + (contentView != null ? contentView.getLayoutId() : "null"));
|
LogUtils.d(TAG, "【自定义布局通知】开始构建,布局ID:" + (contentView != null ? contentView.getLayoutId() : null));
|
||||||
if (contentView == null) {
|
if (contentView == null) {
|
||||||
LogUtils.e(TAG, "【自定义布局通知】构建失败:普通布局contentView为空");
|
LogUtils.e(TAG, "【自定义布局通知】构建失败:普通布局contentView为空");
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user