Remove unused code
CarApiUtil seems not referenced anywhere and not a public API. Remove.
Bug: 130446322
Test: Deleting code and test
Change-Id: Idecabad40d89c01e27c442f874bdc432c5538724
diff --git a/car-lib/src/android/car/CarApiUtil.java b/car-lib/src/android/car/CarApiUtil.java
deleted file mode 100644
index 8343abe..0000000
--- a/car-lib/src/android/car/CarApiUtil.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (C) 2015 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 android.car;
-
-import android.car.settings.CarSettings;
-
-/**
- * Internal helper utilities
- * @hide
- */
-public final class CarApiUtil {
-
- /** do not use */
- private CarApiUtil() {};
-
- /**
- * Return an integer array of {hour, minute} from the String presentation of the garage mode
- * time.
- *
- * @hide
- */
- public static int[] decodeGarageTimeSetting(String time) {
- int[] result = CarSettings.DEFAULT_GARAGE_MODE_WAKE_UP_TIME;
- if (time == null) {
- return result;
- }
-
- String[] tokens = time.split(":");
- if (tokens.length != 2) {
- return result;
- }
- try {
- result[0] = Integer.valueOf(tokens[0]);
- result[1] = Integer.valueOf(tokens[1]);
- } catch (NumberFormatException e) {
- return CarSettings.DEFAULT_GARAGE_MODE_WAKE_UP_TIME;
- }
- if (result[0] >= 0 && result[0] <= 23 && result[1] >= 0 && result[1] <= 59) {
- return result;
- } else {
- return CarSettings.DEFAULT_GARAGE_MODE_WAKE_UP_TIME;
- }
- }
-
- /**
- * Return a String presentation of the garage mode "hour:minute".
- *
- * @hide
- */
- public static String encodeGarageTimeSetting(int hour, int min) {
- return hour + ":" + min;
- }
-}
diff --git a/tests/android_car_api_test/src/android/car/apitest/CarApiUtilTest.java b/tests/android_car_api_test/src/android/car/apitest/CarApiUtilTest.java
deleted file mode 100644
index 78a6f02..0000000
--- a/tests/android_car_api_test/src/android/car/apitest/CarApiUtilTest.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2016 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 android.car.apitest;
-
-import android.car.CarApiUtil;
-import android.car.settings.CarSettings;
-
-import junit.framework.TestCase;
-
-public class CarApiUtilTest extends TestCase {
-
- public void testDecodeGarageTimeSetting() {
- String time = "11:20";
- int[] result = CarApiUtil.decodeGarageTimeSetting(time);
- assertEquals(11, result[0]);
- assertEquals(20, result[1]);
-
- time = "23:59";
- result = CarApiUtil.decodeGarageTimeSetting(time);
- assertEquals(23, result[0]);
- assertEquals(59, result[1]);
-
- time = null;
- assertEquals(CarSettings.DEFAULT_GARAGE_MODE_WAKE_UP_TIME,
- CarApiUtil.decodeGarageTimeSetting(time));
-
- time = "25:10";
- result = CarApiUtil.decodeGarageTimeSetting(time);
- assertEquals(CarSettings.DEFAULT_GARAGE_MODE_WAKE_UP_TIME, result);
-
- time = "12:99";
- result = CarApiUtil.decodeGarageTimeSetting(time);
- assertEquals(CarSettings.DEFAULT_GARAGE_MODE_WAKE_UP_TIME, result);
-
- time= "hour:min";
- result = CarApiUtil.decodeGarageTimeSetting(time);
- assertEquals(CarSettings.DEFAULT_GARAGE_MODE_WAKE_UP_TIME, result);
- }
-
- public void testEncodeGarageModeTime() {
- assertTrue(CarApiUtil.encodeGarageTimeSetting(0, 0).equals("0:0"));
- assertTrue(CarApiUtil.encodeGarageTimeSetting(10, 0).equals("10:0"));
- assertTrue(CarApiUtil.encodeGarageTimeSetting(23, 59).equals("23:59"));
- }
-}