Messaging: Remove compatibility for old android versions

Change-Id: Id9065d60525a509271a0e64c0e349e857cb998e2
This commit is contained in:
Michael W
2024-12-26 14:55:12 +01:00
parent 9bbc7a8f99
commit 7c55a6d56a
104 changed files with 580 additions and 2306 deletions
@@ -36,7 +36,6 @@ public abstract class BaseWidgetProvider extends AppWidgetProvider {
public static final int SIZE_LARGE = 0; // undefined == 0, which is the default, large
public static final int SIZE_SMALL = 1;
public static final int SIZE_MEDIUM = 2;
public static final int SIZE_PRE_JB = 3;
/**
* Update all widgets in the list
@@ -43,7 +43,6 @@ import com.android.messaging.ui.conversationlist.ConversationListItemView;
import com.android.messaging.util.ContentType;
import com.android.messaging.util.Dates;
import com.android.messaging.util.LogUtil;
import com.android.messaging.util.OsUtil;
import com.android.messaging.util.PhoneUtils;
public class WidgetConversationListService extends RemoteViewsService {
@@ -128,19 +127,15 @@ public class WidgetConversationListService extends RemoteViewsService {
// Avatar
boolean includeAvatar;
if (OsUtil.isAtLeastJB()) {
final Bundle options = mAppWidgetManager.getAppWidgetOptions(mAppWidgetId);
if (LogUtil.isLoggable(TAG, LogUtil.VERBOSE)) {
LogUtil.v(TAG, "getViewAt BugleWidgetProvider.WIDGET_SIZE_KEY: " +
options.getInt(BugleWidgetProvider.WIDGET_SIZE_KEY));
}
includeAvatar = options.getInt(BugleWidgetProvider.WIDGET_SIZE_KEY) ==
BugleWidgetProvider.SIZE_LARGE;
} else {
includeAvatar = true;;
final Bundle options = mAppWidgetManager.getAppWidgetOptions(mAppWidgetId);
if (LogUtil.isLoggable(TAG, LogUtil.VERBOSE)) {
LogUtil.v(TAG, "getViewAt BugleWidgetProvider.WIDGET_SIZE_KEY: " +
options.getInt(BugleWidgetProvider.WIDGET_SIZE_KEY));
}
includeAvatar = options.getInt(BugleWidgetProvider.WIDGET_SIZE_KEY) ==
BugleWidgetProvider.SIZE_LARGE;
// Show the avatar when grande size, otherwise hide it.
remoteViews.setViewVisibility(R.id.avatarView, includeAvatar ?
View.VISIBLE : View.GONE);
@@ -179,9 +179,7 @@ public class WidgetConversationService extends RemoteViewsService {
if (message.hasAttachments()) {
final List<MessagePartData> attachments = message.getAttachments();
for (MessagePartData part : attachments) {
final boolean videoWithThumbnail = part.isVideo()
&& (VideoThumbnailRequest.shouldShowIncomingVideoThumbnails()
|| !message.getIsIncoming());
final boolean videoWithThumbnail = part.isVideo();
if (part.isImage() || videoWithThumbnail) {
final Uri uri = part.getContentUri();
remoteViews.setViewVisibility(R.id.attachmentFrame, View.VISIBLE);
@@ -215,20 +213,15 @@ public class WidgetConversationService extends RemoteViewsService {
intent);
// Avatar
boolean includeAvatar;
if (OsUtil.isAtLeastJB()) {
final Bundle options = mAppWidgetManager.getAppWidgetOptions(mAppWidgetId);
if (LogUtil.isLoggable(TAG, LogUtil.VERBOSE)) {
LogUtil.v(TAG, "getViewAt BugleWidgetProvider.WIDGET_SIZE_KEY: " +
options.getInt(BugleWidgetProvider.WIDGET_SIZE_KEY));
}
includeAvatar = options.getInt(BugleWidgetProvider.WIDGET_SIZE_KEY)
== BugleWidgetProvider.SIZE_LARGE;
} else {
includeAvatar = true;
final Bundle options = mAppWidgetManager.getAppWidgetOptions(mAppWidgetId);
if (LogUtil.isLoggable(TAG, LogUtil.VERBOSE)) {
LogUtil.v(TAG, "getViewAt BugleWidgetProvider.WIDGET_SIZE_KEY: " +
options.getInt(BugleWidgetProvider.WIDGET_SIZE_KEY));
}
boolean includeAvatar = options.getInt(BugleWidgetProvider.WIDGET_SIZE_KEY)
== BugleWidgetProvider.SIZE_LARGE;
// Show the avatar (and shadow) when grande size, otherwise hide it.
remoteViews.setViewVisibility(R.id.avatarView, includeAvatar ?
View.VISIBLE : View.GONE);