/* * Copyright (C) 2018 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.car.notification.template; import android.app.Notification; import android.content.Context; import android.content.res.TypedArray; import android.graphics.PorterDuff; import android.graphics.PorterDuffColorFilter; import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.view.View; import android.widget.Button; import android.widget.RelativeLayout; import androidx.annotation.Nullable; import androidx.annotation.VisibleForTesting; import com.android.car.assist.client.CarAssistUtils; import com.android.car.notification.AlertEntry; import com.android.car.notification.NotificationClickHandlerFactory; import com.android.car.notification.NotificationDataManager; import com.android.car.notification.PreprocessingManager; import com.android.car.notification.R; import java.util.ArrayList; import java.util.List; /** * Notification actions view that contains the buttons that fire actions. */ public class CarNotificationActionsView extends RelativeLayout implements PreprocessingManager.CallStateListener { private static final String TAG = "CarNotificationAction"; // Maximum 3 actions // https://developer.android.com/reference/android/app/Notification.Builder.html#addAction @VisibleForTesting static final int MAX_NUM_ACTIONS = 3; @VisibleForTesting static final int FIRST_MESSAGE_ACTION_BUTTON_INDEX = 0; @VisibleForTesting static final int SECOND_MESSAGE_ACTION_BUTTON_INDEX = 1; private final List