| Ruben Brunk | 2823ce0 | 2015-05-19 17:25:13 -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 | #ifndef ANDROID_HARDWARE_ICAMERASERVICEPROXY_H | 
 | 18 | #define ANDROID_HARDWARE_ICAMERASERVICEPROXY_H | 
 | 19 |  | 
 | 20 | #include <utils/RefBase.h> | 
 | 21 | #include <binder/IInterface.h> | 
 | 22 | #include <binder/Parcel.h> | 
 | 23 |  | 
 | 24 | namespace android { | 
 | 25 |  | 
| Eino-Ville Talvala | 412fe56 | 2015-08-20 17:08:32 -0700 | [diff] [blame] | 26 | /** | 
 | 27 |  * Interface from native camera service to managed-side camera service proxy. | 
 | 28 |  * | 
 | 29 |  * Keep in sync with frameworks/base/core/java/android/hardware/ICameraServiceProxy.aidl | 
 | 30 |  * | 
 | 31 |  */ | 
| Ruben Brunk | 2823ce0 | 2015-05-19 17:25:13 -0700 | [diff] [blame] | 32 | class ICameraServiceProxy : public IInterface { | 
 | 33 | public: | 
 | 34 |     enum { | 
 | 35 |         PING_FOR_USER_UPDATE = IBinder::FIRST_CALL_TRANSACTION, | 
| Eino-Ville Talvala | 412fe56 | 2015-08-20 17:08:32 -0700 | [diff] [blame] | 36 |         NOTIFY_CAMERA_STATE | 
 | 37 |     }; | 
 | 38 |  | 
 | 39 |     enum CameraState { | 
 | 40 |         CAMERA_STATE_OPEN, | 
 | 41 |         CAMERA_STATE_ACTIVE, | 
 | 42 |         CAMERA_STATE_IDLE, | 
 | 43 |         CAMERA_STATE_CLOSED | 
| Ruben Brunk | 2823ce0 | 2015-05-19 17:25:13 -0700 | [diff] [blame] | 44 |     }; | 
 | 45 |  | 
 | 46 |     DECLARE_META_INTERFACE(CameraServiceProxy); | 
 | 47 |  | 
 | 48 |     virtual void pingForUserUpdate() = 0; | 
| Eino-Ville Talvala | 412fe56 | 2015-08-20 17:08:32 -0700 | [diff] [blame] | 49 |     virtual void notifyCameraState(String16 cameraId, CameraState newCameraState) = 0; | 
| Ruben Brunk | 2823ce0 | 2015-05-19 17:25:13 -0700 | [diff] [blame] | 50 | }; | 
 | 51 |  | 
 | 52 | class BnCameraServiceProxy: public BnInterface<ICameraServiceProxy> | 
 | 53 | { | 
 | 54 | public: | 
 | 55 |     virtual status_t    onTransact( uint32_t code, | 
 | 56 |                                     const Parcel& data, | 
 | 57 |                                     Parcel* reply, | 
 | 58 |                                     uint32_t flags = 0); | 
 | 59 | }; | 
 | 60 |  | 
 | 61 |  | 
 | 62 |  | 
 | 63 | }; // namespace android | 
 | 64 |  | 
 | 65 | #endif // ANDROID_HARDWARE_ICAMERASERVICEPROXY_H |