// Path: car_app_library/showcase/common/src/main/java/androidx/car/app/sample/showcase/common/ShowcaseService.java
// public static final String INTENT_ACTION_NAV_NOTIFICATION_OPEN_APP =
//         "androidx.car.app.sample.showcase.INTENT_ACTION_NAV_NOTIFICATION_OPEN_APP";
// 
// Path: car_app_library/showcase/common/src/main/java/androidx/car/app/sample/showcase/common/ShowcaseService.java
// public final class ShowcaseService extends CarAppService {
//     public static final String SHARED_PREF_KEY = "ShowcasePrefs";
//     public static final String PRE_SEED_KEY = "PreSeed";
// 
//     // Intent actions for notification actions in car and phone
//     public static final String INTENT_ACTION_NAVIGATE =
//             "androidx.car.app.sample.showcase.INTENT_ACTION_PHONE";
//     public static final String INTENT_ACTION_CALL =
//             "androidx.car.app.sample.showcase.INTENT_ACTION_CANCEL_RESERVATION";
//     public static final String INTENT_ACTION_NAV_NOTIFICATION_OPEN_APP =
//             "androidx.car.app.sample.showcase.INTENT_ACTION_NAV_NOTIFICATION_OPEN_APP";
// 
//     /** Creates a deep link URI with the given deep link action. */
//     @NonNull
//     public static Uri createDeepLinkUri(@NonNull String deepLinkAction) {
//         return Uri.fromParts(ShowcaseSession.URI_SCHEME, ShowcaseSession.URI_HOST, deepLinkAction);
//     }
// 
//     @Override
//     @NonNull
//     public Session onCreateSession() {
//         return new ShowcaseSession();
//     }
// 
//     @NonNull
//     @Override
//     public HostValidator createHostValidator() {
//         if ((getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0) {
//             return HostValidator.ALLOW_ALL_HOSTS_VALIDATOR;
//         } else {
//             return new HostValidator.Builder(getApplicationContext())
//                     .addAllowedHosts(androidx.car.app.R.array.hosts_allowlist_sample)
//                     .build();
//         }
//     }
// }


