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

2024-01-06 19:20

本文主要是介绍当试图回复传入消息时,消息应用程序会闪烁,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

问题描述:

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.chinasem.cn/article/577347

相关文章

如何通过Python实现一个消息队列

《如何通过Python实现一个消息队列》这篇文章主要为大家详细介绍了如何通过Python实现一个简单的消息队列,文中的示例代码讲解详细,感兴趣的小伙伴可以跟随小编一起学习一下... 目录如何通过 python 实现消息队列如何把 http 请求放在队列中执行1. 使用 queue.Queue 和 reque

解读Redis秒杀优化方案(阻塞队列+基于Stream流的消息队列)

《解读Redis秒杀优化方案(阻塞队列+基于Stream流的消息队列)》该文章介绍了使用Redis的阻塞队列和Stream流的消息队列来优化秒杀系统的方案,通过将秒杀流程拆分为两条流水线,使用Redi... 目录Redis秒杀优化方案(阻塞队列+Stream流的消息队列)什么是消息队列?消费者组的工作方式每

使用C/C++调用libcurl调试消息的方式

《使用C/C++调用libcurl调试消息的方式》在使用C/C++调用libcurl进行HTTP请求时,有时我们需要查看请求的/应答消息的内容(包括请求头和请求体)以方便调试,libcurl提供了多种... 目录1. libcurl 调试工具简介2. 输出请求消息使用 CURLOPT_VERBOSE使用 C

Java中Springboot集成Kafka实现消息发送和接收功能

《Java中Springboot集成Kafka实现消息发送和接收功能》Kafka是一个高吞吐量的分布式发布-订阅消息系统,主要用于处理大规模数据流,它由生产者、消费者、主题、分区和代理等组件构成,Ka... 目录一、Kafka 简介二、Kafka 功能三、POM依赖四、配置文件五、生产者六、消费者一、Kaf

JAVA系统中Spring Boot应用程序的配置文件application.yml使用详解

《JAVA系统中SpringBoot应用程序的配置文件application.yml使用详解》:本文主要介绍JAVA系统中SpringBoot应用程序的配置文件application.yml的... 目录文件路径文件内容解释1. Server 配置2. Spring 配置3. Logging 配置4. Ma

SpringBoot 自定义消息转换器使用详解

《SpringBoot自定义消息转换器使用详解》本文详细介绍了SpringBoot消息转换器的知识,并通过案例操作演示了如何进行自定义消息转换器的定制开发和使用,感兴趣的朋友一起看看吧... 目录一、前言二、SpringBoot 内容协商介绍2.1 什么是内容协商2.2 内容协商机制深入理解2.2.1 内容

cross-plateform 跨平台应用程序-03-如果只选择一个框架,应该选择哪一个?

跨平台系列 cross-plateform 跨平台应用程序-01-概览 cross-plateform 跨平台应用程序-02-有哪些主流技术栈? cross-plateform 跨平台应用程序-03-如果只选择一个框架,应该选择哪一个? cross-plateform 跨平台应用程序-04-React Native 介绍 cross-plateform 跨平台应用程序-05-Flutte

ActiveMQ—消息特性(延迟和定时消息投递)

ActiveMQ消息特性:延迟和定时消息投递(Delay and Schedule Message Delivery) 转自:http://blog.csdn.net/kimmking/article/details/8443872 有时候我们不希望消息马上被broker投递出去,而是想要消息60秒以后发给消费者,或者我们想让消息没隔一定时间投递一次,一共投递指定的次数。。。 类似

Java消息队列:RabbitMQ与Kafka的集成与应用

Java消息队列:RabbitMQ与Kafka的集成与应用 大家好,我是微赚淘客返利系统3.0的小编,是个冬天不穿秋裤,天冷也要风度的程序猿! 在现代的分布式系统中,消息队列是实现系统间通信、解耦和提高可扩展性的重要组件。RabbitMQ和Kafka是两个广泛使用的消息队列系统,它们各有特点和优势。本文将介绍如何在Java应用中集成RabbitMQ和Kafka,并展示它们的应用场景。 消息队

mybatis if test 之 0当做参数传入出问题

首先前端传入了参数 if(StringUtils.isNotBlank(status)){requestParam.setProperty("status", Integer.parseInt(status));}List<SuperPojo> applicationList = groupDao.getApplicationListByReviewStatusAndMember(req