android 8.0 屏蔽首次开机弹出的‘即将完成 Android 更新’的弹窗

在Android 8.1系统中,每次刷机或开机后出现系统更新提示,用户希望禁除此通知。解决方案在于修改源代码,具体为在frameworks/base/services/core/java/com/android/server/am/PreBootBroadcaster.java文件中,注释掉创建和显示更新通知的相关代码,包括Notification的构建和显示、取消通知的代码块。
摘要由CSDN通过智能技术生成

在Android 8.1版本上,每次刷机开机后,会弹出Android系统正在更新的提示,客户要求去掉该提示

1.首先,通过字符串找到相对应的title,R.string.android_upgrading_notification_title

2,屏蔽下面对应的2行代码即可frameworks/base/services/core/java/com/android/server/am/PreBootBroadcaster.java

                    final Notification notif =
                            new Notification.Builder(mService.mContext,
                                    SystemNotificationChannels.UPDATES)
                            .setSmallIcon(R.drawable.stat_sys_adb)
                            .setWhen(0)
                            .setOngoing(true)
                            .setTicker(title)
                            .setColor(context.getColor(
                                    com.android.internal.R.color.system_notification_accent_color))
                            .setContentTitle(title)
                            .setContentIntent(contentIntent)
                            .setVisibility(Notification.VISIBILITY_PUBLIC)
                            .setProgress(max, index, false)
                            .build();
                            
       

                  //   notifManager.notifyAsUser(TAG, SystemMessage.NOTE_SYSTEM_UPGRADING,                 //                    notif, UserHandle.of(mUserId));
                    break;

                case MSG_HIDE:
                    notifManager.cancelAsUser(TAG, SystemMessage.NOTE_SYSTEM_UPGRADING,
                            UserHandle.of(mUserId));
                    break;*

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值