diff options
Diffstat (limited to 'cmds')
-rw-r--r-- | cmds/app_process/Android.bp | 1 | ||||
-rw-r--r-- | cmds/app_process/app_main.cpp | 10 | ||||
-rw-r--r-- | cmds/bootanimation/BootAnimation.cpp | 15 |
3 files changed, 25 insertions, 1 deletions
diff --git a/cmds/app_process/Android.bp b/cmds/app_process/Android.bp index 0eff83c99282..6f37ef3959fd 100644 --- a/cmds/app_process/Android.bp +++ b/cmds/app_process/Android.bp @@ -33,6 +33,7 @@ cc_binary { shared_libs: [ "libandroid_runtime", + "libbase", "libbinder", "libcutils", "libdl", diff --git a/cmds/app_process/app_main.cpp b/cmds/app_process/app_main.cpp index 12083b6fe20b..002df808501c 100644 --- a/cmds/app_process/app_main.cpp +++ b/cmds/app_process/app_main.cpp @@ -21,8 +21,11 @@ #include <cutils/properties.h> #include <cutils/trace.h> #include <android_runtime/AndroidRuntime.h> +#include <android-base/properties.h> #include <private/android_filesystem_config.h> // for AID_SYSTEM +using android::base::GetProperty; + namespace android { static void app_usage() @@ -172,6 +175,13 @@ static const char ZYGOTE_NICE_NAME[] = "zygote"; int main(int argc, char* const argv[]) { + std::string bootmode = GetProperty("ro.bootmode", ""); + + if ((strncmp(bootmode.c_str(), "ffbm-00", 7) == 0) + || (strncmp(bootmode.c_str(), "ffbm-01", 7) == 0)) { + return 0; + } + if (!LOG_NDEBUG) { String8 argv_String; for (int i = 0; i < argc; ++i) { diff --git a/cmds/bootanimation/BootAnimation.cpp b/cmds/bootanimation/BootAnimation.cpp index 3109c5c1e075..25a8e482fd00 100644 --- a/cmds/bootanimation/BootAnimation.cpp +++ b/cmds/bootanimation/BootAnimation.cpp @@ -180,7 +180,9 @@ static void* decodeImage(const void* encodedData, size_t dataLength, AndroidBitm const size_t size = outInfo->stride * outInfo->height; void* pixels = malloc(size); int result = AImageDecoder_decodeImage(decoder, pixels, outInfo->stride, size); - AImageDecoder_delete(decoder); + // TODO(b/180130969) Fix ~ImageDecoder() so that AImageDecoder_delete stops + // causing a segfault, then add back this call to AImageDecoder_delete(). + //AImageDecoder_delete(decoder); if (result != ANDROID_IMAGE_DECODER_SUCCESS) { free(pixels); @@ -578,6 +580,17 @@ void BootAnimation::findBootAnimationFile() { } } + std::string custAnimProp = !mShuttingDown ? + android::base::GetProperty("persist.sys.customanim.boot", ""): + android::base::GetProperty("persist.sys.customanim.shutdown", ""); + const char *custAnim = custAnimProp.c_str(); + ALOGD("Animation customzation path: %s", custAnim); + if (access(custAnim, R_OK) == 0) { + mZipFileName = custAnim; + ALOGD("%sAnimation customzation path: %s", mShuttingDown ? "Shutdown" : "Boot", mZipFileName.c_str()); + return; + } + const bool playDarkAnim = android::base::GetIntProperty("ro.boot.theme", 0) == 1; static const std::vector<std::string> bootFiles = { APEX_BOOTANIMATION_FILE, playDarkAnim ? PRODUCT_BOOTANIMATION_DARK_FILE : PRODUCT_BOOTANIMATION_FILE, |