diff options
author | Scott Randolph <randolphs@google.com> | 2017-03-22 15:42:42 -0700 |
---|---|---|
committer | Scott Randolph <randolphs@google.com> | 2017-04-04 16:07:55 -0700 |
commit | 019d6c46302e9e073ee975cd6ba0d836a46573c7 (patch) | |
tree | 5eca91b8bab2ee188361db8a1c91ae8ca273acaa /car-lib/src/android | |
parent | e66337657e3566915b46b608a31a2957d7b37e7c (diff) | |
download | Car-019d6c46302e9e073ee975cd6ba0d836a46573c7.tar.gz |
Remove deprecated CarCamera interface
CarCamera is being replaced by the EVS HAL and manager.
See hardware/interfaces/automotive/evs and packages/services/Car/evs
Test: build full tree
Bug: 36900851
Change-Id: I691c4dc07491d51158f109c79c93f0748186bfc6
(cherry picked from commit 251fb78dc11923820402156e251b6029175eaa73)
Diffstat (limited to 'car-lib/src/android')
6 files changed, 0 insertions, 386 deletions
diff --git a/car-lib/src/android/car/Car.java b/car-lib/src/android/car/Car.java index 44657e15fc..ec554f1b17 100644 --- a/car-lib/src/android/car/Car.java +++ b/car-lib/src/android/car/Car.java @@ -25,7 +25,6 @@ import android.car.hardware.CarDiagnosticManager; import android.car.hardware.CarSensorManager; import android.car.hardware.CarVendorExtensionManager; import android.car.hardware.cabin.CarCabinManager; -import android.car.hardware.camera.CarCameraManager; import android.car.hardware.hvac.CarHvacManager; import android.car.hardware.radio.CarRadioManager; import android.car.media.CarAudioManager; @@ -100,12 +99,6 @@ public final class Car { * @hide */ @SystemApi - public static final String CAMERA_SERVICE = "camera"; - - /** - * @hide - */ - @SystemApi public static final String RADIO_SERVICE = "radio"; /** @@ -193,13 +186,6 @@ public final class Car { public static final String PERMISSION_CAR_CABIN = "android.car.permission.CAR_CABIN"; /** - * Permission necessary to access Car Camera APIs. - * @hide - */ - @SystemApi - public static final String PERMISSION_CAR_CAMERA = "android.car.permission.CAR_CAMERA"; - - /** * Permission necessary to access Car HVAC APIs. * @hide */ @@ -601,9 +587,6 @@ public final class Car { manager = new CarDiagnosticManager(binder, mContext, mEventHandler); } break; - case CAMERA_SERVICE: - manager = new CarCameraManager(binder, mContext); - break; case HVAC_SERVICE: manager = new CarHvacManager(binder, mContext, mEventHandler); break; diff --git a/car-lib/src/android/car/hardware/camera/CarCamera.java b/car-lib/src/android/car/hardware/camera/CarCamera.java deleted file mode 100644 index 8610d7de2e..0000000000 --- a/car-lib/src/android/car/hardware/camera/CarCamera.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (C) 2016 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.car.hardware.camera; - -import android.annotation.SystemApi; -import android.car.CarNotConnectedException; -import android.graphics.Rect; -import android.os.RemoteException; -import android.util.Log; - -/** - * API for controlling camera system in cars - * @hide - */ -@SystemApi -public class CarCamera { - public final static String TAG = CarCamera.class.getSimpleName(); - public final int mCameraType; - private final ICarCamera mService; - - public CarCamera(ICarCamera service, int cameraType) { - mService = service; - mCameraType = cameraType; - } - - public int getCapabilities() throws CarNotConnectedException { - try { - return mService.getCapabilities(mCameraType); - } catch (RemoteException e) { - Log.e(TAG, "Exception in getCapabilities", e); - throw new CarNotConnectedException(e); - } - } - - public Rect getCameraCrop() throws CarNotConnectedException { - try { - return mService.getCameraCrop(mCameraType); - } catch (RemoteException e) { - Log.e(TAG, "Exception in getCameraCrop", e); - throw new CarNotConnectedException(e); - } - } - - public void setCameraCrop(Rect rect) throws CarNotConnectedException { - try { - mService.setCameraCrop(mCameraType, rect); - } catch (RemoteException e) { - Log.e(TAG, "Exception in setCameraCrop", e); - throw new CarNotConnectedException(e); - } - } - - public Rect getCameraPosition() throws CarNotConnectedException { - try { - return mService.getCameraPosition(mCameraType); - } catch (RemoteException e) { - Log.e(TAG, "Exception in getCameraPosition", e); - throw new CarNotConnectedException(e); - } - } - - public void setCameraPosition(Rect rect) throws CarNotConnectedException { - try { - mService.setCameraPosition(mCameraType, rect); - } catch (RemoteException e) { - Log.e(TAG, "Exception in setCameraPosition", e); - } - } - - public CarCameraState getCameraState() throws CarNotConnectedException { - try { - return mService.getCameraState(mCameraType); - } catch (RemoteException e) { - Log.e(TAG, "Exception in getCameraState", e); - throw new CarNotConnectedException(e); - } - } - - public void setCameraState(CarCameraState state) throws CarNotConnectedException { - try { - mService.setCameraState(mCameraType, state); - } catch (RemoteException e) { - Log.e(TAG, "Exception in setCameraState", e); - throw new CarNotConnectedException(e); - } - } -} diff --git a/car-lib/src/android/car/hardware/camera/CarCameraManager.java b/car-lib/src/android/car/hardware/camera/CarCameraManager.java deleted file mode 100644 index 37cf8b9489..0000000000 --- a/car-lib/src/android/car/hardware/camera/CarCameraManager.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright (C) 2016 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.car.hardware.camera; - -import android.annotation.SystemApi; -import android.car.Car; -import android.car.CarManagerBase; -import android.car.CarNotConnectedException; -import android.content.Context; -import android.os.IBinder; -import android.os.RemoteException; -import android.util.Log; - -/** - * API for controlling camera system in cars - * @hide - */ -@SystemApi -public final class CarCameraManager implements CarManagerBase { - private final static boolean DBG = false; - private final static String TAG = CarCameraManager.class.getSimpleName(); - - // Camera capabilities flags - public static final int ANDROID_OVERLAY_SUPPORT_FLAG = 0x1; - public static final int CAMERA_CROP_SUPPORT_FLAG = 0x2; - public static final int CAMERA_POSITIONING_SUPPORT_FLAG = 0x4; - - // Camera types - public static final int CAR_CAMERA_TYPE_NONE = 0; - public static final int CAR_CAMERA_TYPE_RVC = 1; - - private int[] mCameraList; - private final ICarCamera mService; - - /** - * Get an instance of the CarCameraManager. - * - * Should not be obtained directly by clients, use {@link Car.getCarManager()} instead. - * @hide - */ - public CarCameraManager(IBinder service, Context context) throws CarNotConnectedException{ - mService = ICarCamera.Stub.asInterface(service); - try { - mCameraList = mService.getCameraList(); - } catch (RemoteException e) { - Log.e(TAG, "Exception in getCameraList", e); - mCameraList = null; - throw new CarNotConnectedException(e); - } - } - - /** - * - * @return Array of CAR_CAMERA_TYPE_* telling which cameras are present - */ - public int[] getCameraList() throws CarNotConnectedException { - return mCameraList; - } - - /** - * - * @param cameraType Camera type to query capabilites - * @return Bitmask of camera capabilities available for this device - * @throws CarNotConnectedException if the connection to the car service has been lost. - */ - public int getCameraCapabilities(int cameraType) throws CarNotConnectedException { - int capabilities; - try { - capabilities = mService.getCapabilities(cameraType); - } catch (RemoteException e) { - Log.e(TAG, "Exception in getCameraCapabilities", e); - throw new CarNotConnectedException(e); - } - return capabilities; - } - - public CarCamera openCamera(int cameraType) throws CarNotConnectedException { - CarCamera camera = null; - - // Find cameraType in the list of available cameras - for (int i : mCameraList) { - if(i == cameraType) { - camera = new CarCamera(mService, cameraType); - break; - } - } - return camera; - } - - public void closeCamera(CarCamera camera) { - // nothing to do for now - } - - /** @hide */ - @Override - public void onCarDisconnected() { - } -} diff --git a/car-lib/src/android/car/hardware/camera/CarCameraState.aidl b/car-lib/src/android/car/hardware/camera/CarCameraState.aidl deleted file mode 100644 index a9cf858e3a..0000000000 --- a/car-lib/src/android/car/hardware/camera/CarCameraState.aidl +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (C) 2016 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.car.hardware.camera; - -parcelable CarCameraState; diff --git a/car-lib/src/android/car/hardware/camera/CarCameraState.java b/car-lib/src/android/car/hardware/camera/CarCameraState.java deleted file mode 100644 index 6f259032e9..0000000000 --- a/car-lib/src/android/car/hardware/camera/CarCameraState.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (C) 2016 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.car.hardware.camera; - -import android.annotation.SystemApi; -import android.os.Parcel; -import android.os.Parcelable; - -/** - * CarCameraState object corresponds to a property of the car's Camera system - * @hide - */ -@SystemApi -public class CarCameraState implements Parcelable { - private boolean mCameraIsOn; - private boolean mOverlayIsOn; - - public int describeContents() { - return 0; - } - - public void writeToParcel(Parcel out, int flags) { - out.writeInt(mCameraIsOn ? 1 : 0); - out.writeInt(mOverlayIsOn ? 1 : 0); - } - - public static final Parcelable.Creator<CarCameraState> CREATOR - = new Parcelable.Creator<CarCameraState>() { - public CarCameraState createFromParcel(Parcel in) { - return new CarCameraState(in); - } - - public CarCameraState[] newArray(int size) { - return new CarCameraState[size]; - } - }; - - private CarCameraState(Parcel in) { - mCameraIsOn = in.readInt() == 1; - mOverlayIsOn = in.readInt() == 1; - } - - /** - * Copy constructor - * @param that - */ - public CarCameraState(CarCameraState that) { - mCameraIsOn = that.getCameraIsOn(); - mOverlayIsOn = that.getOverlayIsOn(); - } - - /** - * Constructor - */ - public CarCameraState(boolean overlayIsOn, boolean cameraIsOn) { - mCameraIsOn = cameraIsOn; - mOverlayIsOn = overlayIsOn; - } - - // Getters. - public boolean getCameraIsOn() { return mCameraIsOn; } - public boolean getOverlayIsOn() { return mOverlayIsOn; } - - // Setters. - public void setCameraIsOn(boolean v) { mCameraIsOn = v; } - public void setOverlayIsOn(boolean v) { mOverlayIsOn = v; } - - // Printer. - public String toString() { - String myString = "mCameraIsOn: " + mCameraIsOn + " mOverlayIsOn: " + mOverlayIsOn; - return myString; - } - - // Comparator. - public boolean equals(Object o) { - if (o instanceof CarCameraState) { - CarCameraState that = (CarCameraState) o; - - return (that.getCameraIsOn() == mCameraIsOn && - that.getOverlayIsOn() == mOverlayIsOn); - } - return false; - } -} diff --git a/car-lib/src/android/car/hardware/camera/ICarCamera.aidl b/car-lib/src/android/car/hardware/camera/ICarCamera.aidl deleted file mode 100644 index 53eee36b89..0000000000 --- a/car-lib/src/android/car/hardware/camera/ICarCamera.aidl +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2016 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.car.hardware.camera; - -import android.car.hardware.camera.CarCameraState; -import android.graphics.Rect; - -/** @hide */ -interface ICarCamera { - int[] getCameraList() = 0; - - int getCapabilities(in int cameraType) = 1; - - Rect getCameraCrop(in int cameraType) = 2; - - void setCameraCrop(in int cameraType, in Rect rect) = 3; - - Rect getCameraPosition(in int cameraType) = 4; - - void setCameraPosition(in int cameraType, in Rect rect) = 5; - - CarCameraState getCameraState(in int cameraType) = 6; - - void setCameraState(in int cameraType, in CarCameraState state) = 7; -} |