summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandroid-build-prod (mdb)2019-08-15 13:52:31 -0500
committerandroid-build-prod (mdb)2019-08-15 13:52:31 -0500
commit7f8ca1a91354ce7743786ed9536930fc7a3336cc (patch)
tree64016905c9695e6d8e38cd92f6ff12324f61cf83
parent4b3e4ad208334f8fd8f473f1322724a20e0cb7e1 (diff)
parent085ab65789aea0ef195e43714f72462abf5852e1 (diff)
downloadplatform-packages-services-car-simpleperf-release.tar.gz
platform-packages-services-car-simpleperf-release.tar.xz
platform-packages-services-car-simpleperf-release.zip
Snap for 5805824 from 085ab65789aea0ef195e43714f72462abf5852e1 to simpleperf-releasesimpleperf-release
Change-Id: Ic13b6707dd59461d603e4e2d3ce977aee41170c6
-rw-r--r--car-lib/Android.bp53
-rw-r--r--car-lib/src/android/car/hardware/property/CarPropertyEvent.java16
-rw-r--r--procfs-inspector/server/Android.mk3
-rw-r--r--service/src/com/android/car/CarPropertyService.java7
-rw-r--r--service/src/com/android/car/ICarImpl.java24
-rw-r--r--service/src/com/android/car/hal/VehicleHal.java17
-rw-r--r--tests/PowerTestService/Android.mk1
-rw-r--r--tools/keventreader/server/Android.mk3
8 files changed, 96 insertions, 28 deletions
diff --git a/car-lib/Android.bp b/car-lib/Android.bp
index 956ff709..04699cfc 100644
--- a/car-lib/Android.bp
+++ b/car-lib/Android.bp
@@ -12,8 +12,19 @@
12// See the License for the specific language governing permissions and 12// See the License for the specific language governing permissions and
13// limitations under the License. 13// limitations under the License.
14 14
15filegroup {
16 name: "libcarpowermanager_aidl",
17 srcs: [
18 "src/android/car/ICar.aidl",
19 "src/android/car/hardware/power/ICarPower.aidl",
20 "src/android/car/hardware/power/ICarPowerStateListener.aidl",
21 ],
22 path: "src",
23}
24
15cc_library { 25cc_library {
16 name: "libcarpowermanager", 26 name: "libcarpowermanager",
27 vendor_available: true,
17 28
18 aidl: { 29 aidl: {
19 export_aidl_headers: true, 30 export_aidl_headers: true,
@@ -40,9 +51,7 @@ cc_library {
40 ], 51 ],
41 52
42 srcs: [ 53 srcs: [
43 "src/android/car/ICar.aidl", 54 ":libcarpowermanager_aidl",
44 "src/android/car/hardware/power/ICarPower.aidl",
45 "src/android/car/hardware/power/ICarPowerStateListener.aidl",
46 "native/CarPowerManager/CarPowerManager.cpp", 55 "native/CarPowerManager/CarPowerManager.cpp",
47 ], 56 ],
48} 57}
@@ -122,15 +131,15 @@ droidstubs {
122 api_file: ":android-car-last-released-api", 131 api_file: ":android-car-last-released-api",
123 removed_api_file: "api/removed.txt", 132 removed_api_file: "api/removed.txt",
124 args: " -hide 2 -hide 3 -hide 4 -hide 5 -hide 6 -hide 24 -hide 25 -hide 26 -hide 27 " + 133 args: " -hide 2 -hide 3 -hide 4 -hide 5 -hide 6 -hide 24 -hide 25 -hide 26 -hide 27 " +
125 " -warning 7 -warning 8 -warning 9 -warning 10 -warning 11 -warning 12 " + 134 " -warning 7 -warning 8 -warning 9 -warning 10 -warning 11 -warning 12 " +
126 " -warning 13 -warning 14 -warning 15 -warning 16 -warning 17 -warning 18 -hide 113 ", 135 " -warning 13 -warning 14 -warning 15 -warning 16 -warning 17 -warning 18 -hide 113 ",
127 }, 136 },
128 current: { 137 current: {
129 api_file: "api/current.txt", 138 api_file: "api/current.txt",
130 removed_api_file: "api/removed.txt", 139 removed_api_file: "api/removed.txt",
131 args: " -error 2 -error 3 -error 4 -error 5 -error 6 -error 7 -error 8 -error 9 -error 10 -error 11 " + 140 args: " -error 2 -error 3 -error 4 -error 5 -error 6 -error 7 -error 8 -error 9 -error 10 -error 11 " +
132 " -error 12 -error 13 -error 14 -error 15 -error 16 -error 17 -error 18 -error 19 -error 20 " + 141 " -error 12 -error 13 -error 14 -error 15 -error 16 -error 17 -error 18 -error 19 -error 20 " +
133 " -error 21 -error 23 -error 24 -error 25 -hide 113 ", 142 " -error 21 -error 23 -error 24 -error 25 -hide 113 ",
134 }, 143 },
135 }, 144 },
136} 145}
@@ -149,15 +158,15 @@ droidstubs {
149 api_file: ":android-car-last-released-system-api", 158 api_file: ":android-car-last-released-system-api",
150 removed_api_file: "api/system-removed.txt", 159 removed_api_file: "api/system-removed.txt",
151 args: " -hide 2 -hide 3 -hide 4 -hide 5 -hide 6 -hide 24 -hide 25 -hide 26 -hide 27 " + 160 args: " -hide 2 -hide 3 -hide 4 -hide 5 -hide 6 -hide 24 -hide 25 -hide 26 -hide 27 " +
152 " -warning 7 -warning 8 -warning 9 -warning 10 -warning 11 -warning 12 " + 161 " -warning 7 -warning 8 -warning 9 -warning 10 -warning 11 -warning 12 " +
153 " -warning 13 -warning 14 -warning 15 -warning 16 -warning 17 -warning 18 -hide 113 ", 162 " -warning 13 -warning 14 -warning 15 -warning 16 -warning 17 -warning 18 -hide 113 ",
154 }, 163 },
155 current: { 164 current: {
156 api_file: "api/system-current.txt", 165 api_file: "api/system-current.txt",
157 removed_api_file: "api/system-removed.txt", 166 removed_api_file: "api/system-removed.txt",
158 args: " -error 2 -error 3 -error 4 -error 5 -error 6 -error 7 -error 8 -error 9 -error 10 -error 11 " + 167 args: " -error 2 -error 3 -error 4 -error 5 -error 6 -error 7 -error 8 -error 9 -error 10 -error 11 " +
159 " -error 12 -error 13 -error 14 -error 15 -error 16 -error 17 -error 18 -error 19 -error 20 " + 168 " -error 12 -error 13 -error 14 -error 15 -error 16 -error 17 -error 18 -error 19 -error 20 " +
160 " -error 21 -error 23 -error 24 -error 25 -hide 113 ", 169 " -error 21 -error 23 -error 24 -error 25 -hide 113 ",
161 }, 170 },
162 }, 171 },
163} 172}
@@ -212,3 +221,25 @@ java_library_static {
212 }, 221 },
213 compile_dex: true, 222 compile_dex: true,
214} 223}
224
225// Export the api/system-current.txt file.
226filegroup {
227 name: "car-api-system-current.txt",
228 visibility: [
229 "//cts/tests/signature/api",
230 ],
231 srcs: [
232 "api/system-current.txt",
233 ],
234}
235
236// Export the api/system-removed.txt file.
237filegroup {
238 name: "car-api-system-removed.txt",
239 visibility: [
240 "//cts/tests/signature/api",
241 ],
242 srcs: [
243 "api/system-removed.txt",
244 ],
245}
diff --git a/car-lib/src/android/car/hardware/property/CarPropertyEvent.java b/car-lib/src/android/car/hardware/property/CarPropertyEvent.java
index 638fbf2e..258403a4 100644
--- a/car-lib/src/android/car/hardware/property/CarPropertyEvent.java
+++ b/car-lib/src/android/car/hardware/property/CarPropertyEvent.java
@@ -31,7 +31,8 @@ public class CarPropertyEvent implements Parcelable {
31 private final int mEventType; 31 private final int mEventType;
32 private final CarPropertyValue<?> mCarPropertyValue; 32 private final CarPropertyValue<?> mCarPropertyValue;
33 33
34 // Getters. 34 // Use it as default value for error events.
35 private static final int ERROR_EVENT_VALUE = -1;
35 36
36 /** 37 /**
37 * @return EventType field 38 * @return EventType field
@@ -73,6 +74,19 @@ public class CarPropertyEvent implements Parcelable {
73 mCarPropertyValue = carPropertyValue; 74 mCarPropertyValue = carPropertyValue;
74 } 75 }
75 76
77 /**
78 * Constructor for {@link CarPropertyEvent} when it is an error event.
79 *
80 * The status of {@link CarPropertyValue} should be {@link CarPropertyValue#STATUS_ERROR}.
81 * In {@link CarPropertyManager}, the value of {@link CarPropertyValue} will be dropped.
82 */
83 public static CarPropertyEvent createErrorEvent(int propertyId, int areaId) {
84 // valueWithErrorCode will not be propagated to listeners
85 CarPropertyValue<Integer> valueWithErrorCode = new CarPropertyValue<>(propertyId, areaId,
86 CarPropertyValue.STATUS_ERROR, 0, ERROR_EVENT_VALUE);
87 return new CarPropertyEvent(PROPERTY_EVENT_ERROR, valueWithErrorCode);
88 }
89
76 private CarPropertyEvent(Parcel in) { 90 private CarPropertyEvent(Parcel in) {
77 mEventType = in.readInt(); 91 mEventType = in.readInt();
78 mCarPropertyValue = in.readParcelable(CarPropertyValue.class.getClassLoader()); 92 mCarPropertyValue = in.readParcelable(CarPropertyValue.class.getClassLoader());
diff --git a/procfs-inspector/server/Android.mk b/procfs-inspector/server/Android.mk
index fab1cf88..6924ef59 100644
--- a/procfs-inspector/server/Android.mk
+++ b/procfs-inspector/server/Android.mk
@@ -25,9 +25,6 @@ LOCAL_SRC_FILES := \
25 process.cpp \ 25 process.cpp \
26 directory.cpp 26 directory.cpp
27 27
28LOCAL_C_INCLUDES += \
29 frameworks/base/include
30
31LOCAL_SHARED_LIBRARIES := \ 28LOCAL_SHARED_LIBRARIES := \
32 libbinder \ 29 libbinder \
33 liblog \ 30 liblog \
diff --git a/service/src/com/android/car/CarPropertyService.java b/service/src/com/android/car/CarPropertyService.java
index a01d4b87..fa086883 100644
--- a/service/src/com/android/car/CarPropertyService.java
+++ b/service/src/com/android/car/CarPropertyService.java
@@ -372,7 +372,7 @@ public class CarPropertyService extends ICarProperty.Stub
372 List<Client> clients = mPropIdClientMap.get(property); 372 List<Client> clients = mPropIdClientMap.get(property);
373 if (clients != null) { 373 if (clients != null) {
374 List<CarPropertyEvent> eventList = new LinkedList<>(); 374 List<CarPropertyEvent> eventList = new LinkedList<>();
375 eventList.add(createErrorEvent(property, area)); 375 eventList.add(CarPropertyEvent.createErrorEvent(property, area));
376 for (Client c : clients) { 376 for (Client c : clients) {
377 try { 377 try {
378 c.getListener().onEvent(eventList); 378 c.getListener().onEvent(eventList);
@@ -387,9 +387,4 @@ public class CarPropertyService extends ICarProperty.Stub
387 + toHexString(property)); 387 + toHexString(property));
388 } 388 }
389 } 389 }
390
391 private static CarPropertyEvent createErrorEvent(int property, int area) {
392 return new CarPropertyEvent(CarPropertyEvent.PROPERTY_EVENT_ERROR,
393 new CarPropertyValue<>(property, area, null));
394 }
395} 390}
diff --git a/service/src/com/android/car/ICarImpl.java b/service/src/com/android/car/ICarImpl.java
index 67c50a75..8d4212a6 100644
--- a/service/src/com/android/car/ICarImpl.java
+++ b/service/src/com/android/car/ICarImpl.java
@@ -427,6 +427,7 @@ public class ICarImpl extends ICar.Stub {
427 private static final String COMMAND_HELP = "-h"; 427 private static final String COMMAND_HELP = "-h";
428 private static final String COMMAND_DAY_NIGHT_MODE = "day-night-mode"; 428 private static final String COMMAND_DAY_NIGHT_MODE = "day-night-mode";
429 private static final String COMMAND_INJECT_VHAL_EVENT = "inject-vhal-event"; 429 private static final String COMMAND_INJECT_VHAL_EVENT = "inject-vhal-event";
430 private static final String COMMAND_INJECT_ERROR_EVENT = "inject-error-event";
430 private static final String COMMAND_ENABLE_UXR = "enable-uxr"; 431 private static final String COMMAND_ENABLE_UXR = "enable-uxr";
431 private static final String COMMAND_GARAGE_MODE = "garage-mode"; 432 private static final String COMMAND_GARAGE_MODE = "garage-mode";
432 private static final String COMMAND_GET_DO_ACTIVITIES = "get-do-activities"; 433 private static final String COMMAND_GET_DO_ACTIVITIES = "get-do-activities";
@@ -448,6 +449,8 @@ public class ICarImpl extends ICar.Stub {
448 pw.println("\t Force into day/night mode or restore to auto."); 449 pw.println("\t Force into day/night mode or restore to auto.");
449 pw.println("\tinject-vhal-event property [zone] data(can be comma separated list)"); 450 pw.println("\tinject-vhal-event property [zone] data(can be comma separated list)");
450 pw.println("\t Inject a vehicle property for testing"); 451 pw.println("\t Inject a vehicle property for testing");
452 pw.println("\tinject-error-event property zone errorCode");
453 pw.println("\t Inject an error event from VHAL for testing.");
451 pw.println("\tdisable-uxr true|false"); 454 pw.println("\tdisable-uxr true|false");
452 pw.println("\t Disable UX restrictions and App blocking."); 455 pw.println("\t Disable UX restrictions and App blocking.");
453 pw.println("\tgarage-mode [on|off|query]"); 456 pw.println("\tgarage-mode [on|off|query]");
@@ -487,7 +490,17 @@ public class ICarImpl extends ICar.Stub {
487 // Global 490 // Global
488 data = args[2]; 491 data = args[2];
489 } 492 }
490 injectVhalEvent(args[1], zone, data, writer); 493 injectVhalEvent(args[1], zone, data, false, writer);
494 break;
495 case COMMAND_INJECT_ERROR_EVENT:
496 if (args.length != 4) {
497 writer.println("Incorrect number of arguments");
498 dumpHelp(writer);
499 break;
500 }
501 String errorAreaId = args[2];
502 String errorCode = args[3];
503 injectVhalEvent(args[1], errorAreaId, errorCode, true, writer);
491 break; 504 break;
492 case COMMAND_ENABLE_UXR: 505 case COMMAND_ENABLE_UXR:
493 if (args.length < 2) { 506 if (args.length < 2) {
@@ -584,11 +597,12 @@ public class ICarImpl extends ICar.Stub {
584 * 597 *
585 * @param property the Vehicle property Id as defined in the HAL 598 * @param property the Vehicle property Id as defined in the HAL
586 * @param zone Zone that this event services 599 * @param zone Zone that this event services
600 * @param isErrorEvent indicates the type of event
587 * @param value Data value of the event 601 * @param value Data value of the event
588 * @param writer PrintWriter 602 * @param writer PrintWriter
589 */ 603 */
590 private void injectVhalEvent(String property, String zone, String value, 604 private void injectVhalEvent(String property, String zone, String value,
591 PrintWriter writer) { 605 boolean isErrorEvent, PrintWriter writer) {
592 if (zone != null && (zone.equalsIgnoreCase(PARAM_VEHICLE_PROPERTY_AREA_GLOBAL))) { 606 if (zone != null && (zone.equalsIgnoreCase(PARAM_VEHICLE_PROPERTY_AREA_GLOBAL))) {
593 if (!isPropertyAreaTypeGlobal(property)) { 607 if (!isPropertyAreaTypeGlobal(property)) {
594 writer.println("Property area type inconsistent with given zone"); 608 writer.println("Property area type inconsistent with given zone");
@@ -596,7 +610,11 @@ public class ICarImpl extends ICar.Stub {
596 } 610 }
597 } 611 }
598 try { 612 try {
599 mHal.injectVhalEvent(property, zone, value); 613 if (isErrorEvent) {
614 mHal.injectOnPropertySetError(property, zone, value);
615 } else {
616 mHal.injectVhalEvent(property, zone, value);
617 }
600 } catch (NumberFormatException e) { 618 } catch (NumberFormatException e) {
601 writer.println("Invalid property Id zone Id or value" + e); 619 writer.println("Invalid property Id zone Id or value" + e);
602 dumpHelp(writer); 620 dumpHelp(writer);
diff --git a/service/src/com/android/car/hal/VehicleHal.java b/service/src/com/android/car/hal/VehicleHal.java
index f73d07c0..70953b63 100644
--- a/service/src/com/android/car/hal/VehicleHal.java
+++ b/service/src/com/android/car/hal/VehicleHal.java
@@ -552,6 +552,23 @@ public class VehicleHal extends IVehicleCallback.Stub {
552 onPropertyEvent(Lists.newArrayList(v)); 552 onPropertyEvent(Lists.newArrayList(v));
553 } 553 }
554 554
555 /**
556 * Inject an error event.
557 *
558 * @param property the Vehicle property Id as defined in the HAL
559 * @param zone Zone for the event to inject
560 * @param errorCode Error code return from HAL
561 */
562 public void injectOnPropertySetError(String property, String zone, String errorCode) {
563 if (zone == null || property == null || errorCode == null) {
564 return;
565 }
566 int propId = Integer.decode(property);
567 int zoneId = Integer.decode(zone);
568 int errorId = Integer.decode(errorCode);
569 onPropertySetError(errorId, propId, zoneId);
570 }
571
555 private static class VehiclePropertyEventInfo { 572 private static class VehiclePropertyEventInfo {
556 private int eventCount; 573 private int eventCount;
557 private VehiclePropValue lastEvent; 574 private VehiclePropValue lastEvent;
diff --git a/tests/PowerTestService/Android.mk b/tests/PowerTestService/Android.mk
index 6ea33f24..aeca2e9e 100644
--- a/tests/PowerTestService/Android.mk
+++ b/tests/PowerTestService/Android.mk
@@ -28,7 +28,6 @@ LOCAL_CFLAGS += \
28 -Wno-unused-parameter 28 -Wno-unused-parameter
29 29
30LOCAL_C_INCLUDES += \ 30LOCAL_C_INCLUDES += \
31 frameworks/base/include \
32 packages/services/Car/car-lib/native/include 31 packages/services/Car/car-lib/native/include
33 32
34LOCAL_SHARED_LIBRARIES := \ 33LOCAL_SHARED_LIBRARIES := \
diff --git a/tools/keventreader/server/Android.mk b/tools/keventreader/server/Android.mk
index 3dd6bba7..301f5578 100644
--- a/tools/keventreader/server/Android.mk
+++ b/tools/keventreader/server/Android.mk
@@ -28,9 +28,6 @@ LOCAL_SRC_FILES := \
28 ../common/com/android/car/keventreader/IEventCallback.aidl \ 28 ../common/com/android/car/keventreader/IEventCallback.aidl \
29 ../common/com/android/car/keventreader/IEventProvider.aidl \ 29 ../common/com/android/car/keventreader/IEventProvider.aidl \
30 30
31LOCAL_C_INCLUDES += \
32 frameworks/base/include
33
34LOCAL_SHARED_LIBRARIES := \ 31LOCAL_SHARED_LIBRARIES := \
35 libbinder \ 32 libbinder \
36 liblog \ 33 liblog \