From 271a754c8ea933f981e2d9145647c6205bd56bbe Mon Sep 17 00:00:00 2001 From: junjiez Date: Tue, 7 Feb 2017 10:13:36 +0800 Subject: SnapdragonCamera: Smile/blink/gaze detection Implement Smile/blink/gaze detection feature and add option to enable it in develop options. CRs-Fixed: 1087487 Change-Id: I3005ca9767fbe38323e86255238cd4f96f34fbe5 --- src/com/android/camera/SettingsManager.java | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'src/com/android/camera/SettingsManager.java') diff --git a/src/com/android/camera/SettingsManager.java b/src/com/android/camera/SettingsManager.java index 2e207b970..647887fbf 100755 --- a/src/com/android/camera/SettingsManager.java +++ b/src/com/android/camera/SettingsManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2017, The Linux Foundation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -148,6 +148,7 @@ public class SettingsManager implements ListMenu.SettingsListener { public static final String KEY_ZOOM = "pref_camera2_zoom_key"; public static final HashMap KEY_ISO_INDEX = new HashMap(); + public static final String KEY_BSGC_DETECTION = "pref_camera2_bsgc_key"; private static final String TAG = "SnapCam_SettingsManager"; @@ -612,6 +613,7 @@ public class SettingsManager implements ListMenu.SettingsListener { ListPreference histogram = mPreferenceGroup.findPreference(KEY_HISTOGRAM); ListPreference hdr = mPreferenceGroup.findPreference(KEY_HDR); ListPreference zoom = mPreferenceGroup.findPreference(KEY_ZOOM); + ListPreference bsgc = mPreferenceGroup.findPreference(KEY_BSGC_DETECTION); if (whiteBalance != null) { if (filterUnsupportedOptions(whiteBalance, getSupportedWhiteBalanceModes(cameraId))) { @@ -626,6 +628,13 @@ public class SettingsManager implements ListMenu.SettingsListener { } } + if (bsgc != null) { + if (!isBsgcAvailable(mCameraId)) { + removePreference(mPreferenceGroup, KEY_BSGC_DETECTION); + mFilteredKeys.add(bsgc.getKey()); + } + } + if (colorEffect != null) { if (filterUnsupportedOptions(colorEffect, getSupportedColorEffects(cameraId))) { mFilteredKeys.add(colorEffect.getKey()); @@ -1047,6 +1056,17 @@ public class SettingsManager implements ListMenu.SettingsListener { return false; } + public boolean isBsgcAvailable(int id) { + boolean ret = false; + try { + byte bsgc_available = mCharacteristics.get(id).get(CaptureModule.bsgcAvailable); + ret = bsgc_available == 1; + } catch (IllegalArgumentException e) { + e.printStackTrace(); + } + return ret; + } + public boolean isFacingFront(int id) { int facing = mCharacteristics.get(id).get(CameraCharacteristics.LENS_FACING); return facing == CameraCharacteristics.LENS_FACING_FRONT; -- cgit v1.2.3