diff options
author | android-build-team Robot | 2018-05-27 02:23:35 -0500 |
---|---|---|
committer | android-build-team Robot | 2018-05-27 02:23:35 -0500 |
commit | 94ee7ca2db43087fcf7f5d329d2592e0ad44bc76 (patch) | |
tree | 340d773c2f7f914d1e9e34ea80a4a930b9847031 | |
parent | fc0b37e935c25c45722e61d5ff1bb4e7a1d3ab1a (diff) | |
parent | c08e3443fc015066f619278953f78d6d3820dfe7 (diff) | |
download | platform-packages-services-car-94ee7ca2db43087fcf7f5d329d2592e0ad44bc76.tar.gz platform-packages-services-car-94ee7ca2db43087fcf7f5d329d2592e0ad44bc76.tar.xz platform-packages-services-car-94ee7ca2db43087fcf7f5d329d2592e0ad44bc76.zip |
Snap for 4807121 from c08e3443fc015066f619278953f78d6d3820dfe7 to pi-release
Change-Id: I1fa8856579b95a9c283c2c28f20049c57f895adb
-rw-r--r-- | car-lib/api/current.txt | 2 | ||||
-rw-r--r-- | car-lib/src/android/car/Car.java | 7 | ||||
-rw-r--r-- | service/res/drawable/exit_button_background.xml | 5 | ||||
-rw-r--r-- | service/res/drawable/exit_button_ripple_background.xml | 20 | ||||
-rw-r--r-- | service/res/layout/activity_blocking.xml | 9 | ||||
-rw-r--r-- | service/res/values-night/colors.xml | 3 | ||||
-rw-r--r-- | service/res/values/colors.xml | 3 | ||||
-rw-r--r-- | service/res/values/dimens.xml | 10 | ||||
-rw-r--r-- | service/res/values/styles.xml | 13 | ||||
-rw-r--r-- | service/src/com/android/car/VmsSubscriberService.java | 4 | ||||
-rw-r--r-- | tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/input/InputTestFragment.java | 62 |
11 files changed, 112 insertions, 26 deletions
diff --git a/car-lib/api/current.txt b/car-lib/api/current.txt index 81b754e1..71eb12ca 100644 --- a/car-lib/api/current.txt +++ b/car-lib/api/current.txt | |||
@@ -14,12 +14,14 @@ package android.car { | |||
14 | field public static final java.lang.String CAR_CONFIGURATION_SERVICE = "configuration"; | 14 | field public static final java.lang.String CAR_CONFIGURATION_SERVICE = "configuration"; |
15 | field public static final java.lang.String CAR_EXTRA_MEDIA_PACKAGE = "android.car.intent.extra.MEDIA_PACKAGE"; | 15 | field public static final java.lang.String CAR_EXTRA_MEDIA_PACKAGE = "android.car.intent.extra.MEDIA_PACKAGE"; |
16 | field public static final java.lang.String CAR_INTENT_ACTION_MEDIA_TEMPLATE = "android.car.intent.action.MEDIA_TEMPLATE"; | 16 | field public static final java.lang.String CAR_INTENT_ACTION_MEDIA_TEMPLATE = "android.car.intent.action.MEDIA_TEMPLATE"; |
17 | field public static final java.lang.String CAR_NAVIGATION_SERVICE = "car_navigation_service"; | ||
17 | field public static final java.lang.String CAR_UX_RESTRICTION_SERVICE = "uxrestriction"; | 18 | field public static final java.lang.String CAR_UX_RESTRICTION_SERVICE = "uxrestriction"; |
18 | field public static final int CONNECTION_TYPE_EMBEDDED = 5; // 0x5 | 19 | field public static final int CONNECTION_TYPE_EMBEDDED = 5; // 0x5 |
19 | field public static final java.lang.String INFO_SERVICE = "info"; | 20 | field public static final java.lang.String INFO_SERVICE = "info"; |
20 | field public static final java.lang.String PACKAGE_SERVICE = "package"; | 21 | field public static final java.lang.String PACKAGE_SERVICE = "package"; |
21 | field public static final java.lang.String PERMISSION_CAR_CONTROL_AUDIO_VOLUME = "android.car.permission.CAR_CONTROL_AUDIO_VOLUME"; | 22 | field public static final java.lang.String PERMISSION_CAR_CONTROL_AUDIO_VOLUME = "android.car.permission.CAR_CONTROL_AUDIO_VOLUME"; |
22 | field public static final java.lang.String PERMISSION_CAR_INFO = "android.car.permission.CAR_INFO"; | 23 | field public static final java.lang.String PERMISSION_CAR_INFO = "android.car.permission.CAR_INFO"; |
24 | field public static final java.lang.String PERMISSION_CAR_NAVIGATION_MANAGER = "android.car.permission.CAR_NAVIGATION_MANAGER"; | ||
23 | field public static final java.lang.String PERMISSION_ENERGY = "android.car.permission.CAR_ENERGY"; | 25 | field public static final java.lang.String PERMISSION_ENERGY = "android.car.permission.CAR_ENERGY"; |
24 | field public static final java.lang.String PERMISSION_ENERGY_PORTS = "android.car.permission.CAR_ENERGY_PORTS"; | 26 | field public static final java.lang.String PERMISSION_ENERGY_PORTS = "android.car.permission.CAR_ENERGY_PORTS"; |
25 | field public static final java.lang.String PERMISSION_EXTERIOR_ENVIRONMENT = "android.car.permission.CAR_EXTERIOR_ENVIRONMENT"; | 27 | field public static final java.lang.String PERMISSION_EXTERIOR_ENVIRONMENT = "android.car.permission.CAR_EXTERIOR_ENVIRONMENT"; |
diff --git a/car-lib/src/android/car/Car.java b/car-lib/src/android/car/Car.java index 32b7c736..5d166408 100644 --- a/car-lib/src/android/car/Car.java +++ b/car-lib/src/android/car/Car.java | |||
@@ -83,11 +83,9 @@ public final class Car { | |||
83 | /** Service name for {@link CarAudioManager} */ | 83 | /** Service name for {@link CarAudioManager} */ |
84 | public static final String AUDIO_SERVICE = "audio"; | 84 | public static final String AUDIO_SERVICE = "audio"; |
85 | 85 | ||
86 | /** | 86 | /** Service name for {@link CarNavigationStatusManager} */ |
87 | * Service name for {@link CarNavigationStatusManager} | ||
88 | * @hide | ||
89 | */ | ||
90 | public static final String CAR_NAVIGATION_SERVICE = "car_navigation_service"; | 87 | public static final String CAR_NAVIGATION_SERVICE = "car_navigation_service"; |
88 | |||
91 | /** | 89 | /** |
92 | * Service name for {@link CarInstrumentClusterManager} | 90 | * Service name for {@link CarInstrumentClusterManager} |
93 | * @hide | 91 | * @hide |
@@ -230,7 +228,6 @@ public final class Car { | |||
230 | 228 | ||
231 | /** | 229 | /** |
232 | * Permission necessary to use {@link CarNavigationStatusManager}. | 230 | * Permission necessary to use {@link CarNavigationStatusManager}. |
233 | * @hide | ||
234 | */ | 231 | */ |
235 | public static final String PERMISSION_CAR_NAVIGATION_MANAGER = | 232 | public static final String PERMISSION_CAR_NAVIGATION_MANAGER = |
236 | "android.car.permission.CAR_NAVIGATION_MANAGER"; | 233 | "android.car.permission.CAR_NAVIGATION_MANAGER"; |
diff --git a/service/res/drawable/exit_button_background.xml b/service/res/drawable/exit_button_background.xml index 7daa69bf..92d32fd1 100644 --- a/service/res/drawable/exit_button_background.xml +++ b/service/res/drawable/exit_button_background.xml | |||
@@ -15,6 +15,5 @@ limitations under the License. | |||
15 | --> | 15 | --> |
16 | <shape xmlns:android="http://schemas.android.com/apk/res/android"> | 16 | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
17 | <solid android:color="@color/exit_button_background"/> | 17 | <solid android:color="@color/exit_button_background"/> |
18 | <corners | 18 | <corners android:radius="@dimen/exit_button_radius"/> |
19 | android:radius="@dimen/exit_button_radius"/> | 19 | </shape> |
20 | </shape> \ No newline at end of file | ||
diff --git a/service/res/drawable/exit_button_ripple_background.xml b/service/res/drawable/exit_button_ripple_background.xml new file mode 100644 index 00000000..54fd00f8 --- /dev/null +++ b/service/res/drawable/exit_button_ripple_background.xml | |||
@@ -0,0 +1,20 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <!-- Copyright (C) 2018 The Android Open Source Project | ||
3 | |||
4 | Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | you may not use this file except in compliance with the License. | ||
6 | You may obtain a copy of the License at | ||
7 | |||
8 | http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | |||
10 | Unless required by applicable law or agreed to in writing, software | ||
11 | distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | See the License for the specific language governing permissions and | ||
14 | limitations under the License. | ||
15 | --> | ||
16 | <ripple | ||
17 | xmlns:android="http://schemas.android.com/apk/res/android" | ||
18 | android:color="@color/ripple_background"> | ||
19 | <item android:drawable="@drawable/exit_button_background" /> | ||
20 | </ripple> | ||
diff --git a/service/res/layout/activity_blocking.xml b/service/res/layout/activity_blocking.xml index 9cd854a6..687afbe5 100644 --- a/service/res/layout/activity_blocking.xml +++ b/service/res/layout/activity_blocking.xml | |||
@@ -32,11 +32,6 @@ | |||
32 | android:layout_height="wrap_content" | 32 | android:layout_height="wrap_content" |
33 | android:layout_width="wrap_content" | 33 | android:layout_width="wrap_content" |
34 | android:layout_marginTop="@dimen/exit_button_top_margin" | 34 | android:layout_marginTop="@dimen/exit_button_top_margin" |
35 | android:background="@drawable/exit_button_background" | 35 | android:text="@string/exit_button" |
36 | android:paddingEnd="@dimen/exit_button_padding" | 36 | style="@style/ExitButtonStyle"/> |
37 | android:paddingStart="@dimen/exit_button_padding" | ||
38 | android:textColor="@color/exit_button_text" | ||
39 | android:textAllCaps="true" | ||
40 | android:textAppearance="@style/ActivityBlockingActivityText" | ||
41 | android:text="@string/exit_button"/> | ||
42 | </LinearLayout> | 37 | </LinearLayout> |
diff --git a/service/res/values-night/colors.xml b/service/res/values-night/colors.xml index d19a1644..65f8fb11 100644 --- a/service/res/values-night/colors.xml +++ b/service/res/values-night/colors.xml | |||
@@ -29,4 +29,7 @@ | |||
29 | 29 | ||
30 | <!-- Color of exit button text. --> | 30 | <!-- Color of exit button text. --> |
31 | <color name="exit_button_text">#ff212121</color> | 31 | <color name="exit_button_text">#ff212121</color> |
32 | |||
33 | <!-- Ripple color. --> | ||
34 | <color name="ripple_background">#3dffffff</color> | ||
32 | </resources> | 35 | </resources> |
diff --git a/service/res/values/colors.xml b/service/res/values/colors.xml index 4f612340..ed86a3b4 100644 --- a/service/res/values/colors.xml +++ b/service/res/values/colors.xml | |||
@@ -29,4 +29,7 @@ | |||
29 | 29 | ||
30 | <!-- Color of exit button text. --> | 30 | <!-- Color of exit button text. --> |
31 | <color name="exit_button_text">#fffafafa</color> | 31 | <color name="exit_button_text">#fffafafa</color> |
32 | |||
33 | <!-- Ripple color of exit button background. --> | ||
34 | <color name="ripple_background">#3d000000</color> | ||
32 | </resources> | 35 | </resources> |
diff --git a/service/res/values/dimens.xml b/service/res/values/dimens.xml index 1289080c..f75a3585 100644 --- a/service/res/values/dimens.xml +++ b/service/res/values/dimens.xml | |||
@@ -21,10 +21,16 @@ | |||
21 | <dimen name="blocking_text_size">32sp</dimen> | 21 | <dimen name="blocking_text_size">32sp</dimen> |
22 | <!-- Padding of ActivityBlockingActivity. --> | 22 | <!-- Padding of ActivityBlockingActivity. --> |
23 | <dimen name="blocking_activity_padding">20dp</dimen> | 23 | <dimen name="blocking_activity_padding">20dp</dimen> |
24 | |||
25 | <!-- Minimum height of exit button in ActivityBlockingActivity. --> | ||
26 | <dimen name="exit_button_min_height">56dp</dimen> | ||
27 | <!-- Minimum width of exit button in ActivityBlockingActivity. --> | ||
28 | <dimen name="exit_button_min_width">156dp</dimen> | ||
24 | <!-- Padding of exit button in ActivityBlockingActivity. --> | 29 | <!-- Padding of exit button in ActivityBlockingActivity. --> |
25 | <dimen name="exit_button_padding">16dp</dimen> | 30 | <dimen name="exit_button_padding">16dp</dimen> |
26 | <!-- Radius of exit button in ActivityBlockingActivity. --> | 31 | <!-- Radius of exit button in ActivityBlockingActivity. --> |
27 | <dimen name="exit_button_radius">4dp</dimen> | 32 | <dimen name="exit_button_radius">4dp</dimen> |
28 | <!-- Top margin of exit button in ActivityBlockingActivity. --> | 33 | <!-- Top margin of exit button. It should be half the height of |
29 | <dimen name="exit_button_top_margin">16dp</dimen> | 34 | button (exit_button_min_height). --> |
35 | <dimen name="exit_button_top_margin">28dp</dimen> | ||
30 | </resources> | 36 | </resources> |
diff --git a/service/res/values/styles.xml b/service/res/values/styles.xml index 75713624..4098e96e 100644 --- a/service/res/values/styles.xml +++ b/service/res/values/styles.xml | |||
@@ -20,5 +20,18 @@ limitations under the License. | |||
20 | <item name="android:textStyle">normal</item> | 20 | <item name="android:textStyle">normal</item> |
21 | <item name="android:textSize">@dimen/blocking_text_size</item> | 21 | <item name="android:textSize">@dimen/blocking_text_size</item> |
22 | </style> | 22 | </style> |
23 | |||
24 | <!-- Style of exit button. --> | ||
25 | <style name="ExitButtonStyle"> | ||
26 | <item name="android:background">@drawable/exit_button_ripple_background</item> | ||
27 | <item name="android:fontFamily">sans-serif-medium</item> | ||
28 | <item name="android:minHeight">@dimen/exit_button_min_height</item> | ||
29 | <item name="android:minWidth">@dimen/exit_button_min_width</item> | ||
30 | <item name="android:paddingHorizontal">@dimen/exit_button_padding</item> | ||
31 | <item name="android:textAllCaps">true</item> | ||
32 | <item name="android:textAlignment">center</item> | ||
33 | <item name="android:textAppearance">@style/ActivityBlockingActivityText</item> | ||
34 | <item name="android:textColor">@color/exit_button_text</item> | ||
35 | </style> | ||
23 | </resources> | 36 | </resources> |
24 | 37 | ||
diff --git a/service/src/com/android/car/VmsSubscriberService.java b/service/src/com/android/car/VmsSubscriberService.java index 371b4182..e86690df 100644 --- a/service/src/com/android/car/VmsSubscriberService.java +++ b/service/src/com/android/car/VmsSubscriberService.java | |||
@@ -344,9 +344,7 @@ public class VmsSubscriberService extends IVmsSubscriberService.Stub | |||
344 | } | 344 | } |
345 | 345 | ||
346 | Set<IVmsSubscriberClient> subscribers; | 346 | Set<IVmsSubscriberClient> subscribers; |
347 | synchronized (mSubscriberServiceLock) { | 347 | subscribers = new HashSet<>(mSubscribersManager.getListeners()); |
348 | subscribers = new HashSet<>(mSubscribersManager.getListeners()); | ||
349 | } | ||
350 | 348 | ||
351 | for (IVmsSubscriberClient subscriber : subscribers) { | 349 | for (IVmsSubscriberClient subscriber : subscribers) { |
352 | try { | 350 | try { |
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 4b9ec1d2..19ad0943 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 | |||
@@ -15,11 +15,18 @@ | |||
15 | */ | 15 | */ |
16 | package com.google.android.car.kitchensink.input; | 16 | package com.google.android.car.kitchensink.input; |
17 | 17 | ||
18 | import static android.hardware.automotive.vehicle.V2_0.SubscribeFlags.EVENTS_FROM_ANDROID; | ||
19 | import static android.hardware.automotive.vehicle.V2_0.SubscribeFlags.EVENTS_FROM_CAR; | ||
18 | import static android.hardware.automotive.vehicle.V2_0.VehicleDisplay.INSTRUMENT_CLUSTER; | 20 | import static android.hardware.automotive.vehicle.V2_0.VehicleDisplay.INSTRUMENT_CLUSTER; |
21 | import static android.hardware.automotive.vehicle.V2_0.VehicleHwKeyInputAction.ACTION_DOWN; | ||
22 | import static android.hardware.automotive.vehicle.V2_0.VehicleProperty.HW_KEY_INPUT; | ||
19 | 23 | ||
20 | import android.annotation.Nullable; | 24 | import android.annotation.Nullable; |
21 | import android.annotation.StringRes; | 25 | import android.annotation.StringRes; |
22 | import android.hardware.automotive.vehicle.V2_0.IVehicle; | 26 | import android.hardware.automotive.vehicle.V2_0.IVehicle; |
27 | import android.hardware.automotive.vehicle.V2_0.IVehicleCallback; | ||
28 | import android.hardware.automotive.vehicle.V2_0.IVehicleCallback.Stub; | ||
29 | import android.hardware.automotive.vehicle.V2_0.SubscribeOptions; | ||
23 | import android.hardware.automotive.vehicle.V2_0.VehicleArea; | 30 | import android.hardware.automotive.vehicle.V2_0.VehicleArea; |
24 | import android.hardware.automotive.vehicle.V2_0.VehicleDisplay; | 31 | import android.hardware.automotive.vehicle.V2_0.VehicleDisplay; |
25 | import android.hardware.automotive.vehicle.V2_0.VehiclePropValue; | 32 | import android.hardware.automotive.vehicle.V2_0.VehiclePropValue; |
@@ -41,8 +48,6 @@ import android.widget.LinearLayout; | |||
41 | import android.widget.TextView; | 48 | import android.widget.TextView; |
42 | import android.widget.Toast; | 49 | import android.widget.Toast; |
43 | 50 | ||
44 | import android.support.v4.app.Fragment; | ||
45 | |||
46 | import com.android.car.keventreader.EventReaderService; | 51 | import com.android.car.keventreader.EventReaderService; |
47 | import com.android.car.keventreader.IEventCallback; | 52 | import com.android.car.keventreader.IEventCallback; |
48 | import com.android.car.keventreader.KeypressEvent; | 53 | import com.android.car.keventreader.KeypressEvent; |
@@ -67,10 +72,12 @@ public class InputTestFragment extends Fragment { | |||
67 | 72 | ||
68 | private final List<View> mButtons = new ArrayList<>(); | 73 | private final List<View> mButtons = new ArrayList<>(); |
69 | 74 | ||
70 | // This is special property available only in emulated VHAL implementation. | 75 | // This is fake data generation property available only in emulated VHAL implementation. |
71 | private static final int sGenerateFakeDataControllingProperty = | 76 | private static final int sGenerateFakeDataControllingProperty = |
72 | 0x0666 | VehiclePropertyGroup.VENDOR | VehicleArea.GLOBAL | VehiclePropertyType.MIXED; | 77 | 0x0666 | VehiclePropertyGroup.VENDOR | VehicleArea.GLOBAL | VehiclePropertyType.MIXED; |
73 | private static final int sKeyPressCommand = 2; | 78 | // The key press command is sent with the fake data generation property. It's matching the |
79 | // command defined in the emulated VHAL implementation. | ||
80 | private static final int sKeyPressCommand = 100; | ||
74 | 81 | ||
75 | private IVehicle mVehicle; | 82 | private IVehicle mVehicle; |
76 | 83 | ||
@@ -87,10 +94,37 @@ public class InputTestFragment extends Fragment { | |||
87 | @Override | 94 | @Override |
88 | public void onEvent(KeypressEvent keypressEvent) throws RemoteException { | 95 | public void onEvent(KeypressEvent keypressEvent) throws RemoteException { |
89 | Log.d(TAG, "received event " + keypressEvent); | 96 | Log.d(TAG, "received event " + keypressEvent); |
90 | mInputEventsList.append(prettyPrint(keypressEvent)); | 97 | synchronized (mInputEventsList) { |
98 | mInputEventsList.append(prettyPrint(keypressEvent)); | ||
99 | } | ||
91 | } | 100 | } |
92 | }; | 101 | }; |
93 | 102 | ||
103 | private final IVehicleCallback.Stub mHalKeyEventHandler = new Stub() { | ||
104 | private String prettyPrint(VehiclePropValue event) { | ||
105 | if (event.prop != HW_KEY_INPUT) return ""; | ||
106 | if (event.value == null || | ||
107 | event.value.int32Values == null || | ||
108 | event.value.int32Values.size() < 2) return ""; | ||
109 | return String.format("Event{source = HAL, keycode = %s, key%s}\n", | ||
110 | event.value.int32Values.get(1), | ||
111 | event.value.int32Values.get(0) == ACTION_DOWN ? "down" : "up"); | ||
112 | } | ||
113 | |||
114 | @Override | ||
115 | public void onPropertyEvent(ArrayList<VehiclePropValue> propValues) throws RemoteException { | ||
116 | synchronized (mInputEventsList) { | ||
117 | propValues.forEach(vpv -> mInputEventsList.append(prettyPrint(vpv))); | ||
118 | } | ||
119 | } | ||
120 | |||
121 | @Override | ||
122 | public void onPropertySet(VehiclePropValue propValue) {} | ||
123 | |||
124 | @Override | ||
125 | public void onPropertySetError(int errorCode, int propId, int areaId) {} | ||
126 | }; | ||
127 | |||
94 | private TextView mInputEventsList; | 128 | private TextView mInputEventsList; |
95 | 129 | ||
96 | @Override | 130 | @Override |
@@ -111,6 +145,17 @@ public class InputTestFragment extends Fragment { | |||
111 | if (mEventReaderService != null) { | 145 | if (mEventReaderService != null) { |
112 | mEventReaderService.registerCallback(mKeypressEventHandler); | 146 | mEventReaderService.registerCallback(mKeypressEventHandler); |
113 | } | 147 | } |
148 | |||
149 | SubscribeOptions subscribeOption = new SubscribeOptions(); | ||
150 | subscribeOption.propId = HW_KEY_INPUT; | ||
151 | subscribeOption.flags = EVENTS_FROM_CAR | EVENTS_FROM_ANDROID; | ||
152 | ArrayList<SubscribeOptions> subscribeOptions = new ArrayList<>(); | ||
153 | subscribeOptions.add(subscribeOption); | ||
154 | try { | ||
155 | mVehicle.subscribe(mHalKeyEventHandler, subscribeOptions); | ||
156 | } catch (RemoteException e) { | ||
157 | Log.e(TAG, "failed to connect to VHAL for key events", e); | ||
158 | } | ||
114 | } | 159 | } |
115 | 160 | ||
116 | @Nullable | 161 | @Nullable |
@@ -178,7 +223,7 @@ public class InputTestFragment extends Fragment { | |||
178 | VehiclePropValue prop = new VehiclePropValue(); | 223 | VehiclePropValue prop = new VehiclePropValue(); |
179 | prop.prop = sGenerateFakeDataControllingProperty; | 224 | prop.prop = sGenerateFakeDataControllingProperty; |
180 | prop.value.int32Values.addAll(Lists.newArrayList( | 225 | prop.value.int32Values.addAll(Lists.newArrayList( |
181 | sKeyPressCommand, VehicleProperty.HW_KEY_INPUT, keyCode, targetDisplay)); | 226 | sKeyPressCommand, HW_KEY_INPUT, keyCode, targetDisplay)); |
182 | int status; | 227 | int status; |
183 | try { | 228 | try { |
184 | status = mVehicle.set(prop); | 229 | status = mVehicle.set(prop); |
@@ -199,6 +244,11 @@ public class InputTestFragment extends Fragment { | |||
199 | if (mEventReaderService != null) { | 244 | if (mEventReaderService != null) { |
200 | mEventReaderService.unregisterCallback(mKeypressEventHandler); | 245 | mEventReaderService.unregisterCallback(mKeypressEventHandler); |
201 | } | 246 | } |
247 | try { | ||
248 | mVehicle.unsubscribe(mHalKeyEventHandler, HW_KEY_INPUT); | ||
249 | } catch (RemoteException e) { | ||
250 | Log.e(TAG, "failed to remove HAL registration for keypress events", e); | ||
251 | } | ||
202 | } | 252 | } |
203 | 253 | ||
204 | private void addButtonsToPanel(LinearLayout root, List<View> buttons) { | 254 | private void addButtonsToPanel(LinearLayout root, List<View> buttons) { |