Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 53d53cfe authored by Rashed Abdel-Tawab's avatar Rashed Abdel-Tawab Committed by Arnav Gupta
Browse files

Added system to build LegacyCamera if specified

Some devices (all 2011 Xperias, and most 2010 legacy devices) cannot use the
default Jellybean camera. Instead they can run the LegacyCamera app
This commit enables using LegacyCamera wrapped into Gallery apk like the
normal JB camera is wrapped into Gallery

To use, just add BOARD_USES_LEGACY_CAMERA := true to your BoardConfig

Credits:
Inspired by a patch by Bryan Gantt <dragonzkiller@gmail.com>
Enhanced by Rashed Abdel-Tawab <rashedabdeltawab@gmail.com>
Thanks for tips and hints from:
	- Konsta Tuomio <konsta09@gmail.com>
	- Arnav Gupta <championswimmer@gmail.com>
	- Ricardo Cerqueira <cyanogenmod@cerqueira.org>

Changelog:
Patch set 1: Fixed up the code
Patch set 2: Use BOARD_USES_LEGACY_CAMERA instead
Patch set 3: Fix up normal Camera stuff
Patch set 4: Clean up. This should be it
Patch set 5: Reomved whitespace, documented the if's and else's, ready to merge now

Change-Id: I2e07032e6a097b8334762af789bf2c72f2515cab
parent 6430623c
Loading
Loading
Loading
Loading
+46 −1
Original line number Diff line number Diff line
ifeq ($(BOARD_USES_LEGACY_CAMERA), true)

LOCAL_PATH:= $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE_TAGS := optional

LOCAL_STATIC_JAVA_LIBRARIES := android-support-v13
LOCAL_STATIC_JAVA_LIBRARIES += com.android.gallery3d.common2

LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_SRC_FILES += $(call all-java-files-under, src_pd)
LOCAL_SRC_FILES += $(call all-java-files-under, ../LegacyCamera/src)

LOCAL_RESOURCE_DIR += $(LOCAL_PATH)/res packages/apps/LegacyCamera/res
LOCAL_AAPT_FLAGS := --auto-add-overlay --extra-packages com.android.camera

LOCAL_PACKAGE_NAME := Gallery2

LOCAL_OVERRIDES_PACKAGES := Gallery Gallery3D GalleryNew3D

#LOCAL_SDK_VERSION := current

LOCAL_JNI_SHARED_LIBRARIES := libjni_legacymosaic libjni_eglfence

LOCAL_REQUIRED_MODULES := libjni_legacymosaic libjni_eglfence

LOCAL_PROGUARD_FLAG_FILES := proguard.flags

include $(BUILD_PACKAGE)

include $(call all-makefiles-under, jni)

ifeq ($(strip $(LOCAL_PACKAGE_OVERRIDES)),)
# Use the following include to make gallery test apk.
include $(call all-makefiles-under, $(LOCAL_PATH))

# Use the following include to make camera test apk.
include $(call all-makefiles-under, ../LegacyCamera)
endif #gallery and camera test apk

else #BOARD_USES_LEGACY_CAMERA

LOCAL_PATH:= $(call my-dir)

include $(CLEAR_VARS)
@@ -36,5 +80,6 @@ include $(call all-makefiles-under, $(LOCAL_PATH))

# Use the following include to make camera test apk.
include $(call all-makefiles-under, ../Camera)
endif #gallery and camera test apk

endif
endif #BOARD_USES_LEGACY_CAMERA