Remove deprecated api that is no longer referenced.

Test: Dead API removal
Relnote: Removed deprecated `ConnectionToCar` API
Bug: 169537526
Change-Id: Ib3d6d69e67185a9215fd5012a69a73e377f8f3d2
diff --git a/car/app/app/api/current.txt b/car/app/app/api/current.txt
index 3a71b2b..932faf27 100644
--- a/car/app/app/api/current.txt
+++ b/car/app/app/api/current.txt
@@ -189,16 +189,6 @@
     field public static final int CONNECTION_TYPE_PROJECTION = 2; // 0x2
   }
 
-  @Deprecated public final class ConnectionToCar {
-    ctor @Deprecated public ConnectionToCar(android.content.Context);
-    method @Deprecated public androidx.lifecycle.LiveData<java.lang.Integer!> getType();
-    field @Deprecated public static final String ACTION_CAR_CONNECTION_UPDATED = "androidx.car.app.connection.action.CAR_CONNECTION_UPDATED";
-    field @Deprecated public static final String CAR_CONNECTION_STATE = "CarConnectionState";
-    field @Deprecated public static final int NATIVE = 1; // 0x1
-    field @Deprecated public static final int NOT_CONNECTED = 0; // 0x0
-    field @Deprecated public static final int PROJECTION = 2; // 0x2
-  }
-
 }
 
 package androidx.car.app.constraints {
diff --git a/car/app/app/api/public_plus_experimental_current.txt b/car/app/app/api/public_plus_experimental_current.txt
index dbcb362..609beaed 100644
--- a/car/app/app/api/public_plus_experimental_current.txt
+++ b/car/app/app/api/public_plus_experimental_current.txt
@@ -192,16 +192,6 @@
     field public static final int CONNECTION_TYPE_PROJECTION = 2; // 0x2
   }
 
-  @Deprecated public final class ConnectionToCar {
-    ctor @Deprecated public ConnectionToCar(android.content.Context);
-    method @Deprecated public androidx.lifecycle.LiveData<java.lang.Integer!> getType();
-    field @Deprecated public static final String ACTION_CAR_CONNECTION_UPDATED = "androidx.car.app.connection.action.CAR_CONNECTION_UPDATED";
-    field @Deprecated public static final String CAR_CONNECTION_STATE = "CarConnectionState";
-    field @Deprecated public static final int NATIVE = 1; // 0x1
-    field @Deprecated public static final int NOT_CONNECTED = 0; // 0x0
-    field @Deprecated public static final int PROJECTION = 2; // 0x2
-  }
-
 }
 
 package androidx.car.app.constraints {
diff --git a/car/app/app/api/restricted_current.txt b/car/app/app/api/restricted_current.txt
index 3a71b2b..932faf27 100644
--- a/car/app/app/api/restricted_current.txt
+++ b/car/app/app/api/restricted_current.txt
@@ -189,16 +189,6 @@
     field public static final int CONNECTION_TYPE_PROJECTION = 2; // 0x2
   }
 
-  @Deprecated public final class ConnectionToCar {
-    ctor @Deprecated public ConnectionToCar(android.content.Context);
-    method @Deprecated public androidx.lifecycle.LiveData<java.lang.Integer!> getType();
-    field @Deprecated public static final String ACTION_CAR_CONNECTION_UPDATED = "androidx.car.app.connection.action.CAR_CONNECTION_UPDATED";
-    field @Deprecated public static final String CAR_CONNECTION_STATE = "CarConnectionState";
-    field @Deprecated public static final int NATIVE = 1; // 0x1
-    field @Deprecated public static final int NOT_CONNECTED = 0; // 0x0
-    field @Deprecated public static final int PROJECTION = 2; // 0x2
-  }
-
 }
 
 package androidx.car.app.constraints {
diff --git a/car/app/app/src/main/java/androidx/car/app/connection/ConnectionToCar.java b/car/app/app/src/main/java/androidx/car/app/connection/ConnectionToCar.java
deleted file mode 100644
index 4caabbe..0000000
--- a/car/app/app/src/main/java/androidx/car/app/connection/ConnectionToCar.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright 2021 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 androidx.car.app.connection;
-
-import static androidx.annotation.RestrictTo.Scope.LIBRARY;
-import static androidx.car.app.utils.CommonUtils.isAutomotiveOS;
-
-import static java.util.Objects.requireNonNull;
-
-import android.content.Context;
-
-import androidx.annotation.IntDef;
-import androidx.annotation.NonNull;
-import androidx.annotation.RestrictTo;
-import androidx.lifecycle.LiveData;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-// TODO(b/169537526): Remove this class
-/**
- * A class that allows retrieval of information about connection to a car head unit.
- *
- * @deprecated use {@link CarConnection} instead.
- */
-@Deprecated
-public final class ConnectionToCar {
-    /**
-     * Defines current car connection state.
-     *
-     * <p>This is used for communication with the car host's content provider on queries for
-     * connection type.
-     */
-    public static final String CAR_CONNECTION_STATE = "CarConnectionState";
-
-    /**
-     * Broadcast action that notifies that the car connection has changed and needs to be updated.
-     */
-    public static final String ACTION_CAR_CONNECTION_UPDATED =
-            "androidx.car.app.connection.action.CAR_CONNECTION_UPDATED";
-
-    /**
-     * Represents the types of connections that exist to a car head unit.
-     *
-     * @hide
-     */
-    @IntDef({NOT_CONNECTED, NATIVE, PROJECTION})
-    @Retention(RetentionPolicy.SOURCE)
-    @Target({ElementType.TYPE_USE})
-    @RestrictTo(LIBRARY)
-    public @interface ConnectionType {
-    }
-
-    /**
-     * Not connected to any car head unit.
-     */
-    public static final int NOT_CONNECTED = 0;
-
-    /**
-     * Natively running on a head unit (Android Automotive OS).
-     */
-    public static final int NATIVE = 1;
-
-    /**
-     * Connected to a car head unit by projecting to it.
-     */
-    public static final int PROJECTION = 2;
-
-    private final LiveData<Integer> mConnectionTypeLiveData;
-
-    /**
-     * Constructs a {@link ConnectionToCar} that can be used to get connection information.
-     *
-     * @throws NullPointerException if {@code context} is {@code null}
-     */
-    public ConnectionToCar(@NonNull Context context) {
-        requireNonNull(context);
-        mConnectionTypeLiveData = isAutomotiveOS(context)
-                ? new AutomotiveCarConnectionTypeLiveData()
-                : new CarConnectionTypeLiveData(context);
-    }
-
-    /**
-     * Returns a {@link LiveData} that can be observed to get current connection type.
-     *
-     * <p>The recommended pattern is to observe the {@link LiveData} with the activity's
-     * lifecycle in order to get updates on the state change throughout the activity's lifetime.
-     *
-     * <p>Connection types are:
-     * <ol>
-     *     <li>{@link #NOT_CONNECTED}
-     *     <li>{@link #NATIVE}
-     *     <li>{@link #PROJECTION}
-     * </ol>
-     */
-    @NonNull
-    public LiveData<@ConnectionType Integer> getType() {
-        return mConnectionTypeLiveData;
-    }
-}