当前位置: 首页 > news >正文

当试图回复传入消息时,消息应用程序会闪烁

问题描述:

Actual Results: Unable to reply for incoming message as Messaging app flickers and closes.

Expected Results:  User should be able to send reply for incoming messages.

Reproduction Steps:

  1. Stay in home screen. 
  2. Receive an incoming message.
  3. Click on reply from incoming pop-up.

Reproducibility: 2/3

Recoverability: NA

Comparative Data: Issue not seen in ET65

*****{}{}{}Device Details{}{}{}*****
Software
Build Number:  13-10-03.00-TG-U00-PRD-NEM-04

具体Error的UI如下面的图片所示:



分析可能是QN 的对话框中手机号码的长度过长导致的问题
解决方案如下:
frameworks/base/+/447854/2/core/java/android/app/Notification.java
 

private RemoteViews makeMessagingView(int viewType) {boolean isCollapsed = viewType != StandardTemplateParams.VIEW_TYPE_BIG;boolean hideRightIcons = viewType != StandardTemplateParams.VIEW_TYPE_NORMAL;boolean isConversationLayout = mConversationType != CONVERSATION_TYPE_LEGACY;boolean isImportantConversation = mConversationType == CONVERSATION_TYPE_IMPORTANT;boolean isHeaderless = !isConversationLayout && isCollapsed;CharSequence conversationTitle = !TextUtils.isEmpty(super.mBigContentTitle)? super.mBigContentTitle: mConversationTitle;CharSequence conversationTitleNew = "";boolean atLeastP = mBuilder.mContext.getApplicationInfo().targetSdkVersion>= Build.VERSION_CODES.P;boolean isOneToOne;CharSequence nameReplacement = null;if (!atLeastP) {isOneToOne = TextUtils.isEmpty(conversationTitle);if (hasOnlyWhiteSpaceSenders()) {isOneToOne = true;nameReplacement = conversationTitle;conversationTitle = null;}} else {isOneToOne = !isGroupConversation();}if (isHeaderless && isOneToOne && TextUtils.isEmpty(conversationTitle)) {conversationTitle = getOtherPersonName();}if (ZebraUtils.isZebra().orElse(false) && ZebraUtils.isMediumDisplay().orElse(false) && conversationTitle.length()>=7){conversationTitleNew = conversationTitle.subSequence(0,7) + ".";}else{conversationTitleNew = conversationTitle;}Icon largeIcon = mBuilder.mN.mLargeIcon;TemplateBindResult bindResult = new TemplateBindResult();StandardTemplateParams p = mBuilder.mParams.reset().viewType(viewType).highlightExpander(isConversationLayout).hideProgress(true).title(isHeaderless ? conversationTitle : null).text(null).hideLeftIcon(isOneToOne).hideRightIcon(hideRightIcons || isOneToOne).headerTextSecondary(isHeaderless ? null : conversationTitle);RemoteViews contentView = mBuilder.applyStandardTemplateWithActions(isConversationLayout? mBuilder.getConversationLayoutResource(): isCollapsed? mBuilder.getMessagingLayoutResource(): mBuilder.getBigMessagingLayoutResource(),p,bindResult);if (isConversationLayout) {mBuilder.setTextViewColorPrimary(contentView, R.id.conversation_text, p);mBuilder.setTextViewColorSecondary(contentView, R.id.app_name_divider, p);}addExtras(mBuilder.mN.extras);contentView.setInt(R.id.status_bar_latest_event_content, "setLayoutColor",mBuilder.getSmallIconColor(p));contentView.setInt(R.id.status_bar_latest_event_content, "setSenderTextColor",mBuilder.getPrimaryTextColor(p));contentView.setInt(R.id.status_bar_latest_event_content, "setMessageTextColor",mBuilder.getSecondaryTextColor(p));contentView.setInt(R.id.status_bar_latest_event_content,"setNotificationBackgroundColor",mBuilder.getBackgroundColor(p));contentView.setBoolean(R.id.status_bar_latest_event_content, "setIsCollapsed",isCollapsed);contentView.setIcon(R.id.status_bar_latest_event_content, "setAvatarReplacement",mBuilder.mN.mLargeIcon);contentView.setCharSequence(R.id.status_bar_latest_event_content, "setNameReplacement",nameReplacement);contentView.setBoolean(R.id.status_bar_latest_event_content, "setIsOneToOne",isOneToOne);contentView.setCharSequence(R.id.status_bar_latest_event_content,"setConversationTitle", conversationTitleNew);if (isConversationLayout) {contentView.setIcon(R.id.status_bar_latest_event_content,"setShortcutIcon", mShortcutIcon);contentView.setBoolean(R.id.status_bar_latest_event_content,"setIsImportantConversation", isImportantConversation);}if (isHeaderless) {// Collapsed legacy messaging style has a 1-line limit.contentView.setInt(R.id.notification_messaging, "setMaxDisplayedLines", 1);}
}

其中关键处理是对号码的长度做截取处理:

if (ZebraUtils.isZebra().orElse(false) && ZebraUtils.isMediumDisplay().orElse(false) && conversationTitle.length()>=7){conversationTitleNew = conversationTitle.subSequence(0,7) + ".";}else{conversationTitleNew = conversationTitle;}

修改后的效果如下:


http://www.lryc.cn/news/276851.html

相关文章:

  • Hubery-个人项目经历记录
  • Ubuntu18.04 安装 qt 5.15.2
  • 【Linux Shell】6. echo 命令
  • Dell 机架式服务器 - 高级定制服务
  • C++ 中关键字 Static
  • 系统学习Python——警告信息的控制模块warnings:警告过滤器-[重写默认的过滤器]
  • C++力扣题目-- 二叉树层序遍历
  • 前端实现回车键触发搜索
  • k8s yaml文件pod的生命周期
  • MPEG4Extractor
  • 我在工作一年时怎么都看不懂的编程写法。今天手把手教给你
  • ThinkPHP5多小区物业管理系统源码(支持多小区)
  • 2024 年 API 安全:预测和趋势
  • 3D模型UV展开原理
  • SPL-cmcRVFL+
  • Vue3+TS+Vite 构建自动导入开发环境
  • 长期使用外接键盘,外物压着自带键盘,容易导致华硕飞行堡垒FX53VD键盘全部失灵【除电源键】
  • JavaScript-循环嵌套断点调试-笔记
  • 1042: 数列求和3 和 1057: 素数判定 和 1063: 最大公约与最小公倍
  • [足式机器人]Part2 Dr. CAN学习笔记-动态系统建模与分析 Ch02-8 Bode Plot伯德图
  • Java 将Excel转换为TXT文本格式
  • 什么事“网络水军”?他们的违法活动主要有四种形式
  • 授权策略(authorize方法)
  • FFmpeg获取音视频流信息
  • 编程语言的走向又将如何呢?
  • 基于SpringBoot的电影评论网站
  • 粒子群算法优化支持向量SVM的供热量预测,粒子群优化支持向量机SVM回归分析
  • 【Verilog】运算符
  • 浅析ARMv8体系结构:A64指令集
  • VSCode安装GitHub Copilot插件方法