keunyoung | ca51507 | 2015-07-10 12:21:47 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2015 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 | |
| 17 | package com.android.car; |
| 18 | |
Pavel Maltsev | abd4723 | 2017-10-10 16:54:57 -0700 | [diff] [blame] | 19 | import android.annotation.MainThread; |
Keun young Park | f3523cd | 2019-04-08 10:09:17 -0700 | [diff] [blame] | 20 | import android.app.ActivityManager; |
Yao Chen | e33f07e | 2016-07-26 12:02:51 -0700 | [diff] [blame] | 21 | import android.app.UiModeManager; |
Keun-young Park | e54ac27 | 2016-02-16 19:02:18 -0800 | [diff] [blame] | 22 | import android.car.Car; |
| 23 | import android.car.ICar; |
Pavel Maltsev | 0477e29 | 2016-05-27 12:22:36 -0700 | [diff] [blame] | 24 | import android.car.cluster.renderer.IInstrumentClusterNavigation; |
Ying Zheng | 9fc9940 | 2018-09-19 14:23:59 -0700 | [diff] [blame] | 25 | import android.car.userlib.CarUserManagerHelper; |
keunyoung | ca51507 | 2015-07-10 12:21:47 -0700 | [diff] [blame] | 26 | import android.content.Context; |
keunyoung | 1ab8e18 | 2015-09-24 09:25:22 -0700 | [diff] [blame] | 27 | import android.content.pm.PackageManager; |
Keun young Park | f3523cd | 2019-04-08 10:09:17 -0700 | [diff] [blame] | 28 | import android.content.res.Resources; |
Pavel Maltsev | cfe9310 | 2017-02-02 12:38:08 -0800 | [diff] [blame] | 29 | import android.hardware.automotive.vehicle.V2_0.IVehicle; |
Ram Periathiruvadi | 5cd00cb | 2018-02-12 13:49:50 -0800 | [diff] [blame] | 30 | import android.hardware.automotive.vehicle.V2_0.VehicleArea; |
Keun-young Park | aab47cd | 2017-06-05 11:04:50 -0700 | [diff] [blame] | 31 | import android.os.Binder; |
Enrico Granata | e8056ca | 2018-04-03 13:19:52 -0700 | [diff] [blame] | 32 | import android.os.Build; |
keunyoung | ca51507 | 2015-07-10 12:21:47 -0700 | [diff] [blame] | 33 | import android.os.IBinder; |
Keun-young Park | aab47cd | 2017-06-05 11:04:50 -0700 | [diff] [blame] | 34 | import android.os.Process; |
Steve Paik | c302c7c | 2017-08-04 14:01:58 -0700 | [diff] [blame] | 35 | import android.os.Trace; |
keunyoung | ca51507 | 2015-07-10 12:21:47 -0700 | [diff] [blame] | 36 | import android.util.Log; |
Steve Paik | c302c7c | 2017-08-04 14:01:58 -0700 | [diff] [blame] | 37 | import android.util.Slog; |
Keun-young Park | 4a79a38 | 2017-08-10 18:19:14 -0700 | [diff] [blame] | 38 | import android.util.TimingsTraceLog; |
Gregory Clark | 26fa601 | 2018-03-14 18:38:56 -0700 | [diff] [blame] | 39 | |
Hongwei Wang | 3854909 | 2018-08-22 12:32:42 -0700 | [diff] [blame] | 40 | import com.android.car.audio.CarAudioService; |
Pavel Maltsev | 1ecdd6c | 2016-03-02 16:33:44 -0800 | [diff] [blame] | 41 | import com.android.car.cluster.InstrumentClusterService; |
Serik Beketayev | 06a6668 | 2018-06-12 16:54:29 -0700 | [diff] [blame] | 42 | import com.android.car.garagemode.GarageModeService; |
keunyoung | cc449f7 | 2015-08-12 10:46:27 -0700 | [diff] [blame] | 43 | import com.android.car.hal.VehicleHal; |
Antonio Cortes | c52d5f9 | 2017-02-06 08:47:38 -0800 | [diff] [blame] | 44 | import com.android.car.internal.FeatureConfiguration; |
Keun-young Park | 4aeb4bf | 2015-12-08 18:31:33 -0800 | [diff] [blame] | 45 | import com.android.car.pm.CarPackageManagerService; |
Enrico Granata | b19bc32 | 2017-10-12 12:25:06 -0700 | [diff] [blame] | 46 | import com.android.car.systeminterface.SystemInterface; |
Ram Periathiruvadi | de0ca08 | 2019-03-20 11:16:44 -0700 | [diff] [blame] | 47 | import com.android.car.trust.CarTrustedDeviceService; |
Ying Zheng | 86d1c3e | 2018-05-11 11:42:48 -0700 | [diff] [blame] | 48 | import com.android.car.user.CarUserService; |
Mark Tabry | 76cfaaa | 2019-02-01 14:28:30 -0800 | [diff] [blame] | 49 | import com.android.car.vms.VmsBrokerService; |
Mark Tabry | a8fce56 | 2019-01-16 16:24:01 -0800 | [diff] [blame] | 50 | import com.android.car.vms.VmsClientManager; |
keunyoung | ca51507 | 2015-07-10 12:21:47 -0700 | [diff] [blame] | 51 | import com.android.internal.annotations.GuardedBy; |
Steve Paik | 1d8bea2 | 2018-02-03 01:54:06 +0000 | [diff] [blame] | 52 | import com.android.internal.car.ICarServiceHelper; |
Gregory Clark | 26fa601 | 2018-03-14 18:38:56 -0700 | [diff] [blame] | 53 | |
Enrico Granata | e8056ca | 2018-04-03 13:19:52 -0700 | [diff] [blame] | 54 | import java.io.FileDescriptor; |
keunyoung | a3b28d8 | 2015-08-25 13:05:15 -0700 | [diff] [blame] | 55 | import java.io.PrintWriter; |
Ying Zheng | 86d1c3e | 2018-05-11 11:42:48 -0700 | [diff] [blame] | 56 | import java.util.ArrayList; |
Antonio Cortes | e4619c7 | 2017-02-02 07:53:27 -0800 | [diff] [blame] | 57 | import java.util.Arrays; |
Ying Zheng | 86d1c3e | 2018-05-11 11:42:48 -0700 | [diff] [blame] | 58 | import java.util.List; |
keunyoung | a3b28d8 | 2015-08-25 13:05:15 -0700 | [diff] [blame] | 59 | |
keunyoung | ca51507 | 2015-07-10 12:21:47 -0700 | [diff] [blame] | 60 | public class ICarImpl extends ICar.Stub { |
keunyoung | ca51507 | 2015-07-10 12:21:47 -0700 | [diff] [blame] | 61 | |
Ram Periathiruvadi | 49d5a5a | 2017-02-17 18:50:09 -0800 | [diff] [blame] | 62 | public static final String INTERNAL_INPUT_SERVICE = "internal_input"; |
Keun-young Park | 4727da3 | 2016-05-31 10:00:51 -0700 | [diff] [blame] | 63 | public static final String INTERNAL_SYSTEM_ACTIVITY_MONITORING_SERVICE = |
| 64 | "system_activity_monitoring"; |
Keun-young Park | a28d7b2 | 2016-02-29 16:54:29 -0800 | [diff] [blame] | 65 | |
keunyoung | ca51507 | 2015-07-10 12:21:47 -0700 | [diff] [blame] | 66 | private final Context mContext; |
Pavel Maltsev | ec83b63 | 2017-01-05 15:10:55 -0800 | [diff] [blame] | 67 | private final VehicleHal mHal; |
keunyoung | ca51507 | 2015-07-10 12:21:47 -0700 | [diff] [blame] | 68 | |
Anthony Chen | 12aec30 | 2018-04-25 16:41:48 -0700 | [diff] [blame] | 69 | private final SystemInterface mSystemInterface; |
| 70 | |
Keun-young Park | 4727da3 | 2016-05-31 10:00:51 -0700 | [diff] [blame] | 71 | private final SystemActivityMonitoringService mSystemActivityMonitoringService; |
keunyoung | 4b0212c | 2015-10-29 17:11:57 -0700 | [diff] [blame] | 72 | private final CarPowerManagementService mCarPowerManagementService; |
Keun-young Park | a28d7b2 | 2016-02-29 16:54:29 -0800 | [diff] [blame] | 73 | private final CarPackageManagerService mCarPackageManagerService; |
| 74 | private final CarInputService mCarInputService; |
Ram Periathiruvadi | 25c16f1 | 2017-11-17 16:48:37 -0800 | [diff] [blame] | 75 | private final CarDrivingStateService mCarDrivingStateService; |
Ram Periathiruvadi | 4526a43 | 2018-01-24 13:00:54 -0800 | [diff] [blame] | 76 | private final CarUxRestrictionsManagerService mCarUXRestrictionsService; |
keunyoung | d32f4e6 | 2015-09-21 11:33:06 -0700 | [diff] [blame] | 77 | private final CarAudioService mCarAudioService; |
Vitalii Tomkiv | 6e5ee61 | 2016-03-09 14:57:32 -0800 | [diff] [blame] | 78 | private final CarProjectionService mCarProjectionService; |
Steve Paik | 9ec53d7 | 2018-04-27 13:28:31 -0700 | [diff] [blame] | 79 | private final CarPropertyService mCarPropertyService; |
Joseph Pirozzo | 317343d | 2016-01-25 10:22:37 -0800 | [diff] [blame] | 80 | private final CarNightService mCarNightService; |
Vitalii Tomkiv | 4637147 | 2016-05-23 16:55:22 -0700 | [diff] [blame] | 81 | private final AppFocusService mAppFocusService; |
Yao Chen | 3a7976d | 2016-01-20 17:27:08 -0800 | [diff] [blame] | 82 | private final GarageModeService mGarageModeService; |
Pavel Maltsev | 1ecdd6c | 2016-03-02 16:33:44 -0800 | [diff] [blame] | 83 | private final InstrumentClusterService mInstrumentClusterService; |
Gregory Clark | d813606 | 2017-12-11 14:27:53 -0800 | [diff] [blame] | 84 | private final CarLocationService mCarLocationService; |
Keun-young Park | d73afae | 2016-04-08 20:03:32 -0700 | [diff] [blame] | 85 | private final SystemStateControllerService mSystemStateControllerService; |
Ram Periathiruvadi | 7ed8418 | 2017-01-20 15:18:08 -0800 | [diff] [blame] | 86 | private final CarBluetoothService mCarBluetoothService; |
Ram Periathiruvadi | acb6024 | 2017-04-13 16:19:09 -0700 | [diff] [blame] | 87 | private final PerUserCarServiceHelper mPerUserCarServiceHelper; |
Enrico Granata | 9a916d7 | 2017-09-19 14:33:08 -0700 | [diff] [blame] | 88 | private final CarDiagnosticService mCarDiagnosticService; |
| 89 | private final CarStorageMonitoringService mCarStorageMonitoringService; |
Anthony Chen | 12aec30 | 2018-04-25 16:41:48 -0700 | [diff] [blame] | 90 | private final CarConfigurationService mCarConfigurationService; |
Ram Periathiruvadi | de0ca08 | 2019-03-20 11:16:44 -0700 | [diff] [blame] | 91 | private final CarTrustedDeviceService mCarTrustedDeviceService; |
Simon Dai | 527eb55 | 2019-02-12 13:06:15 -0800 | [diff] [blame] | 92 | private final CarMediaService mCarMediaService; |
Ying Zheng | 86d1c3e | 2018-05-11 11:42:48 -0700 | [diff] [blame] | 93 | private final CarUserManagerHelper mUserManagerHelper; |
Keun-young Park | d462a91 | 2019-02-11 08:53:42 -0800 | [diff] [blame] | 94 | private final CarUserService mCarUserService; |
Mark Tabry | a8fce56 | 2019-01-16 16:24:01 -0800 | [diff] [blame] | 95 | private final VmsClientManager mVmsClientManager; |
Mark Tabry | 76cfaaa | 2019-02-01 14:28:30 -0800 | [diff] [blame] | 96 | private final VmsBrokerService mVmsBrokerService; |
Mark Tabry | a8fce56 | 2019-01-16 16:24:01 -0800 | [diff] [blame] | 97 | private final VmsSubscriberService mVmsSubscriberService; |
| 98 | private final VmsPublisherService mVmsPublisherService; |
Selim Gurun | c8c82f6 | 2019-04-17 14:07:30 -0700 | [diff] [blame] | 99 | private final CarBugreportManagerService mCarBugreportManagerService; |
keunyoung | a74b9ca | 2015-10-21 13:33:58 -0700 | [diff] [blame] | 100 | |
Pavel Maltsev | 0d07c76 | 2016-11-03 16:40:15 -0700 | [diff] [blame] | 101 | private final CarServiceBase[] mAllServices; |
| 102 | |
Steve Paik | c302c7c | 2017-08-04 14:01:58 -0700 | [diff] [blame] | 103 | private static final String TAG = "ICarImpl"; |
| 104 | private static final String VHAL_TIMING_TAG = "VehicleHalTiming"; |
Serik Beketayev | 74debf2 | 2018-10-04 12:18:09 -0700 | [diff] [blame] | 105 | |
| 106 | private TimingsTraceLog mBootTiming; |
Steve Paik | c302c7c | 2017-08-04 14:01:58 -0700 | [diff] [blame] | 107 | |
keunyoung | 1ab8e18 | 2015-09-24 09:25:22 -0700 | [diff] [blame] | 108 | /** Test only service. Populate it only when necessary. */ |
| 109 | @GuardedBy("this") |
| 110 | private CarTestService mCarTestService; |
keunyoung | ca51507 | 2015-07-10 12:21:47 -0700 | [diff] [blame] | 111 | |
Keun-young Park | aab47cd | 2017-06-05 11:04:50 -0700 | [diff] [blame] | 112 | @GuardedBy("this") |
| 113 | private ICarServiceHelper mICarServiceHelper; |
| 114 | |
Enrico Granata | e8056ca | 2018-04-03 13:19:52 -0700 | [diff] [blame] | 115 | private final String mVehicleInterfaceName; |
| 116 | |
Pavel Maltsev | ec83b63 | 2017-01-05 15:10:55 -0800 | [diff] [blame] | 117 | public ICarImpl(Context serviceContext, IVehicle vehicle, SystemInterface systemInterface, |
Enrico Granata | e8056ca | 2018-04-03 13:19:52 -0700 | [diff] [blame] | 118 | CanBusErrorNotifier errorNotifier, String vehicleInterfaceName) { |
keunyoung | ca51507 | 2015-07-10 12:21:47 -0700 | [diff] [blame] | 119 | mContext = serviceContext; |
Steve Paik | 0f9fc00 | 2018-02-09 17:42:00 -0800 | [diff] [blame] | 120 | mSystemInterface = systemInterface; |
Pavel Maltsev | 0d07c76 | 2016-11-03 16:40:15 -0700 | [diff] [blame] | 121 | mHal = new VehicleHal(vehicle); |
Enrico Granata | e8056ca | 2018-04-03 13:19:52 -0700 | [diff] [blame] | 122 | mVehicleInterfaceName = vehicleInterfaceName; |
Yao, Yuxing | 0811d5a | 2018-11-29 16:18:53 -0800 | [diff] [blame] | 123 | mUserManagerHelper = new CarUserManagerHelper(serviceContext); |
Keun young Park | f3523cd | 2019-04-08 10:09:17 -0700 | [diff] [blame] | 124 | final Resources res = mContext.getResources(); |
| 125 | final int maxRunningUsers = res.getInteger( |
| 126 | com.android.internal.R.integer.config_multiuserMaxRunningUsers); |
| 127 | mCarUserService = new CarUserService(serviceContext, mUserManagerHelper, |
| 128 | ActivityManager.getService(), maxRunningUsers); |
Keun-young Park | 4727da3 | 2016-05-31 10:00:51 -0700 | [diff] [blame] | 129 | mSystemActivityMonitoringService = new SystemActivityMonitoringService(serviceContext); |
Steve Paik | 388d777 | 2018-02-12 10:54:51 -0800 | [diff] [blame] | 130 | mCarPowerManagementService = new CarPowerManagementService(mContext, mHal.getPowerHal(), |
Keun young Park | 9b3f266 | 2019-03-19 10:30:25 -0700 | [diff] [blame] | 131 | systemInterface, mUserManagerHelper); |
Steve Paik | 9ec53d7 | 2018-04-27 13:28:31 -0700 | [diff] [blame] | 132 | mCarPropertyService = new CarPropertyService(serviceContext, mHal.getPropertyHal()); |
| 133 | mCarDrivingStateService = new CarDrivingStateService(serviceContext, mCarPropertyService); |
Ram Periathiruvadi | 4526a43 | 2018-01-24 13:00:54 -0800 | [diff] [blame] | 134 | mCarUXRestrictionsService = new CarUxRestrictionsManagerService(serviceContext, |
Yao, Yuxing | 9bfb749 | 2019-02-15 11:53:34 -0800 | [diff] [blame] | 135 | mCarDrivingStateService, mCarPropertyService); |
Ram Periathiruvadi | 2da6d0e | 2018-01-26 18:02:10 -0800 | [diff] [blame] | 136 | mCarPackageManagerService = new CarPackageManagerService(serviceContext, |
| 137 | mCarUXRestrictionsService, |
Pavel Maltsev | 38da431 | 2019-04-08 10:38:38 -0700 | [diff] [blame] | 138 | mSystemActivityMonitoringService, |
| 139 | mUserManagerHelper); |
Justin Paupore | 44985ba | 2019-01-30 18:53:41 -0800 | [diff] [blame] | 140 | mPerUserCarServiceHelper = new PerUserCarServiceHelper(serviceContext); |
Sal Savage | 703c46f | 2019-04-15 08:39:25 -0700 | [diff] [blame] | 141 | mCarBluetoothService = new CarBluetoothService(serviceContext, mPerUserCarServiceHelper); |
Pavel Maltsev | 0d07c76 | 2016-11-03 16:40:15 -0700 | [diff] [blame] | 142 | mCarInputService = new CarInputService(serviceContext, mHal.getInputHal()); |
Justin Paupore | 44985ba | 2019-01-30 18:53:41 -0800 | [diff] [blame] | 143 | mCarProjectionService = new CarProjectionService( |
Pavel Maltsev | 079873b | 2019-02-25 12:15:09 -0800 | [diff] [blame] | 144 | serviceContext, null /* handler */, mCarInputService, mCarBluetoothService); |
Serik Beketayev | c6ab8be | 2018-08-28 21:20:53 -0700 | [diff] [blame] | 145 | mGarageModeService = new GarageModeService(mContext); |
Vitalii Tomkiv | 8c7f297 | 2016-07-11 15:42:04 -0700 | [diff] [blame] | 146 | mAppFocusService = new AppFocusService(serviceContext, mSystemActivityMonitoringService); |
Hongwei Wang | 3055723 | 2018-01-02 10:25:08 -0800 | [diff] [blame] | 147 | mCarAudioService = new CarAudioService(serviceContext); |
Steve Paik | 9ec53d7 | 2018-04-27 13:28:31 -0700 | [diff] [blame] | 148 | mCarNightService = new CarNightService(serviceContext, mCarPropertyService); |
Pavel Maltsev | 0477e29 | 2016-05-27 12:22:36 -0700 | [diff] [blame] | 149 | mInstrumentClusterService = new InstrumentClusterService(serviceContext, |
Pavel Maltsev | 03cf60c | 2016-06-27 15:11:51 -0700 | [diff] [blame] | 150 | mAppFocusService, mCarInputService); |
Serik Beketayev | f9f2ef0 | 2018-09-06 12:37:02 -0700 | [diff] [blame] | 151 | mSystemStateControllerService = new SystemStateControllerService( |
| 152 | serviceContext, mCarAudioService, this); |
Mark Tabry | 76cfaaa | 2019-02-01 14:28:30 -0800 | [diff] [blame] | 153 | mVmsBrokerService = new VmsBrokerService(); |
Mark Tabry | 1534c06 | 2019-03-29 01:30:49 -0700 | [diff] [blame] | 154 | mVmsClientManager = new VmsClientManager( |
Mark Tabry | 4143756 | 2019-04-04 10:37:33 -0700 | [diff] [blame] | 155 | serviceContext, mCarUserService, mUserManagerHelper, mHal.getVmsHal()); |
Mark Tabry | 76cfaaa | 2019-02-01 14:28:30 -0800 | [diff] [blame] | 156 | mVmsSubscriberService = new VmsSubscriberService( |
| 157 | serviceContext, mVmsBrokerService, mHal.getVmsHal()); |
| 158 | mVmsPublisherService = new VmsPublisherService( |
Mark Tabry | 1534c06 | 2019-03-29 01:30:49 -0700 | [diff] [blame] | 159 | serviceContext, mVmsBrokerService, mVmsClientManager); |
Enrico Granata | b3634e2 | 2017-05-05 18:02:31 -0700 | [diff] [blame] | 160 | mCarDiagnosticService = new CarDiagnosticService(serviceContext, mHal.getDiagnosticHal()); |
Enrico Granata | 517a1e0 | 2017-09-20 16:15:50 -0700 | [diff] [blame] | 161 | mCarStorageMonitoringService = new CarStorageMonitoringService(serviceContext, |
| 162 | systemInterface); |
Anthony Chen | 12aec30 | 2018-04-25 16:41:48 -0700 | [diff] [blame] | 163 | mCarConfigurationService = |
| 164 | new CarConfigurationService(serviceContext, new JsonReaderImpl()); |
Gregory Clark | e151953 | 2019-05-10 16:25:57 -0700 | [diff] [blame] | 165 | mCarLocationService = new CarLocationService(mContext, mUserManagerHelper); |
Ram Periathiruvadi | de0ca08 | 2019-03-20 11:16:44 -0700 | [diff] [blame] | 166 | mCarTrustedDeviceService = new CarTrustedDeviceService(serviceContext); |
Simon Dai | 527eb55 | 2019-02-12 13:06:15 -0800 | [diff] [blame] | 167 | mCarMediaService = new CarMediaService(serviceContext); |
Selim Gurun | c8c82f6 | 2019-04-17 14:07:30 -0700 | [diff] [blame] | 168 | mCarBugreportManagerService = new CarBugreportManagerService(serviceContext); |
keunyoung | a74b9ca | 2015-10-21 13:33:58 -0700 | [diff] [blame] | 169 | |
Keun young Park | a5fa478 | 2019-04-16 18:56:27 -0700 | [diff] [blame] | 170 | CarLocalServices.addService(CarPowerManagementService.class, mCarPowerManagementService); |
Keun-young Park | d462a91 | 2019-02-11 08:53:42 -0800 | [diff] [blame] | 171 | CarLocalServices.addService(CarUserService.class, mCarUserService); |
Ram Periathiruvadi | de0ca08 | 2019-03-20 11:16:44 -0700 | [diff] [blame] | 172 | CarLocalServices.addService(CarTrustedDeviceService.class, |
| 173 | mCarTrustedDeviceService); |
Gregory Clark | a440e81 | 2019-02-14 16:05:51 -0800 | [diff] [blame] | 174 | CarLocalServices.addService(SystemInterface.class, mSystemInterface); |
Keun-young Park | d462a91 | 2019-02-11 08:53:42 -0800 | [diff] [blame] | 175 | |
keunyoung | a3b28d8 | 2015-08-25 13:05:15 -0700 | [diff] [blame] | 176 | // Be careful with order. Service depending on other service should be inited later. |
Ying Zheng | 86d1c3e | 2018-05-11 11:42:48 -0700 | [diff] [blame] | 177 | List<CarServiceBase> allServices = new ArrayList<>(); |
Keun-young Park | d462a91 | 2019-02-11 08:53:42 -0800 | [diff] [blame] | 178 | allServices.add(mCarUserService); |
Ying Zheng | 86d1c3e | 2018-05-11 11:42:48 -0700 | [diff] [blame] | 179 | allServices.add(mSystemActivityMonitoringService); |
| 180 | allServices.add(mCarPowerManagementService); |
| 181 | allServices.add(mCarPropertyService); |
| 182 | allServices.add(mCarDrivingStateService); |
| 183 | allServices.add(mCarUXRestrictionsService); |
| 184 | allServices.add(mCarPackageManagerService); |
| 185 | allServices.add(mCarInputService); |
Ying Zheng | 86d1c3e | 2018-05-11 11:42:48 -0700 | [diff] [blame] | 186 | allServices.add(mGarageModeService); |
| 187 | allServices.add(mAppFocusService); |
| 188 | allServices.add(mCarAudioService); |
| 189 | allServices.add(mCarNightService); |
| 190 | allServices.add(mInstrumentClusterService); |
Ying Zheng | 86d1c3e | 2018-05-11 11:42:48 -0700 | [diff] [blame] | 191 | allServices.add(mSystemStateControllerService); |
Ying Zheng | 86d1c3e | 2018-05-11 11:42:48 -0700 | [diff] [blame] | 192 | allServices.add(mPerUserCarServiceHelper); |
Justin Paupore | 44985ba | 2019-01-30 18:53:41 -0800 | [diff] [blame] | 193 | allServices.add(mCarBluetoothService); |
| 194 | allServices.add(mCarProjectionService); |
| 195 | allServices.add(mCarDiagnosticService); |
Ying Zheng | 86d1c3e | 2018-05-11 11:42:48 -0700 | [diff] [blame] | 196 | allServices.add(mCarStorageMonitoringService); |
| 197 | allServices.add(mCarConfigurationService); |
Mark Tabry | a8fce56 | 2019-01-16 16:24:01 -0800 | [diff] [blame] | 198 | allServices.add(mVmsClientManager); |
Ying Zheng | 86d1c3e | 2018-05-11 11:42:48 -0700 | [diff] [blame] | 199 | allServices.add(mVmsSubscriberService); |
| 200 | allServices.add(mVmsPublisherService); |
Ram Periathiruvadi | de0ca08 | 2019-03-20 11:16:44 -0700 | [diff] [blame] | 201 | allServices.add(mCarTrustedDeviceService); |
Simon Dai | 527eb55 | 2019-02-12 13:06:15 -0800 | [diff] [blame] | 202 | allServices.add(mCarMediaService); |
Gregory Clark | a63ba02 | 2018-06-07 16:42:12 -0700 | [diff] [blame] | 203 | allServices.add(mCarLocationService); |
Selim Gurun | c8c82f6 | 2019-04-17 14:07:30 -0700 | [diff] [blame] | 204 | allServices.add(mCarBugreportManagerService); |
Ying Zheng | 86d1c3e | 2018-05-11 11:42:48 -0700 | [diff] [blame] | 205 | mAllServices = allServices.toArray(new CarServiceBase[allServices.size()]); |
keunyoung | ca51507 | 2015-07-10 12:21:47 -0700 | [diff] [blame] | 206 | } |
| 207 | |
Pavel Maltsev | abd4723 | 2017-10-10 16:54:57 -0700 | [diff] [blame] | 208 | @MainThread |
Pavel Maltsev | 8edd255 | 2017-09-18 14:52:16 -0700 | [diff] [blame] | 209 | void init() { |
Serik Beketayev | 74debf2 | 2018-10-04 12:18:09 -0700 | [diff] [blame] | 210 | mBootTiming = new TimingsTraceLog(VHAL_TIMING_TAG, Trace.TRACE_TAG_HAL); |
Steve Paik | c302c7c | 2017-08-04 14:01:58 -0700 | [diff] [blame] | 211 | traceBegin("VehicleHal.init"); |
Pavel Maltsev | 0d07c76 | 2016-11-03 16:40:15 -0700 | [diff] [blame] | 212 | mHal.init(); |
Steve Paik | c302c7c | 2017-08-04 14:01:58 -0700 | [diff] [blame] | 213 | traceEnd(); |
| 214 | traceBegin("CarService.initAllServices"); |
Ram Periathiruvadi | ee28c00 | 2017-02-07 21:35:01 -0800 | [diff] [blame] | 215 | for (CarServiceBase service : mAllServices) { |
keunyoung | a3b28d8 | 2015-08-25 13:05:15 -0700 | [diff] [blame] | 216 | service.init(); |
| 217 | } |
Steve Paik | c302c7c | 2017-08-04 14:01:58 -0700 | [diff] [blame] | 218 | traceEnd(); |
keunyoung | ca51507 | 2015-07-10 12:21:47 -0700 | [diff] [blame] | 219 | } |
| 220 | |
Pavel Maltsev | 8edd255 | 2017-09-18 14:52:16 -0700 | [diff] [blame] | 221 | void release() { |
keunyoung | a3b28d8 | 2015-08-25 13:05:15 -0700 | [diff] [blame] | 222 | // release done in opposite order from init |
| 223 | for (int i = mAllServices.length - 1; i >= 0; i--) { |
| 224 | mAllServices[i].release(); |
| 225 | } |
Pavel Maltsev | 0d07c76 | 2016-11-03 16:40:15 -0700 | [diff] [blame] | 226 | mHal.release(); |
Keun-young Park | d462a91 | 2019-02-11 08:53:42 -0800 | [diff] [blame] | 227 | CarLocalServices.removeAllServices(); |
keunyoung | 1ab8e18 | 2015-09-24 09:25:22 -0700 | [diff] [blame] | 228 | } |
| 229 | |
Pavel Maltsev | 8edd255 | 2017-09-18 14:52:16 -0700 | [diff] [blame] | 230 | void vehicleHalReconnected(IVehicle vehicle) { |
Pavel Maltsev | ec83b63 | 2017-01-05 15:10:55 -0800 | [diff] [blame] | 231 | mHal.vehicleHalReconnected(vehicle); |
| 232 | for (CarServiceBase service : mAllServices) { |
| 233 | service.vehicleHalReconnected(); |
| 234 | } |
| 235 | } |
| 236 | |
keunyoung | ca51507 | 2015-07-10 12:21:47 -0700 | [diff] [blame] | 237 | @Override |
Keun-young Park | aab47cd | 2017-06-05 11:04:50 -0700 | [diff] [blame] | 238 | public void setCarServiceHelper(IBinder helper) { |
Pavel Maltsev | 17e8183 | 2019-04-04 14:38:41 -0700 | [diff] [blame] | 239 | assertCallingFromSystemProcess(); |
Keun-young Park | aab47cd | 2017-06-05 11:04:50 -0700 | [diff] [blame] | 240 | synchronized (this) { |
| 241 | mICarServiceHelper = ICarServiceHelper.Stub.asInterface(helper); |
Steve Paik | 0f9fc00 | 2018-02-09 17:42:00 -0800 | [diff] [blame] | 242 | mSystemInterface.setCarServiceHelper(mICarServiceHelper); |
Keun-young Park | aab47cd | 2017-06-05 11:04:50 -0700 | [diff] [blame] | 243 | } |
| 244 | } |
| 245 | |
| 246 | @Override |
Keun-young Park | d462a91 | 2019-02-11 08:53:42 -0800 | [diff] [blame] | 247 | public void setUserLockStatus(int userHandle, int unlocked) { |
Pavel Maltsev | 17e8183 | 2019-04-04 14:38:41 -0700 | [diff] [blame] | 248 | assertCallingFromSystemProcess(); |
| 249 | mCarUserService.setUserLockStatus(userHandle, unlocked == 1); |
| 250 | } |
| 251 | |
| 252 | @Override |
| 253 | public void onSwitchUser(int userHandle) { |
| 254 | assertCallingFromSystemProcess(); |
| 255 | |
| 256 | Log.i(TAG, "Foreground user switched to " + userHandle); |
| 257 | mCarUserService.onSwitchUser(userHandle); |
| 258 | } |
| 259 | |
Jim Kaye | e513316 | 2019-04-22 12:50:27 -0700 | [diff] [blame] | 260 | static void assertCallingFromSystemProcess() { |
Keun-young Park | d462a91 | 2019-02-11 08:53:42 -0800 | [diff] [blame] | 261 | int uid = Binder.getCallingUid(); |
| 262 | if (uid != Process.SYSTEM_UID) { |
| 263 | throw new SecurityException("Only allowed from system"); |
| 264 | } |
Keun-young Park | d462a91 | 2019-02-11 08:53:42 -0800 | [diff] [blame] | 265 | } |
| 266 | |
Keun young Park | aabecd9 | 2019-05-03 17:31:27 -0700 | [diff] [blame] | 267 | /** |
| 268 | * Assert if binder call is coming from system process like system server or if it is called |
| 269 | * from its own process even if it is not system. The latter can happen in test environment. |
| 270 | * Note that car service runs as system user but test like car service test will not. |
| 271 | */ |
| 272 | static void assertCallingFromSystemProcessOrSelf() { |
| 273 | int uid = Binder.getCallingUid(); |
| 274 | int pid = Binder.getCallingPid(); |
| 275 | if (uid != Process.SYSTEM_UID && pid != Process.myPid()) { |
| 276 | throw new SecurityException("Only allowed from system or self"); |
| 277 | } |
| 278 | } |
| 279 | |
Keun-young Park | d462a91 | 2019-02-11 08:53:42 -0800 | [diff] [blame] | 280 | @Override |
keunyoung | ca51507 | 2015-07-10 12:21:47 -0700 | [diff] [blame] | 281 | public IBinder getCarService(String serviceName) { |
| 282 | switch (serviceName) { |
Keun-young Park | 5672e85 | 2016-02-09 19:53:48 -0800 | [diff] [blame] | 283 | case Car.AUDIO_SERVICE: |
| 284 | return mCarAudioService; |
Vitalii Tomkiv | 4637147 | 2016-05-23 16:55:22 -0700 | [diff] [blame] | 285 | case Car.APP_FOCUS_SERVICE: |
| 286 | return mAppFocusService; |
Keun-young Park | 45fdcba | 2015-12-08 11:38:58 -0800 | [diff] [blame] | 287 | case Car.PACKAGE_SERVICE: |
| 288 | return mCarPackageManagerService; |
Enrico Granata | 5c56d2a | 2017-02-07 15:38:12 -0800 | [diff] [blame] | 289 | case Car.DIAGNOSTIC_SERVICE: |
Enrico Granata | b3634e2 | 2017-05-05 18:02:31 -0700 | [diff] [blame] | 290 | assertAnyDiagnosticPermission(mContext); |
| 291 | return mCarDiagnosticService; |
Steve Paik | 388d777 | 2018-02-12 10:54:51 -0800 | [diff] [blame] | 292 | case Car.POWER_SERVICE: |
| 293 | assertPowerPermission(mContext); |
| 294 | return mCarPowerManagementService; |
Steve Paik | 9ec53d7 | 2018-04-27 13:28:31 -0700 | [diff] [blame] | 295 | case Car.CABIN_SERVICE: |
| 296 | case Car.HVAC_SERVICE: |
| 297 | case Car.INFO_SERVICE: |
| 298 | case Car.PROPERTY_SERVICE: |
| 299 | case Car.SENSOR_SERVICE: |
| 300 | case Car.VENDOR_EXTENSION_SERVICE: |
| 301 | return mCarPropertyService; |
Pavel Maltsev | 7a948e5 | 2016-02-02 23:30:14 -0800 | [diff] [blame] | 302 | case Car.CAR_NAVIGATION_SERVICE: |
Keun-young Park | e31a8b2 | 2016-03-16 17:34:08 -0700 | [diff] [blame] | 303 | assertNavigationManagerPermission(mContext); |
Pavel Maltsev | 0477e29 | 2016-05-27 12:22:36 -0700 | [diff] [blame] | 304 | IInstrumentClusterNavigation navService = |
| 305 | mInstrumentClusterService.getNavigationService(); |
| 306 | return navService == null ? null : navService.asBinder(); |
Pavel Maltsev | 905968c | 2017-07-16 19:48:57 -0700 | [diff] [blame] | 307 | case Car.CAR_INSTRUMENT_CLUSTER_SERVICE: |
| 308 | assertClusterManagerPermission(mContext); |
| 309 | return mInstrumentClusterService.getManagerService(); |
Vitalii Tomkiv | 6e5ee61 | 2016-03-09 14:57:32 -0800 | [diff] [blame] | 310 | case Car.PROJECTION_SERVICE: |
Vitalii Tomkiv | 6e5ee61 | 2016-03-09 14:57:32 -0800 | [diff] [blame] | 311 | return mCarProjectionService; |
Antonio Cortes | e4619c7 | 2017-02-02 07:53:27 -0800 | [diff] [blame] | 312 | case Car.VMS_SUBSCRIBER_SERVICE: |
Asaf Rosenfeld | 39e4f03 | 2017-09-16 11:33:50 -0700 | [diff] [blame] | 313 | assertVmsSubscriberPermission(mContext); |
| 314 | return mVmsSubscriberService; |
Keun-young Park | e54ac27 | 2016-02-16 19:02:18 -0800 | [diff] [blame] | 315 | case Car.TEST_SERVICE: { |
Pavel Maltsev | 0d07c76 | 2016-11-03 16:40:15 -0700 | [diff] [blame] | 316 | assertPermission(mContext, Car.PERMISSION_CAR_TEST_SERVICE); |
keunyoung | 1ab8e18 | 2015-09-24 09:25:22 -0700 | [diff] [blame] | 317 | synchronized (this) { |
| 318 | if (mCarTestService == null) { |
| 319 | mCarTestService = new CarTestService(mContext, this); |
| 320 | } |
| 321 | return mCarTestService; |
| 322 | } |
| 323 | } |
Ram Periathiruvadi | 76a8489 | 2017-07-27 18:10:35 -0700 | [diff] [blame] | 324 | case Car.BLUETOOTH_SERVICE: |
| 325 | return mCarBluetoothService; |
Enrico Granata | 9a916d7 | 2017-09-19 14:33:08 -0700 | [diff] [blame] | 326 | case Car.STORAGE_MONITORING_SERVICE: |
Enrico Granata | 1172f88 | 2017-09-21 14:51:30 -0700 | [diff] [blame] | 327 | assertPermission(mContext, Car.PERMISSION_STORAGE_MONITORING); |
Enrico Granata | 9a916d7 | 2017-09-19 14:33:08 -0700 | [diff] [blame] | 328 | return mCarStorageMonitoringService; |
Ram Periathiruvadi | 25c16f1 | 2017-11-17 16:48:37 -0800 | [diff] [blame] | 329 | case Car.CAR_DRIVING_STATE_SERVICE: |
| 330 | assertDrivingStatePermission(mContext); |
| 331 | return mCarDrivingStateService; |
| 332 | case Car.CAR_UX_RESTRICTION_SERVICE: |
| 333 | return mCarUXRestrictionsService; |
Anthony Chen | d4203d8 | 2018-05-16 16:21:52 -0700 | [diff] [blame] | 334 | case Car.CAR_CONFIGURATION_SERVICE: |
| 335 | return mCarConfigurationService; |
Ram Periathiruvadi | 194ce1b | 2019-01-14 09:42:12 -0800 | [diff] [blame] | 336 | case Car.CAR_TRUST_AGENT_ENROLLMENT_SERVICE: |
| 337 | assertTrustAgentEnrollmentPermission(mContext); |
Ram Periathiruvadi | de0ca08 | 2019-03-20 11:16:44 -0700 | [diff] [blame] | 338 | return mCarTrustedDeviceService.getCarTrustAgentEnrollmentService(); |
Simon Dai | 527eb55 | 2019-02-12 13:06:15 -0800 | [diff] [blame] | 339 | case Car.CAR_MEDIA_SERVICE: |
| 340 | return mCarMediaService; |
Selim Gurun | c8c82f6 | 2019-04-17 14:07:30 -0700 | [diff] [blame] | 341 | case Car.CAR_BUGREPORT_SERVICE: |
| 342 | return mCarBugreportManagerService; |
keunyoung | ca51507 | 2015-07-10 12:21:47 -0700 | [diff] [blame] | 343 | default: |
| 344 | Log.w(CarLog.TAG_SERVICE, "getCarService for unknown service:" + serviceName); |
| 345 | return null; |
| 346 | } |
| 347 | } |
| 348 | |
Pavel Maltsev | 1ecdd6c | 2016-03-02 16:33:44 -0800 | [diff] [blame] | 349 | @Override |
| 350 | public int getCarConnectionType() { |
Pavel Maltsev | 0d07c76 | 2016-11-03 16:40:15 -0700 | [diff] [blame] | 351 | return Car.CONNECTION_TYPE_EMBEDDED; |
Pavel Maltsev | 1ecdd6c | 2016-03-02 16:33:44 -0800 | [diff] [blame] | 352 | } |
| 353 | |
Keun-young Park | a28d7b2 | 2016-02-29 16:54:29 -0800 | [diff] [blame] | 354 | public CarServiceBase getCarInternalService(String serviceName) { |
| 355 | switch (serviceName) { |
| 356 | case INTERNAL_INPUT_SERVICE: |
| 357 | return mCarInputService; |
Keun-young Park | 4727da3 | 2016-05-31 10:00:51 -0700 | [diff] [blame] | 358 | case INTERNAL_SYSTEM_ACTIVITY_MONITORING_SERVICE: |
| 359 | return mSystemActivityMonitoringService; |
Keun-young Park | a28d7b2 | 2016-02-29 16:54:29 -0800 | [diff] [blame] | 360 | default: |
| 361 | Log.w(CarLog.TAG_SERVICE, "getCarInternalService for unknown service:" + |
| 362 | serviceName); |
| 363 | return null; |
| 364 | } |
| 365 | } |
| 366 | |
keunyoung | 1ab8e18 | 2015-09-24 09:25:22 -0700 | [diff] [blame] | 367 | public static void assertVehicleHalMockPermission(Context context) { |
Steve Paik | 461ecc6 | 2016-06-08 15:28:32 -0700 | [diff] [blame] | 368 | assertPermission(context, Car.PERMISSION_MOCK_VEHICLE_HAL); |
keunyoung | 1ab8e18 | 2015-09-24 09:25:22 -0700 | [diff] [blame] | 369 | } |
| 370 | |
Keun-young Park | e31a8b2 | 2016-03-16 17:34:08 -0700 | [diff] [blame] | 371 | public static void assertNavigationManagerPermission(Context context) { |
Steve Paik | 461ecc6 | 2016-06-08 15:28:32 -0700 | [diff] [blame] | 372 | assertPermission(context, Car.PERMISSION_CAR_NAVIGATION_MANAGER); |
Pavel Maltsev | ce4ffd9 | 2016-03-09 10:56:23 -0800 | [diff] [blame] | 373 | } |
| 374 | |
Pavel Maltsev | 905968c | 2017-07-16 19:48:57 -0700 | [diff] [blame] | 375 | public static void assertClusterManagerPermission(Context context) { |
| 376 | assertPermission(context, Car.PERMISSION_CAR_INSTRUMENT_CLUSTER_CONTROL); |
| 377 | } |
| 378 | |
Steve Paik | 388d777 | 2018-02-12 10:54:51 -0800 | [diff] [blame] | 379 | public static void assertPowerPermission(Context context) { |
| 380 | assertPermission(context, Car.PERMISSION_CAR_POWER); |
| 381 | } |
| 382 | |
Vitalii Tomkiv | 6e5ee61 | 2016-03-09 14:57:32 -0800 | [diff] [blame] | 383 | public static void assertProjectionPermission(Context context) { |
Steve Paik | 461ecc6 | 2016-06-08 15:28:32 -0700 | [diff] [blame] | 384 | assertPermission(context, Car.PERMISSION_CAR_PROJECTION); |
| 385 | } |
| 386 | |
Pavel Maltsev | 079873b | 2019-02-25 12:15:09 -0800 | [diff] [blame] | 387 | /** Verify the calling context has the {@link Car#PERMISSION_CAR_PROJECTION_STATUS} */ |
| 388 | public static void assertProjectionStatusPermission(Context context) { |
| 389 | assertPermission(context, Car.PERMISSION_CAR_PROJECTION_STATUS); |
| 390 | } |
| 391 | |
Enrico Granata | 3c7a666 | 2017-02-23 18:07:59 -0800 | [diff] [blame] | 392 | public static void assertAnyDiagnosticPermission(Context context) { |
| 393 | assertAnyPermission(context, |
Enrico Granata | ae25b92 | 2017-07-07 11:28:15 -0700 | [diff] [blame] | 394 | Car.PERMISSION_CAR_DIAGNOSTIC_READ_ALL, |
Enrico Granata | 3c7a666 | 2017-02-23 18:07:59 -0800 | [diff] [blame] | 395 | Car.PERMISSION_CAR_DIAGNOSTIC_CLEAR); |
| 396 | } |
| 397 | |
Ram Periathiruvadi | 25c16f1 | 2017-11-17 16:48:37 -0800 | [diff] [blame] | 398 | public static void assertDrivingStatePermission(Context context) { |
| 399 | assertPermission(context, Car.PERMISSION_CAR_DRIVING_STATE); |
| 400 | } |
| 401 | |
Antonio Cortes | 6b3544c | 2017-02-06 16:54:58 -0800 | [diff] [blame] | 402 | public static void assertVmsPublisherPermission(Context context) { |
| 403 | assertPermission(context, Car.PERMISSION_VMS_PUBLISHER); |
| 404 | } |
| 405 | |
Antonio Cortes | e4619c7 | 2017-02-02 07:53:27 -0800 | [diff] [blame] | 406 | public static void assertVmsSubscriberPermission(Context context) { |
| 407 | assertPermission(context, Car.PERMISSION_VMS_SUBSCRIBER); |
| 408 | } |
| 409 | |
Ram Periathiruvadi | 194ce1b | 2019-01-14 09:42:12 -0800 | [diff] [blame] | 410 | /** |
| 411 | * Ensures the caller has the permission to enroll a Trust Agent. |
Ram Periathiruvadi | 194ce1b | 2019-01-14 09:42:12 -0800 | [diff] [blame] | 412 | */ |
| 413 | public static void assertTrustAgentEnrollmentPermission(Context context) { |
| 414 | assertPermission(context, Car.PERMISSION_CAR_ENROLL_TRUST); |
| 415 | } |
| 416 | |
Steve Paik | 461ecc6 | 2016-06-08 15:28:32 -0700 | [diff] [blame] | 417 | public static void assertPermission(Context context, String permission) { |
| 418 | if (context.checkCallingOrSelfPermission(permission) != PackageManager.PERMISSION_GRANTED) { |
| 419 | throw new SecurityException("requires " + permission); |
Vitalii Tomkiv | 6e5ee61 | 2016-03-09 14:57:32 -0800 | [diff] [blame] | 420 | } |
| 421 | } |
| 422 | |
Steve Paik | 9ec53d7 | 2018-04-27 13:28:31 -0700 | [diff] [blame] | 423 | /** |
| 424 | * Checks to see if the caller has a permission. |
Steve Paik | 9ec53d7 | 2018-04-27 13:28:31 -0700 | [diff] [blame] | 425 | * |
| 426 | * @return boolean TRUE if caller has the permission. |
| 427 | */ |
| 428 | public static boolean hasPermission(Context context, String permission) { |
| 429 | return context.checkCallingOrSelfPermission(permission) |
| 430 | == PackageManager.PERMISSION_GRANTED; |
| 431 | } |
| 432 | |
Enrico Granata | 3c7a666 | 2017-02-23 18:07:59 -0800 | [diff] [blame] | 433 | public static void assertAnyPermission(Context context, String... permissions) { |
| 434 | for (String permission : permissions) { |
| 435 | if (context.checkCallingOrSelfPermission(permission) == |
| 436 | PackageManager.PERMISSION_GRANTED) { |
| 437 | return; |
| 438 | } |
| 439 | } |
| 440 | throw new SecurityException("requires any of " + Arrays.toString(permissions)); |
| 441 | } |
| 442 | |
Enrico Granata | e8056ca | 2018-04-03 13:19:52 -0700 | [diff] [blame] | 443 | @Override |
| 444 | protected void dump(FileDescriptor fd, PrintWriter writer, String[] args) { |
| 445 | if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.DUMP) |
Anthony Chen | 12aec30 | 2018-04-25 16:41:48 -0700 | [diff] [blame] | 446 | != PackageManager.PERMISSION_GRANTED) { |
Enrico Granata | e8056ca | 2018-04-03 13:19:52 -0700 | [diff] [blame] | 447 | writer.println("Permission Denial: can't dump CarService from from pid=" |
Anthony Chen | 12aec30 | 2018-04-25 16:41:48 -0700 | [diff] [blame] | 448 | + Binder.getCallingPid() + ", uid=" + Binder.getCallingUid() |
| 449 | + " without permission " + android.Manifest.permission.DUMP); |
Enrico Granata | e8056ca | 2018-04-03 13:19:52 -0700 | [diff] [blame] | 450 | return; |
keunyoung | a3b28d8 | 2015-08-25 13:05:15 -0700 | [diff] [blame] | 451 | } |
Enrico Granata | e8056ca | 2018-04-03 13:19:52 -0700 | [diff] [blame] | 452 | if (args == null || args.length == 0) { |
| 453 | writer.println("*dump car service*"); |
| 454 | |
| 455 | writer.println("*FutureConfig, DEFAULT:" + FeatureConfiguration.DEFAULT); |
| 456 | writer.println("*Dump all services*"); |
| 457 | for (CarServiceBase service : mAllServices) { |
| 458 | dumpService(service, writer); |
| 459 | } |
| 460 | if (mCarTestService != null) { |
| 461 | dumpService(mCarTestService, writer); |
| 462 | } |
| 463 | writer.println("*Dump Vehicle HAL*"); |
| 464 | writer.println("Vehicle HAL Interface: " + mVehicleInterfaceName); |
| 465 | try { |
| 466 | // TODO dump all feature flags by creating a dumpable interface |
| 467 | mHal.dump(writer); |
| 468 | } catch (Exception e) { |
| 469 | writer.println("Failed dumping: " + mHal.getClass().getName()); |
| 470 | e.printStackTrace(writer); |
| 471 | } |
| 472 | } else if (Build.IS_USERDEBUG || Build.IS_ENG) { |
| 473 | execShellCmd(args, writer); |
| 474 | } else { |
| 475 | writer.println("Commands not supported in " + Build.TYPE); |
Brad Stenning | ed3d59b | 2017-11-09 16:15:17 -0800 | [diff] [blame] | 476 | } |
| 477 | } |
| 478 | |
| 479 | private void dumpService(CarServiceBase service, PrintWriter writer) { |
| 480 | try { |
| 481 | service.dump(writer); |
| 482 | } catch (Exception e) { |
| 483 | writer.println("Failed dumping: " + service.getClass().getName()); |
| 484 | e.printStackTrace(writer); |
| 485 | } |
keunyoung | cc449f7 | 2015-08-12 10:46:27 -0700 | [diff] [blame] | 486 | } |
Yao Chen | e33f07e | 2016-07-26 12:02:51 -0700 | [diff] [blame] | 487 | |
| 488 | void execShellCmd(String[] args, PrintWriter writer) { |
| 489 | new CarShellCommand().exec(args, writer); |
| 490 | } |
| 491 | |
Pavel Maltsev | abd4723 | 2017-10-10 16:54:57 -0700 | [diff] [blame] | 492 | @MainThread |
Serik Beketayev | 74debf2 | 2018-10-04 12:18:09 -0700 | [diff] [blame] | 493 | private void traceBegin(String name) { |
Steve Paik | c302c7c | 2017-08-04 14:01:58 -0700 | [diff] [blame] | 494 | Slog.i(TAG, name); |
| 495 | mBootTiming.traceBegin(name); |
| 496 | } |
| 497 | |
Pavel Maltsev | abd4723 | 2017-10-10 16:54:57 -0700 | [diff] [blame] | 498 | @MainThread |
Serik Beketayev | 74debf2 | 2018-10-04 12:18:09 -0700 | [diff] [blame] | 499 | private void traceEnd() { |
Steve Paik | c302c7c | 2017-08-04 14:01:58 -0700 | [diff] [blame] | 500 | mBootTiming.traceEnd(); |
| 501 | } |
| 502 | |
Yao Chen | e33f07e | 2016-07-26 12:02:51 -0700 | [diff] [blame] | 503 | private class CarShellCommand { |
| 504 | private static final String COMMAND_HELP = "-h"; |
| 505 | private static final String COMMAND_DAY_NIGHT_MODE = "day-night-mode"; |
Ram Periathiruvadi | 5cd00cb | 2018-02-12 13:49:50 -0800 | [diff] [blame] | 506 | private static final String COMMAND_INJECT_VHAL_EVENT = "inject-vhal-event"; |
Ram Periathiruvadi | bf0eab7 | 2018-02-06 12:32:43 -0800 | [diff] [blame] | 507 | private static final String COMMAND_ENABLE_UXR = "enable-uxr"; |
Bryan Eyler | a32a7c1 | 2018-02-27 15:40:00 -0800 | [diff] [blame] | 508 | private static final String COMMAND_GARAGE_MODE = "garage-mode"; |
Ram Periathiruvadi | 3838830 | 2018-02-22 16:42:49 -0800 | [diff] [blame] | 509 | private static final String COMMAND_GET_DO_ACTIVITIES = "get-do-activities"; |
Kai | dd4ef5a | 2019-03-04 14:07:26 -0800 | [diff] [blame] | 510 | private static final String COMMAND_GET_CARPROPERTYCONFIG = "get-carpropertyconfig"; |
Kai | 29fba11 | 2019-04-22 18:37:38 -0700 | [diff] [blame^] | 511 | private static final String COMMAND_GET_PROPERTY_VALUE = "get-property-value"; |
Pavel Maltsev | 48a3194 | 2019-03-03 22:08:28 -0800 | [diff] [blame] | 512 | private static final String COMMAND_PROJECTION_UI_MODE = "projection-ui-mode"; |
Jim Kaye | d76c274 | 2019-04-02 11:33:27 -0700 | [diff] [blame] | 513 | private static final String COMMAND_RESUME = "resume"; |
| 514 | private static final String COMMAND_SUSPEND = "suspend"; |
Ram Periathiruvadi | d26a3fb | 2019-04-15 14:48:23 -0700 | [diff] [blame] | 515 | private static final String COMMAND_ENABLE_TRUSTED_DEVICE = "enable-trusted-device"; |
| 516 | private static final String COMMAND_REMOVE_TRUSTED_DEVICES = "remove-trusted-devices"; |
Ram Periathiruvadi | ee28c00 | 2017-02-07 21:35:01 -0800 | [diff] [blame] | 517 | |
Yao Chen | e33f07e | 2016-07-26 12:02:51 -0700 | [diff] [blame] | 518 | private static final String PARAM_DAY_MODE = "day"; |
| 519 | private static final String PARAM_NIGHT_MODE = "night"; |
| 520 | private static final String PARAM_SENSOR_MODE = "sensor"; |
Ram Periathiruvadi | 5cd00cb | 2018-02-12 13:49:50 -0800 | [diff] [blame] | 521 | private static final String PARAM_VEHICLE_PROPERTY_AREA_GLOBAL = "0"; |
Bryan Eyler | a32a7c1 | 2018-02-27 15:40:00 -0800 | [diff] [blame] | 522 | private static final String PARAM_ON_MODE = "on"; |
| 523 | private static final String PARAM_OFF_MODE = "off"; |
| 524 | private static final String PARAM_QUERY_MODE = "query"; |
Ram Periathiruvadi | 5cd00cb | 2018-02-12 13:49:50 -0800 | [diff] [blame] | 525 | |
Yao Chen | e33f07e | 2016-07-26 12:02:51 -0700 | [diff] [blame] | 526 | |
| 527 | private void dumpHelp(PrintWriter pw) { |
| 528 | pw.println("Car service commands:"); |
| 529 | pw.println("\t-h"); |
| 530 | pw.println("\t Print this help text."); |
| 531 | pw.println("\tday-night-mode [day|night|sensor]"); |
| 532 | pw.println("\t Force into day/night mode or restore to auto."); |
Ram Periathiruvadi | 5cd00cb | 2018-02-12 13:49:50 -0800 | [diff] [blame] | 533 | pw.println("\tinject-vhal-event property [zone] data(can be comma separated list)"); |
Jim Kaye | f10b7d8 | 2019-02-26 12:53:22 -0800 | [diff] [blame] | 534 | pw.println("\t Inject a vehicle property for testing."); |
Ram Periathiruvadi | d26a3fb | 2019-04-15 14:48:23 -0700 | [diff] [blame] | 535 | pw.println("\tenable-uxr true|false"); |
| 536 | pw.println("\t Enable/Disable UX restrictions and App blocking."); |
Bryan Eyler | a32a7c1 | 2018-02-27 15:40:00 -0800 | [diff] [blame] | 537 | pw.println("\tgarage-mode [on|off|query]"); |
| 538 | pw.println("\t Force into garage mode or check status."); |
Ram Periathiruvadi | 3838830 | 2018-02-22 16:42:49 -0800 | [diff] [blame] | 539 | pw.println("\tget-do-activities pkgname"); |
Jim Kaye | f10b7d8 | 2019-02-26 12:53:22 -0800 | [diff] [blame] | 540 | pw.println("\t Get Distraction Optimized activities in given package."); |
Kai | dd4ef5a | 2019-03-04 14:07:26 -0800 | [diff] [blame] | 541 | pw.println("\tget-carpropertyconfig [propertyId]"); |
| 542 | pw.println("\t Get a CarPropertyConfig by Id in Hex or list all CarPropertyConfigs"); |
Kai | 29fba11 | 2019-04-22 18:37:38 -0700 | [diff] [blame^] | 543 | pw.println("\tget-property-value [propertyId] [areaId]"); |
| 544 | pw.println("\t Get a vehicle property value by property id in Hex and areaId"); |
| 545 | pw.println("\t or list all property values for all areaId"); |
Jim Kaye | d76c274 | 2019-04-02 11:33:27 -0700 | [diff] [blame] | 546 | pw.println("\tsuspend"); |
| 547 | pw.println("\t Suspend the system to Deep Sleep."); |
| 548 | pw.println("\tresume"); |
| 549 | pw.println("\t Wake the system up after a 'suspend.'"); |
Ram Periathiruvadi | d26a3fb | 2019-04-15 14:48:23 -0700 | [diff] [blame] | 550 | pw.println("\tenable-trusted-device true|false"); |
| 551 | pw.println("\t Enable/Disable Trusted device feature."); |
| 552 | pw.println("\tremove-trusted-devices"); |
| 553 | pw.println("\t Remove all trusted devices for the current foreground user."); |
Yao Chen | e33f07e | 2016-07-26 12:02:51 -0700 | [diff] [blame] | 554 | } |
| 555 | |
| 556 | public void exec(String[] args, PrintWriter writer) { |
| 557 | String arg = args[0]; |
| 558 | switch (arg) { |
| 559 | case COMMAND_HELP: |
| 560 | dumpHelp(writer); |
| 561 | break; |
Bryan Eyler | a32a7c1 | 2018-02-27 15:40:00 -0800 | [diff] [blame] | 562 | case COMMAND_DAY_NIGHT_MODE: { |
Jim Kaye | f10b7d8 | 2019-02-26 12:53:22 -0800 | [diff] [blame] | 563 | String value = args.length < 2 ? "" : args[1]; |
Yao Chen | e33f07e | 2016-07-26 12:02:51 -0700 | [diff] [blame] | 564 | forceDayNightMode(value, writer); |
| 565 | break; |
Bryan Eyler | a32a7c1 | 2018-02-27 15:40:00 -0800 | [diff] [blame] | 566 | } |
| 567 | case COMMAND_GARAGE_MODE: { |
Jim Kaye | f10b7d8 | 2019-02-26 12:53:22 -0800 | [diff] [blame] | 568 | String value = args.length < 2 ? "" : args[1]; |
Bryan Eyler | a32a7c1 | 2018-02-27 15:40:00 -0800 | [diff] [blame] | 569 | forceGarageMode(value, writer); |
| 570 | break; |
| 571 | } |
Ram Periathiruvadi | 5cd00cb | 2018-02-12 13:49:50 -0800 | [diff] [blame] | 572 | case COMMAND_INJECT_VHAL_EVENT: |
| 573 | String zone = PARAM_VEHICLE_PROPERTY_AREA_GLOBAL; |
| 574 | String data; |
Jim Kaye | f10b7d8 | 2019-02-26 12:53:22 -0800 | [diff] [blame] | 575 | if (args.length != 3 && args.length != 4) { |
Ram Periathiruvadi | 5cd00cb | 2018-02-12 13:49:50 -0800 | [diff] [blame] | 576 | writer.println("Incorrect number of arguments."); |
| 577 | dumpHelp(writer); |
| 578 | break; |
Jim Kaye | f10b7d8 | 2019-02-26 12:53:22 -0800 | [diff] [blame] | 579 | } else if (args.length == 4) { |
Ram Periathiruvadi | 5cd00cb | 2018-02-12 13:49:50 -0800 | [diff] [blame] | 580 | // Zoned |
| 581 | zone = args[2]; |
| 582 | data = args[3]; |
| 583 | } else { |
| 584 | // Global |
| 585 | data = args[2]; |
Ram Periathiruvadi | ee28c00 | 2017-02-07 21:35:01 -0800 | [diff] [blame] | 586 | } |
Ram Periathiruvadi | 5cd00cb | 2018-02-12 13:49:50 -0800 | [diff] [blame] | 587 | injectVhalEvent(args[1], zone, data, writer); |
Ram Periathiruvadi | ee28c00 | 2017-02-07 21:35:01 -0800 | [diff] [blame] | 588 | break; |
Ram Periathiruvadi | bf0eab7 | 2018-02-06 12:32:43 -0800 | [diff] [blame] | 589 | case COMMAND_ENABLE_UXR: |
Jim Kaye | f10b7d8 | 2019-02-26 12:53:22 -0800 | [diff] [blame] | 590 | if (args.length != 2) { |
Ram Periathiruvadi | bf0eab7 | 2018-02-06 12:32:43 -0800 | [diff] [blame] | 591 | writer.println("Incorrect number of arguments"); |
| 592 | dumpHelp(writer); |
| 593 | break; |
| 594 | } |
| 595 | boolean enableBlocking = Boolean.valueOf(args[1]); |
| 596 | if (mCarPackageManagerService != null) { |
| 597 | mCarPackageManagerService.setEnableActivityBlocking(enableBlocking); |
| 598 | } |
| 599 | break; |
Ram Periathiruvadi | 3838830 | 2018-02-22 16:42:49 -0800 | [diff] [blame] | 600 | case COMMAND_GET_DO_ACTIVITIES: |
Jim Kaye | f10b7d8 | 2019-02-26 12:53:22 -0800 | [diff] [blame] | 601 | if (args.length != 2) { |
Ram Periathiruvadi | 3838830 | 2018-02-22 16:42:49 -0800 | [diff] [blame] | 602 | writer.println("Incorrect number of arguments"); |
| 603 | dumpHelp(writer); |
| 604 | break; |
| 605 | } |
| 606 | String pkgName = args[1].toLowerCase(); |
| 607 | if (mCarPackageManagerService != null) { |
| 608 | String[] doActivities = |
| 609 | mCarPackageManagerService.getDistractionOptimizedActivities( |
| 610 | pkgName); |
| 611 | if (doActivities != null) { |
| 612 | writer.println("DO Activities for " + pkgName); |
| 613 | for (String a : doActivities) { |
| 614 | writer.println(a); |
| 615 | } |
| 616 | } else { |
| 617 | writer.println("No DO Activities for " + pkgName); |
| 618 | } |
| 619 | } |
| 620 | break; |
Kai | dd4ef5a | 2019-03-04 14:07:26 -0800 | [diff] [blame] | 621 | case COMMAND_GET_CARPROPERTYCONFIG: |
| 622 | String propertyId = args.length < 2 ? "" : args[1]; |
| 623 | mHal.dumpPropertyConfigs(writer, propertyId); |
| 624 | break; |
Kai | 29fba11 | 2019-04-22 18:37:38 -0700 | [diff] [blame^] | 625 | case COMMAND_GET_PROPERTY_VALUE: |
| 626 | String propId = args.length < 2 ? "" : args[1]; |
| 627 | String areaId = args.length < 3 ? "" : args[2]; |
| 628 | mHal.dumpPropertyValueByCommend(writer, propId, areaId); |
| 629 | break; |
Pavel Maltsev | 48a3194 | 2019-03-03 22:08:28 -0800 | [diff] [blame] | 630 | case COMMAND_PROJECTION_UI_MODE: |
| 631 | if (args.length != 2) { |
| 632 | writer.println("Incorrect number of arguments"); |
| 633 | dumpHelp(writer); |
| 634 | break; |
| 635 | } |
| 636 | mCarProjectionService.setUiMode(Integer.valueOf(args[1])); |
Pavel Maltsev | d6961f6 | 2019-03-26 10:22:31 -0700 | [diff] [blame] | 637 | break; |
Jim Kaye | d76c274 | 2019-04-02 11:33:27 -0700 | [diff] [blame] | 638 | case COMMAND_RESUME: |
| 639 | mCarPowerManagementService.forceSimulatedResume(); |
| 640 | writer.println("Resume: Simulating resuming from Deep Sleep"); |
| 641 | break; |
| 642 | case COMMAND_SUSPEND: |
| 643 | mCarPowerManagementService.forceSimulatedSuspend(); |
| 644 | writer.println("Resume: Simulating powering down to Deep Sleep"); |
| 645 | break; |
Ram Periathiruvadi | d26a3fb | 2019-04-15 14:48:23 -0700 | [diff] [blame] | 646 | case COMMAND_ENABLE_TRUSTED_DEVICE: |
| 647 | if (args.length != 2) { |
| 648 | writer.println("Incorrect number of arguments"); |
| 649 | dumpHelp(writer); |
| 650 | break; |
| 651 | } |
| 652 | mCarTrustedDeviceService.getCarTrustAgentEnrollmentService() |
| 653 | .setTrustedDeviceEnrollmentEnabled(Boolean.valueOf(args[1])); |
| 654 | mCarTrustedDeviceService.getCarTrustAgentUnlockService() |
| 655 | .setTrustedDeviceUnlockEnabled(Boolean.valueOf(args[1])); |
| 656 | break; |
| 657 | case COMMAND_REMOVE_TRUSTED_DEVICES: |
| 658 | mCarTrustedDeviceService.getCarTrustAgentEnrollmentService() |
| 659 | .removeAllTrustedDevices( |
| 660 | mUserManagerHelper.getCurrentForegroundUserId()); |
| 661 | break; |
Yao Chen | e33f07e | 2016-07-26 12:02:51 -0700 | [diff] [blame] | 662 | default: |
Jim Kaye | f10b7d8 | 2019-02-26 12:53:22 -0800 | [diff] [blame] | 663 | writer.println("Unknown command: \"" + arg + "\""); |
Yao Chen | e33f07e | 2016-07-26 12:02:51 -0700 | [diff] [blame] | 664 | dumpHelp(writer); |
| 665 | } |
| 666 | } |
| 667 | |
| 668 | private void forceDayNightMode(String arg, PrintWriter writer) { |
| 669 | int mode; |
| 670 | switch (arg) { |
| 671 | case PARAM_DAY_MODE: |
| 672 | mode = CarNightService.FORCED_DAY_MODE; |
| 673 | break; |
| 674 | case PARAM_NIGHT_MODE: |
| 675 | mode = CarNightService.FORCED_NIGHT_MODE; |
| 676 | break; |
| 677 | case PARAM_SENSOR_MODE: |
| 678 | mode = CarNightService.FORCED_SENSOR_MODE; |
| 679 | break; |
| 680 | default: |
| 681 | writer.println("Unknown value. Valid argument: " + PARAM_DAY_MODE + "|" |
| 682 | + PARAM_NIGHT_MODE + "|" + PARAM_SENSOR_MODE); |
| 683 | return; |
| 684 | } |
| 685 | int current = mCarNightService.forceDayNightMode(mode); |
| 686 | String currentMode = null; |
| 687 | switch (current) { |
| 688 | case UiModeManager.MODE_NIGHT_AUTO: |
| 689 | currentMode = PARAM_SENSOR_MODE; |
| 690 | break; |
| 691 | case UiModeManager.MODE_NIGHT_YES: |
| 692 | currentMode = PARAM_NIGHT_MODE; |
| 693 | break; |
| 694 | case UiModeManager.MODE_NIGHT_NO: |
| 695 | currentMode = PARAM_DAY_MODE; |
| 696 | break; |
| 697 | } |
| 698 | writer.println("DayNightMode changed to: " + currentMode); |
| 699 | } |
Ram Periathiruvadi | ee28c00 | 2017-02-07 21:35:01 -0800 | [diff] [blame] | 700 | |
Bryan Eyler | a32a7c1 | 2018-02-27 15:40:00 -0800 | [diff] [blame] | 701 | private void forceGarageMode(String arg, PrintWriter writer) { |
| 702 | switch (arg) { |
| 703 | case PARAM_ON_MODE: |
Serik Beketayev | e0e7ff2 | 2018-07-31 21:04:12 -0700 | [diff] [blame] | 704 | mGarageModeService.forceStartGarageMode(); |
Bryan Eyler | a32a7c1 | 2018-02-27 15:40:00 -0800 | [diff] [blame] | 705 | break; |
| 706 | case PARAM_OFF_MODE: |
Serik Beketayev | e0e7ff2 | 2018-07-31 21:04:12 -0700 | [diff] [blame] | 707 | mGarageModeService.stopAndResetGarageMode(); |
Bryan Eyler | a32a7c1 | 2018-02-27 15:40:00 -0800 | [diff] [blame] | 708 | break; |
| 709 | case PARAM_QUERY_MODE: |
| 710 | // Nothing to do. Always query at the end anyway. |
| 711 | break; |
| 712 | default: |
| 713 | writer.println("Unknown value. Valid argument: " + PARAM_ON_MODE + "|" |
| 714 | + PARAM_OFF_MODE + "|" + PARAM_QUERY_MODE); |
| 715 | return; |
| 716 | } |
Serik Beketayev | e0e7ff2 | 2018-07-31 21:04:12 -0700 | [diff] [blame] | 717 | writer.println("Garage mode: " + mGarageModeService.isGarageModeActive()); |
Bryan Eyler | a32a7c1 | 2018-02-27 15:40:00 -0800 | [diff] [blame] | 718 | } |
| 719 | |
Ram Periathiruvadi | ee28c00 | 2017-02-07 21:35:01 -0800 | [diff] [blame] | 720 | /** |
Ram Periathiruvadi | 5cd00cb | 2018-02-12 13:49:50 -0800 | [diff] [blame] | 721 | * Inject a fake VHAL event |
Ram Periathiruvadi | 49d5a5a | 2017-02-17 18:50:09 -0800 | [diff] [blame] | 722 | * |
Ram Periathiruvadi | 5cd00cb | 2018-02-12 13:49:50 -0800 | [diff] [blame] | 723 | * @param property the Vehicle property Id as defined in the HAL |
| 724 | * @param zone Zone that this event services |
| 725 | * @param value Data value of the event |
| 726 | * @param writer PrintWriter |
Ram Periathiruvadi | ee28c00 | 2017-02-07 21:35:01 -0800 | [diff] [blame] | 727 | */ |
Ram Periathiruvadi | 5cd00cb | 2018-02-12 13:49:50 -0800 | [diff] [blame] | 728 | private void injectVhalEvent(String property, String zone, String value, |
Ram Periathiruvadi | 49d5a5a | 2017-02-17 18:50:09 -0800 | [diff] [blame] | 729 | PrintWriter writer) { |
Ram Periathiruvadi | 5cd00cb | 2018-02-12 13:49:50 -0800 | [diff] [blame] | 730 | if (zone != null && (zone.equalsIgnoreCase(PARAM_VEHICLE_PROPERTY_AREA_GLOBAL))) { |
| 731 | if (!isPropertyAreaTypeGlobal(property)) { |
| 732 | writer.println("Property area type inconsistent with given zone"); |
| 733 | return; |
| 734 | } |
Ram Periathiruvadi | ee28c00 | 2017-02-07 21:35:01 -0800 | [diff] [blame] | 735 | } |
| 736 | try { |
Ram Periathiruvadi | 5cd00cb | 2018-02-12 13:49:50 -0800 | [diff] [blame] | 737 | mHal.injectVhalEvent(property, zone, value); |
Ram Periathiruvadi | ee28c00 | 2017-02-07 21:35:01 -0800 | [diff] [blame] | 738 | } catch (NumberFormatException e) { |
Ram Periathiruvadi | 5cd00cb | 2018-02-12 13:49:50 -0800 | [diff] [blame] | 739 | writer.println("Invalid property Id zone Id or value" + e); |
| 740 | dumpHelp(writer); |
Ram Periathiruvadi | ee28c00 | 2017-02-07 21:35:01 -0800 | [diff] [blame] | 741 | } |
Ram Periathiruvadi | ee28c00 | 2017-02-07 21:35:01 -0800 | [diff] [blame] | 742 | } |
| 743 | |
Ram Periathiruvadi | 5cd00cb | 2018-02-12 13:49:50 -0800 | [diff] [blame] | 744 | // Check if the given property is global |
| 745 | private boolean isPropertyAreaTypeGlobal(String property) { |
| 746 | if (property == null) { |
| 747 | return false; |
Ram Periathiruvadi | 49d5a5a | 2017-02-17 18:50:09 -0800 | [diff] [blame] | 748 | } |
Ram Periathiruvadi | 5cd00cb | 2018-02-12 13:49:50 -0800 | [diff] [blame] | 749 | return (Integer.decode(property) & VehicleArea.MASK) == VehicleArea.GLOBAL; |
Ram Periathiruvadi | 49d5a5a | 2017-02-17 18:50:09 -0800 | [diff] [blame] | 750 | } |
Yao Chen | e33f07e | 2016-07-26 12:02:51 -0700 | [diff] [blame] | 751 | } |
kevinjm | 55822c4 | 2018-08-15 11:26:00 -0700 | [diff] [blame] | 752 | } |