import static androidx.car.app.sample.showcase.common.ShowcaseService.INTENT_ACTION_NAV_NOTIFICATION_OPEN_APP;
import static java.util.concurrent.TimeUnit.SECONDS;
import android.annotation.SuppressLint;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.Service;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.os.Handler;
import android.os.IBinder;
import android.os.Looper;
import android.os.Message;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.car.app.notification.CarAppExtender;
import androidx.car.app.notification.CarNotificationManager;
import androidx.car.app.notification.CarPendingIntent;
import androidx.car.app.sample.showcase.common.R;
import androidx.car.app.sample.showcase.common.ShowcaseService;
import androidx.core.app.NotificationChannelCompat;
import androidx.core.app.NotificationCompat;
import androidx.core.app.NotificationManagerCompat;
import java.math.RoundingMode;
import java.text.DecimalFormat;
    /**
     * Initializes the notifications, if needed.
     *
     * <p>{@link NotificationManager#IMPORTANCE_HIGH} is needed to show the alerts on top of the car
     * screen. However, the rail widget at the bottom of the screen will show regardless of the
     * importance setting.
     */
    // Suppressing 'ObsoleteSdkInt' as this code is shared between APKs with different min SDK
    // levels
    @SuppressLint({"ObsoleteSdkInt"})
    private static void initNotifications(Context context) {
        NotificationChannelCompat navChannel =
                new NotificationChannelCompat.Builder(
                        NAV_NOTIFICATION_CHANNEL_ID,
                        NotificationManagerCompat.IMPORTANCE_HIGH)
                        .setName(NAV_NOTIFICATION_CHANNEL_NAME).build();
        CarNotificationManager.from(context).createNotificationChannel(navChannel);
    }

    /** Returns the navigation notification that corresponds to the given notification count. */
    static NotificationCompat.Builder getNavigationNotification(
            Context context, int notificationCount) {
        NotificationCompat.Builder builder =
                new NotificationCompat.Builder(context, NAV_NOTIFICATION_CHANNEL_ID);
        DirectionInfo directionInfo = getDirectionInfo(notificationCount);

        // Set an intent to open the car app. The app receives this intent when the user taps the
        // heads-up notification or the rail widget.
        PendingIntent pendingIntent = CarPendingIntent.getCarApp(
                context,
// Path: car_app_library/showcase/common/src/main/java/androidx/car/app/sample/showcase/common/ShowcaseService.java
// public static final String INTENT_ACTION_NAV_NOTIFICATION_OPEN_APP =
//         "androidx.car.app.sample.showcase.INTENT_ACTION_NAV_NOTIFICATION_OPEN_APP";
// 
// Path: car_app_library/showcase/common/src/main/java/androidx/car/app/sample/showcase/common/ShowcaseService.java
// public final class ShowcaseService extends CarAppService {
//     public static final String SHARED_PREF_KEY = "ShowcasePrefs";
//     public static final String PRE_SEED_KEY = "PreSeed";
// 
//     // Intent actions for notification actions in car and phone
//     public static final String INTENT_ACTION_NAVIGATE =
//             "androidx.car.app.sample.showcase.INTENT_ACTION_PHONE";
//     public static final String INTENT_ACTION_CALL =
//             "androidx.car.app.sample.showcase.INTENT_ACTION_CANCEL_RESERVATION";
//     public static final String INTENT_ACTION_NAV_NOTIFICATION_OPEN_APP =
//             "androidx.car.app.sample.showcase.INTENT_ACTION_NAV_NOTIFICATION_OPEN_APP";
// 
//     /** Creates a deep link URI with the given deep link action. */
//     @NonNull
//     public static Uri createDeepLinkUri(@NonNull String deepLinkAction) {
//         return Uri.fromParts(ShowcaseSession.URI_SCHEME, ShowcaseSession.URI_HOST, deepLinkAction);
//     }
// 
//     @Override
//     @NonNull
//     public Session onCreateSession() {
//         return new ShowcaseSession();
//     }
// 
//     @NonNull
//     @Override
//     public HostValidator createHostValidator() {
//         if ((getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0) {
//             return HostValidator.ALLOW_ALL_HOSTS_VALIDATOR;
//         } else {
//             return new HostValidator.Builder(getApplicationContext())
//                     .addAllowedHosts(androidx.car.app.R.array.hosts_allowlist_sample)
//                     .build();
//         }
//     }
// }


// Path: car_app_library/showcase/common/src/main/java/androidx/car/app/sample/showcase/common/navigation/NavigationNotificationService.java
import static androidx.car.app.sample.showcase.common.ShowcaseService.INTENT_ACTION_NAV_NOTIFICATION_OPEN_APP;
import static java.util.concurrent.TimeUnit.SECONDS;
import android.annotation.SuppressLint;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.Service;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.os.Handler;
import android.os.IBinder;
import android.os.Looper;
import android.os.Message;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.car.app.notification.CarAppExtender;
import androidx.car.app.notification.CarNotificationManager;
import androidx.car.app.notification.CarPendingIntent;
import androidx.car.app.sample.showcase.common.R;
import androidx.car.app.sample.showcase.common.ShowcaseService;
import androidx.core.app.NotificationChannelCompat;
import androidx.core.app.NotificationCompat;
import androidx.core.app.NotificationManagerCompat;
import java.math.RoundingMode;
import java.text.DecimalFormat;

    /**
     * Initializes the notifications, if needed.
     *
     * <p>{@link NotificationManager#IMPORTANCE_HIGH} is needed to show the alerts on top of the car
     * screen. However, the rail widget at the bottom of the screen will show regardless of the
     * importance setting.
     */
    // Suppressing 'ObsoleteSdkInt' as this code is shared between APKs with different min SDK
    // levels
    @SuppressLint({"ObsoleteSdkInt"})
    private static void initNotifications(Context context) {
        NotificationChannelCompat navChannel =
                new NotificationChannelCompat.Builder(
                        NAV_NOTIFICATION_CHANNEL_ID,
                        NotificationManagerCompat.IMPORTANCE_HIGH)
                        .setName(NAV_NOTIFICATION_CHANNEL_NAME).build();
        CarNotificationManager.from(context).createNotificationChannel(navChannel);
    }

    /** Returns the navigation notification that corresponds to the given notification count. */
    static NotificationCompat.Builder getNavigationNotification(
            Context context, int notificationCount) {
        NotificationCompat.Builder builder =
                new NotificationCompat.Builder(context, NAV_NOTIFICATION_CHANNEL_ID);
        DirectionInfo directionInfo = getDirectionInfo(notificationCount);

        // Set an intent to open the car app. The app receives this intent when the user taps the
        // heads-up notification or the rail widget.
        PendingIntent pendingIntent = CarPendingIntent.getCarApp(
                context,
                INTENT_ACTION_NAV_NOTIFICATION_OPEN_APP.hashCode(),