[automerger] Sends KEYCODE_MEDIA_{PLAY,PAUSE} on master mute am: fe51ee780b am: 5958ac2b3b
Change-Id: Ie13db132033c2a5e2ce31b87d2838a7bcc178e1e
diff --git a/car-lib/src/android/car/hardware/CarVendorExtensionManager.java b/car-lib/src/android/car/hardware/CarVendorExtensionManager.java
index 9f06764..5e07ace 100644
--- a/car-lib/src/android/car/hardware/CarVendorExtensionManager.java
+++ b/car-lib/src/android/car/hardware/CarVendorExtensionManager.java
@@ -106,7 +106,6 @@
if (mCallbacks.isEmpty()) {
mListenerToBase = new CarPropertyEventListenerToBase(this);
}
-
List<CarPropertyConfig> configs = mPropertyManager.getPropertyList();
for (CarPropertyConfig c : configs) {
// Register each individual propertyId
diff --git a/car-lib/src/android/car/hardware/cabin/CarCabinManager.java b/car-lib/src/android/car/hardware/cabin/CarCabinManager.java
index 1dee2b0..7d5715f 100644
--- a/car-lib/src/android/car/hardware/cabin/CarCabinManager.java
+++ b/car-lib/src/android/car/hardware/cabin/CarCabinManager.java
@@ -496,8 +496,6 @@
mCarPropertyMgr.registerListener(mListenerToBase, c.getPropertyId(), 0);
}
mCallbacks.add(callback);
-
-
}
/**
@@ -510,7 +508,7 @@
mCallbacks.remove(callback);
List<CarPropertyConfig> configs = getPropertyList();
for (CarPropertyConfig c : configs) {
- // Register each individual propertyId
+ // Register each individual propertyId
mCarPropertyMgr.unregisterListener(mListenerToBase, c.getPropertyId());
}
if (mCallbacks.isEmpty()) {
diff --git a/car-lib/src/android/car/hardware/hvac/CarHvacManager.java b/car-lib/src/android/car/hardware/hvac/CarHvacManager.java
index c953d6f..fc0e065 100644
--- a/car-lib/src/android/car/hardware/hvac/CarHvacManager.java
+++ b/car-lib/src/android/car/hardware/hvac/CarHvacManager.java
@@ -325,7 +325,7 @@
}
List<CarPropertyConfig> configs = getPropertyList();
for (CarPropertyConfig c : configs) {
- // Register each individual propertyId
+ // Register each individual propertyId
mCarPropertyMgr.registerListener(mListenerToBase, c.getPropertyId(), 0);
}
mCallbacks.add(callback);
@@ -343,6 +343,7 @@
for (CarPropertyConfig c : configs) {
// Register each individual propertyId
mCarPropertyMgr.unregisterListener(mListenerToBase, c.getPropertyId());
+
}
} catch (Exception e) {
Log.e(TAG, "getPropertyList exception ", e);
diff --git a/car-lib/src/android/car/media/CarAudioManager.java b/car-lib/src/android/car/media/CarAudioManager.java
index 7257255..2b9e5af 100644
--- a/car-lib/src/android/car/media/CarAudioManager.java
+++ b/car-lib/src/android/car/media/CarAudioManager.java
@@ -116,7 +116,7 @@
try {
return mService.getGroupMaxVolume(groupId);
} catch (RemoteException e) {
- Log.e(CarLibLog.TAG_CAR, "getUsageMaxVolume failed", e);
+ Log.e(CarLibLog.TAG_CAR, "getGroupMaxVolume failed", e);
throw new CarNotConnectedException(e);
}
}
@@ -134,7 +134,7 @@
try {
return mService.getGroupMinVolume(groupId);
} catch (RemoteException e) {
- Log.e(CarLibLog.TAG_CAR, "getUsageMinVolume failed", e);
+ Log.e(CarLibLog.TAG_CAR, "getGroupMinVolume failed", e);
throw new CarNotConnectedException(e);
}
}
@@ -155,7 +155,7 @@
try {
return mService.getGroupVolume(groupId);
} catch (RemoteException e) {
- Log.e(CarLibLog.TAG_CAR, "getUsageVolume failed", e);
+ Log.e(CarLibLog.TAG_CAR, "getGroupVolume failed", e);
throw new CarNotConnectedException(e);
}
}
diff --git a/car-support-lib/proguard-release.flags b/car-support-lib/proguard-release.flags
index 91cab7e..652be52 100644
--- a/car-support-lib/proguard-release.flags
+++ b/car-support-lib/proguard-release.flags
@@ -1823,6 +1823,7 @@
public void finishOp(java.lang.String, int, java.lang.String);
public void finishOp(int, int, java.lang.String);
public void finishOp(int);
+ public static int getNumOps();
public static java.lang.String[] getOpStrs();
public java.util.List getOpsForPackage(int, java.lang.String, int[]);
public java.util.List getPackagesForOps(int[]);
@@ -4451,7 +4452,6 @@
public int describeContents();
public void dump(boolean);
public void ensureData();
- public void ensureDataForAutofill();
public long getAcquisitionEndTime();
public long getAcquisitionStartTime();
public android.content.ComponentName getActivityComponent();
@@ -8094,6 +8094,7 @@
public void writeToProto(android.util.proto.ProtoOutputStream, long);
+ public static float DEFAULT_MAX_LABEL_SIZE_PX;
public static int DUMP_FLAG_ALL;
public static int DUMP_FLAG_APPLICATION;
public static int DUMP_FLAG_DETAILS;
@@ -10763,7 +10764,6 @@
public boolean isMutable();
public boolean isPremultiplied();
public boolean isRecycled();
- public void makeImmutable();
public void prepareToDraw();
public void reconfigure(int, int, android.graphics.Bitmap$Config);
public void recycle();
@@ -10775,6 +10775,7 @@
public void setHasAlpha(boolean);
public void setHasMipMap(boolean);
public void setHeight(int);
+ public void setImmutable();
public void setNinePatchChunk(byte[]);
public void setPixel(int, int, int);
public void setPixels(int[], int, int, int, int, int, int);
@@ -15107,6 +15108,7 @@
public static int DETECT_CUSTOM;
public static int DETECT_DISK_READ;
public static int DETECT_DISK_WRITE;
+ public static int DETECT_EXPLICIT_GC;
public static int DETECT_NETWORK;
public static int DETECT_RESOURCE_MISMATCH;
public static int DETECT_UNBUFFERED_IO;
@@ -17460,7 +17462,7 @@
protected void finalize();
public void finishInputEvent(android.view.InputEvent, boolean);
public void onBatchedInputEventPending();
- public void onInputEvent(android.view.InputEvent, int);
+ public void onInputEvent(android.view.InputEvent);
}
@@ -17946,6 +17948,7 @@
public static int KEYCODE_ZENKAKU_HANKAKU;
public static int KEYCODE_ZOOM_IN;
public static int KEYCODE_ZOOM_OUT;
+ public static int LAST_KEYCODE;
public static int MAX_KEYCODE;
public static int META_ALT_LEFT_ON;
public static int META_ALT_LOCKED;
@@ -18260,6 +18263,7 @@
public float getAxisValue(int, int);
public int getButtonState();
public int getDeviceId();
+ public int getDisplayId();
public long getDownTime();
public int getEdgeFlags();
public long getEventTime();
@@ -18325,6 +18329,7 @@
public boolean isTargetAccessibilityFocus();
public boolean isTouchEvent();
public boolean isWithinBoundsNoHistory(float, float, float, float);
+ public static android.view.MotionEvent obtain(long, long, int, int, android.view.MotionEvent$PointerProperties[], android.view.MotionEvent$PointerCoords[], int, int, float, float, int, int, int, int, int);
public static android.view.MotionEvent obtain(long, long, int, int, android.view.MotionEvent$PointerProperties[], android.view.MotionEvent$PointerCoords[], int, int, float, float, int, int, int, int);
public static android.view.MotionEvent obtain(long, long, int, int, int[], android.view.MotionEvent$PointerCoords[], int, float, float, int, int, int, int);
public static android.view.MotionEvent obtain(long, long, int, float, float, float, float, int, float, float, int, int);
@@ -18338,6 +18343,7 @@
public void setAction(int);
public void setActionButton(int);
public void setButtonState(int);
+ public void setDisplayId(int);
public void setDownTime(long);
public void setEdgeFlags(int);
public void setHoverExitPending(boolean);
@@ -19081,7 +19087,6 @@
public void notifyFramePending();
public static void overrideProperty(java.lang.String, java.lang.String);
public void removeRenderNode(android.view.RenderNode);
- public void serializeDisplayListTree();
public void setContentDrawBounds(int, int, int, int);
public static void setContextPriority(int);
public static void setDebuggingEnabled(boolean);
@@ -23405,6 +23410,8 @@
protected android.widget.Toolbar$LayoutParams generateLayoutParams(android.view.ViewGroup$LayoutParams);
protected android.view.ViewGroup$LayoutParams generateLayoutParams(android.view.ViewGroup$LayoutParams);
public android.view.ViewGroup$LayoutParams generateLayoutParams(android.util.AttributeSet);
+ public java.lang.CharSequence getCollapseContentDescription();
+ public android.graphics.drawable.Drawable getCollapseIcon();
public int getContentInsetEnd();
public int getContentInsetEndWithActions();
public int getContentInsetLeft();
@@ -23445,6 +23452,10 @@
protected android.os.Parcelable onSaveInstanceState();
protected void onSetLayoutParams(android.view.View, android.view.ViewGroup$LayoutParams);
public boolean onTouchEvent(android.view.MotionEvent);
+ public void setCollapseContentDescription(int);
+ public void setCollapseContentDescription(java.lang.CharSequence);
+ public void setCollapseIcon(int);
+ public void setCollapseIcon(android.graphics.drawable.Drawable);
public void setCollapsible(boolean);
public void setContentInsetEndWithActions(int);
public void setContentInsetStartWithNavigation(int);
diff --git a/car_product/build/car_base.mk b/car_product/build/car_base.mk
index 9138090..6788a49 100644
--- a/car_product/build/car_base.mk
+++ b/car_product/build/car_base.mk
@@ -20,8 +20,6 @@
PRODUCT_PACKAGE_OVERLAYS += packages/services/Car/car_product/overlay
PRODUCT_PACKAGES += \
- ContactsProvider \
- DefaultContainerService \
Home \
BasicDreams \
CaptivePortalLogin \
@@ -46,39 +44,13 @@
ExternalStorageProvider \
atrace \
libandroidfw \
- libaudiopreprocessing \
libaudioutils \
- libfilterpack_imageproc \
- libgabi++ \
libmdnssd \
libnfc_ndef \
libpowermanager \
libspeexresampler \
- libstagefright_soft_aacdec \
- libstagefright_soft_aacenc \
- libstagefright_soft_amrdec \
- libstagefright_soft_amrnbenc \
- libstagefright_soft_amrwbenc \
- libstagefright_soft_avcdec \
- libstagefright_soft_avcenc \
- libstagefright_soft_flacdec \
- libstagefright_soft_flacenc \
- libstagefright_soft_g711dec \
- libstagefright_soft_gsmdec \
- libstagefright_soft_hevcdec \
- libstagefright_soft_mp3dec \
- libstagefright_soft_mpeg2dec \
- libstagefright_soft_mpeg4dec \
- libstagefright_soft_mpeg4enc \
- libstagefright_soft_opusdec \
- libstagefright_soft_rawdec \
- libstagefright_soft_vorbisdec \
- libstagefright_soft_vpxdec \
- libstagefright_soft_vpxenc \
libvariablespeed \
libwebrtc_audio_preprocessing \
- mdnsd \
- requestsync \
wifi-service \
A2dpSinkService \
diff --git a/car_product/overlay/frameworks/base/core/res/res/color/car_borderless_button_text_color.xml b/car_product/overlay/frameworks/base/core/res/res/color/car_borderless_button_text_color.xml
new file mode 100644
index 0000000..01fc20b
--- /dev/null
+++ b/car_product/overlay/frameworks/base/core/res/res/color/car_borderless_button_text_color.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+<!-- Default text colors for car buttons when enabled/disabled. -->
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:color="@color/car_grey_700" android:state_enabled="false"/>
+ <item android:color="?android:attr/colorButtonNormal"/>
+</selector>
diff --git a/car_product/overlay/frameworks/base/core/res/res/color/car_button_text_color.xml b/car_product/overlay/frameworks/base/core/res/res/color/car_button_text_color.xml
new file mode 100644
index 0000000..7add316
--- /dev/null
+++ b/car_product/overlay/frameworks/base/core/res/res/color/car_button_text_color.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+<!-- Default text colors for car buttons when enabled/disabled. -->
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:color="@color/car_grey_700" android:state_enabled="false"/>
+ <item android:color="@color/car_action1"/>
+</selector>
diff --git a/car_product/overlay/frameworks/base/core/res/res/drawable/car_button_background.xml b/car_product/overlay/frameworks/base/core/res/res/drawable/car_button_background.xml
new file mode 100644
index 0000000..ccc4e22
--- /dev/null
+++ b/car_product/overlay/frameworks/base/core/res/res/drawable/car_button_background.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+<!-- Default background styles for car buttons when enabled/disabled. -->
+<ripple
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:color="?attr/colorControlHighlight">
+ <item>
+ <selector>
+ <item android:state_enabled="false">
+ <shape android:shape="rectangle">
+ <corners android:radius="@dimen/car_button_radius"/>
+ <solid android:color="@color/car_grey_300"/>
+ </shape>
+ </item>
+ <item>
+ <shape android:shape="rectangle">
+ <corners android:radius="@dimen/car_button_radius"/>
+ <solid android:color="?android:attr/colorButtonNormal"/>
+ </shape>
+ </item>
+ </selector>
+ </item>
+</ripple>
diff --git a/car_product/overlay/frameworks/base/core/res/res/drawable/car_seekbar_thumb.xml b/car_product/overlay/frameworks/base/core/res/res/drawable/car_seekbar_thumb.xml
new file mode 100644
index 0000000..3729a3b
--- /dev/null
+++ b/car_product/overlay/frameworks/base/core/res/res/drawable/car_seekbar_thumb.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+
+<shape
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shape="oval">
+ <solid android:color="@color/car_accent" />
+ <size
+ android:width="@dimen/car_seekbar_thumb_size"
+ android:height="@dimen/car_seekbar_thumb_size" />
+</shape>
diff --git a/car_product/overlay/frameworks/base/core/res/res/drawable/car_seekbar_thumb_dark.xml b/car_product/overlay/frameworks/base/core/res/res/drawable/car_seekbar_thumb_dark.xml
new file mode 100644
index 0000000..a469ada
--- /dev/null
+++ b/car_product/overlay/frameworks/base/core/res/res/drawable/car_seekbar_thumb_dark.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+
+<shape
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shape="oval">
+ <solid android:color="@color/car_accent_dark" />
+ <size
+ android:width="@dimen/car_seekbar_thumb_size"
+ android:height="@dimen/car_seekbar_thumb_size" />
+</shape>
diff --git a/car_product/overlay/frameworks/base/core/res/res/drawable/car_seekbar_thumb_light.xml b/car_product/overlay/frameworks/base/core/res/res/drawable/car_seekbar_thumb_light.xml
new file mode 100644
index 0000000..0509858
--- /dev/null
+++ b/car_product/overlay/frameworks/base/core/res/res/drawable/car_seekbar_thumb_light.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+
+<shape
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shape="oval">
+ <solid android:color="@color/car_accent_light" />
+ <size
+ android:width="@dimen/car_seekbar_thumb_size"
+ android:height="@dimen/car_seekbar_thumb_size" />
+</shape>
diff --git a/car_product/overlay/frameworks/base/core/res/res/drawable/car_seekbar_track.xml b/car_product/overlay/frameworks/base/core/res/res/drawable/car_seekbar_track.xml
new file mode 100644
index 0000000..fd112b0
--- /dev/null
+++ b/car_product/overlay/frameworks/base/core/res/res/drawable/car_seekbar_track.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:id="@android:id/background">
+ <shape android:shape="line">
+ <stroke
+ android:width="@dimen/car_seekbar_height"
+ android:color="@color/car_seekbar_track_background" />
+ </shape>
+ </item>
+ <item android:id="@android:id/secondaryProgress">
+ <clip>
+ <shape android:shape="line">
+ <stroke
+ android:width="@dimen/car_seekbar_height"
+ android:color="@color/car_seekbar_track_secondary_progress" />
+ </shape>
+ </clip>
+ </item>
+ <item android:id="@android:id/progress">
+ <clip>
+ <shape android:shape="line">
+ <stroke
+ android:width="@dimen/car_seekbar_height"
+ android:color="@color/car_accent" />
+ </shape>
+ </clip>
+ </item>
+</layer-list>
diff --git a/car_product/overlay/frameworks/base/core/res/res/drawable/car_seekbar_track_dark.xml b/car_product/overlay/frameworks/base/core/res/res/drawable/car_seekbar_track_dark.xml
new file mode 100644
index 0000000..b7fa379
--- /dev/null
+++ b/car_product/overlay/frameworks/base/core/res/res/drawable/car_seekbar_track_dark.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+
+<!-- Drawable of seekbar track. Uses dark color for track. -->
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:id="@android:id/background">
+ <shape android:shape="line">
+ <stroke
+ android:width="@dimen/car_seekbar_height"
+ android:color="@color/car_seekbar_track_background_dark" />
+ </shape>
+ </item>
+ <item android:id="@android:id/secondaryProgress">
+ <clip>
+ <shape android:shape="line">
+ <stroke
+ android:width="@dimen/car_seekbar_height"
+ android:color="@color/car_seekbar_track_secondary_progress" />
+ </shape>
+ </clip>
+ </item>
+ <item android:id="@android:id/progress">
+ <clip>
+ <shape android:shape="line">
+ <stroke
+ android:width="@dimen/car_seekbar_height"
+ android:color="@color/car_accent_light" />
+ </shape>
+ </clip>
+ </item>
+</layer-list>
diff --git a/car_product/overlay/frameworks/base/core/res/res/drawable/car_seekbar_track_light.xml b/car_product/overlay/frameworks/base/core/res/res/drawable/car_seekbar_track_light.xml
new file mode 100644
index 0000000..a9df2b6
--- /dev/null
+++ b/car_product/overlay/frameworks/base/core/res/res/drawable/car_seekbar_track_light.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+
+<!-- Drawable of seekbar track. Uses light color for track. -->
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:id="@android:id/background">
+ <shape android:shape="line">
+ <stroke
+ android:width="@dimen/car_seekbar_height"
+ android:color="@color/car_seekbar_track_background_light" />
+ </shape>
+ </item>
+ <item android:id="@android:id/secondaryProgress">
+ <clip>
+ <shape android:shape="line">
+ <stroke
+ android:width="@dimen/car_seekbar_height"
+ android:color="@color/car_seekbar_track_secondary_progress" />
+ </shape>
+ </clip>
+ </item>
+ <item android:id="@android:id/progress">
+ <clip>
+ <shape android:shape="line">
+ <stroke
+ android:width="@dimen/car_seekbar_height"
+ android:color="@color/car_accent_dark" />
+ </shape>
+ </clip>
+ </item>
+</layer-list>
diff --git a/car_product/overlay/frameworks/base/core/res/res/values-night/themes.xml b/car_product/overlay/frameworks/base/core/res/res/values-night/themes.xml
new file mode 100644
index 0000000..6f89ffd
--- /dev/null
+++ b/car_product/overlay/frameworks/base/core/res/res/values-night/themes.xml
@@ -0,0 +1,18 @@
+<!-- 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.
+-->
+<resources>
+ <style name="Theme.DeviceDefaultBase.DayNight">
+ </style>
+</resources>
diff --git a/car_product/overlay/frameworks/base/core/res/res/values/colors.xml b/car_product/overlay/frameworks/base/core/res/res/values/colors.xml
index 37dc0bf..7057083 100644
--- a/car_product/overlay/frameworks/base/core/res/res/values/colors.xml
+++ b/car_product/overlay/frameworks/base/core/res/res/values/colors.xml
@@ -180,8 +180,21 @@
car_scrollbar_thumb. -->
<color name="car_scrollbar_thumb_inverse">@color/car_scrollbar_thumb_light</color>
+ <!-- The color of the seekbar track secondary progress in SeekbarListItem. -->
+ <color name="car_seekbar_track_secondary_progress">@color/car_grey_500</color>
+
+ <!-- The lighter and darker color for the seekbar track background. -->
+ <color name="car_seekbar_track_background_light">@color/car_grey_400</color>
+ <color name="car_seekbar_track_background_dark">@color/car_grey_700</color>
+ <!-- The color of the seekbar track background in SeekbarListItem. This color is assumed to be
+ on a light-colored background. -->
+ <color name="car_seekbar_track_background">@color/car_seekbar_track_background_light</color>
+
<!-- Misc colors -->
<color name="car_highlight_light">@color/car_teal_700</color>
<color name="car_highlight_dark">@color/car_teal_200</color>
<color name="car_highlight">@color/car_highlight_light</color>
+ <color name="car_accent_light">@color/car_highlight_light</color>
+ <color name="car_accent_dark">@color/car_highlight_dark</color>
+ <color name="car_accent">@color/car_highlight</color>
</resources>
diff --git a/car_product/overlay/frameworks/base/core/res/res/values/dimens.xml b/car_product/overlay/frameworks/base/core/res/res/values/dimens.xml
index 2adc535..4eaceaf 100644
--- a/car_product/overlay/frameworks/base/core/res/res/values/dimens.xml
+++ b/car_product/overlay/frameworks/base/core/res/res/values/dimens.xml
@@ -109,10 +109,21 @@
<dimen name="notification_progress_margin_top">16dp</dimen>
<!-- Text size for car -->
- <dimen name="car_title2_size">40sp</dimen>
- <dimen name="car_body1_size">40sp</dimen>
- <dimen name="car_body2_size">32sp</dimen>
- <dimen name="car_action1_size">32sp</dimen>
+ <dimen name="car_title_size">32sp</dimen>
+ <dimen name="car_title2_size">32sp</dimen>
+ <dimen name="car_headline1_size">45sp</dimen>
+ <dimen name="car_headline2_size">32sp</dimen>
+ <dimen name="car_headline3_size">24sp</dimen>
+ <dimen name="car_headline4_size">20sp</dimen>
+ <dimen name="car_body1_size">32sp</dimen>
+ <dimen name="car_body2_size">26sp</dimen>
+ <dimen name="car_body3_size">16sp</dimen>
+ <dimen name="car_body4_size">14sp</dimen>
+ <dimen name="car_body5_size">18sp</dimen>
+ <dimen name="car_label1_size">26sp</dimen>
+ <dimen name="car_label2_size">64sp</dimen>
+ <dimen name="car_action1_size">26sp</dimen>
+ <dimen name="car_action2_size">26sp</dimen>
<!-- Common icon size for car app -->
<dimen name="car_icon_size">56dp</dimen>
@@ -139,6 +150,26 @@
<dimen name="car_keyline_3">152dp</dimen>
<dimen name="car_keyline_4">182dp</dimen>
+ <!-- Buttons -->
+ <dimen name="car_button_height">56dp</dimen>
+ <dimen name="car_button_min_width">158dp</dimen>
+ <dimen name="car_button_horizontal_padding">@dimen/car_padding_4</dimen>
+ <dimen name="car_borderless_button_horizontal_padding">0dp</dimen>
+ <dimen name="car_button_radius">@dimen/car_radius_1</dimen>
+ <dimen name="car_pill_button_size">56dp</dimen>
+
+ <!-- Seekbar -->
+ <dimen name="car_seekbar_height">6dp</dimen>
+ <dimen name="car_seekbar_padding">26dp</dimen>
+ <dimen name="car_seekbar_thumb_size">24dp</dimen>
+ <dimen name="car_seekbar_thumb_stroke">1dp</dimen>
+ <!-- The space between seekbar and text in ListItem. This value is based on car_seekbar_padding.
+ It brings seekbar and text closer for visual balance while maintaining touch area. -->
+ <dimen name="car_seekbar_text_overlap">-20dp</dimen>
+
+ <!-- Progress Bar -->
+ <dimen name="car_progress_bar_height">@dimen/car_seekbar_height</dimen>
+
<!-- Make the dots in lock pattern thicker in Car -->
<dimen name="lock_pattern_dot_size">20dp</dimen>
</resources>
diff --git a/car_product/overlay/frameworks/base/core/res/res/values/styles.xml b/car_product/overlay/frameworks/base/core/res/res/values/styles.xml
index f654f3d..5c2968e 100644
--- a/car_product/overlay/frameworks/base/core/res/res/values/styles.xml
+++ b/car_product/overlay/frameworks/base/core/res/res/values/styles.xml
@@ -77,6 +77,20 @@
</style>
<!-- Car text -->
+ <style name="CarBody1">
+ <item name="android:textStyle">normal</item>
+ <item name="android:textSize">@dimen/car_body1_size</item>
+ <item name="android:textColor">@color/car_body1</item>
+ </style>
+
+ <style name="CarBody1.Light">
+ <item name="android:textColor">@color/car_body1_light</item>
+ </style>
+
+ <style name="CarBody1.Dark">
+ <item name="android:textColor">@color/car_body2_dark</item>
+ </style>
+
<style name="CarBody2">
<item name="android:textStyle">normal</item>
<item name="android:textSize">@dimen/car_body2_size</item>
@@ -89,6 +103,20 @@
<style name="CarBody2.Light">
<item name="android:textColor">@color/car_body2_light</item>
</style>
+
+ <style name="CarBody3">
+ <item name="android:textStyle">normal</item>
+ <item name="android:textSize">@dimen/car_body3_size</item>
+ <item name="android:textColor">@color/car_body3</item>
+ </style>
+
+ <!-- The smallest styling for body text. The color of this text changes based on the day/night
+ mode. -->
+ <style name="CarBody4">
+ <item name="android:textStyle">normal</item>
+ <item name="android:textSize">@dimen/car_body4_size</item>
+ <item name="android:textColor">@color/car_body4</item>
+ </style>
<style name="CarAction1">
<item name="android:textStyle">bold</item>
@@ -119,4 +147,55 @@
<style name="CarTitle.Light" >
<item name="android:textColor">@color/car_title_light</item>
</style>
+
+ <!-- ======= -->
+ <!-- Widgets -->
+ <!-- ======= -->
+
+ <!-- The styles for the regular and borderless buttons. -->
+ <style name="Widget.CarDefault.Button" parent="Widget.DeviceDefault.Button">
+ <item name="android:fontFamily">sans-serif-medium</item>
+ <item name="android:layout_height">@dimen/car_button_height</item>
+ <item name="android:minWidth">@dimen/car_button_min_width</item>
+ <item name="android:paddingStart">@dimen/car_button_horizontal_padding</item>
+ <item name="android:paddingEnd">@dimen/car_button_horizontal_padding</item>
+ <item name="android:textSize">@dimen/car_action1_size</item>
+ <item name="android:background">@drawable/car_button_background</item>
+ <item name="android:textColor">@color/car_button_text_color</item>
+ </style>
+
+ <style name="Widget.CarDefault.Button.Borderless.Colored" parent="Widget.DeviceDefault.Button.Borderless.Colored">
+ <item name="android:fontFamily">sans-serif-medium</item>
+ <item name="android:layout_height">@dimen/car_button_height</item>
+ <item name="android:minWidth">@dimen/car_button_min_width</item>
+ <item name="android:paddingStart">@dimen/car_borderless_button_horizontal_padding</item>
+ <item name="android:paddingEnd">@dimen/car_borderless_button_horizontal_padding</item>
+ <item name="android:textSize">@dimen/car_action1_size</item>
+ <item name="android:textColor">@color/car_borderless_button_text_color</item>
+ </style>
+
+ <style name="Widget.CarDefault.Button.Borderless.Colored.Light">
+ <item name="android:textColor">@color/car_borderless_button_text_color</item>
+ </style>
+
+ <style name="Widget.CarDefault.Button.Borderless.Colored.Dark">
+ <item name="android:textColor">@color/car_borderless_button_text_color</item>
+ </style>
+
+ <!-- Style for the progress bars. -->
+ <style name="Widget.CarDefault.ProgressBar.Horizontal" parent="Widget.DeviceDefault.ProgressBar.Horizontal">
+ <item name="android:minHeight">@dimen/car_progress_bar_height</item>
+ <item name="android:maxHeight">@dimen/car_progress_bar_height</item>
+ </style>
+
+ <style name="Widget.CarDefault.EditText" parent="Widget.DeviceDefault.EditText">
+ <item name="android:textColor">?attr/editTextColor</item>
+ <item name="android:textAppearance">@style/CarBody1</item>
+ </style>
+
+ <!-- Styling for the seek bars. -->
+ <style name="Widget.CarDefault.SeekBar" parent="Widget.DeviceDefault.SeekBar">
+ <item name="android:progressDrawable">@drawable/car_seekbar_track</item>
+ <item name="android:thumb">@drawable/car_seekbar_thumb</item>
+ </style>
</resources>
diff --git a/car_product/overlay/frameworks/base/core/res/res/values/themes.xml b/car_product/overlay/frameworks/base/core/res/res/values/themes.xml
new file mode 100644
index 0000000..75fb3d1
--- /dev/null
+++ b/car_product/overlay/frameworks/base/core/res/res/values/themes.xml
@@ -0,0 +1,31 @@
+<!-- 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.
+-->
+<resources>
+ <style name="Theme.DeviceDefaultBase.DayNight" />
+ <style name="Theme.DeviceDefault" parent="Theme.DeviceDefaultBase.DayNight">
+ <item name="android:colorAccent">@color/car_highlight</item>
+ <item name="android:colorButtonNormal">@color/car_highlight</item>
+ <item name="android:colorControlHighlight">@color/car_card_ripple_background</item>
+ <item name="android:buttonStyle">@style/Widget.CarDefault.Button</item>
+ <item name="android:borderlessButtonStyle">@style/Widget.CarDefault.Button.Borderless.Colored</item>
+ <item name="android:progressBarStyleHorizontal">@style/Widget.CarDefault.ProgressBar.Horizontal</item>
+ <item name="android:textColorHint">@color/car_body2</item>
+ <item name="android:editTextStyle">@style/Widget.CarDefault.EditText</item>
+ <item name="android:editTextColor">@color/car_body1</item>
+ <item name="android:colorControlNormal">@color/car_body2</item>
+ <item name="android:seekBarStyle">@style/Widget.CarDefault.SeekBar</item>
+ <item name="android:colorControlHighlight">@color/car_card_ripple_background_inverse</item>
+ </style>
+</resources>
diff --git a/evs/app/RenderDirectView.cpp b/evs/app/RenderDirectView.cpp
index 24eb485..45dfa78 100644
--- a/evs/app/RenderDirectView.cpp
+++ b/evs/app/RenderDirectView.cpp
@@ -135,6 +135,6 @@
// Wait for the rendering to finish
glFinish();
-
+ detachRenderTarget();
return true;
}
diff --git a/evs/app/RenderTopView.cpp b/evs/app/RenderTopView.cpp
index bff2b3c..5bc943c 100644
--- a/evs/app/RenderTopView.cpp
+++ b/evs/app/RenderTopView.cpp
@@ -214,7 +214,7 @@
// Wait for the rendering to finish
glFinish();
-
+ detachRenderTarget();
return true;
}
diff --git a/service/Android.mk b/service/Android.mk
index c03042d..2ec4c4a 100644
--- a/service/Android.mk
+++ b/service/Android.mk
@@ -72,6 +72,8 @@
car-systemtest \
com.android.car.procfsinspector-client \
+LOCAL_MIN_SDK_VERSION := 25
+
include $(BUILD_STATIC_JAVA_LIBRARY)
include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/service/AndroidManifest.xml b/service/AndroidManifest.xml
index 5212448..7cef341 100644
--- a/service/AndroidManifest.xml
+++ b/service/AndroidManifest.xml
@@ -236,7 +236,7 @@
<uses-permission android:name="android.permission.LOCATION_HARDWARE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
- <application android:label="Car service"
+ <application android:label="@string/app_title"
android:directBootAware="true"
android:allowBackup="false"
android:persistent="true">
diff --git a/service/res/values/strings.xml b/service/res/values/strings.xml
index 9423e85..1947e43 100644
--- a/service/res/values/strings.xml
+++ b/service/res/values/strings.xml
@@ -14,6 +14,8 @@
limitations under the License.
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="app_title">Car service</string>
+
<!-- For permissions -->
<!-- Permission text: can access your car's information [CHAR LIMIT=NONE] -->
<string name="car_permission_label">Car information</string>
diff --git a/service/src/com/android/car/ICarImpl.java b/service/src/com/android/car/ICarImpl.java
index 9a15631..48113fa 100644
--- a/service/src/com/android/car/ICarImpl.java
+++ b/service/src/com/android/car/ICarImpl.java
@@ -611,4 +611,4 @@
return (Integer.decode(property) & VehicleArea.MASK) == VehicleArea.GLOBAL;
}
}
-}
+}
\ No newline at end of file
diff --git a/tests/EmbeddedKitchenSinkApp/Android.mk b/tests/EmbeddedKitchenSinkApp/Android.mk
index 7a8c145..71adf6b 100644
--- a/tests/EmbeddedKitchenSinkApp/Android.mk
+++ b/tests/EmbeddedKitchenSinkApp/Android.mk
@@ -41,7 +41,7 @@
LOCAL_DEX_PREOPT := false
LOCAL_STATIC_ANDROID_LIBRARIES += \
- android-support-car \
+ androidx.car_car \
car-service-lib-for-test
LOCAL_STATIC_JAVA_LIBRARIES += \
diff --git a/tests/EmbeddedKitchenSinkApp/res/layout/vhal_listitem.xml b/tests/EmbeddedKitchenSinkApp/res/layout/vhal_listitem.xml
new file mode 100644
index 0000000..7057660
--- /dev/null
+++ b/tests/EmbeddedKitchenSinkApp/res/layout/vhal_listitem.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="horizontal">
+ <TextView
+ android:id="@+id/textString"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="7"/>
+ <Button
+ android:id="@+id/infoButton"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="2"
+ android:text="config"/>
+ <Button
+ android:id="@+id/valueButton"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="3"
+ android:text="value"/>
+</LinearLayout>
diff --git a/tests/EmbeddedKitchenSinkApp/res/values/strings.xml b/tests/EmbeddedKitchenSinkApp/res/values/strings.xml
index 452fec8..3fbbafb 100644
--- a/tests/EmbeddedKitchenSinkApp/res/values/strings.xml
+++ b/tests/EmbeddedKitchenSinkApp/res/values/strings.xml
@@ -237,6 +237,7 @@
<string name="sensor_ev_charge_port_is_open">EV Charge Port Is Open[%1$s]: %2$s</string>
<string name="sensor_ev_charge_port_is_connected">EV Charge Port Is Connected[%1$s]: %2$s</string>
<string name="sensor_ev_charge_rate">EV Charge Rate[%1$s]: %2$s</string>
+ <string name="sensor_oil_level">Oil Level[%1$s]: %2$s</string>
<string name="volume_test">Volume Test</string>
<string name="volume_up_logical">Vol +</string>
diff --git a/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/CarEmulator.java b/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/CarEmulator.java
index ecb734d..ca2d6b3 100644
--- a/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/CarEmulator.java
+++ b/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/CarEmulator.java
@@ -17,6 +17,8 @@
package com.google.android.car.kitchensink;
+import com.google.android.collect.Lists;
+
import android.car.Car;
import android.content.Context;
import android.hardware.automotive.vehicle.V2_0.VehicleHwKeyInputAction;
@@ -24,6 +26,7 @@
import android.hardware.automotive.vehicle.V2_0.VehicleProperty;
import android.hardware.automotive.vehicle.V2_0.VehiclePropertyAccess;
import android.os.SystemClock;
+import android.util.SparseIntArray;
import com.android.car.ICarImpl;
import com.android.car.systeminterface.SystemInterface;
@@ -32,6 +35,10 @@
import com.android.car.vehiclehal.test.MockedVehicleHal.VehicleHalPropertyHandler;
import com.android.car.vehiclehal.test.VehiclePropConfigBuilder;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
public class CarEmulator {
private final Car mCar;
diff --git a/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/KitchenSinkActivity.java b/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/KitchenSinkActivity.java
index 7837f2e..0b0a878 100644
--- a/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/KitchenSinkActivity.java
+++ b/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/KitchenSinkActivity.java
@@ -16,7 +16,6 @@
package com.google.android.car.kitchensink;
-
import android.car.hardware.CarSensorManager;
import android.car.hardware.hvac.CarHvacManager;
import android.car.hardware.power.CarPowerManager;
@@ -28,12 +27,12 @@
import android.support.car.CarAppFocusManager;
import android.support.car.CarConnectionCallback;
import android.support.car.CarNotConnectedException;
-import android.support.v4.app.Fragment;
import android.util.Log;
import androidx.car.drawer.CarDrawerActivity;
import androidx.car.drawer.CarDrawerAdapter;
import androidx.car.drawer.DrawerItemViewHolder;
+import androidx.fragment.app.Fragment;
import com.google.android.car.kitchensink.activityview.ActivityViewTestFragment;
import com.google.android.car.kitchensink.alertdialog.AlertDialogTestFragment;
diff --git a/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/activityview/ActivityViewTestFragment.java b/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/activityview/ActivityViewTestFragment.java
index 2df0b07..a41427d 100644
--- a/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/activityview/ActivityViewTestFragment.java
+++ b/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/activityview/ActivityViewTestFragment.java
@@ -21,12 +21,13 @@
import android.content.Intent;
import android.os.Bundle;
import android.os.SystemClock;
-import android.support.annotation.Nullable;
-import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
+import androidx.annotation.Nullable;
+import androidx.fragment.app.Fragment;
+
import com.google.android.car.kitchensink.R;
import java.util.Random;
diff --git a/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/alertdialog/AlertDialogTestFragment.java b/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/alertdialog/AlertDialogTestFragment.java
index f2f5712..324df02 100644
--- a/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/alertdialog/AlertDialogTestFragment.java
+++ b/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/alertdialog/AlertDialogTestFragment.java
@@ -19,12 +19,13 @@
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.os.Bundle;
-import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
+import androidx.fragment.app.Fragment;
+
import com.google.android.car.kitchensink.R;
/**
diff --git a/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/assistant/CarAssistantFragment.java b/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/assistant/CarAssistantFragment.java
index 4bee453..9f3ab1a 100644
--- a/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/assistant/CarAssistantFragment.java
+++ b/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/assistant/CarAssistantFragment.java
@@ -18,8 +18,6 @@
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
-import android.support.annotation.Nullable;
-import android.support.v4.app.Fragment;
import android.view.HapticFeedbackConstants;
import android.view.LayoutInflater;
import android.view.View;
@@ -27,6 +25,9 @@
import android.widget.ImageView;
import android.widget.Toast;
+import androidx.annotation.Nullable;
+import androidx.fragment.app.Fragment;
+
import com.google.android.car.kitchensink.R;
public class CarAssistantFragment extends Fragment {
diff --git a/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/audio/AudioPlayer.java b/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/audio/AudioPlayer.java
index 50a5e9e..74345aa 100644
--- a/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/audio/AudioPlayer.java
+++ b/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/audio/AudioPlayer.java
@@ -23,6 +23,8 @@
import android.media.MediaPlayer;
import android.util.Log;
+import com.google.android.car.kitchensink.R;
+
import java.io.IOException;
import java.util.concurrent.atomic.AtomicBoolean;
diff --git a/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/audio/AudioTestFragment.java b/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/audio/AudioTestFragment.java
index 626dc2a..6325512 100644
--- a/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/audio/AudioTestFragment.java
+++ b/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/audio/AudioTestFragment.java
@@ -31,7 +31,6 @@
import android.os.Handler;
import android.os.IBinder;
import android.os.Looper;
-import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
@@ -42,6 +41,8 @@
import android.widget.Toast;
import android.widget.ToggleButton;
+import androidx.fragment.app.Fragment;
+
import com.google.android.car.kitchensink.CarEmulator;
import com.google.android.car.kitchensink.R;
diff --git a/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/bluetooth/BluetoothHeadsetFragment.java b/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/bluetooth/BluetoothHeadsetFragment.java
index a98d49e..2d57d28 100644
--- a/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/bluetooth/BluetoothHeadsetFragment.java
+++ b/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/bluetooth/BluetoothHeadsetFragment.java
@@ -26,8 +26,6 @@
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
-import android.support.annotation.Nullable;
-import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
@@ -35,6 +33,9 @@
import android.widget.Button;
import android.widget.TextView;
+import androidx.annotation.Nullable;
+import androidx.fragment.app.Fragment;
+
import com.google.android.car.kitchensink.R;
public class BluetoothHeadsetFragment extends Fragment {
diff --git a/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/bluetooth/MapMceTestFragment.java b/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/bluetooth/MapMceTestFragment.java
index 6a72428..2d9df69 100644
--- a/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/bluetooth/MapMceTestFragment.java
+++ b/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/bluetooth/MapMceTestFragment.java
@@ -32,8 +32,6 @@
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
-import android.support.annotation.Nullable;
-import android.support.v4.app.Fragment;
import android.telecom.PhoneAccount;
import android.util.Log;
import android.view.LayoutInflater;
@@ -45,6 +43,9 @@
import android.widget.TextView;
import android.widget.Toast;
+import androidx.annotation.Nullable;
+import androidx.fragment.app.Fragment;
+
import com.google.android.car.kitchensink.KitchenSinkActivity;
import com.google.android.car.kitchensink.R;
diff --git a/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/cluster/InstrumentClusterFragment.java b/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/cluster/InstrumentClusterFragment.java
index 748ea68..8e4483e 100644
--- a/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/cluster/InstrumentClusterFragment.java
+++ b/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/cluster/InstrumentClusterFragment.java
@@ -20,19 +20,20 @@
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.Bundle;
-import android.support.annotation.Nullable;
import android.support.car.Car;
import android.support.car.CarAppFocusManager;
import android.support.car.CarConnectionCallback;
import android.support.car.CarNotConnectedException;
import android.support.car.navigation.CarNavigationStatusManager;
-import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;
+import androidx.annotation.Nullable;
+import androidx.fragment.app.Fragment;
+
import com.google.android.car.kitchensink.R;
/**
diff --git a/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/cube/CubesTestFragment.java b/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/cube/CubesTestFragment.java
index b149df5..209d98d 100644
--- a/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/cube/CubesTestFragment.java
+++ b/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/cube/CubesTestFragment.java
@@ -18,12 +18,13 @@
import android.opengl.GLSurfaceView;
import android.os.Bundle;
-import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
+import androidx.fragment.app.Fragment;
+
import com.google.android.car.kitchensink.R;
public class CubesTestFragment extends Fragment {
diff --git a/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/diagnostic/DiagnosticTestFragment.java b/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/diagnostic/DiagnosticTestFragment.java
index e2b452c..5569848 100644
--- a/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/diagnostic/DiagnosticTestFragment.java
+++ b/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/diagnostic/DiagnosticTestFragment.java
@@ -24,13 +24,14 @@
import android.graphics.Color;
import android.os.Bundle;
import android.support.car.hardware.CarSensorManager;
-import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
+import androidx.fragment.app.Fragment;
+
import com.google.android.car.kitchensink.KitchenSinkActivity;
import com.google.android.car.kitchensink.R;
diff --git a/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/displayinfo/DisplayInfoFragment.java b/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/displayinfo/DisplayInfoFragment.java
index bae2253..ac0bdae 100644
--- a/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/displayinfo/DisplayInfoFragment.java
+++ b/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/displayinfo/DisplayInfoFragment.java
@@ -20,7 +20,6 @@
import android.content.res.Resources;
import android.graphics.Point;
import android.os.Bundle;
-import android.support.v4.app.Fragment;
import android.util.DisplayMetrics;
import android.view.LayoutInflater;
import android.view.View;
@@ -28,6 +27,8 @@
import android.widget.LinearLayout;
import android.widget.TextView;
+import androidx.fragment.app.Fragment;
+
import com.google.android.car.kitchensink.R;
/**
diff --git a/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/hvac/HvacTestFragment.java b/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/hvac/HvacTestFragment.java
index a1f8e1d..0b83f73 100644
--- a/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/hvac/HvacTestFragment.java
+++ b/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/hvac/HvacTestFragment.java
@@ -25,7 +25,6 @@
import android.hardware.automotive.vehicle.V2_0.VehicleAreaSeat;
import android.hardware.automotive.vehicle.V2_0.VehicleAreaWindow;
import android.os.Bundle;
-import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
@@ -36,6 +35,8 @@
import android.widget.TextView;
import android.widget.ToggleButton;
+import androidx.fragment.app.Fragment;
+
import com.google.android.car.kitchensink.KitchenSinkActivity;
import com.google.android.car.kitchensink.R;
diff --git a/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/input/InputTestFragment.java b/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/input/InputTestFragment.java
index 19ad094..5128816 100644
--- a/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/input/InputTestFragment.java
+++ b/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/input/InputTestFragment.java
@@ -36,7 +36,6 @@
import android.hardware.automotive.vehicle.V2_0.VehiclePropertyType;
import android.os.Bundle;
import android.os.RemoteException;
-import android.support.v4.app.Fragment;
import android.text.method.ScrollingMovementMethod;
import android.util.Log;
import android.view.KeyEvent;
@@ -48,6 +47,8 @@
import android.widget.TextView;
import android.widget.Toast;
+import androidx.fragment.app.Fragment;
+
import com.android.car.keventreader.EventReaderService;
import com.android.car.keventreader.IEventCallback;
import com.android.car.keventreader.KeypressEvent;
diff --git a/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/job/JobSchedulerFragment.java b/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/job/JobSchedulerFragment.java
index 3cf96e4..b82818f 100644
--- a/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/job/JobSchedulerFragment.java
+++ b/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/job/JobSchedulerFragment.java
@@ -22,8 +22,6 @@
import android.content.SharedPreferences;
import android.os.Bundle;
import android.os.PersistableBundle;
-import android.support.annotation.Nullable;
-import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
@@ -35,6 +33,9 @@
import android.widget.TextView;
import android.widget.Toast;
+import androidx.annotation.Nullable;
+import androidx.fragment.app.Fragment;
+
import com.google.android.car.kitchensink.R;
import java.util.List;
diff --git a/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/notification/NotificationFragment.java b/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/notification/NotificationFragment.java
index 5f88259..7a26f93 100644
--- a/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/notification/NotificationFragment.java
+++ b/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/notification/NotificationFragment.java
@@ -12,12 +12,13 @@
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
-import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
+import androidx.fragment.app.Fragment;
+
import com.google.android.car.kitchensink.KitchenSinkActivity;
import com.google.android.car.kitchensink.R;
diff --git a/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/orientation/OrientationTestFragment.java b/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/orientation/OrientationTestFragment.java
index ef49ae4..b81104b 100644
--- a/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/orientation/OrientationTestFragment.java
+++ b/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/orientation/OrientationTestFragment.java
@@ -18,13 +18,14 @@
import android.content.Intent;
import android.os.Bundle;
-import android.support.annotation.Nullable;
-import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
+import androidx.annotation.Nullable;
+import androidx.fragment.app.Fragment;
+
import com.google.android.car.kitchensink.R;
public class OrientationTestFragment extends Fragment {
diff --git a/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/power/PowerTestFragment.java b/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/power/PowerTestFragment.java
index fed1fbd..e9c82a3 100644
--- a/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/power/PowerTestFragment.java
+++ b/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/power/PowerTestFragment.java
@@ -22,7 +22,6 @@
import android.os.Bundle;
import android.os.PowerManager;
import android.os.SystemClock;
-import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
@@ -30,6 +29,8 @@
import android.widget.Button;
import android.widget.TextView;
+import androidx.fragment.app.Fragment;
+
import com.google.android.car.kitchensink.KitchenSinkActivity;
import com.google.android.car.kitchensink.R;
diff --git a/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/property/PropertyTestFragment.java b/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/property/PropertyTestFragment.java
index fc6621a..57a1785 100644
--- a/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/property/PropertyTestFragment.java
+++ b/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/property/PropertyTestFragment.java
@@ -26,7 +26,6 @@
import android.hardware.automotive.vehicle.V2_0.VehicleProperty;
import android.hardware.automotive.vehicle.V2_0.VehiclePropertyType;
import android.os.Bundle;
-import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
@@ -42,6 +41,8 @@
import android.widget.TextView;
import android.widget.Toast;
+import androidx.fragment.app.Fragment;
+
import com.google.android.car.kitchensink.KitchenSinkActivity;
import com.google.android.car.kitchensink.R;
@@ -74,7 +75,7 @@
@Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.property, container, false);
- mActivity = (KitchenSinkActivity) getHost();
+ mActivity = (KitchenSinkActivity) getActivity();
mMgr = mActivity.getPropertyManager();
// Get resource IDs
diff --git a/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/sensor/SensorsTestFragment.java b/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/sensor/SensorsTestFragment.java
index a6cc5ac..dea1639 100644
--- a/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/sensor/SensorsTestFragment.java
+++ b/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/sensor/SensorsTestFragment.java
@@ -28,7 +28,6 @@
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.os.Handler;
-import android.support.v4.app.Fragment;
import android.text.TextUtils;
import android.util.Log;
import android.view.LayoutInflater;
@@ -36,6 +35,8 @@
import android.view.ViewGroup;
import android.widget.TextView;
+import androidx.fragment.app.Fragment;
+
import com.google.android.car.kitchensink.KitchenSinkActivity;
import com.google.android.car.kitchensink.R;
@@ -291,6 +292,9 @@
case CarSensorManager.SENSOR_TYPE_EV_BATTERY_CHARGE_RATE:
summary.add(getEvChargeRate(event));
break;
+ case CarSensorManager.SENSOR_TYPE_ENGINE_OIL_LEVEL:
+ summary.add(getEngineOilLevel(event));
+ break;
default:
// Should never happen.
Log.w(TAG, "Unrecognized event type: " + toHexString(i));
@@ -367,4 +371,14 @@
return getContext().getString(R.string.sensor_ev_charge_rate, getTimestamp(event),
evChargeRate);
}
+
+ private String getEngineOilLevel(CarSensorEvent event) {
+ String engineOilLevel = mNaString;
+ if(event != null) {
+ engineOilLevel = String.valueOf(event.getCarEngineOilLevelData(null).engineOilLevel);
+ }
+ return getContext().getString(R.string.sensor_oil_level, getTimestamp(event),
+ engineOilLevel);
+
+ }
}
diff --git a/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/setting/GarageModeSettingsFragment.java b/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/setting/GarageModeSettingsFragment.java
index 4ace656..df191b8 100644
--- a/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/setting/GarageModeSettingsFragment.java
+++ b/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/setting/GarageModeSettingsFragment.java
@@ -15,13 +15,6 @@
*/
package com.google.android.car.kitchensink.setting;
-import static android.car.settings.CarSettings.Global.KEY_GARAGE_MODE_ENABLED;
-import static android.car.settings.CarSettings.Global.KEY_GARAGE_MODE_MAINTENANCE_WINDOW;
-import static android.car.settings.CarSettings.Global.KEY_GARAGE_MODE_WAKE_UP_TIME;
-import static android.car.settings.GarageModeSettingsObserver.GARAGE_MODE_ENABLED_URI;
-import static android.car.settings.GarageModeSettingsObserver.GARAGE_MODE_MAINTENANCE_WINDOW_URI;
-import static android.car.settings.GarageModeSettingsObserver.GARAGE_MODE_WAKE_UP_TIME_URI;
-
import android.app.TimePickerDialog;
import android.car.CarApiUtil;
import android.car.settings.GarageModeSettingsObserver;
@@ -40,6 +33,13 @@
import java.sql.Time;
+import static android.car.settings.CarSettings.Global.KEY_GARAGE_MODE_MAINTENANCE_WINDOW;
+import static android.car.settings.CarSettings.Global.KEY_GARAGE_MODE_ENABLED;
+import static android.car.settings.CarSettings.Global.KEY_GARAGE_MODE_WAKE_UP_TIME;
+import static android.car.settings.GarageModeSettingsObserver.GARAGE_MODE_ENABLED_URI;
+import static android.car.settings.GarageModeSettingsObserver.GARAGE_MODE_WAKE_UP_TIME_URI;
+import static android.car.settings.GarageModeSettingsObserver.GARAGE_MODE_MAINTENANCE_WINDOW_URI;
+
public class GarageModeSettingsFragment extends PreferenceFragment implements
TimePickerDialog.OnTimeSetListener, Preference.OnPreferenceChangeListener {
diff --git a/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/storagelifetime/StorageLifetimeFragment.java b/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/storagelifetime/StorageLifetimeFragment.java
index fc4052e..bf7af5d 100644
--- a/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/storagelifetime/StorageLifetimeFragment.java
+++ b/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/storagelifetime/StorageLifetimeFragment.java
@@ -27,7 +27,6 @@
import android.car.storagemonitoring.IoStatsEntry;
import android.os.Bundle;
import android.os.StatFs;
-import android.support.v4.app.Fragment;
import android.system.ErrnoException;
import android.util.Log;
import android.view.LayoutInflater;
@@ -37,6 +36,8 @@
import android.widget.ListView;
import android.widget.TextView;
+import androidx.fragment.app.Fragment;
+
import com.google.android.car.kitchensink.KitchenSinkActivity;
import com.google.android.car.kitchensink.R;
diff --git a/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/touch/TouchTestFragment.java b/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/touch/TouchTestFragment.java
index fe2c385..2cb0a64 100644
--- a/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/touch/TouchTestFragment.java
+++ b/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/touch/TouchTestFragment.java
@@ -17,11 +17,12 @@
package com.google.android.car.kitchensink.touch;
import android.os.Bundle;
-import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
+import androidx.fragment.app.Fragment;
+
import com.google.android.car.kitchensink.R;
public class TouchTestFragment extends Fragment {
diff --git a/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/vhal/VehicleHalFragment.java b/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/vhal/VehicleHalFragment.java
index ac62505..c5998c9 100644
--- a/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/vhal/VehicleHalFragment.java
+++ b/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/vhal/VehicleHalFragment.java
@@ -17,23 +17,26 @@
import android.annotation.Nullable;
import android.app.AlertDialog;
-import android.content.DialogInterface;
-import android.content.DialogInterface.OnClickListener;
+import android.content.Context;
import android.hardware.automotive.vehicle.V2_0.IVehicle;
+import android.hardware.automotive.vehicle.V2_0.StatusCode;
import android.hardware.automotive.vehicle.V2_0.VehiclePropConfig;
+import android.hardware.automotive.vehicle.V2_0.VehiclePropValue;
import android.hardware.automotive.vehicle.V2_0.VehicleProperty;
import android.os.Bundle;
import android.os.RemoteException;
-import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
-import android.widget.AdapterView;
-import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
+import android.widget.Button;
+import android.widget.LinearLayout;
import android.widget.ListView;
+import android.widget.TextView;
+import androidx.fragment.app.Fragment;
+
import com.google.android.car.kitchensink.KitchenSinkActivity;
import com.google.android.car.kitchensink.R;
@@ -42,28 +45,12 @@
import java.util.stream.Collectors;
public class VehicleHalFragment extends Fragment {
+
private static final String TAG = "CAR.VEHICLEHAL.KS";
private KitchenSinkActivity mActivity;
private ListView mListView;
- private final OnClickListener mNopOnClickListener = new OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) { }
- };
-
- private final OnItemClickListener mOnClickListener = new OnItemClickListener() {
- @Override
- public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
- HalPropertyInfo entry = (HalPropertyInfo)parent.getItemAtPosition(position);
- AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
- builder.setTitle("Info for " + entry.name)
- .setPositiveButton(android.R.string.yes, mNopOnClickListener)
- .setMessage(entry.config.toString())
- .show();
- }
- };
-
@Nullable
@Override
public View onCreateView(LayoutInflater inflater,
@@ -72,8 +59,6 @@
View view = inflater.inflate(R.layout.vhal, container, false);
mActivity = (KitchenSinkActivity) getHost();
mListView = view.findViewById(R.id.hal_prop_list);
- mListView.setOnItemClickListener(mOnClickListener);
-
return view;
}
@@ -102,12 +87,11 @@
.sorted()
.collect(Collectors.toList());
- mListView.setAdapter(new ArrayAdapter<HalPropertyInfo>(mActivity,
- android.R.layout.simple_list_item_1,
- supportedProperties));
+ mListView.setAdapter(new ListAdapter(mActivity, vehicle, supportedProperties));
}
private static class HalPropertyInfo implements Comparable<HalPropertyInfo> {
+
public final int id;
public final String name;
public final VehiclePropConfig config;
@@ -125,10 +109,7 @@
@Override
public boolean equals(Object other) {
- if (other instanceof HalPropertyInfo) {
- return ((HalPropertyInfo)other).id == id;
- }
- return false;
+ return other instanceof HalPropertyInfo && ((HalPropertyInfo) other).id == id;
}
@Override
@@ -140,5 +121,79 @@
public int compareTo(HalPropertyInfo halPropertyInfo) {
return name.compareTo(halPropertyInfo.name);
}
+
+ public String getValue(IVehicle vehicle) {
+ String result[] = new String[] {"<unknown>"};
+
+ try {
+ VehiclePropValue request = new VehiclePropValue();
+ // TODO: add zones support
+ request.prop = id;
+
+ // NB: this call is synchronous
+ vehicle.get(request, (status, propValue) -> {
+ if (status == StatusCode.OK) {
+ result[0] = propValue.value.toString();
+ }
+ });
+ } catch (android.os.RemoteException e) {
+ Log.e(TAG, "unable to read property " + name, e);
+ }
+
+ return result[0];
+ }
+ }
+
+ private static final class ListAdapter extends ArrayAdapter<HalPropertyInfo> {
+ private static final int RESOURCE_ID = R.layout.vhal_listitem;
+
+ // cannot use superclass' LayoutInflater as it is private
+ private final LayoutInflater mLayoutInflater;
+ private final IVehicle mVehicle;
+
+ ListAdapter(Context context, IVehicle vehicle, List<HalPropertyInfo> properties) {
+ super(context, RESOURCE_ID, properties);
+ mVehicle = vehicle;
+ mLayoutInflater = LayoutInflater.from(context);
+ }
+
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ final HalPropertyInfo item = getItem(position);
+
+ final LinearLayout viewLayout;
+ if (convertView != null && convertView instanceof LinearLayout) {
+ viewLayout = (LinearLayout)convertView;
+ } else {
+ // this is the value used by the superclass's view inflater
+ final boolean attachToRoot = false;
+
+ viewLayout =
+ (LinearLayout)mLayoutInflater.inflate(RESOURCE_ID, parent, attachToRoot);
+ }
+
+ TextView textString = viewLayout.findViewById(R.id.textString);
+ Button infoButton = viewLayout.findViewById(R.id.infoButton);
+ Button valueButton = viewLayout.findViewById(R.id.valueButton);
+
+ infoButton.setOnClickListener(btn -> {
+ AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
+ builder.setTitle("Configuration for " + item.name)
+ .setPositiveButton(android.R.string.yes, (x, y) -> { })
+ .setMessage(item.config.toString())
+ .show();
+ });
+
+ valueButton.setOnClickListener(btn -> {
+ AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
+ builder.setTitle("Value for " + item.name)
+ .setPositiveButton(android.R.string.yes, (x, y) -> { })
+ .setMessage(item.getValue(mVehicle))
+ .show();
+ });
+
+ textString.setText(item.toString());
+ return viewLayout;
+ }
}
}
diff --git a/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/volume/VolumeTestFragment.java b/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/volume/VolumeTestFragment.java
index 800d650..066f46a 100644
--- a/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/volume/VolumeTestFragment.java
+++ b/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/volume/VolumeTestFragment.java
@@ -26,8 +26,6 @@
import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
-import android.support.annotation.Nullable;
-import android.support.v4.app.Fragment;
import android.util.Log;
import android.util.SparseIntArray;
import android.view.LayoutInflater;
@@ -36,6 +34,9 @@
import android.widget.ListView;
import android.widget.SeekBar;
+import androidx.annotation.Nullable;
+import androidx.fragment.app.Fragment;
+
import com.google.android.car.kitchensink.R;
public class VolumeTestFragment extends Fragment {
diff --git a/tests/vehiclehal_test/assets/car_info_test.json b/tests/vehiclehal_test/assets/car_info_test.json
new file mode 100644
index 0000000..90c9bdc
--- /dev/null
+++ b/tests/vehiclehal_test/assets/car_info_test.json
@@ -0,0 +1,20 @@
+[
+ {
+ "timestamp": 1526063903356950016,
+ "areaId": 0,
+ "value": 15000,
+ "prop": 291504388
+ },
+ {
+ "timestamp": 1526063903358950016,
+ "areaId": 0,
+ "value": 150000,
+ "prop": 291504390
+ },
+ {
+ "timestamp": 1526063903360950016,
+ "areaId": 0,
+ "value": "Test Car",
+ "prop": 286261505
+ }
+]
diff --git a/tests/vehiclehal_test/src/com/android/car/vehiclehal/test/CarHvacTest.java b/tests/vehiclehal_test/src/com/android/car/vehiclehal/test/CarHvacTest.java
deleted file mode 100644
index 08544bd..0000000
--- a/tests/vehiclehal_test/src/com/android/car/vehiclehal/test/CarHvacTest.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * 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.vehiclehal.test;
-
-import static org.junit.Assert.assertTrue;
-
-import static java.lang.Integer.toHexString;
-
-import android.car.Car;
-import android.car.hardware.CarPropertyConfig;
-import android.car.hardware.CarPropertyValue;
-import android.car.hardware.hvac.CarHvacManager;
-import android.car.hardware.hvac.CarHvacManager.CarHvacEventCallback;
-import android.hardware.automotive.vehicle.V2_0.VehiclePropValue;
-import android.hardware.automotive.vehicle.V2_0.VehicleProperty;
-import android.support.test.filters.LargeTest;
-import android.support.test.runner.AndroidJUnit4;
-import android.util.ArraySet;
-import android.util.Log;
-
-import org.junit.Assert;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import java.io.File;
-import java.time.Duration;
-import java.util.Set;
-
-
-/**
- * The test suite will execute end-to-end Car HVAC API test by generating HVAC property data from
- * default VHAL and verify those data on the fly. The test data is coming from assets/ folder in the
- * test APK and will be shared with VHAL to execute the test.
- */
-@RunWith(AndroidJUnit4.class)
-@LargeTest
-public class CarHvacTest extends E2eCarTestBase {
- private static final String TAG = Utils.concatTag(CarHvacTest.class);
-
- // Test should be completed within 1 hour as it only covers a finite set of HVAC properties
- private static final Duration TEST_TIME_OUT = Duration.ofHours(1);
-
- private static final String CAR_HVAC_TEST_JSON = "car_hvac_test.json";
-
- // Referred to hardware/interfaces/automotive/vehicle/2.0/types.hal, some of the HVAC properties
- // are in CONTINUOUS mode. They should be omitted when testing ON_CHANGE properties.
- private static final Set<Integer> CONTINUOUS_HVAC_PROPS;
-
- private Integer mNumPropEventsToSkip;
-
- static {
- CONTINUOUS_HVAC_PROPS = new ArraySet<>();
- CONTINUOUS_HVAC_PROPS.add(VehicleProperty.ENV_OUTSIDE_TEMPERATURE);
- }
-
-
- private class CarHvacOnChangeEventListener implements CarHvacEventCallback {
- private VhalEventVerifier mVerifier;
-
- CarHvacOnChangeEventListener(VhalEventVerifier verifier) {
- mVerifier = verifier;
- }
-
- @Override
- public void onChangeEvent(CarPropertyValue carPropertyValue) {
- VehiclePropValue event = Utils.fromHvacPropertyValue(carPropertyValue);
- if (!CONTINUOUS_HVAC_PROPS.contains(event.prop)) {
- synchronized (mNumPropEventsToSkip) {
- if (mNumPropEventsToSkip == 0) {
- mVerifier.verify(Utils.fromHvacPropertyValue(carPropertyValue));
- } else {
- mNumPropEventsToSkip--;
- }
- }
- }
- }
-
- @Override
- public void onErrorEvent(final int propertyId, final int zone) {
- Assert.fail("Error: propertyId=" + toHexString(propertyId) + " zone=" + zone);
- }
- }
-
- private Integer calculateNumPropEventsToSkip(CarHvacManager hvacMgr) {
- int numToSkip = 0;
- try {
- for (CarPropertyConfig c: hvacMgr.getPropertyList()) {
- if (!CONTINUOUS_HVAC_PROPS.contains(c.getPropertyId())) {
- numToSkip += c.getAreaCount();
- }
- }
- } catch (Exception e) {
- Log.d(TAG, "Unhandled exception thrown: ", e);
- }
- return Integer.valueOf(numToSkip);
- }
- @Test
- public void testHvacOperations() throws Exception {
- Log.d(TAG, "Prepare HVAC test data");
- VhalEventVerifier verifier = new VhalEventVerifier(getExpectedEvents(CAR_HVAC_TEST_JSON));
- File sharedJson = makeShareable(CAR_HVAC_TEST_JSON);
-
- Log.d(TAG, "Start listening to the HAL");
- CarHvacManager hvacMgr = (CarHvacManager) mCar.getCarManager(Car.HVAC_SERVICE);
- // Calculate number of properties to skip due to registration event
- mNumPropEventsToSkip = calculateNumPropEventsToSkip(hvacMgr);
- CarHvacEventCallback callback = new CarHvacOnChangeEventListener(verifier);
- hvacMgr.registerCallback(callback);
-
- Log.d(TAG, "Send command to VHAL to start generation");
- VhalEventGenerator hvacGenerator =
- new JsonVhalEventGenerator(mVehicle).setJsonFile(sharedJson);
- hvacGenerator.start();
-
- Log.d(TAG, "Receiving and verifying VHAL events");
- verifier.waitForEnd(TEST_TIME_OUT.toMillis());
-
- Log.d(TAG, "Send command to VHAL to stop generation");
- hvacGenerator.stop();
- hvacMgr.unregisterCallback(callback);
-
- assertTrue("Detected mismatched events: " + verifier.getResultString(),
- verifier.getMismatchedEvents().isEmpty());
- }
-}
diff --git a/tests/vehiclehal_test/src/com/android/car/vehiclehal/test/CarPropertyTest.java b/tests/vehiclehal_test/src/com/android/car/vehiclehal/test/CarPropertyTest.java
new file mode 100644
index 0000000..27579bd
--- /dev/null
+++ b/tests/vehiclehal_test/src/com/android/car/vehiclehal/test/CarPropertyTest.java
@@ -0,0 +1,206 @@
+/*
+ * 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.vehiclehal.test;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import static java.lang.Integer.toHexString;
+
+import android.car.Car;
+import android.car.hardware.CarPropertyConfig;
+import android.car.hardware.CarPropertyValue;
+import android.car.hardware.property.CarPropertyManager;
+import android.support.test.filters.LargeTest;
+import android.support.test.runner.AndroidJUnit4;
+import android.util.ArraySet;
+import android.util.Log;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.io.File;
+import java.time.Duration;
+import java.util.List;
+
+/**
+ * The test suite will execute end-to-end Car Property API test by generating VHAL property data
+ * from default VHAL and verify those data on the fly. The test data is coming from assets/ folder
+ * in the test APK and will be shared with VHAL to execute the test.
+ */
+@RunWith(AndroidJUnit4.class)
+@LargeTest
+public class CarPropertyTest extends E2eCarTestBase {
+
+ private static final String TAG = Utils.concatTag(CarPropertyTest.class);
+
+ // Test should be completed within 10 minutes as it only covers a finite set of properties
+ private static final Duration TEST_TIME_OUT = Duration.ofMinutes(10);
+
+ private static final String CAR_HVAC_TEST_JSON = "car_hvac_test.json";
+ private static final String CAR_INFO_TEST_JSON = "car_info_test.json";
+
+ private class CarPropertyEventReceiver implements
+ CarPropertyManager.CarPropertyEventListener {
+
+ private VhalEventVerifier mVerifier;
+ private Integer mNumOfEventToSkip;
+
+ CarPropertyEventReceiver(VhalEventVerifier verifier, int numOfEventToSkip) {
+ mVerifier = verifier;
+ mNumOfEventToSkip = numOfEventToSkip;
+ }
+
+ @Override
+ public void onChangeEvent(CarPropertyValue carPropertyValue) {
+ Log.d(TAG, "Received event: " + carPropertyValue);
+ synchronized (mNumOfEventToSkip) {
+ if (mNumOfEventToSkip > 0) {
+ mNumOfEventToSkip--;
+ return;
+ }
+ }
+ mVerifier.verify(carPropertyValue);
+ }
+
+ @Override
+ public void onErrorEvent(final int propertyId, final int zone) {
+ Assert.fail("Error: propertyId=" + toHexString(propertyId) + " zone=" + zone);
+ }
+ }
+
+ private int countNumPropEventsToSkip(CarPropertyManager propMgr, ArraySet<Integer> props) {
+ int numToSkip = 0;
+ for (CarPropertyConfig c : propMgr.getPropertyList(props)) {
+ numToSkip += c.getAreaCount();
+ }
+ return numToSkip;
+ }
+
+ /**
+ * This test will let Default VHAL to generate HVAC data and verify on-the-fly in the test. It
+ * is simulating the HVAC actions coming from hard buttons in a car.
+ * @throws Exception
+ */
+ @Test
+ public void testHvacHardButtonOperations() throws Exception {
+ Log.d(TAG, "Prepare HVAC test data");
+ List<CarPropertyValue> expectedEvents = getExpectedEvents(CAR_HVAC_TEST_JSON);
+ VhalEventVerifier verifier = new VhalEventVerifier(expectedEvents);
+
+ CarPropertyManager propMgr = (CarPropertyManager) mCar.getCarManager(Car.PROPERTY_SERVICE);
+ assertNotNull("CarPropertyManager is null", propMgr);
+
+ ArraySet<Integer> props = new ArraySet<>();
+ for (CarPropertyValue event : expectedEvents) {
+ if (!props.contains(event.getPropertyId())) {
+ props.add(event.getPropertyId());
+ }
+ }
+
+ int numToSkip = countNumPropEventsToSkip(propMgr, props);
+ Log.d(TAG, String.format("Start listening to the HAL."
+ + " Skipping %d events for listener registration", numToSkip));
+ CarPropertyManager.CarPropertyEventListener receiver =
+ new CarPropertyEventReceiver(verifier, numToSkip);
+ for (Integer prop : props) {
+ propMgr.registerListener(receiver, prop, 0);
+ }
+
+ File sharedJson = makeShareable(CAR_HVAC_TEST_JSON);
+ Log.d(TAG, "Send command to VHAL to start generation");
+ VhalEventGenerator hvacGenerator =
+ new JsonVhalEventGenerator(mVehicle).setJsonFile(sharedJson);
+ hvacGenerator.start();
+
+ Log.d(TAG, "Receiving and verifying VHAL events");
+ verifier.waitForEnd(TEST_TIME_OUT.toMillis());
+
+ Log.d(TAG, "Send command to VHAL to stop generation");
+ hvacGenerator.stop();
+ propMgr.unregisterListener(receiver);
+
+ assertTrue("Detected mismatched events: " + verifier.getResultString(),
+ verifier.getMismatchedEvents().isEmpty());
+ }
+
+ /**
+ * This test will exercise on "set" calls to inject HVAC data in order to test the Car Property
+ * API end-to-end functionality.
+ * @throws Exception
+ */
+ @Test
+ @SuppressWarnings("unchecked")
+ public void testHvacSetGetOperations() throws Exception {
+ Log.d(TAG, "Prepare HVAC test data");
+ List<CarPropertyValue> expectedEvents = getExpectedEvents(CAR_HVAC_TEST_JSON);
+
+ CarPropertyManager propMgr = (CarPropertyManager) mCar.getCarManager(Car.PROPERTY_SERVICE);
+ assertNotNull("CarPropertyManager is null", propMgr);
+
+ final long waitForSetMillisecond = 2;
+ for (CarPropertyValue expectedEvent : expectedEvents) {
+ Class valueClass = expectedEvent.getValue().getClass();
+ propMgr.setProperty(valueClass,
+ expectedEvent.getPropertyId(),
+ expectedEvent.getAreaId(),
+ expectedEvent.getValue());
+
+ Thread.sleep(waitForSetMillisecond);
+ CarPropertyValue receivedEvent = propMgr.getProperty(valueClass,
+ expectedEvent.getPropertyId(), expectedEvent.getAreaId());
+ assertTrue("Mismatched events, expected: " + expectedEvent + ", received: "
+ + receivedEvent, Utils.areCarPropertyValuesEqual(expectedEvent, receivedEvent));
+ }
+ }
+
+ /**
+ * This test will load static vehicle information from test data file and verify them through
+ * get calls.
+ * @throws Exception
+ */
+ @Test
+ public void testStaticInfoOperations() throws Exception {
+ Log.d(TAG, "Prepare static car information");
+
+ List<CarPropertyValue> expectedEvents = getExpectedEvents(CAR_INFO_TEST_JSON);
+ CarPropertyManager propMgr = (CarPropertyManager) mCar.getCarManager(Car.PROPERTY_SERVICE);
+ assertNotNull("CarPropertyManager is null", propMgr);
+
+ File sharedJson = makeShareable(CAR_INFO_TEST_JSON);
+ Log.d(TAG, "Send command to VHAL to start generation");
+ VhalEventGenerator infoGenerator =
+ new JsonVhalEventGenerator(mVehicle).setJsonFile(sharedJson);
+ infoGenerator.start();
+
+ // Wait for some time to ensure information is all loaded
+ // It is assuming the test data is not very large
+ Thread.sleep(2000);
+
+ Log.d(TAG, "Send command to VHAL to stop generation");
+ infoGenerator.stop();
+
+ for (CarPropertyValue expectedEvent : expectedEvents) {
+ CarPropertyValue actualEvent = propMgr.getProperty(
+ expectedEvent.getPropertyId(), expectedEvent.getAreaId());
+ assertTrue(String.format(
+ "Mismatched car information data, actual: %s, expected: %s",
+ actualEvent, expectedEvent),
+ Utils.areCarPropertyValuesEqual(actualEvent, expectedEvent));
+ }
+ }
+}
diff --git a/tests/vehiclehal_test/src/com/android/car/vehiclehal/test/E2eCarTestBase.java b/tests/vehiclehal_test/src/com/android/car/vehiclehal/test/E2eCarTestBase.java
index 5960422..9485d80 100644
--- a/tests/vehiclehal_test/src/com/android/car/vehiclehal/test/E2eCarTestBase.java
+++ b/tests/vehiclehal_test/src/com/android/car/vehiclehal/test/E2eCarTestBase.java
@@ -19,12 +19,12 @@
import static org.junit.Assume.assumeTrue;
import android.car.Car;
+import android.car.hardware.CarPropertyValue;
import android.content.ComponentName;
import android.content.Context;
import android.content.ServiceConnection;
import android.hardware.automotive.vehicle.V2_0.IVehicle;
import android.hardware.automotive.vehicle.V2_0.StatusCode;
-import android.hardware.automotive.vehicle.V2_0.VehiclePropValue;
import android.os.ConditionVariable;
import android.os.FileUtils;
import android.os.IBinder;
@@ -82,7 +82,7 @@
}
}
- protected List<VehiclePropValue> getExpectedEvents(String fileName)
+ protected List<CarPropertyValue> getExpectedEvents(String fileName)
throws IOException, JSONException {
try (InputStream in = mContext.getAssets().open(fileName)) {
Log.d(TAG, "Reading golden test data" + fileName);
diff --git a/tests/vehiclehal_test/src/com/android/car/vehiclehal/test/JsonVhalEventGenerator.java b/tests/vehiclehal_test/src/com/android/car/vehiclehal/test/JsonVhalEventGenerator.java
index 702f5f0..4560b8c 100644
--- a/tests/vehiclehal_test/src/com/android/car/vehiclehal/test/JsonVhalEventGenerator.java
+++ b/tests/vehiclehal_test/src/com/android/car/vehiclehal/test/JsonVhalEventGenerator.java
@@ -28,6 +28,9 @@
class JsonVhalEventGenerator implements VhalEventGenerator {
+ // Exactly one iteration is required for JSON-based end-to-end test
+ private static final int NUM_OF_ITERATION = 1;
+
private IVehicle mVehicle;
private File mFile;
@@ -47,7 +50,7 @@
public void start() throws RemoteException {
VehiclePropValue request =
VehiclePropValueBuilder.newBuilder(GENERATE_FAKE_DATA_CONTROLLING_PROPERTY)
- .addIntValue(CMD_START_JSON)
+ .addIntValue(CMD_START_JSON, NUM_OF_ITERATION)
.setStringValue(mFile.getAbsolutePath())
.build();
assertEquals(StatusCode.OK, mVehicle.set(request));
@@ -58,6 +61,7 @@
VehiclePropValue request =
VehiclePropValueBuilder.newBuilder(GENERATE_FAKE_DATA_CONTROLLING_PROPERTY)
.addIntValue(CMD_STOP_JSON)
+ .setStringValue(mFile.getAbsolutePath())
.build();
assertEquals(StatusCode.OK, mVehicle.set(request));
}
diff --git a/tests/vehiclehal_test/src/com/android/car/vehiclehal/test/Utils.java b/tests/vehiclehal_test/src/com/android/car/vehiclehal/test/Utils.java
index 6a4b496..496b504 100644
--- a/tests/vehiclehal_test/src/com/android/car/vehiclehal/test/Utils.java
+++ b/tests/vehiclehal_test/src/com/android/car/vehiclehal/test/Utils.java
@@ -16,13 +16,10 @@
package com.android.car.vehiclehal.test;
-import static java.lang.Integer.toHexString;
-
import android.car.hardware.CarPropertyValue;
import android.hardware.automotive.vehicle.V2_0.IVehicle;
import android.hardware.automotive.vehicle.V2_0.VehiclePropConfig;
import android.hardware.automotive.vehicle.V2_0.VehiclePropValue;
-import android.os.HidlSupport;
import android.os.RemoteException;
import android.util.Log;
@@ -102,55 +99,13 @@
* @param value2
* @return true if equal
*/
- static boolean areVehiclePropValuesEqual(final VehiclePropValue value1,
- final VehiclePropValue value2) {
+ static boolean areCarPropertyValuesEqual(final CarPropertyValue value1,
+ final CarPropertyValue value2) {
return value1 == value2
|| value1 != null
&& value2 != null
- && value1.prop == value2.prop
- && value1.areaId == value2.areaId
- && HidlSupport.deepEquals(value1.value, value2.value);
- }
-
- /**
- * The method will convert prop ID to hexadecimal format, and omit timestamp and status
- *
- * @param value
- * @return String
- */
- static String vehiclePropValueToString(final VehiclePropValue value) {
- return "{.prop = 0x" + toHexString(value.prop)
- + ", .areaId = " + value.areaId
- + ", .value = " + value.value + "}";
- }
-
- static VehiclePropValue fromHvacPropertyValue(CarPropertyValue value) {
- VehiclePropValueBuilder builder =
- VehiclePropValueBuilder.newBuilder(
- VhalPropMaps.getHvacVhalProp(value.getPropertyId()));
- return fromCarPropertyValue(value, builder);
- }
-
- private static VehiclePropValue fromCarPropertyValue(
- CarPropertyValue value, VehiclePropValueBuilder builder) {
- builder.setAreaId(value.getAreaId()).setTimestamp(value.getTimestamp());
-
- //TODO: Consider move this conversion to VehiclePropValueBuilder
- Object o = value.getValue();
- if (o instanceof Boolean) {
- builder.addIntValue((boolean) o ? 1 : 0);
- } else if (o instanceof Integer) {
- builder.addIntValue((int) o);
- } else if (o instanceof Float) {
- builder.addFloatValue((float) o);
- } else if (o instanceof Long) {
- builder.setInt64Value((long) o);
- } else if (o instanceof String) {
- builder.setStringValue((String) o);
- } else { //TODO: Add support for MIXED type
- throw new IllegalArgumentException("Unrecognized car property value type, "
- + o.getClass());
- }
- return builder.build();
+ && value1.getPropertyId() == value2.getPropertyId()
+ && value1.getAreaId() == value2.getAreaId()
+ && value1.getValue().equals(value2.getValue());
}
}
diff --git a/tests/vehiclehal_test/src/com/android/car/vehiclehal/test/VhalEventVerifier.java b/tests/vehiclehal_test/src/com/android/car/vehiclehal/test/VhalEventVerifier.java
index 5ac92ca..62dbf5c 100644
--- a/tests/vehiclehal_test/src/com/android/car/vehiclehal/test/VhalEventVerifier.java
+++ b/tests/vehiclehal_test/src/com/android/car/vehiclehal/test/VhalEventVerifier.java
@@ -15,7 +15,7 @@
*/
package com.android.car.vehiclehal.test;
-import android.hardware.automotive.vehicle.V2_0.VehiclePropValue;
+import android.car.hardware.CarPropertyValue;
import android.os.ConditionVariable;
import java.util.ArrayList;
@@ -28,7 +28,7 @@
* The verifier will provide formatted result for all mismatched events in sequence.
*/
class VhalEventVerifier {
- private List<VehiclePropValue> mExpectedEvents;
+ private List<CarPropertyValue> mExpectedEvents;
// A pointer to keep track of the next expected event in the list
private int mIdx;
private List<MismatchedEventPair> mMismatchedEvents;
@@ -37,10 +37,10 @@
static class MismatchedEventPair {
public final int idx;
- public final VehiclePropValue expectedEvent;
- public final VehiclePropValue mismatchedEvent;
+ public final CarPropertyValue expectedEvent;
+ public final CarPropertyValue mismatchedEvent;
- MismatchedEventPair(VehiclePropValue expectedEvent, VehiclePropValue mismatchedEvent,
+ MismatchedEventPair(CarPropertyValue expectedEvent, CarPropertyValue mismatchedEvent,
int idx) {
this.idx = idx;
this.expectedEvent = expectedEvent;
@@ -48,7 +48,7 @@
}
}
- VhalEventVerifier(List<VehiclePropValue> expectedEvents) {
+ VhalEventVerifier(List<CarPropertyValue> expectedEvents) {
mExpectedEvents = expectedEvents;
mIdx = 0;
mMismatchedEvents = new ArrayList<>();
@@ -62,12 +62,12 @@
*
* @param nextEvent to be verified
*/
- public void verify(VehiclePropValue nextEvent) {
+ public void verify(CarPropertyValue nextEvent) {
if (mIdx >= mExpectedEvents.size()) {
return;
}
- VehiclePropValue expectedEvent = mExpectedEvents.get(mIdx);
- if (!Utils.areVehiclePropValuesEqual(expectedEvent, nextEvent)) {
+ CarPropertyValue expectedEvent = mExpectedEvents.get(mIdx);
+ if (!Utils.areCarPropertyValuesEqual(expectedEvent, nextEvent)) {
mMismatchedEvents.add(new MismatchedEventPair(expectedEvent, nextEvent, mIdx));
}
if (++mIdx == mExpectedEvents.size()) {
@@ -87,8 +87,8 @@
StringBuilder resultBuilder = new StringBuilder();
for (MismatchedEventPair pair : mMismatchedEvents) {
resultBuilder.append("Index " + pair.idx + ": Expected "
- + Utils.vehiclePropValueToString(pair.expectedEvent) + ", Received "
- + Utils.vehiclePropValueToString(pair.mismatchedEvent) + "\n");
+ + pair.expectedEvent + ", Received "
+ + pair.mismatchedEvent + "\n");
}
return resultBuilder.toString();
}
diff --git a/tests/vehiclehal_test/src/com/android/car/vehiclehal/test/VhalJsonReader.java b/tests/vehiclehal_test/src/com/android/car/vehiclehal/test/VhalJsonReader.java
index bf4e32f..01a62fc 100644
--- a/tests/vehiclehal_test/src/com/android/car/vehiclehal/test/VhalJsonReader.java
+++ b/tests/vehiclehal_test/src/com/android/car/vehiclehal/test/VhalJsonReader.java
@@ -17,10 +17,9 @@
import static java.lang.Integer.toHexString;
-import android.hardware.automotive.vehicle.V2_0.VehiclePropValue;
+import android.car.hardware.CarPropertyValue;
import android.hardware.automotive.vehicle.V2_0.VehiclePropertyType;
-import com.android.car.vehiclehal.VehiclePropValueBuilder;
import org.json.JSONArray;
import org.json.JSONException;
@@ -45,10 +44,10 @@
private static final String JSON_FIELD_TIMESTAMP = "timestamp";
private static final String JSON_FIELD_VALUE = "value";
- public static List<VehiclePropValue> readFromJson(InputStream in)
+ public static List<CarPropertyValue> readFromJson(InputStream in)
throws IOException, JSONException {
JSONArray rawEvents = new JSONArray(readJsonString(in));
- List<VehiclePropValue> events = new ArrayList<>();
+ List<CarPropertyValue> events = new ArrayList<>();
for (int i = 0; i < rawEvents.length(); i++) {
events.add(getEvent(rawEvents.getJSONObject(i)));
}
@@ -64,32 +63,33 @@
return builder.toString();
}
- private static VehiclePropValue getEvent(JSONObject rawEvent) throws JSONException {
+ private static CarPropertyValue<?> getEvent(JSONObject rawEvent) throws JSONException {
int prop = rawEvent.getInt(JSON_FIELD_PROP);
- VehiclePropValueBuilder builder = VehiclePropValueBuilder.newBuilder(prop)
- .setAreaId(rawEvent.getInt(JSON_FIELD_AREA_ID))
- .setTimestamp(rawEvent.getLong(JSON_FIELD_TIMESTAMP));
+ int areaId = rawEvent.getInt(JSON_FIELD_AREA_ID);
+ long timestamp = rawEvent.getLong(JSON_FIELD_TIMESTAMP);
switch (prop & VehiclePropertyType.MASK) {
case VehiclePropertyType.BOOLEAN:
+ return new CarPropertyValue<>(prop, areaId, CarPropertyValue.STATUS_AVAILABLE,
+ timestamp, rawEvent.getInt(JSON_FIELD_VALUE) != 0);
case VehiclePropertyType.INT32:
- builder.addIntValue(rawEvent.getInt(JSON_FIELD_VALUE));
- break;
+ return new CarPropertyValue<>(prop, areaId, CarPropertyValue.STATUS_AVAILABLE,
+ timestamp, rawEvent.getInt(JSON_FIELD_VALUE));
case VehiclePropertyType.INT64:
- builder.setInt64Value(rawEvent.getLong(JSON_FIELD_VALUE));
- break;
+ return new CarPropertyValue<>(prop, areaId, CarPropertyValue.STATUS_AVAILABLE,
+ timestamp, rawEvent.getLong(JSON_FIELD_VALUE));
case VehiclePropertyType.FLOAT:
- builder.addFloatValue((float) rawEvent.getDouble(JSON_FIELD_VALUE));
- break;
+ return new CarPropertyValue<>(prop, areaId,
+ CarPropertyValue.STATUS_AVAILABLE, timestamp,
+ (float) rawEvent.getDouble(JSON_FIELD_VALUE));
case VehiclePropertyType.STRING:
- builder.setStringValue(rawEvent.getString(JSON_FIELD_VALUE));
- break;
+ return new CarPropertyValue<>(prop, areaId, CarPropertyValue.STATUS_AVAILABLE,
+ timestamp, rawEvent.getString(JSON_FIELD_VALUE));
//TODO: Add VehiclePropertyType.MIXED type support
default:
throw new IllegalArgumentException("Property type 0x"
+ toHexString(prop & VehiclePropertyType.MASK)
+ " is not supported in the test.");
}
- return builder.build();
}
}
diff --git a/tests/vehiclehal_test/src/com/android/car/vehiclehal/test/VhalPropMaps.java b/tests/vehiclehal_test/src/com/android/car/vehiclehal/test/VhalPropMaps.java
deleted file mode 100644
index f24cad6..0000000
--- a/tests/vehiclehal_test/src/com/android/car/vehiclehal/test/VhalPropMaps.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * 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.vehiclehal.test;
-
-import android.car.hardware.hvac.CarHvacManager;
-import android.hardware.automotive.vehicle.V2_0.VehicleProperty;
-import android.util.SparseIntArray;
-
-class VhalPropMaps {
-
- private static final SparseIntArray HVAC_PROP_MAP;
-
- static {
- HVAC_PROP_MAP = new SparseIntArray();
- HVAC_PROP_MAP.put(CarHvacManager.ID_MIRROR_DEFROSTER_ON,
- VehicleProperty.HVAC_SIDE_MIRROR_HEAT);
- HVAC_PROP_MAP.put(CarHvacManager.ID_STEERING_WHEEL_HEAT,
- VehicleProperty.HVAC_STEERING_WHEEL_HEAT);
- HVAC_PROP_MAP.put(CarHvacManager.ID_OUTSIDE_AIR_TEMP,
- VehicleProperty.ENV_OUTSIDE_TEMPERATURE);
- HVAC_PROP_MAP.put(CarHvacManager.ID_TEMPERATURE_DISPLAY_UNITS,
- VehicleProperty.HVAC_TEMPERATURE_DISPLAY_UNITS);
- HVAC_PROP_MAP.put(CarHvacManager.ID_ZONED_TEMP_SETPOINT,
- VehicleProperty.HVAC_TEMPERATURE_SET);
- HVAC_PROP_MAP.put(CarHvacManager.ID_ZONED_TEMP_ACTUAL,
- VehicleProperty.HVAC_TEMPERATURE_CURRENT);
- HVAC_PROP_MAP.put(CarHvacManager.ID_ZONED_FAN_SPEED_SETPOINT,
- VehicleProperty.HVAC_FAN_SPEED);
- HVAC_PROP_MAP.put(CarHvacManager.ID_ZONED_FAN_SPEED_RPM,
- VehicleProperty.HVAC_ACTUAL_FAN_SPEED_RPM);
- HVAC_PROP_MAP.put(CarHvacManager.ID_ZONED_FAN_DIRECTION_AVAILABLE,
- VehicleProperty.HVAC_FAN_DIRECTION_AVAILABLE);
- HVAC_PROP_MAP.put(CarHvacManager.ID_ZONED_FAN_DIRECTION,
- VehicleProperty.HVAC_FAN_DIRECTION);
- HVAC_PROP_MAP.put(CarHvacManager.ID_ZONED_SEAT_TEMP,
- VehicleProperty.HVAC_SEAT_TEMPERATURE);
- HVAC_PROP_MAP.put(CarHvacManager.ID_ZONED_AC_ON,
- VehicleProperty.HVAC_AC_ON);
- HVAC_PROP_MAP.put(CarHvacManager.ID_ZONED_AUTOMATIC_MODE_ON,
- VehicleProperty.HVAC_AUTO_ON);
- HVAC_PROP_MAP.put(CarHvacManager.ID_ZONED_AIR_RECIRCULATION_ON,
- VehicleProperty.HVAC_RECIRC_ON);
- HVAC_PROP_MAP.put(CarHvacManager.ID_ZONED_MAX_AC_ON,
- VehicleProperty.HVAC_MAX_AC_ON);
- HVAC_PROP_MAP.put(CarHvacManager.ID_ZONED_DUAL_ZONE_ON,
- VehicleProperty.HVAC_DUAL_ON);
- HVAC_PROP_MAP.put(CarHvacManager.ID_ZONED_MAX_DEFROST_ON,
- VehicleProperty.HVAC_MAX_DEFROST_ON);
- HVAC_PROP_MAP.put(CarHvacManager.ID_ZONED_HVAC_POWER_ON,
- VehicleProperty.HVAC_POWER_ON);
- HVAC_PROP_MAP.put(CarHvacManager.ID_ZONED_HVAC_AUTO_RECIRC_ON,
- VehicleProperty.HVAC_AUTO_RECIRC_ON);
- HVAC_PROP_MAP.put(CarHvacManager.ID_WINDOW_DEFROSTER_ON,
- VehicleProperty.HVAC_DEFROSTER);
- }
-
- static int getHvacVhalProp(final int hvacProp) {
- return HVAC_PROP_MAP.get(hvacProp);
- }
-}
diff --git a/tools/emulator/vhal_consts_2_0.py b/tools/emulator/vhal_consts_2_0.py
index a9d9990..85351c0 100644
--- a/tools/emulator/vhal_consts_2_0.py
+++ b/tools/emulator/vhal_consts_2_0.py
@@ -138,13 +138,6 @@
STATUSCODE_ACCESS_DENIED = 0x4
STATUSCODE_INTERNAL_ERROR = 0x5
-# Wheel
-WHEEL_UNKNOWN = 0x0
-WHEEL_LEFT_FRONT = 0x1
-WHEEL_RIGHT_FRONT = 0x2
-WHEEL_LEFT_REAR = 0x4
-WHEEL_RIGHT_REAR = 0x8
-
# VehicleLightState
VEHICLELIGHTSTATE_OFF = 0x0
VEHICLELIGHTSTATE_ON = 0x1
@@ -266,17 +259,19 @@
VEHICLETURNSIGNAL_LEFT = 0x2
# EvConnectorType
-EVCONNECTORTYPE_EV_CONNECTOR_TYPE_UNKNOWN = 0x0
-EVCONNECTORTYPE_EV_CONNECTOR_TYPE_J1772 = 0x1
-EVCONNECTORTYPE_EV_CONNECTOR_TYPE_MENNEKES = 0x2
-EVCONNECTORTYPE_EV_CONNECTOR_TYPE_CHADEMO = 0x3
-EVCONNECTORTYPE_EV_CONNECTOR_TYPE_COMBO_1 = 0x4
-EVCONNECTORTYPE_EV_CONNECTOR_TYPE_COMBO_2 = 0x5
-EVCONNECTORTYPE_EV_CONNECTOR_TYPE_TESLA_ROADSTER = 0x6
-EVCONNECTORTYPE_EV_CONNECTOR_TYPE_TESLA_HPWC = 0x7
-EVCONNECTORTYPE_EV_CONNECTOR_TYPE_TESLA_SUPERCHARGER = 0x8
-EVCONNECTORTYPE_EV_CONNECTOR_TYPE_GBT = 0x9
-EVCONNECTORTYPE_EV_CONNECTOR_TYPE_OTHER = 0x65
+EVCONNECTORTYPE_UNKNOWN = 0x0
+EVCONNECTORTYPE_IEC_TYPE_1_AC = 0x1
+EVCONNECTORTYPE_IEC_TYPE_2_AC = 0x2
+EVCONNECTORTYPE_IEC_TYPE_3_AC = 0x3
+EVCONNECTORTYPE_IEC_TYPE_4_DC = 0x4
+EVCONNECTORTYPE_IEC_TYPE_1_CCS_DC = 0x5
+EVCONNECTORTYPE_IEC_TYPE_2_CCS_DC = 0x6
+EVCONNECTORTYPE_TESLA_ROADSTER = 0x7
+EVCONNECTORTYPE_TESLA_HPWC = 0x8
+EVCONNECTORTYPE_TESLA_SUPERCHARGER = 0x9
+EVCONNECTORTYPE_GBT_AC = 0xa
+EVCONNECTORTYPE_GBT_DC = 0xb
+EVCONNECTORTYPE_OTHER = 0x65
# VehiclePropertyType
VEHICLEPROPERTYTYPE_STRING = 0x100000
@@ -309,6 +304,13 @@
OBD2SECONDARYAIRSTATUS_FROM_OUTSIDE_OR_OFF = 0x4
OBD2SECONDARYAIRSTATUS_PUMP_ON_FOR_DIAGNOSTICS = 0x8
+# VehicleAreaWheel
+VEHICLEAREAWHEEL_UNKNOWN = 0x0
+VEHICLEAREAWHEEL_LEFT_FRONT = 0x1
+VEHICLEAREAWHEEL_RIGHT_FRONT = 0x2
+VEHICLEAREAWHEEL_LEFT_REAR = 0x4
+VEHICLEAREAWHEEL_RIGHT_REAR = 0x8
+
# VehicleGear
VEHICLEGEAR_GEAR_NEUTRAL = 0x1
VEHICLEGEAR_GEAR_REVERSE = 0x2
@@ -410,7 +412,7 @@
VEHICLEPROPERTY_EV_CHARGE_PORT_CONNECTED = 0x1120030b
VEHICLEPROPERTY_EV_BATTERY_INSTANTANEOUS_CHARGE_RATE = 0x1160030c
VEHICLEPROPERTY_RANGE_REMAINING = 0x11600308
-VEHICLEPROPERTY_TIRE_PRESSURE = 0x17e00309
+VEHICLEPROPERTY_TIRE_PRESSURE = 0x17600309
VEHICLEPROPERTY_GEAR_SELECTION = 0x11400400
VEHICLEPROPERTY_CURRENT_GEAR = 0x11400401
VEHICLEPROPERTY_PARKING_BRAKE_ON = 0x11200402
@@ -442,7 +444,6 @@
VEHICLEPROPERTY_HVAC_AUTO_RECIRC_ON = 0x15200512
VEHICLEPROPERTY_HVAC_SEAT_VENTILATION = 0x15400513
VEHICLEPROPERTY_ENV_OUTSIDE_TEMPERATURE = 0x11600703
-VEHICLEPROPERTY_ENV_CABIN_TEMPERATURE = 0x15600704
VEHICLEPROPERTY_AP_POWER_STATE_REQ = 0x11410a00
VEHICLEPROPERTY_AP_POWER_STATE_REPORT = 0x11410a01
VEHICLEPROPERTY_AP_POWER_BOOTUP_REASON = 0x11400a02