Zhijun He | 046205c | 2015-01-08 17:40:00 -0800 | [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 | //#define LOG_NDEBUG 0 |
| 18 | #define LOG_TAG "HotplugThread" |
Mark Salyzyn | d88dfe8 | 2017-04-11 08:56:09 -0700 | [diff] [blame] | 19 | |
| 20 | #include <log/log.h> |
Zhijun He | 046205c | 2015-01-08 17:40:00 -0800 | [diff] [blame] | 21 | |
| 22 | #include "HotplugThread.h" |
| 23 | |
| 24 | namespace usb_camera_hal { |
| 25 | |
| 26 | HotplugThread::HotplugThread(CameraHAL *hal) |
| 27 | : mModule(hal) { |
| 28 | |
| 29 | } |
| 30 | |
| 31 | HotplugThread::~HotplugThread() { |
| 32 | |
| 33 | } |
| 34 | |
| 35 | void HotplugThread::requestExit() { |
| 36 | // Call parent to set up shutdown |
| 37 | Thread::requestExit(); |
| 38 | |
| 39 | // Cleanup other states? |
| 40 | } |
| 41 | |
| 42 | bool HotplugThread::threadLoop() { |
Greg Kaiser | 7a915ef | 2016-06-30 16:59:38 -0700 | [diff] [blame] | 43 | (void)mModule; // silence warning about unused member. |
Zhijun He | 046205c | 2015-01-08 17:40:00 -0800 | [diff] [blame] | 44 | |
| 45 | /** |
| 46 | * Check camera connection status change, if connected, do below: |
| 47 | * 1. Create camera device, add to mCameras. |
| 48 | * 2. Init static info (mCameras[id]->initStaticInfo()) |
| 49 | * 3. Notify on_status_change callback |
| 50 | * |
| 51 | * If unconnected, similarly, do below: |
| 52 | * 1. Destroy camera device and remove it from mCameras. |
| 53 | * 2. Notify on_status_change callback |
| 54 | * |
| 55 | * DO NOT have a tight polling loop here, to avoid excessive CPU utilization. |
| 56 | */ |
| 57 | |
| 58 | return true; |
| 59 | } |
| 60 | |
| 61 | } // namespace usb_camera_hal |