Android -- Camera源码简析,启动流程
部检测
startFaceDetection();
// Show the tap to focus toast if this is the first start.
// 假如是第一次启动,提示用户“触摸对焦”
if (mFocusAreaSupported
mPreferences.getBoolean(CameraSettings.KEY_CAMERA_FIRST_USE_HINT_SHOWN, true)) {
// Delay the toast for one second to wait for orientation.
mHandler.sendEmptyMessageDelayed(SHOW_TAP_TO_FOCUS_TOAST, 1000);
}
mFirstTimeInitialized = true;
addIdleHandler();
}
复制代码
如果不是,则执行initializeSecondTime();
复制代码
/**
* // If the activity is paused and resumed, this method will be called in
* // onResume.
*/
private void initializeSecondTime() {
// Start orientation listener as soon as possible because it takes
// some time to get first orientation.
//方向翻转设置enable,其中包括翻转的时候的动画
mOrientationListener.enable();
// Start location update if needed.
boolean recordLocation = RecordLocationPreference.get(
mPreferences, getContentResolver());
mLocationManager.recordLocation(recordLocation);
//设置SD卡广播
installIntentFilter();
mImageSaver = new ImageSaver();
//初始化Zoom
initializeZoom();
//mMediaProviderClient=媒体Provider对象
keepMediaProviderInstance();
//检查硬盘
checkStorage();
//淡出retake和done的Button
hidePostCaptureAlert();
if (!mIsImageCaptureIntent) {
//如果不是第三方开启,则更新缩略图
updateThumbnailButton();
mModePicker.setCurrentMode(ModePicker.MODE_CAMERA);
}
}
复制代码
4、surfaceDestroyed
stopPreview();
mSurfaceHolder = null;
- Windows CE 进程、线程和内存管理(11-09)
- RedHatLinux新手入门教程(5)(11-12)
- uClinux介绍(11-09)
- openwebmailV1.60安装教学(11-12)
- Linux嵌入式系统开发平台选型探讨(11-09)
- Windows CE 进程、线程和内存管理(二)(11-09)