diff --git a/Android.mk b/Android.mk index 9ae99b36ee061528f726bb9331181cbe5c5cda25..a5249a16ed03f4ac20eabfc1e2cf86af7ab00d12 100644 --- a/Android.mk +++ b/Android.mk @@ -39,8 +39,7 @@ $(AAPT): mkdir -p $(@D) ln -sf $(FAKETOOLS_AAPT) $@ -include $(LOCAL_PATH)/updater/Android.mk \ - $(LOCAL_PATH)/jsmin/Android.mk +include $(call all-subdir-makefiles) ifdef GAIA_DISTRIBUTION_DIR diff --git a/gaia_settings/Android.mk b/gaia_settings/Android.mk new file mode 100644 index 0000000000000000000000000000000000000000..845653780e9afec4c03ae52a4cd9aa62f15337c9 --- /dev/null +++ b/gaia_settings/Android.mk @@ -0,0 +1,48 @@ +LOCAL_PATH:= $(call my-dir) + +TEMPLATE_GAIA_DISTRIBUTION_DIR:=$(LOCAL_PATH)/distribution + +gaia/profile.tar.gz: $(GAIA_DISTRIBUTION_DIR)/.exist + +CAMERA_RECORDING_PREFERREDSIZES=\"cif\" +ifeq ($(TARGET_PRODUCT),msm8226) +CAMERA_RECORDING_PREFERREDSIZES=\"720p\" +endif +ifeq ($(TARGET_PRODUCT),msm8610) +CAMERA_RECORDING_PREFERREDSIZES=\"480p\" +endif + +MERGEJSON:=$(LOCAL_PATH)/bin/mergejson + +$(GAIA_DISTRIBUTION_DIR)/.exist: $(GAIA_DISTRIBUTION_DIR)/settings.json +$(GAIA_DISTRIBUTION_DIR)/settings.json: \ + $(GAIA_DISTRIBUTION_DIR)/.settings.tmp \ + $(EXTRA_SETTINGS_JSON_FILE) + echo extra json file is $(EXTRA_SETTINGS_JSON_FILE) + if [ -z "$(EXTRA_SETTINGS_JSON_FILE)" ]; then \ + cp $< $@; \ + else \ + $(MERGEJSON) $(EXTRA_SETTINGS_JSON_FILE) $(GAIA_DISTRIBUTION_DIR)/.settings.tmp $@; \ + fi + +$(GAIA_DISTRIBUTION_DIR)/.settings.tmp: $(TEMPLATE_GAIA_DISTRIBUTION_DIR)/settings.json + mkdir -p $(@D) + cpp -P -DCAMERA_RECORDING_PREFERREDSIZES=$(CAMERA_RECORDING_PREFERREDSIZES) $< $@ + +$(GAIA_DISTRIBUTION_DIR)/.exist: $(GAIA_DISTRIBUTION_DIR)/partner-prefs.js +$(GAIA_DISTRIBUTION_DIR)/partner-prefs.js: \ + $(TEMPLATE_GAIA_DISTRIBUTION_DIR)/partner-prefs.js \ + $(EXTRA_PARTNER_PREFS_FILE) + mkdir -p $(@D) + cp $< $@ + cat $(EXTRA_PARTNER_PREFS_FILE) >> $@ + +$(GAIA_DISTRIBUTION_DIR)/.exist: $(GAIA_DISTRIBUTION_DIR)/camera.json +$(GAIA_DISTRIBUTION_DIR)/camera.json: \ + $(TEMPLATE_GAIA_DISTRIBUTION_DIR)/camera.json + mkdir -p $(@D) + cp $< $@ + +$(GAIA_DISTRIBUTION_DIR)/.exist: + mkdir -p $(@D) + touch $@ diff --git a/gaia_settings/bin/mergejson b/gaia_settings/bin/mergejson new file mode 100755 index 0000000000000000000000000000000000000000..5e69994aab6ce213fa52f8c34cf8bcc3002fd55f --- /dev/null +++ b/gaia_settings/bin/mergejson @@ -0,0 +1,68 @@ +#!/usr/bin/env python + +# Copyright (c) 2014, 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 +# met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# * Neither the name of The Linux Foundation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +def usage(): + print """ +Merge two JSON files into a single file +Usage: mergeJSON [input file 1] [input file 2] [output file] +""" + +import sys + +if len(sys.argv) < 2 or sys.argv[1] == '-h': + usage() + sys.exit(0) + +if len(sys.argv) < 4: + print('error: please provide input and output files') + usage() + sys.exit(1) + +baseA = sys.argv[1] +baseB = sys.argv[2] +merge = sys.argv[3] + +import json +from pprint import pprint + +dictA = None +with open(baseA) as f: + dictA = json.load(f) + +dictB = None +with open(baseB) as f: + dictB = json.load(f) + +dictMerge = {key: value for (key, value) + in (dictA.items() + dictB.items())} + +with open(merge, 'w') as f: + json.dump(dictMerge, f) + +print('Merged ' + str(baseA) + ' and ' + str(baseB) + ' into ' + str(merge)) diff --git a/gaia_settings/distribution/camera.json b/gaia_settings/distribution/camera.json new file mode 100644 index 0000000000000000000000000000000000000000..7f6b2ad9ddb843031e6b95ba48af26d24cdff514 --- /dev/null +++ b/gaia_settings/distribution/camera.json @@ -0,0 +1,33 @@ +/* +Copyright (c) 2014, 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 +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of The Linux Foundation nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED +WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +{ + "maxImagePixelSize": 5242880, + "maxSnapshotPixelSize": 3145728, + "requiredEXIFPreviewSize": { "width": 640, "height": 480} +} diff --git a/gaia_settings/distribution/partner-prefs.js b/gaia_settings/distribution/partner-prefs.js new file mode 100644 index 0000000000000000000000000000000000000000..8c246f18a0c84662f47cbc44a937fa2d326eadda --- /dev/null +++ b/gaia_settings/distribution/partner-prefs.js @@ -0,0 +1,30 @@ +/* +Copyright (c) 2014, 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 +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of The Linux Foundation nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED +WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +pref("media.peerconnection.video.h264_enabled", true); +pref("media.peerconnection.video.max_bitrate", 600); diff --git a/gaia_settings/distribution/settings.json b/gaia_settings/distribution/settings.json new file mode 100644 index 0000000000000000000000000000000000000000..7afcfb83f68b1aadcb4531f1ec19c8146d354ba6 --- /dev/null +++ b/gaia_settings/distribution/settings.json @@ -0,0 +1,31 @@ +/* +Copyright (c) 2014, 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 +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of The Linux Foundation nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED +WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +{ + "camera.recording.preferredSizes": [CAMERA_RECORDING_PREFERREDSIZES] +}