From 5d70c451a8cb7478fe1ddd618d4ac0560f3ac7da Mon Sep 17 00:00:00 2001 From: Bongkyu Kim Date: Wed, 30 Jan 2019 19:59:53 +0900 Subject: [PATCH 01/21] ueventd: parallelize restorecon /sys generate subdir for /sys and /sys/devices, handle restorecon in parallel. This reduces coldboot time on our target about 300ms. Change-Id: I9c3d0e97aacff0ca127880d936dfd5fcc2aee125 --- init/ueventd.cpp | 50 +++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 43 insertions(+), 7 deletions(-) diff --git a/init/ueventd.cpp b/init/ueventd.cpp index 399ea4c5c2b4..2668b6575f79 100644 --- a/init/ueventd.cpp +++ b/init/ueventd.cpp @@ -17,12 +17,15 @@ #include "ueventd.h" #include +#include #include #include #include #include #include +#include #include +#include #include #include @@ -120,8 +123,9 @@ class ColdBoot { void UeventHandlerMain(unsigned int process_num, unsigned int total_processes); void RegenerateUevents(); void ForkSubProcesses(); - void DoRestoreCon(); void WaitForSubProcesses(); + void RestoreConHandler(unsigned int process_num, unsigned int total_processes); + void GenerateRestoreCon(const std::string& directory); UeventListener& uevent_listener_; std::vector>& uevent_handlers_; @@ -130,6 +134,8 @@ class ColdBoot { std::vector uevent_queue_; std::set subprocess_pids_; + + std::vector restorecon_queue_; }; void ColdBoot::UeventHandlerMain(unsigned int process_num, unsigned int total_processes) { @@ -140,9 +146,38 @@ void ColdBoot::UeventHandlerMain(unsigned int process_num, unsigned int total_pr uevent_handler->HandleUevent(uevent); } } +} + +void ColdBoot::RestoreConHandler(unsigned int process_num, unsigned int total_processes) { + for (unsigned int i = process_num; i < restorecon_queue_.size(); i += total_processes) { + auto& dir = restorecon_queue_[i]; + + selinux_android_restorecon(dir.c_str(), SELINUX_ANDROID_RESTORECON_RECURSE); + } _exit(EXIT_SUCCESS); } +void ColdBoot::GenerateRestoreCon(const std::string& directory) { + std::unique_ptr dir(opendir(directory.c_str()), &closedir); + + if (!dir) return; + + struct dirent* dent; + while ((dent = readdir(dir.get())) != NULL) { + if (strcmp(dent->d_name, ".") == 0 || strcmp(dent->d_name, "..") == 0) continue; + + struct stat st; + if (fstatat(dirfd(dir.get()), dent->d_name, &st, 0) == -1) continue; + + if (S_ISDIR(st.st_mode)) { + std::string fullpath = directory + "/" + dent->d_name; + if (fullpath != "/sys/devices") { + restorecon_queue_.emplace_back(fullpath); + } + } + } +} + void ColdBoot::RegenerateUevents() { uevent_listener_.RegenerateUevents([this](const Uevent& uevent) { uevent_queue_.emplace_back(std::move(uevent)); @@ -159,16 +194,13 @@ void ColdBoot::ForkSubProcesses() { if (pid == 0) { UeventHandlerMain(i, num_handler_subprocesses_); + RestoreConHandler(i, num_handler_subprocesses_); } subprocess_pids_.emplace(pid); } } -void ColdBoot::DoRestoreCon() { - selinux_android_restorecon("/sys", SELINUX_ANDROID_RESTORECON_RECURSE); -} - void ColdBoot::WaitForSubProcesses() { // Treat subprocesses that crash or get stuck the same as if ueventd itself has crashed or gets // stuck. @@ -207,9 +239,13 @@ void ColdBoot::Run() { RegenerateUevents(); - ForkSubProcesses(); + selinux_android_restorecon("/sys", 0); + selinux_android_restorecon("/sys/devices", 0); + GenerateRestoreCon("/sys"); + // takes long time for /sys/devices, parallelize it + GenerateRestoreCon("/sys/devices"); - DoRestoreCon(); + ForkSubProcesses(); WaitForSubProcesses(); From dbedbeeea3e9b3f63da1c96e4275788cdda8fbd8 Mon Sep 17 00:00:00 2001 From: William Bellavance Date: Tue, 30 Aug 2016 08:04:38 -0400 Subject: [PATCH 02/21] init: don't skip starting a service with no domain if permissive Requires external/libselinux change as well [Adrian DC] Preserve the log while permissive Change-Id: I3f2887930e15d09014c2594141ba4acbbc8d6d9d --- init/service.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/init/service.cpp b/init/service.cpp index ccc37b70cb40..ad9a3e0aff27 100644 --- a/init/service.cpp +++ b/init/service.cpp @@ -94,11 +94,16 @@ static Result ComputeContextFromExecutable(const std::string& servi free(new_con); } if (rc == 0 && computed_context == mycon.get()) { - return Error() << "File " << service_path << "(labeled \"" << filecon.get() - << "\") has incorrect label or no domain transition from " << mycon.get() - << " to another SELinux domain defined. Have you configured your " - "service correctly? https://source.android.com/security/selinux/" - "device-policy#label_new_services_and_address_denials"; + std::string error = StringPrintf( + "File %s (labeled \"%s\") has incorrect label or no domain transition from %s to " + "another SELinux domain defined. Have you configured your " + "service correctly? https://source.android.com/security/selinux/" + "device-policy#label_new_services_and_address_denials", + service_path.c_str(), filecon.get(), mycon.get()); + if (selinux_status_getenforce() > 0) { + return Error() << error; + } + LOG(ERROR) << error; } if (rc < 0) { return Error() << "Could not get process context"; From 8e51159281354802b7bbcee64498e95f84f437d8 Mon Sep 17 00:00:00 2001 From: "Brint E. Kriebel" Date: Wed, 14 May 2014 18:13:00 -0700 Subject: [PATCH 03/21] init: update recovery when enabled in settings Update the recovery image only if the option is enabled under Developer options This reverts commit 231e0a9e6a1da6fa4a188840f68af649669e417f. Change-Id: I928f7ee8bb3eaf5581bb8225661d253ecca0c4ef Change CM recovery install script filename [2/2] This is part 2/2 to maintain backwards compatibility with CWM's verify_root_and_recovery() function. CWM checks if install-recovery.sh exists and has an executable flag set, then offers to disable the script for the user. CM now controls this with the persist.sys.recovery_update property which is configurable via settings, so we don't need to double-check this. This changes the name of the recovery install script to install-cm-recovery.sh. init: Move install-recovery.sh back to the standard location L moved the location of install-recovery.sh from /system/etc/ to /system/bin. Since CWM recovery isn't looking for this location anyway, let's return the file to this standard location. This allows all other code in L to function properly. Maintain the change to the init to allow flash_recovery to be disabled in settings. Change-Id: I8a85db8addeb75a2fd60d809c5ed4edc619ef7ed Former-commit-id: 770c2eff9be48e0d2a0695b7b133c73cadf506f3 Former-commit-id: 534c62cc1291041ca66a248f763235531f7bf36e Former-commit-id: 2d465f0cf69bc82f0c2c993ee797de6037fa1d48 Former-commit-id: a3c8e2b494a1319aa43851bc6a545933089fa1be Former-commit-id: 329d1a39580072177c346a8cee90f6b9334819cb Former-commit-id: 97142c25ff28b6c0a4a916404225c064a977bf6b Change-Id: I275dd358b46c626dfcb8fe02c583a308d5a89c56 --- rootdir/init.rc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rootdir/init.rc b/rootdir/init.rc index 893998cee967..f2e65fccb459 100644 --- a/rootdir/init.rc +++ b/rootdir/init.rc @@ -848,3 +848,9 @@ on property:ro.debuggable=1 service flash_recovery /system/bin/install-recovery.sh class main oneshot + disabled + +# update recovery if enabled +on property:persist.sys.recovery_update=true + start flash_recovery + From 8587480894ff91f9481844cb580a7cec1a28d34c Mon Sep 17 00:00:00 2001 From: M1cha Date: Fri, 26 Aug 2016 06:32:25 +0200 Subject: [PATCH 04/21] mkbootimg: add support for --dt Change-Id: I19f149fac693420cf1f630b51293bbd3650a1b59 --- mkbootimg/mkbootimg.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/mkbootimg/mkbootimg.py b/mkbootimg/mkbootimg.py index 92b11a56d40f..f0c958b228b3 100644 --- a/mkbootimg/mkbootimg.py +++ b/mkbootimg/mkbootimg.py @@ -79,7 +79,7 @@ def write_header(args): args.base + args.second_offset, # physical load addr args.base + args.tags_offset, # physical addr for kernel tags args.pagesize, # flash page size we assume - args.header_version, # version of bootimage header + max(args.header_version, filesize(args.dt)), # version of bootimage header or dt size in bytes (args.os_version << 11) | args.os_patch_level)) # os version and patch level args.output.write(pack('16s', args.board.encode())) # asciiz product name args.output.write(pack('512s', args.cmdline[:512].encode())) @@ -88,6 +88,7 @@ def write_header(args): update_sha(sha, args.kernel) update_sha(sha, args.ramdisk) update_sha(sha, args.second) + update_sha(sha, args.dt) if args.header_version > 0: update_sha(sha, args.recovery_dtbo) @@ -203,15 +204,22 @@ def parse_cmdline(): parser.add_argument('--id', help='print the image ID on standard output', action='store_true') parser.add_argument('--header_version', help='boot image header version', type=parse_int, default=0) + parser.add_argument('--dt', help='path to the device tree image', type=FileType('rb')) parser.add_argument('-o', '--output', help='output file name', type=FileType('wb'), required=True) - return parser.parse_args() + + args = parser.parse_args() + if args.header_version > 0 and args.dt != None: + raise ValueError('header_version and dt cannot be set at the same time') + + return args def write_data(args): write_padded_file(args.output, args.kernel, args.pagesize) write_padded_file(args.output, args.ramdisk, args.pagesize) write_padded_file(args.output, args.second, args.pagesize) + write_padded_file(args.output, args.dt, args.pagesize) if args.header_version > 0: write_padded_file(args.output, args.recovery_dtbo, args.pagesize) From 987a82651463030b3c4c669b769c8b2d0e730d36 Mon Sep 17 00:00:00 2001 From: David Ng Date: Mon, 23 Sep 2013 18:50:24 -0700 Subject: [PATCH 05/21] init: Add vendor-specific initialization hooks. Allow optional vendor-specific initializations within init. This can be used for runtime initialization setup that init rc scripts do not support. Change-Id: I7623a0d59b18f9ec8e3623958e2f7ccd72b877bf --- init/Android.bp | 1 + init/Android.mk | 5 +++++ init/NOTICE | 26 ++++++++++++++++++++++++++ init/property_service.cpp | 4 ++++ init/vendor_init.cpp | 37 +++++++++++++++++++++++++++++++++++++ init/vendor_init.h | 33 +++++++++++++++++++++++++++++++++ 6 files changed, 106 insertions(+) create mode 100644 init/vendor_init.cpp create mode 100644 init/vendor_init.h diff --git a/init/Android.bp b/init/Android.bp index 6be7290e3278..9c7734a5e0a7 100644 --- a/init/Android.bp +++ b/init/Android.bp @@ -136,6 +136,7 @@ cc_library_static { "ueventd.cpp", "ueventd_parser.cpp", "util.cpp", + "vendor_init.cpp", ], whole_static_libs: ["libcap", "com.android.sysprop.apex"], header_libs: ["bootimg_headers"], diff --git a/init/Android.mk b/init/Android.mk index c4f7d34b2d7d..e52fbef6ba34 100644 --- a/init/Android.mk +++ b/init/Android.mk @@ -113,6 +113,11 @@ LOCAL_STATIC_LIBRARIES := \ LOCAL_SANITIZE := signed-integer-overflow # First stage init is weird: it may start without stdout/stderr, and no /proc. LOCAL_NOSANITIZE := hwaddress + +ifneq ($(strip $(TARGET_INIT_VENDOR_LIB)),) +LOCAL_WHOLE_STATIC_LIBRARIES += $(TARGET_INIT_VENDOR_LIB) +endif + include $(BUILD_EXECUTABLE) endif diff --git a/init/NOTICE b/init/NOTICE index c5b1efa7aac7..383d0f5418a6 100644 --- a/init/NOTICE +++ b/init/NOTICE @@ -188,3 +188,29 @@ END OF TERMS AND CONDITIONS +Copyright (c) 2013, 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. diff --git a/init/property_service.cpp b/init/property_service.cpp index f2c7462abf02..470f6e06c46e 100644 --- a/init/property_service.cpp +++ b/init/property_service.cpp @@ -64,6 +64,7 @@ #include "selinux.h" #include "subcontext.h" #include "util.h" +#include "vendor_init.h" using namespace std::literals; @@ -912,6 +913,9 @@ void property_load_boot_defaults(bool load_debug_prop) { } } + // Update with vendor-specific property runtime overrides + vendor_load_properties(); + property_initialize_ro_product_props(); property_derive_build_fingerprint(); diff --git a/init/vendor_init.cpp b/init/vendor_init.cpp new file mode 100644 index 000000000000..d3fd5ffe2be9 --- /dev/null +++ b/init/vendor_init.cpp @@ -0,0 +1,37 @@ +/* +Copyright (c) 2013, 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. + */ + +#include "vendor_init.h" + +/* init vendor override stubs */ + +__attribute__ ((weak)) +void vendor_load_properties() +{ +} diff --git a/init/vendor_init.h b/init/vendor_init.h new file mode 100644 index 000000000000..9afb449be013 --- /dev/null +++ b/init/vendor_init.h @@ -0,0 +1,33 @@ +/* +Copyright (c) 2013, 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. + */ + +#ifndef __INIT_VENDOR__H__ +#define __INIT_VENDOR__H__ +extern void vendor_load_properties(void); +#endif /* __INIT_VENDOR__H__ */ From 377903608eb742cece6d7eee7f22c6b0186cc55d Mon Sep 17 00:00:00 2001 From: Michael Bestas Date: Sun, 4 Sep 2016 13:48:49 +0300 Subject: [PATCH 06/21] mkbootimg: add 32K 64K and 128K pagesizes Change-Id: I392fe860b51a8c022ffdace45b8eeb46618d6ec6 --- mkbootimg/mkbootimg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkbootimg/mkbootimg.py b/mkbootimg/mkbootimg.py index f0c958b228b3..7e556d0c1eca 100644 --- a/mkbootimg/mkbootimg.py +++ b/mkbootimg/mkbootimg.py @@ -200,7 +200,7 @@ def parse_cmdline(): parser.add_argument('--board', help='board name', default='', action=ValidateStrLenAction, maxlen=16) parser.add_argument('--pagesize', help='page size', type=parse_int, - choices=[2**i for i in range(11,15)], default=2048) + choices=[2**i for i in range(11,18)], default=2048) parser.add_argument('--id', help='print the image ID on standard output', action='store_true') parser.add_argument('--header_version', help='boot image header version', type=parse_int, default=0) From 42061658761be5fae7120adce5809d40a8162113 Mon Sep 17 00:00:00 2001 From: Adnan Begovic Date: Tue, 13 Oct 2015 16:28:49 -0700 Subject: [PATCH 07/21] logcat: Map '-C' to 'logcat -v color' Change-Id: I0419f4551a6dfd77c7d4833050b36da28113ed9b --- logcat/logcat.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/logcat/logcat.cpp b/logcat/logcat.cpp index 15e07feefb95..400635d9be24 100644 --- a/logcat/logcat.cpp +++ b/logcat/logcat.cpp @@ -492,6 +492,7 @@ static void show_help(android_logcat_context_internal* context) { " other pruning activity is oldest first. Special case ~!\n" " represents an automatic quicker pruning for the noisiest\n" " UID as determined by the current statistics.\n" + " -C colored output\n" " -P ' ...', --prune=' ...'\n" " Set prune white and ~black list, using same format as\n" " listed above. Must be quoted.\n" @@ -867,6 +868,7 @@ static int __logcat(android_logcat_context_internal* context) { { "dividers", no_argument, nullptr, 'D' }, { "file", required_argument, nullptr, 'f' }, { "format", required_argument, nullptr, 'v' }, + { "color", no_argument, NULL, 'C' }, // hidden and undocumented reserved alias for --regex { "grep", required_argument, nullptr, 'e' }, // hidden and undocumented reserved alias for --max-count @@ -890,7 +892,7 @@ static int __logcat(android_logcat_context_internal* context) { }; // clang-format on - int c = getopt_long(argc, argv, ":cdDhLt:T:gG:sQf:r:n:v:b:BSpP:m:e:", long_options, + int c = getopt_long(argc, argv, ":cdDhLt:T:gG:sQf:r:n:v:b:BSpCP:m:e:", long_options, &option_index); if (c == -1) break; @@ -1058,6 +1060,10 @@ static int __logcat(android_logcat_context_internal* context) { setPruneList = optarg; break; + case 'C': + setLogFormat(context, "color"); + break; + case 'b': { std::unique_ptr buffers(strdup(optarg), free); char* arg = buffers.get(); From e5df8e535251851fca27dbfe2e501a721874eedb Mon Sep 17 00:00:00 2001 From: Sauhard Pande Date: Wed, 24 Jun 2015 22:38:25 -0700 Subject: [PATCH 08/21] Camera: Add feature extensions This change includes below commits: Camera bringup changes system-core Change-Id: I1cf98641eca9096bd27645e07ea802646ea1fb96 system/core: Fix for HAL compilation issues while integrating HAL 1.0 Change-Id: Iead9c1ade279b64c5cbdf4d2de1a8b695939c52a Camera: Add enum to specify the frame type Added enum to specify the frame type of either fd/data buffer CRs-fixed: 654901 Change-Id: I1c0b1a2c6a1425cdb6650cdfc20ca65835a1b81f Change-Id: I654a40661e6e101da2a06986abeceb20639cccd9 --- libsystem/include/system/camera.h | 53 ++++++++++++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/libsystem/include/system/camera.h b/libsystem/include/system/camera.h index 2ca90c395ba1..990edcf326f3 100644 --- a/libsystem/include/system/camera.h +++ b/libsystem/include/system/camera.h @@ -88,9 +88,20 @@ enum { // Notify on autofocus start and stop. This is useful in continuous // autofocus - FOCUS_MODE_CONTINUOUS_VIDEO and FOCUS_MODE_CONTINUOUS_PICTURE. CAMERA_MSG_FOCUS_MOVE = 0x0800, // notifyCallback + CAMERA_MSG_VENDOR_START = 0x1000, + CAMERA_MSG_STATS_DATA = CAMERA_MSG_VENDOR_START, + CAMERA_MSG_META_DATA = 0x2000, + CAMERA_MSG_VENDOR_END = 0x8000, CAMERA_MSG_ALL_MSGS = 0xFFFF }; +/** meta data type in CameraMetaDataCallback */ +enum { + CAMERA_META_DATA_ASD = 0x001, //ASD data + CAMERA_META_DATA_FD = 0x002, //FD/FP data + CAMERA_META_DATA_HDR = 0x003, //Auto HDR data +}; + /** cmdType in sendCommand functions */ enum { CAMERA_CMD_START_SMOOTH_ZOOM = 1, @@ -189,7 +200,25 @@ enum { * IMPLEMENTATION_DEFINED, then HALv3 devices will use gralloc usage flags * of SW_READ_OFTEN. */ - CAMERA_CMD_SET_VIDEO_FORMAT = 11 + CAMERA_CMD_SET_VIDEO_FORMAT = 11, + + CAMERA_CMD_VENDOR_START = 20, + /** + * Commands to enable/disable preview histogram + * + * Based on user's input to enable/disable histogram from the camera + * UI, send the appropriate command to the HAL to turn on/off the histogram + * stats and start sending the data to the application. + */ + CAMERA_CMD_HISTOGRAM_ON = CAMERA_CMD_VENDOR_START, + CAMERA_CMD_HISTOGRAM_OFF = CAMERA_CMD_VENDOR_START + 1, + CAMERA_CMD_HISTOGRAM_SEND_DATA = CAMERA_CMD_VENDOR_START + 2, + CAMERA_CMD_LONGSHOT_ON = CAMERA_CMD_VENDOR_START + 3, + CAMERA_CMD_LONGSHOT_OFF = CAMERA_CMD_VENDOR_START + 4, + CAMERA_CMD_STOP_LONGSHOT = CAMERA_CMD_VENDOR_START + 5, + CAMERA_CMD_METADATA_ON = CAMERA_CMD_VENDOR_START + 6, + CAMERA_CMD_METADATA_OFF = CAMERA_CMD_VENDOR_START + 7, + CAMERA_CMD_VENDOR_END = 200, }; /** camera fatal errors */ @@ -284,9 +313,31 @@ typedef struct camera_face { * -2000, -2000 if this is not supported. */ int32_t mouth[2]; + int32_t smile_degree; + int32_t smile_score; + int32_t blink_detected; + int32_t face_recognised; + int32_t gaze_angle; + int32_t updown_dir; + int32_t leftright_dir; + int32_t roll_dir; + int32_t left_right_gaze; + int32_t top_bottom_gaze; + int32_t leye_blink; + int32_t reye_blink; } camera_face_t; +/** + * The information of a data type received in a camera frame. + */ +typedef enum { + /** Data buffer */ + CAMERA_FRAME_DATA_BUF = 0x000, + /** File descriptor */ + CAMERA_FRAME_DATA_FD = 0x100 +} camera_frame_data_type_t; + /** * The metadata of the frame data. */ From 2d232e727d845a2857c9fb343a32a7b80a249f95 Mon Sep 17 00:00:00 2001 From: Dan Pasanen Date: Fri, 29 Dec 2017 11:08:39 -0600 Subject: [PATCH 09/21] init: always allow local.prop overrides * Many people use this for more than just debugging. Let's allow it to work in non-debuggable situations too. Change-Id: Ifb0d0e636c225ff8830154a49a182a034332056b --- init/Android.bp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init/Android.bp b/init/Android.bp index 9c7734a5e0a7..87c497887275 100644 --- a/init/Android.bp +++ b/init/Android.bp @@ -26,7 +26,7 @@ cc_defaults { "-Wextra", "-Wno-unused-parameter", "-Werror", - "-DALLOW_LOCAL_PROP_OVERRIDE=0", + "-DALLOW_LOCAL_PROP_OVERRIDE=1", "-DALLOW_PERMISSIVE_SELINUX=0", "-DREBOOT_BOOTLOADER_ON_PANIC=0", "-DWORLD_WRITABLE_KMSG=0", From aae27a03d012ca9ffe1d8800b83a6c77524ed3e9 Mon Sep 17 00:00:00 2001 From: Steve Kondik Date: Thu, 28 Jul 2016 12:17:40 -0700 Subject: [PATCH 10/21] healthd: Add DASH charger type Change-Id: Ie1ca5018c465f6b2c15cbc00bdf3bb866d98ddef --- healthd/BatteryMonitor.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/healthd/BatteryMonitor.cpp b/healthd/BatteryMonitor.cpp index 06c8176e9588..30c5f7e78b5d 100644 --- a/healthd/BatteryMonitor.cpp +++ b/healthd/BatteryMonitor.cpp @@ -164,6 +164,7 @@ BatteryMonitor::PowerSupplyType BatteryMonitor::readPowerSupplyType(const String { "USB_PD", ANDROID_POWER_SUPPLY_TYPE_AC }, { "USB_PD_DRP", ANDROID_POWER_SUPPLY_TYPE_USB }, { "Wireless", ANDROID_POWER_SUPPLY_TYPE_WIRELESS }, + { "DASH", ANDROID_POWER_SUPPLY_TYPE_AC }, { NULL, 0 }, }; From 54a4244ec881151f292e7c3a8f7b282cbf5d71dd Mon Sep 17 00:00:00 2001 From: Abhijeet Dharmapurikar Date: Mon, 14 Sep 2015 16:35:26 -0700 Subject: [PATCH 11/21] healthd: Add support for HVDCP_3 chargers HVDCP_3 is a high voltage DCP charger where the charger's voltage can be changed by issuing pulses on the D+/D- lines. Add support to recognize it and treat it as an AC power source. Change-Id: Ib719529904e8b7a676bbdc5f5953f0f9da6df3fa --- healthd/BatteryMonitor.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/healthd/BatteryMonitor.cpp b/healthd/BatteryMonitor.cpp index 30c5f7e78b5d..18bd251df968 100644 --- a/healthd/BatteryMonitor.cpp +++ b/healthd/BatteryMonitor.cpp @@ -158,6 +158,7 @@ BatteryMonitor::PowerSupplyType BatteryMonitor::readPowerSupplyType(const String { "USB", ANDROID_POWER_SUPPLY_TYPE_USB }, { "USB_DCP", ANDROID_POWER_SUPPLY_TYPE_AC }, { "USB_HVDCP", ANDROID_POWER_SUPPLY_TYPE_AC }, + { "USB_HVDCP_3", ANDROID_POWER_SUPPLY_TYPE_AC }, { "USB_CDP", ANDROID_POWER_SUPPLY_TYPE_AC }, { "USB_ACA", ANDROID_POWER_SUPPLY_TYPE_AC }, { "USB_C", ANDROID_POWER_SUPPLY_TYPE_AC }, From a92bfce06781d2ad60c6f290c3ba491437218276 Mon Sep 17 00:00:00 2001 From: "Christopher N. Hesse" Date: Sun, 4 Sep 2016 12:26:32 +0200 Subject: [PATCH 12/21] utils: Threads: Handle empty thread names * Fixes camera for Samsung Exynos devices: 08-30 18:07:03.585 2729 2729 I ExynosCameraFrameFactory: INFO(startThread[1608]):pipeId=0 08-30 18:07:03.585 2729 2729 F libutils.threads: thread name not provided to Thread::run 08-30 18:07:03.586 2729 2729 F libc : Fatal signal 6 (SIGABRT), code -6 in tid 2729 (cameraserver) 08-30 18:07:03.587 2548 2548 W : debuggerd: handling request: pid=2729 uid=1047 gid=1005 tid=2729 08-30 18:07:03.656 6489 6489 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 08-30 18:07:03.656 6489 6489 F DEBUG : Build fingerprint: 'samsung/aosp_gts210ltexx/gts210ltexx:7.0/NYC/chris08292135:userdebug/test-keys' 08-30 18:07:03.656 6489 6489 F DEBUG : Revision: '0' 08-30 18:07:03.657 6489 6489 F DEBUG : ABI: 'arm' 08-30 18:07:03.657 6489 6489 F DEBUG : pid: 2729, tid: 2729, name: cameraserver >>> /system/bin/cameraserver <<< 08-30 18:07:03.658 6489 6489 F DEBUG : signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr -------- 08-30 18:07:03.673 6489 6489 F DEBUG : Abort message: 'thread name not provided to Thread::run' 08-30 18:07:03.673 6489 6489 F DEBUG : r0 00000000 r1 00000aa9 r2 00000006 r3 00000008 08-30 18:07:03.674 6489 6489 F DEBUG : r4 b5a2c58c r5 00000006 r6 b5a2c534 r7 0000010c 08-30 18:07:03.674 6489 6489 F DEBUG : r8 b28b5380 r9 00000000 sl 00000000 fp b2a92800 08-30 18:07:03.674 6489 6489 F DEBUG : ip 00000016 sp be90b350 lr b4f7e537 pc b4f80d94 cpsr 200f0010 08-30 18:07:03.694 6489 6489 F DEBUG : 08-30 18:07:03.694 6489 6489 F DEBUG : backtrace: 08-30 18:07:03.694 6489 6489 F DEBUG : #00 pc 00049d94 /system/lib/libc.so (tgkill+12) 08-30 18:07:03.694 6489 6489 F DEBUG : #01 pc 00047533 /system/lib/libc.so (pthread_kill+34) 08-30 18:07:03.694 6489 6489 F DEBUG : #02 pc 0001d885 /system/lib/libc.so (raise+10) 08-30 18:07:03.694 6489 6489 F DEBUG : #03 pc 000193d1 /system/lib/libc.so (__libc_android_abort+34) 08-30 18:07:03.694 6489 6489 F DEBUG : #04 pc 00017014 /system/lib/libc.so (abort+4) 08-30 18:07:03.695 6489 6489 F DEBUG : #05 pc 0000bfd5 /system/lib/libcutils.so (__android_log_assert+112) 08-30 18:07:03.695 6489 6489 F DEBUG : #06 pc 0000e265 /system/lib/libutils.so (_ZN7android6Thread3runEPKcij+212) 08-30 18:07:03.695 6489 6489 F DEBUG : #07 pc 00045903 /system/lib/libexynoscamera.so (_ZN7android16ExynosCameraPipe11startThreadEv+74) 08-30 18:07:03.695 6489 6489 F DEBUG : #08 pc 0007b1c3 /system/lib/libexynoscamera.so (_ZN7android24ExynosCameraFrameFactory11startThreadEj+70) 08-30 18:07:03.695 6489 6489 F DEBUG : #09 pc 0007bcef /system/lib/libexynoscamera.so (_ZN7android24ExynosCameraFrameFactory19startInitialThreadsEv+70) 08-30 18:07:03.695 6489 6489 F DEBUG : #10 pc 0006231d /system/lib/libexynoscamera.so (_ZN7android12ExynosCamera22m_startPreviewInternalEv+1140) 08-30 18:07:03.695 6489 6489 F DEBUG : #11 pc 0006b897 /system/lib/libexynoscamera.so (_ZN7android12ExynosCamera12startPreviewEv+1666) 08-30 18:07:03.695 6489 6489 F DEBUG : #12 pc 000037b1 /system/lib/hw/camera.universal5433.so 08-30 18:07:03.695 6489 6489 F DEBUG : #13 pc 0006094f /system/lib/libcameraservice.so (_ZN7android12CameraClient16startPreviewModeEv+102) 08-30 18:07:03.695 6489 6489 F DEBUG : #14 pc 00060825 /system/lib/libcameraservice.so (_ZN7android12CameraClient15startCameraModeENS0_11camera_modeE+68) 08-30 18:07:03.695 6489 6489 F DEBUG : #15 pc 000282f9 /system/lib/libcamera_client.so (_ZN7android8hardware8BnCamera10onTransactEjRKNS_6ParcelEPS2_j+724) 08-30 18:07:03.695 6489 6489 F DEBUG : #16 pc 000359b3 /system/lib/libbinder.so (_ZN7android7BBinder8transactEjRKNS_6ParcelEPS1_j+70) 08-30 18:07:03.695 6489 6489 F DEBUG : #17 pc 0003d159 /system/lib/libbinder.so (_ZN7android14IPCThreadState14executeCommandEi+684) 08-30 18:07:03.695 6489 6489 F DEBUG : #18 pc 0003cdb7 /system/lib/libbinder.so (_ZN7android14IPCThreadState20getAndExecuteCommandEv+114) 08-30 18:07:03.695 6489 6489 F DEBUG : #19 pc 0003d2bb /system/lib/libbinder.so (_ZN7android14IPCThreadState14joinThreadPoolEb+46) 08-30 18:07:03.695 6489 6489 F DEBUG : #20 pc 00000b4d /system/bin/cameraserver 08-30 18:07:03.696 6489 6489 F DEBUG : #21 pc 00016c2d /system/lib/libc.so (__libc_init+48) 08-30 18:07:03.696 6489 6489 F DEBUG : #22 pc 00000a18 /system/bin/cameraserver Change-Id: Ib6234260a5fc5798eea580e0ac594313650de933 --- libutils/Threads.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libutils/Threads.cpp b/libutils/Threads.cpp index 31ca1383e7a2..78fec09e2bb1 100644 --- a/libutils/Threads.cpp +++ b/libutils/Threads.cpp @@ -663,7 +663,10 @@ status_t Thread::readyToRun() status_t Thread::run(const char* name, int32_t priority, size_t stack) { - LOG_ALWAYS_FATAL_IF(name == nullptr, "thread name not provided to Thread::run"); + if (name == nullptr) { + ALOGW("Thread name not provided to Thread::run"); + name = 0; + } Mutex::Autolock _l(mLock); From 86759ac4903c428e56cc1c3bc3ff07080dd88b61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Burtin?= Date: Sun, 5 Feb 2012 00:55:17 +0100 Subject: [PATCH 13/21] set /system/etc/init.d/* permissions ported from CM7 [@AgentFabulous - POSP] - Adapt for q-preview upstream Change-Id: I279d78679f7d779d6cd6bbc6c834d94706937ae8 Signed-off-by: Kshitij Gupta --- libcutils/fs_config.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libcutils/fs_config.cpp b/libcutils/fs_config.cpp index a5f4f0e5579d..27e450bee9e6 100644 --- a/libcutils/fs_config.cpp +++ b/libcutils/fs_config.cpp @@ -220,6 +220,7 @@ static const struct fs_path_config android_files[] = { { 00755, AID_ROOT, AID_SHELL, 0, "product/bin/*" }, { 00750, AID_ROOT, AID_SHELL, 0, "sbin/*" }, { 00755, AID_ROOT, AID_SHELL, 0, "system/bin/*" }, + { 00755, AID_ROOT, AID_SHELL, 0, "system/etc/init.d/*" }, { 00755, AID_ROOT, AID_SHELL, 0, "system/xbin/*" }, { 00755, AID_ROOT, AID_SHELL, 0, "system/apex/*/bin/*" }, { 00755, AID_ROOT, AID_SHELL, 0, "vendor/bin/*" }, From b7a35b95c44ba3f609d615f3f94ea63dceffdac8 Mon Sep 17 00:00:00 2001 From: Scott Mertz Date: Sat, 21 Mar 2015 17:33:47 -0700 Subject: [PATCH 14/21] healthd: allow custom charger images Change-Id: I1380bea300bfaa6819d50bdc813329c93050286a (cherry picked from commit b6ebd65cd36d06daa5cf33f031d7e03b0bd674c6) --- healthd/Android.mk | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/healthd/Android.mk b/healthd/Android.mk index 05123af80d35..4eb98dae0d48 100644 --- a/healthd/Android.mk +++ b/healthd/Android.mk @@ -200,8 +200,13 @@ include $$(BUILD_PREBUILT) endef _img_modules := +ifeq ($(strip $(BOARD_HEALTHD_CUSTOM_CHARGER_RES)),) +IMAGES_DIR := images +else +IMAGES_DIR := ../../../$(BOARD_HEALTHD_CUSTOM_CHARGER_RES) +endif _images := -$(foreach _img, $(call find-subdir-subdir-files, "images", "*.png"), \ +$(foreach _img, $(call find-subdir-subdir-files, "$(IMAGES_DIR)", "*.png"), \ $(eval $(call _add-charger-image,$(_img)))) include $(CLEAR_VARS) From 91e39024599100bb8e159d1c6dfd4eae8485f34b Mon Sep 17 00:00:00 2001 From: Steve Kondik Date: Thu, 5 Nov 2015 04:09:22 -0800 Subject: [PATCH 15/21] camera: Add L-compatible camera feature enums * These QC-specific features have been renumbered in M, so add a compilation flag to permit using the old versions in case we can't rebuild the driver. Change-Id: I3f5a545fde8b27684b1b8ea490c09bb66e3b4cd9 --- libsystem/include/system/camera.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/libsystem/include/system/camera.h b/libsystem/include/system/camera.h index 990edcf326f3..1b5154e3c028 100644 --- a/libsystem/include/system/camera.h +++ b/libsystem/include/system/camera.h @@ -200,6 +200,7 @@ enum { * IMPLEMENTATION_DEFINED, then HALv3 devices will use gralloc usage flags * of SW_READ_OFTEN. */ +#ifndef CAMERA_VENDOR_L_COMPAT CAMERA_CMD_SET_VIDEO_FORMAT = 11, CAMERA_CMD_VENDOR_START = 20, @@ -219,6 +220,20 @@ enum { CAMERA_CMD_METADATA_ON = CAMERA_CMD_VENDOR_START + 6, CAMERA_CMD_METADATA_OFF = CAMERA_CMD_VENDOR_START + 7, CAMERA_CMD_VENDOR_END = 200, +#else + /** + * Values used by older HALs, provided as an option for compatibility + */ + CAMERA_CMD_HISTOGRAM_ON = 11, + CAMERA_CMD_HISTOGRAM_OFF = 12, + CAMERA_CMD_HISTOGRAM_SEND_DATA = 13, + CAMERA_CMD_LONGSHOT_ON = 14, + CAMERA_CMD_LONGSHOT_OFF = 15, + CAMERA_CMD_STOP_LONGSHOT = 16, + CAMERA_CMD_METADATA_ON = 100, + CAMERA_CMD_METADATA_OFF = 101, + CAMERA_CMD_SET_VIDEO_FORMAT = 102, +#endif }; /** camera fatal errors */ From e2da2f6aa4379a59aeced6448ad38b7a97f33e17 Mon Sep 17 00:00:00 2001 From: Kshitij Gupta Date: Fri, 16 Aug 2019 18:43:31 +0530 Subject: [PATCH 16/21] Don't format formattable partitions if mount fails - Forward port to Q, based on revert of change 29dd6b6c01295222fee5ef2fc70692b2ecb12504 in bootable/recovery Change-Id: Ibd896e611eb2140c9bc2402d6ef623f8c9ee3bf5 Signed-off-by: Kshitij Gupta --- fs_mgr/fs_mgr_roots.cpp | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/fs_mgr/fs_mgr_roots.cpp b/fs_mgr/fs_mgr_roots.cpp index 58ef9b6cd309..04030880e1df 100644 --- a/fs_mgr/fs_mgr_roots.cpp +++ b/fs_mgr/fs_mgr_roots.cpp @@ -117,18 +117,7 @@ bool EnsurePathMounted(Fstab* fstab, const std::string& path, const std::string& return false; } - int result = fs_mgr_do_mount_one(*rec, mount_point); - if (result == -1 && rec->fs_mgr_flags.formattable) { - PERROR << "Failed to mount " << mount_point << "; formatting"; - bool crypt_footer = rec->is_encryptable() && rec->key_loc == "footer"; - if (fs_mgr_do_format(*rec, crypt_footer) != 0) { - PERROR << "Failed to format " << mount_point; - return false; - } - result = fs_mgr_do_mount_one(*rec, mount_point); - } - - if (result == -1) { + if (fs_mgr_do_mount_one(*rec, mount_point) == -1) { PERROR << "Failed to mount " << mount_point; return false; } From e302ab7f2423b58a06cb787a41249cd6cdc76302 Mon Sep 17 00:00:00 2001 From: Abhijeet Dharmapurikar Date: Tue, 24 May 2016 15:12:11 -0700 Subject: [PATCH 17/21] healthd: Reinitialize mChargerNames for every battery update Booting up the device without usb, the kernel sets the usb power supply type as UNKNOWN. The type of usb power supply changes at run-time as various chargers are plugged in/out. However, healthd initilizes the charger list only at bootup. Change it such that it checks for charger type changes with every battery or usb uevent. While at it, the kernel may have a power supply type which is not known to healthd. This is perfectly fine. Update healthd to not print a warning. Change-Id: I2ec9f9a420ca61814d43c316b418ce94de3691bc --- healthd/BatteryMonitor.cpp | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/healthd/BatteryMonitor.cpp b/healthd/BatteryMonitor.cpp index 18bd251df968..bc071965369b 100644 --- a/healthd/BatteryMonitor.cpp +++ b/healthd/BatteryMonitor.cpp @@ -246,6 +246,40 @@ bool BatteryMonitor::update(void) { double MaxPower = 0; + // Rescan for the available charger types + std::unique_ptr dir(opendir(POWER_SUPPLY_SYSFS_PATH), closedir); + if (dir == NULL) { + KLOG_ERROR(LOG_TAG, "Could not open %s\n", POWER_SUPPLY_SYSFS_PATH); + } else { + struct dirent* entry; + String8 path; + + mChargerNames.clear(); + + while ((entry = readdir(dir.get()))) { + const char* name = entry->d_name; + + if (!strcmp(name, ".") || !strcmp(name, "..")) + continue; + + // Look for "type" file in each subdirectory + path.clear(); + path.appendFormat("%s/%s/type", POWER_SUPPLY_SYSFS_PATH, name); + switch(BatteryMonitor::readPowerSupplyType(path)) { + case ANDROID_POWER_SUPPLY_TYPE_AC: + case ANDROID_POWER_SUPPLY_TYPE_USB: + case ANDROID_POWER_SUPPLY_TYPE_WIRELESS: + path.clear(); + path.appendFormat("%s/%s/online", POWER_SUPPLY_SYSFS_PATH, name); + if (access(path.string(), R_OK) == 0) + mChargerNames.add(String8(name)); + break; + default: + break; + } + } + } + for (size_t i = 0; i < mChargerNames.size(); i++) { String8 path; path.appendFormat("%s/%s/online", POWER_SUPPLY_SYSFS_PATH, From 1cfe21dd899b5eb2c8cc12c2bd5c89a52df09639 Mon Sep 17 00:00:00 2001 From: maxwen Date: Mon, 2 Oct 2017 00:03:49 +0200 Subject: [PATCH 18/21] healthd: cover devices that have voltage_max file with value of 0 its perfectly fine to use default value also in those cases instead of not adding anything at all and breaking fast vs. slow charging calc in framework Change-Id: I098660592dcb1c877ad15ed2b5c3b40cc2d414e6 Former-commit-id: e9654ad9dcf129171c78237023f5238d96382fc4 --- healthd/BatteryMonitor.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/healthd/BatteryMonitor.cpp b/healthd/BatteryMonitor.cpp index bc071965369b..5b24b23a9db3 100644 --- a/healthd/BatteryMonitor.cpp +++ b/healthd/BatteryMonitor.cpp @@ -316,6 +316,11 @@ bool BatteryMonitor::update(void) { (access(path.string(), R_OK) == 0) ? getIntField(path) : DEFAULT_VBUS_VOLTAGE; + // there are devices that have the file but with a value of 0 + if (ChargingVoltage == 0) { + ChargingVoltage = DEFAULT_VBUS_VOLTAGE; + } + double power = ((double)ChargingCurrent / MILLION) * ((double)ChargingVoltage / MILLION); if (MaxPower < power) { From 2d4f7a05a7c3c10a101d8888daa5b9613aa77861 Mon Sep 17 00:00:00 2001 From: Shivaprasad Hongal Date: Thu, 12 Jul 2018 16:24:45 -0700 Subject: [PATCH 19/21] fs_mgr: Wrapped key support for FBE @jhenrique09 : Port to android 10 Change-Id: I01f634e8d464059791d731d2af690bdfd8008107 --- fs_mgr/fs_mgr_fstab.cpp | 2 ++ fs_mgr/include_fstab/fstab/fstab.h | 1 + 2 files changed, 3 insertions(+) diff --git a/fs_mgr/fs_mgr_fstab.cpp b/fs_mgr/fs_mgr_fstab.cpp index 7df7cfd99b30..b7145d53814c 100644 --- a/fs_mgr/fs_mgr_fstab.cpp +++ b/fs_mgr/fs_mgr_fstab.cpp @@ -329,6 +329,8 @@ void ParseFsMgrFlags(const std::string& flags, FstabEntry* entry) { } } else if (StartsWith(flag, "zram_backing_dev_path=")) { entry->zram_backing_dev_path = arg; + } else if (StartsWith(flag, "wrappedkey")) { + entry->fs_mgr_flags.wrappedkey = true; } else { LWARNING << "Warning: unknown flag: " << flag; } diff --git a/fs_mgr/include_fstab/fstab/fstab.h b/fs_mgr/include_fstab/fstab/fstab.h index d7afed654892..9ab8ddc02a50 100644 --- a/fs_mgr/include_fstab/fstab/fstab.h +++ b/fs_mgr/include_fstab/fstab/fstab.h @@ -84,6 +84,7 @@ struct FstabEntry { bool first_stage_mount : 1; bool slot_select_other : 1; bool fs_verity : 1; + bool wrappedkey : 1; } fs_mgr_flags = {}; bool is_encryptable() const { From 8562d4939bc96c9536c2acbb907842330e4f95ad Mon Sep 17 00:00:00 2001 From: David Ng Date: Mon, 23 Sep 2013 18:50:24 -0700 Subject: [PATCH 20/21] init: Add vendor-specific initialization hooks. Allow optional vendor-specific initializations within init. This can be used for runtime initialization setup that init rc scripts do not support. Change-Id: I7623a0d59b18f9ec8e3623958e2f7ccd72b877bf --- init/Android.bp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/init/Android.bp b/init/Android.bp index 87c497887275..ac95f288d445 100644 --- a/init/Android.bp +++ b/init/Android.bp @@ -151,6 +151,14 @@ cc_library_static { exclude_shared_libs: ["libbinder", "libutils"], }, }, + + product_variables: { + rr: { + target_init_vendor_lib: { + whole_static_libs: ["%s"], + }, + }, + }, } cc_binary { From b9cf1f937e6451387e751af0625a6bdcdcf0c998 Mon Sep 17 00:00:00 2001 From: Joshua Primero Date: Thu, 19 Sep 2019 03:06:17 -0700 Subject: [PATCH 21/21] init: we Converted libinit to blueprint now * This Entry on Android.mk Doesn't work anymore.. --- init/Android.mk | 4 ---- 1 file changed, 4 deletions(-) diff --git a/init/Android.mk b/init/Android.mk index e52fbef6ba34..4f29b68a929f 100644 --- a/init/Android.mk +++ b/init/Android.mk @@ -114,10 +114,6 @@ LOCAL_SANITIZE := signed-integer-overflow # First stage init is weird: it may start without stdout/stderr, and no /proc. LOCAL_NOSANITIZE := hwaddress -ifneq ($(strip $(TARGET_INIT_VENDOR_LIB)),) -LOCAL_WHOLE_STATIC_LIBRARIES += $(TARGET_INIT_VENDOR_LIB) -endif - include $(BUILD_EXECUTABLE) endif