diff options
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/camera/CameraActivity.java | 9 | ||||
-rw-r--r-- | src/com/android/camera/app/DevicePluginBase.java | 35 |
2 files changed, 44 insertions, 0 deletions
diff --git a/src/com/android/camera/CameraActivity.java b/src/com/android/camera/CameraActivity.java index d78590f18..a5bf0d747 100644 --- a/src/com/android/camera/CameraActivity.java +++ b/src/com/android/camera/CameraActivity.java @@ -73,6 +73,7 @@ import com.android.camera.app.CameraController; import com.android.camera.app.CameraProvider; import com.android.camera.app.CameraServices; import com.android.camera.app.CameraServicesImpl; +import com.android.camera.app.DevicePluginImpl; import com.android.camera.app.FirstRunDialog; import com.android.camera.app.LocationManager; import com.android.camera.app.MemoryManager; @@ -229,6 +230,7 @@ public class CameraActivity extends QuickActivity private int mCurrentModeIndex; private CameraModule mCurrentModule; private ModuleManagerImpl mModuleManager; + private DevicePluginImpl mDevicePlugin; private FrameLayout mAboveFilmstripControlLayout; private FilmstripController mFilmstripController; private boolean mFilmstripVisible; @@ -538,6 +540,7 @@ public class CameraActivity extends QuickActivity } Log.v(TAG, "invoking onChangeCamera"); mCameraAppUI.onChangeCamera(); + mDevicePlugin.onCameraOpened(camera); } private void resetExposureCompensationToDefault(CameraAgent.CameraProxy camera) { @@ -1511,6 +1514,9 @@ public class CameraActivity extends QuickActivity ModulesInfo.setupModules(mAppContext, mModuleManager, mFeatureConfig); + mDevicePlugin = new DevicePluginImpl(); + mDevicePlugin.onCreate(mAppContext); + initPowerShutter(); initMaxBrightness(); @@ -2201,6 +2207,9 @@ public class CameraActivity extends QuickActivity if (mModeListView != null) { mModeListView.setVisibilityChangedListener(null); } + if (mDevicePlugin != null) { + mDevicePlugin.onDestroy(); + } mCameraController = null; mSettingsManager = null; mOrientationManager = null; diff --git a/src/com/android/camera/app/DevicePluginBase.java b/src/com/android/camera/app/DevicePluginBase.java new file mode 100644 index 000000000..8f934dd64 --- /dev/null +++ b/src/com/android/camera/app/DevicePluginBase.java @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2015 The CyanogenMod 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 com.android.camera.app; + +import android.content.Context; + +import com.android.ex.camera2.portability.CameraAgent; + +/** + * The interface defining device-specific application hooks + */ +public class DevicePluginBase { + public void onCreate(Context context) { + } + + public void onDestroy() { + } + + public void onCameraOpened(CameraAgent.CameraProxy camera) { + } +} |