// 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;
        public boolean handleMessage(Message msg) {
            if (msg.what == MSG_SEND_NOTIFICATION) {
                Context context = NavigationNotificationService.this;
                CarNotificationManager.from(context).notify(NAV_NOTIFICATION_ID,
                        getNavigationNotification(context, mNotificationCount));
                mNotificationCount++;
                mHandler.sendMessageDelayed(
                        mHandler.obtainMessage(MSG_SEND_NOTIFICATION),
                        NAV_NOTIFICATION_DELAY_IN_MILLIS);
                return true;
            }
            return false;
        }
    }

    /**
     * Returns a {@link DirectionInfo} that corresponds to the given notification count.
     *
     * <p>There are 5 directions, repeating in order. For each direction, the alert will only show
     * once, but the distance will update on every count on the rail widget.
     */
    private static DirectionInfo getDirectionInfo(int notificationCount) {
        DecimalFormat formatter = new DecimalFormat("#.##");
        formatter.setRoundingMode(RoundingMode.DOWN);
        int repeatingCount = notificationCount % 35;
        if (0 <= repeatingCount && repeatingCount < 10) {
            // Distance decreases from 1km to 0.1km
            String distance = formatter.format((10 - repeatingCount) * 0.1) + "km";
            return new DirectionInfo(
                    "Go Straight",
// 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;

        public boolean handleMessage(Message msg) {
            if (msg.what == MSG_SEND_NOTIFICATION) {
                Context context = NavigationNotificationService.this;
                CarNotificationManager.from(context).notify(NAV_NOTIFICATION_ID,
                        getNavigationNotification(context, mNotificationCount));
                mNotificationCount++;
                mHandler.sendMessageDelayed(
                        mHandler.obtainMessage(MSG_SEND_NOTIFICATION),
                        NAV_NOTIFICATION_DELAY_IN_MILLIS);
                return true;
            }
            return false;
        }
    }

    /**
     * Returns a {@link DirectionInfo} that corresponds to the given notification count.
     *
     * <p>There are 5 directions, repeating in order. For each direction, the alert will only show
     * once, but the distance will update on every count on the rail widget.
     */
    private static DirectionInfo getDirectionInfo(int notificationCount) {
        DecimalFormat formatter = new DecimalFormat("#.##");
        formatter.setRoundingMode(RoundingMode.DOWN);
        int repeatingCount = notificationCount % 35;
        if (0 <= repeatingCount && repeatingCount < 10) {
            // Distance decreases from 1km to 0.1km
            String distance = formatter.format((10 - repeatingCount) * 0.1) + "km";
            return new DirectionInfo(
                    "Go Straight",
                    distance,