aboutsummaryrefslogtreecommitdiff
path: root/service/src/com/android
diff options
context:
space:
mode:
authorJason Tholstrup <jthol@google.com>2016-09-22 16:32:14 -0700
committerJason Tholstrup <jthol@google.com>2016-10-03 15:11:48 -0700
commitd72b53500006e84b0c69e650878267c693c164a3 (patch)
tree280e923477b438110c2a918368313bbd16dc0986 /service/src/com/android
parent4fbde4fb755440713a0ec4cdaaab4f30630b58d3 (diff)
downloadCar-d72b53500006e84b0c69e650878267c693c164a3.tar.gz
Many API council fixes.
bug: 31913591 Change-Id: I3a0f9a57ecdccdae6c0b3b98b5bbf9b31733933b
Diffstat (limited to 'service/src/com/android')
-rw-r--r--service/src/com/android/car/AppFocusService.java4
-rw-r--r--service/src/com/android/car/CarProjectionService.java24
-rw-r--r--service/src/com/android/car/CarSensorEventFactory.java12
-rw-r--r--service/src/com/android/car/CarSensorService.java7
4 files changed, 21 insertions, 26 deletions
diff --git a/service/src/com/android/car/AppFocusService.java b/service/src/com/android/car/AppFocusService.java
index d7f9c3e815..4e85e81a4c 100644
--- a/service/src/com/android/car/AppFocusService.java
+++ b/service/src/com/android/car/AppFocusService.java
@@ -307,14 +307,14 @@ public class AppFocusService extends IAppFocus.Stub implements CarServiceBase,
private void dispatchAppFocusOwnershipLoss(IAppFocusOwnershipListener listener, int appType) {
try {
- listener.onAppFocusOwnershipLoss(appType);
+ listener.onAppFocusOwnershipLost(appType);
} catch (RemoteException e) {
}
}
private void dispatchAppFocusChange(IAppFocusListener listener, int appType, boolean active) {
try {
- listener.onAppFocusChange(appType, active);
+ listener.onAppFocusChanged(appType, active);
} catch (RemoteException e) {
}
}
diff --git a/service/src/com/android/car/CarProjectionService.java b/service/src/com/android/car/CarProjectionService.java
index 1c5f15dfee..52fd93f38e 100644
--- a/service/src/com/android/car/CarProjectionService.java
+++ b/service/src/com/android/car/CarProjectionService.java
@@ -17,7 +17,7 @@ package com.android.car;
import android.car.CarProjectionManager;
import android.car.ICarProjection;
-import android.car.ICarProjectionListener;
+import android.car.ICarProjectionCallback;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
@@ -36,7 +36,7 @@ import java.io.PrintWriter;
* It also enables proejcted applications to handle voice action requests.
*/
class CarProjectionService extends ICarProjection.Stub implements CarServiceBase,
- BinderInterfaceContainer.BinderEventHandler<ICarProjectionListener> {
+ BinderInterfaceContainer.BinderEventHandler<ICarProjectionCallback> {
private final ListenerHolder mAllListeners;
private final CarInputService mCarInputService;
private final Context mContext;
@@ -136,7 +136,7 @@ class CarProjectionService extends ICarProjection.Stub implements CarServiceBase
}
private synchronized void handleVoiceAssitantRequest(boolean isTriggeredByLongPress) {
- for (BinderInterfaceContainer.BinderInterface<ICarProjectionListener> listener :
+ for (BinderInterfaceContainer.BinderInterface<ICarProjectionCallback> listener :
mAllListeners.getInterfaces()) {
ListenerInfo listenerInfo = (ListenerInfo) listener;
if ((listenerInfo.hasFilter(CarProjectionManager.PROJECTION_LONG_PRESS_VOICE_SEARCH)
@@ -149,7 +149,7 @@ class CarProjectionService extends ICarProjection.Stub implements CarServiceBase
}
@Override
- public void regsiterProjectionListener(ICarProjectionListener listener, int filter) {
+ public void regsiterProjectionListener(ICarProjectionCallback listener, int filter) {
synchronized (this) {
ListenerInfo info = (ListenerInfo) mAllListeners.getBinderInterface(listener);
if (info == null) {
@@ -163,7 +163,7 @@ class CarProjectionService extends ICarProjection.Stub implements CarServiceBase
}
@Override
- public void unregsiterProjectionListener(ICarProjectionListener listener) {
+ public void unregsiterProjectionListener(ICarProjectionCallback listener) {
synchronized (this) {
mAllListeners.removeBinder(listener);
}
@@ -174,7 +174,7 @@ class CarProjectionService extends ICarProjection.Stub implements CarServiceBase
boolean listenShortPress = false;
boolean listenLongPress = false;
synchronized (this) {
- for (BinderInterfaceContainer.BinderInterface<ICarProjectionListener> listener :
+ for (BinderInterfaceContainer.BinderInterface<ICarProjectionCallback> listener :
mAllListeners.getInterfaces()) {
ListenerInfo listenerInfo = (ListenerInfo) listener;
listenShortPress |= listenerInfo.hasFilter(
@@ -203,7 +203,7 @@ class CarProjectionService extends ICarProjection.Stub implements CarServiceBase
@Override
public void onBinderDeath(
- BinderInterfaceContainer.BinderInterface<ICarProjectionListener> bInterface) {
+ BinderInterfaceContainer.BinderInterface<ICarProjectionCallback> bInterface) {
unregsiterProjectionListener(bInterface.binderInterface);
}
@@ -211,7 +211,7 @@ class CarProjectionService extends ICarProjection.Stub implements CarServiceBase
public void dump(PrintWriter writer) {
writer.println("**CarProjectionService**");
synchronized (this) {
- for (BinderInterfaceContainer.BinderInterface<ICarProjectionListener> listener :
+ for (BinderInterfaceContainer.BinderInterface<ICarProjectionCallback> listener :
mAllListeners.getInterfaces()) {
ListenerInfo listenerInfo = (ListenerInfo) listener;
writer.println(listenerInfo.toString());
@@ -219,7 +219,7 @@ class CarProjectionService extends ICarProjection.Stub implements CarServiceBase
}
}
- private void dispatchVoiceAssistantRequest(ICarProjectionListener listener,
+ private void dispatchVoiceAssistantRequest(ICarProjectionCallback listener,
boolean fromLongPress) {
try {
listener.onVoiceAssistantRequest(fromLongPress);
@@ -227,17 +227,17 @@ class CarProjectionService extends ICarProjection.Stub implements CarServiceBase
}
}
- private static class ListenerHolder extends BinderInterfaceContainer<ICarProjectionListener> {
+ private static class ListenerHolder extends BinderInterfaceContainer<ICarProjectionCallback> {
private ListenerHolder(CarProjectionService service) {
super(service);
}
}
private static class ListenerInfo extends
- BinderInterfaceContainer.BinderInterface<ICarProjectionListener> {
+ BinderInterfaceContainer.BinderInterface<ICarProjectionCallback> {
private int mFilter;
- private ListenerInfo(ListenerHolder holder, ICarProjectionListener binder, int filter) {
+ private ListenerInfo(ListenerHolder holder, ICarProjectionCallback binder, int filter) {
super(holder, binder);
this.mFilter = filter;
}
diff --git a/service/src/com/android/car/CarSensorEventFactory.java b/service/src/com/android/car/CarSensorEventFactory.java
index e270eba852..fbae0edfe1 100644
--- a/service/src/com/android/car/CarSensorEventFactory.java
+++ b/service/src/com/android/car/CarSensorEventFactory.java
@@ -21,21 +21,21 @@ import android.car.hardware.CarSensorEvent;
//TODO add memory pool and recycling
public class CarSensorEventFactory {
- public static CarSensorEvent createBooleanEvent(int sensorType, long timeStampNs,
+ public static CarSensorEvent createBooleanEvent(int sensorType, long timestamp,
boolean value) {
- CarSensorEvent event = new CarSensorEvent(sensorType, timeStampNs, 0, 1);
+ CarSensorEvent event = new CarSensorEvent(sensorType, timestamp, 0, 1);
event.intValues[0] = value ? 1 : 0;
return event;
}
- public static CarSensorEvent createIntEvent(int sensorType, long timeStampNs, int value) {
- CarSensorEvent event = new CarSensorEvent(sensorType, timeStampNs, 0, 1);
+ public static CarSensorEvent createIntEvent(int sensorType, long timestamp, int value) {
+ CarSensorEvent event = new CarSensorEvent(sensorType, timestamp, 0, 1);
event.intValues[0] = value;
return event;
}
- public static CarSensorEvent createFloatEvent(int sensorType, long timeStampNs, float value) {
- CarSensorEvent event = new CarSensorEvent(sensorType, timeStampNs, 1, 0);
+ public static CarSensorEvent createFloatEvent(int sensorType, long timestamp, float value) {
+ CarSensorEvent event = new CarSensorEvent(sensorType, timestamp, 1, 0);
event.floatValues[0] = value;
return event;
}
diff --git a/service/src/com/android/car/CarSensorService.java b/service/src/com/android/car/CarSensorService.java
index 0c452180f1..f0bc8d11b7 100644
--- a/service/src/com/android/car/CarSensorService.java
+++ b/service/src/com/android/car/CarSensorService.java
@@ -16,16 +16,13 @@
package com.android.car;
-import android.Manifest;
import android.car.Car;
import android.car.hardware.CarSensorEvent;
import android.car.hardware.CarSensorManager;
import android.car.hardware.ICarSensor;
import android.car.hardware.ICarSensorEventListener;
-import android.car.hardware.CarSensorManager.CarSensorEventListener;
import android.content.Context;
import android.content.pm.PackageManager;
-import android.hardware.SensorEvent;
import android.os.Binder;
import android.os.Handler;
import android.os.HandlerThread;
@@ -42,13 +39,11 @@ import android.util.SparseBooleanArray;
import com.android.car.hal.VehicleHal;
import com.android.car.hal.SensorHalService;
import com.android.car.hal.SensorHalServiceBase;
-import com.android.car.hal.SensorHalServiceBase.SensorListener;
import com.android.internal.annotations.GuardedBy;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.ConcurrentModificationException;
-import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.concurrent.TimeUnit;
@@ -237,7 +232,7 @@ public class CarSensorService extends ICarSensor.Stub
if (record != null) {
if (record.lastEvent == null) {
record.lastEvent = event;
- } else if (record.lastEvent.timeStampNs < event.timeStampNs) {
+ } else if (record.lastEvent.timestamp < event.timestamp) {
record.lastEvent = event;
//TODO recycle event
} else { // wrong timestamp, throw away this.