diff options
Diffstat (limited to 'cmds')
29 files changed, 348 insertions, 165 deletions
diff --git a/cmds/atrace/TEST_MAPPING b/cmds/atrace/TEST_MAPPING new file mode 100644 index 0000000000..f43db2291e --- /dev/null +++ b/cmds/atrace/TEST_MAPPING @@ -0,0 +1,7 @@ +{ + "presubmit": [ + { + "name": "CtsAtraceHostTestCases" + } + ] +} diff --git a/cmds/atrace/atrace.cpp b/cmds/atrace/atrace.cpp index 443f885f40..587d25f9ed 100644 --- a/cmds/atrace/atrace.cpp +++ b/cmds/atrace/atrace.cpp @@ -99,30 +99,31 @@ struct TracingCategory { /* Tracing categories */ static const TracingCategory k_categories[] = { - { "gfx", "Graphics", ATRACE_TAG_GRAPHICS, { } }, - { "input", "Input", ATRACE_TAG_INPUT, { } }, - { "view", "View System", ATRACE_TAG_VIEW, { } }, - { "webview", "WebView", ATRACE_TAG_WEBVIEW, { } }, - { "wm", "Window Manager", ATRACE_TAG_WINDOW_MANAGER, { } }, - { "am", "Activity Manager", ATRACE_TAG_ACTIVITY_MANAGER, { } }, - { "sm", "Sync Manager", ATRACE_TAG_SYNC_MANAGER, { } }, - { "audio", "Audio", ATRACE_TAG_AUDIO, { } }, - { "video", "Video", ATRACE_TAG_VIDEO, { } }, - { "camera", "Camera", ATRACE_TAG_CAMERA, { } }, - { "hal", "Hardware Modules", ATRACE_TAG_HAL, { } }, - { "res", "Resource Loading", ATRACE_TAG_RESOURCES, { } }, - { "dalvik", "Dalvik VM", ATRACE_TAG_DALVIK, { } }, - { "rs", "RenderScript", ATRACE_TAG_RS, { } }, - { "bionic", "Bionic C Library", ATRACE_TAG_BIONIC, { } }, - { "power", "Power Management", ATRACE_TAG_POWER, { } }, - { "pm", "Package Manager", ATRACE_TAG_PACKAGE_MANAGER, { } }, - { "ss", "System Server", ATRACE_TAG_SYSTEM_SERVER, { } }, - { "database", "Database", ATRACE_TAG_DATABASE, { } }, - { "network", "Network", ATRACE_TAG_NETWORK, { } }, - { "adb", "ADB", ATRACE_TAG_ADB, { } }, - { "vibrator", "Vibrator", ATRACE_TAG_VIBRATOR, { } }, - { "aidl", "AIDL calls", ATRACE_TAG_AIDL, { } }, - { "nnapi", "NNAPI", ATRACE_TAG_NNAPI, { } }, + { "gfx", "Graphics", ATRACE_TAG_GRAPHICS, { } }, + { "input", "Input", ATRACE_TAG_INPUT, { } }, + { "view", "View System", ATRACE_TAG_VIEW, { } }, + { "webview", "WebView", ATRACE_TAG_WEBVIEW, { } }, + { "wm", "Window Manager", ATRACE_TAG_WINDOW_MANAGER, { } }, + { "am", "Activity Manager", ATRACE_TAG_ACTIVITY_MANAGER, { } }, + { "sm", "Sync Manager", ATRACE_TAG_SYNC_MANAGER, { } }, + { "audio", "Audio", ATRACE_TAG_AUDIO, { } }, + { "video", "Video", ATRACE_TAG_VIDEO, { } }, + { "camera", "Camera", ATRACE_TAG_CAMERA, { } }, + { "hal", "Hardware Modules", ATRACE_TAG_HAL, { } }, + { "res", "Resource Loading", ATRACE_TAG_RESOURCES, { } }, + { "dalvik", "Dalvik VM", ATRACE_TAG_DALVIK, { } }, + { "rs", "RenderScript", ATRACE_TAG_RS, { } }, + { "bionic", "Bionic C Library", ATRACE_TAG_BIONIC, { } }, + { "power", "Power Management", ATRACE_TAG_POWER, { } }, + { "pm", "Package Manager", ATRACE_TAG_PACKAGE_MANAGER, { } }, + { "ss", "System Server", ATRACE_TAG_SYSTEM_SERVER, { } }, + { "database", "Database", ATRACE_TAG_DATABASE, { } }, + { "network", "Network", ATRACE_TAG_NETWORK, { } }, + { "adb", "ADB", ATRACE_TAG_ADB, { } }, + { "vibrator", "Vibrator", ATRACE_TAG_VIBRATOR, { } }, + { "aidl", "AIDL calls", ATRACE_TAG_AIDL, { } }, + { "nnapi", "NNAPI", ATRACE_TAG_NNAPI, { } }, + { "rro", "Runtime Resource Overlay", ATRACE_TAG_RRO, { } }, { k_coreServiceCategory, "Core services", 0, { } }, { k_pdxServiceCategory, "PDX services", 0, { } }, { "sched", "CPU Scheduling", 0, { @@ -889,6 +890,7 @@ static void cleanUpUserspaceTracing() setTagsProperty(0); clearAppProperties(); pokeBinderServices(); + pokeHalServices(); if (g_tracePdx) { ServiceUtility::PokeServices(); diff --git a/cmds/atrace/atrace_userdebug.rc b/cmds/atrace/atrace_userdebug.rc index acc62c0fe0..6c86c21387 100644 --- a/cmds/atrace/atrace_userdebug.rc +++ b/cmds/atrace/atrace_userdebug.rc @@ -15,8 +15,8 @@ on post-fs chmod 0666 /sys/kernel/debug/tracing/events/workqueue/enable chmod 0666 /sys/kernel/tracing/events/regulator/enable chmod 0666 /sys/kernel/debug/tracing/events/regulator/enable - chmod 0666 /sys/kernel/tracing/events/pagecache/enable - chmod 0666 /sys/kernel/debug/tracing/events/pagecache/enable + chmod 0666 /sys/kernel/tracing/events/filemap/enable + chmod 0666 /sys/kernel/debug/tracing/events/filemap/enable # irq chmod 0666 /sys/kernel/tracing/events/irq/enable diff --git a/cmds/bugreportz/bugreportz.cpp b/cmds/bugreportz/bugreportz.cpp index 75855cfee1..ded0ed35cb 100644 --- a/cmds/bugreportz/bugreportz.cpp +++ b/cmds/bugreportz/bugreportz.cpp @@ -55,7 +55,7 @@ int bugreportz(int s, bool show_progress) { errno = ETIMEDOUT; } printf("FAIL:Bugreport read terminated abnormally (%s)\n", strerror(errno)); - break; + return EXIT_FAILURE; } // Writes line by line. @@ -71,8 +71,5 @@ int bugreportz(int s, bool show_progress) { // Process final line, in case it didn't finish with newline write_line(line, show_progress); - if (close(s) == -1) { - fprintf(stderr, "WARNING: error closing socket: %s\n", strerror(errno)); - } return EXIT_SUCCESS; } diff --git a/cmds/bugreportz/bugreportz.h b/cmds/bugreportz/bugreportz.h index 304e4b3dc3..7af289b2be 100644 --- a/cmds/bugreportz/bugreportz.h +++ b/cmds/bugreportz/bugreportz.h @@ -16,6 +16,7 @@ #define BUGREPORTZ_H // Calls dumpstate using the given socket and output its result to stdout. +// Ownership of the socket is not transferred. int bugreportz(int s, bool show_progress); #endif // BUGREPORTZ_H diff --git a/cmds/bugreportz/main.cpp b/cmds/bugreportz/main.cpp index 945eae50af..40346bee1f 100644 --- a/cmds/bugreportz/main.cpp +++ b/cmds/bugreportz/main.cpp @@ -82,7 +82,7 @@ int main(int argc, char* argv[]) { if (s == -1) { printf("FAIL:Failed to connect to dumpstatez service: %s\n", strerror(errno)); - return EXIT_SUCCESS; + return EXIT_FAILURE; } // Set a timeout so that if nothing is read in 10 minutes, we'll stop @@ -92,8 +92,16 @@ int main(int argc, char* argv[]) { tv.tv_sec = 10 * 60; tv.tv_usec = 0; if (setsockopt(s, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv)) == -1) { - fprintf(stderr, "WARNING: Cannot set socket timeout: %s\n", strerror(errno)); + fprintf(stderr, + "WARNING: Cannot set socket timeout, bugreportz might hang indefinitely: %s\n", + strerror(errno)); } - bugreportz(s, show_progress); + int ret = bugreportz(s, show_progress); + + if (close(s) == -1) { + fprintf(stderr, "WARNING: error closing socket: %s\n", strerror(errno)); + ret = EXIT_FAILURE; + } + return ret; } diff --git a/cmds/dumpstate/dumpstate.cpp b/cmds/dumpstate/dumpstate.cpp index 6e99f1d7eb..320ebf8b37 100644 --- a/cmds/dumpstate/dumpstate.cpp +++ b/cmds/dumpstate/dumpstate.cpp @@ -19,6 +19,7 @@ #include <dirent.h> #include <errno.h> #include <fcntl.h> +#include <inttypes.h> #include <libgen.h> #include <limits.h> #include <stdbool.h> @@ -50,9 +51,11 @@ #include <android-base/stringprintf.h> #include <android-base/strings.h> #include <android-base/unique_fd.h> +#include <android/content/pm/IPackageManagerNative.h> #include <android/hardware/dumpstate/1.0/IDumpstateDevice.h> #include <android/hidl/manager/1.0/IServiceManager.h> #include <android/os/IIncidentCompanion.h> +#include <binder/IServiceManager.h> #include <cutils/native_handle.h> #include <cutils/properties.h> #include <debuggerd/client.h> @@ -203,6 +206,30 @@ static bool IsFileEmpty(const std::string& file_path) { return file.tellg() <= 0; } +int64_t GetModuleMetadataVersion() { + auto binder = defaultServiceManager()->getService(android::String16("package_native")); + if (binder == nullptr) { + MYLOGE("Failed to retrieve package_native service"); + return 0L; + } + auto package_service = android::interface_cast<content::pm::IPackageManagerNative>(binder); + std::string package_name; + auto status = package_service->getModuleMetadataPackageName(&package_name); + if (!status.isOk()) { + MYLOGE("Failed to retrieve module metadata package name: %s", status.toString8().c_str()); + return 0L; + } + MYLOGD("Module metadata package name: %s", package_name.c_str()); + int64_t version_code; + status = package_service->getVersionCodeForPackage(android::String16(package_name.c_str()), + &version_code); + if (!status.isOk()) { + MYLOGE("Failed to retrieve module metadata version: %s", status.toString8().c_str()); + return 0L; + } + return version_code; +} + } // namespace } // namespace os } // namespace android @@ -638,6 +665,10 @@ void Dumpstate::PrintHeader() const { printf("Bootloader: %s\n", bootloader.c_str()); printf("Radio: %s\n", radio.c_str()); printf("Network: %s\n", network.c_str()); + int64_t module_metadata_version = android::os::GetModuleMetadataVersion(); + if (module_metadata_version != 0) { + printf("Module Metadata version: %" PRId64 "\n", module_metadata_version); + } printf("Kernel: "); DumpFileToFd(STDOUT_FILENO, "", "/proc/version"); @@ -1386,6 +1417,12 @@ static Dumpstate::RunStatus dumpstate() { printf("========================================================\n"); printf("== dumpstate: done (id %d)\n", ds.id_); printf("========================================================\n"); + + printf("========================================================\n"); + printf("== Obtaining statsd metadata\n"); + printf("========================================================\n"); + // This differs from the usual dumpsys stats, which is the stats report data. + RunDumpsys("STATSDSTATS", {"stats", "--metadata"}); return Dumpstate::RunStatus::OK; } @@ -2634,8 +2671,8 @@ void Dumpstate::CheckUserConsent(int32_t calling_uid, const android::String16& c if (ics != nullptr) { MYLOGD("Checking user consent via incidentcompanion service\n"); android::interface_cast<android::os::IIncidentCompanion>(ics)->authorizeReport( - calling_uid, calling_package, 0x1 /* FLAG_CONFIRMATION_DIALOG */, - consent_callback_.get()); + calling_uid, calling_package, String16(), String16(), + 0x1 /* FLAG_CONFIRMATION_DIALOG */, consent_callback_.get()); } else { MYLOGD("Unable to check user consent; incidentcompanion service unavailable\n"); } diff --git a/cmds/dumpsys/dumpsys.cpp b/cmds/dumpsys/dumpsys.cpp index 8fbea8a163..4811927106 100644 --- a/cmds/dumpsys/dumpsys.cpp +++ b/cmds/dumpsys/dumpsys.cpp @@ -65,7 +65,7 @@ static void usage() { " -l: only list services, do not dump them\n" " -t TIMEOUT_SEC: TIMEOUT to use in seconds instead of default 10 seconds\n" " -T TIMEOUT_MS: TIMEOUT to use in milliseconds instead of default 10 seconds\n" - " --proto: filter services that support dumping data in proto format. Dumps" + " --proto: filter services that support dumping data in proto format. Dumps\n" " will be in proto format.\n" " --priority LEVEL: filter services based on specified priority\n" " LEVEL must be one of CRITICAL | HIGH | NORMAL\n" diff --git a/cmds/dumpsys/tests/dumpsys_test.cpp b/cmds/dumpsys/tests/dumpsys_test.cpp index 8f60881bfe..3ada15398c 100644 --- a/cmds/dumpsys/tests/dumpsys_test.cpp +++ b/cmds/dumpsys/tests/dumpsys_test.cpp @@ -371,8 +371,8 @@ TEST_F(DumpsysTest, PassAllFlagsToNormalServices) { IServiceManager::DUMP_FLAG_PRIORITY_NORMAL); ExpectCheckService("Locksmith"); ExpectCheckService("Valet"); - ExpectDumpWithArgs("Locksmith", {"-a", "--dump-priority", "NORMAL"}, "dump1"); - ExpectDumpWithArgs("Valet", {"-a", "--dump-priority", "NORMAL"}, "dump2"); + ExpectDumpWithArgs("Locksmith", {"--dump-priority", "NORMAL", "-a"}, "dump1"); + ExpectDumpWithArgs("Valet", {"--dump-priority", "NORMAL", "-a"}, "dump2"); CallMain({"--priority", "NORMAL"}); diff --git a/cmds/flatland/GLHelper.cpp b/cmds/flatland/GLHelper.cpp index 62d2fa1548..d398559ee8 100644 --- a/cmds/flatland/GLHelper.cpp +++ b/cmds/flatland/GLHelper.cpp @@ -222,9 +222,9 @@ bool GLHelper::createNamedSurfaceTexture(GLuint name, uint32_t w, uint32_t h, } bool GLHelper::computeWindowScale(uint32_t w, uint32_t h, float* scale) { - sp<IBinder> dpy = mSurfaceComposerClient->getBuiltInDisplay(0); + const sp<IBinder> dpy = mSurfaceComposerClient->getInternalDisplayToken(); if (dpy == nullptr) { - fprintf(stderr, "SurfaceComposer::getBuiltInDisplay failed.\n"); + fprintf(stderr, "SurfaceComposer::getInternalDisplayToken failed.\n"); return false; } diff --git a/cmds/installd/Android.bp b/cmds/installd/Android.bp index 8b860bcdba..654213f5e0 100644 --- a/cmds/installd/Android.bp +++ b/cmds/installd/Android.bp @@ -18,6 +18,7 @@ cc_defaults { "dexopt.cpp", "globals.cpp", "utils.cpp", + "utils_default.cpp", "view_compiler.cpp", ":installd_aidl", ], @@ -127,6 +128,10 @@ cc_binary { ], }, }, + + // Needs to be wherever installd is as it's execed by + // installd. + required: [ "migrate_legacy_obb_data.sh" ], } // OTA chroot tool @@ -210,6 +215,7 @@ cc_binary { "otapreopt.cpp", "otapreopt_utils.cpp", "utils.cpp", + "utils_default.cpp", "view_compiler.cpp", ], @@ -253,3 +259,9 @@ sh_binary { "otapreopt_slot", ], } + +// Script to migrate legacy obb data. +sh_binary { + name: "migrate_legacy_obb_data.sh", + src: "migrate_legacy_obb_data.sh" +} diff --git a/cmds/installd/InstalldNativeService.cpp b/cmds/installd/InstalldNativeService.cpp index ae4ea785bc..caac2e89a7 100644 --- a/cmds/installd/InstalldNativeService.cpp +++ b/cmds/installd/InstalldNativeService.cpp @@ -102,15 +102,6 @@ static constexpr int kVerityPageSize = 4096; static constexpr size_t kSha256Size = 32; static constexpr const char* kPropApkVerityMode = "ro.apk_verity.mode"; -// NOTE: keep in sync with Installer -static constexpr int FLAG_CLEAR_CACHE_ONLY = 1 << 8; -static constexpr int FLAG_CLEAR_CODE_CACHE_ONLY = 1 << 9; -static constexpr int FLAG_USE_QUOTA = 1 << 12; -static constexpr int FLAG_FREE_CACHE_V2 = 1 << 13; -static constexpr int FLAG_FREE_CACHE_V2_DEFY_QUOTA = 1 << 14; -static constexpr int FLAG_FREE_CACHE_NOOP = 1 << 15; -static constexpr int FLAG_FORCE = 1 << 16; - namespace { constexpr const char* kDump = "android.permission.DUMP"; @@ -597,6 +588,41 @@ binder::Status InstalldNativeService::clearAppData(const std::unique_ptr<std::st } } } + if (flags & FLAG_STORAGE_EXTERNAL) { + std::lock_guard<std::recursive_mutex> lock(mMountsLock); + for (const auto& n : mStorageMounts) { + auto extPath = n.second; + if (n.first.compare(0, 14, "/mnt/media_rw/") != 0) { + extPath += StringPrintf("/%d", userId); + } else if (userId != 0) { + // TODO: support devices mounted under secondary users + continue; + } + if (flags & FLAG_CLEAR_CACHE_ONLY) { + // Clear only cached data from shared storage + auto path = StringPrintf("%s/Android/data/%s/cache", extPath.c_str(), pkgname); + if (delete_dir_contents(path, true) != 0) { + res = error("Failed to delete contents of " + path); + } + } else if (flags & FLAG_CLEAR_CODE_CACHE_ONLY) { + // No code cache on shared storage + } else { + // Clear everything on shared storage + auto path = StringPrintf("%s/Android/data/%s", extPath.c_str(), pkgname); + if (delete_dir_contents(path, true) != 0) { + res = error("Failed to delete contents of " + path); + } + path = StringPrintf("%s/Android/media/%s", extPath.c_str(), pkgname); + if (delete_dir_contents(path, true) != 0) { + res = error("Failed to delete contents of " + path); + } + path = StringPrintf("%s/Android/obb/%s", extPath.c_str(), pkgname); + if (delete_dir_contents(path, true) != 0) { + res = error("Failed to delete contents of " + path); + } + } + } + } return res; } @@ -658,6 +684,30 @@ binder::Status InstalldNativeService::destroyAppData(const std::unique_ptr<std:: // Verify if it's ok to do that. destroy_app_reference_profile(packageName); } + if (flags & FLAG_STORAGE_EXTERNAL) { + std::lock_guard<std::recursive_mutex> lock(mMountsLock); + for (const auto& n : mStorageMounts) { + auto extPath = n.second; + if (n.first.compare(0, 14, "/mnt/media_rw/") != 0) { + extPath += StringPrintf("/%d", userId); + } else if (userId != 0) { + // TODO: support devices mounted under secondary users + continue; + } + auto path = StringPrintf("%s/Android/data/%s", extPath.c_str(), pkgname); + if (delete_dir_contents_and_dir(path, true) != 0) { + res = error("Failed to delete contents of " + path); + } + path = StringPrintf("%s/Android/media/%s", extPath.c_str(), pkgname); + if (delete_dir_contents_and_dir(path, true) != 0) { + res = error("Failed to delete contents of " + path); + } + path = StringPrintf("%s/Android/obb/%s", extPath.c_str(), pkgname); + if (delete_dir_contents_and_dir(path, true) != 0) { + res = error("Failed to delete contents of " + path); + } + } + } return res; } @@ -1610,7 +1660,8 @@ binder::Status InstalldNativeService::getAppSize(const std::unique_ptr<std::stri ATRACE_BEGIN("obb"); for (const auto& packageName : packageNames) { - auto obbCodePath = create_data_media_obb_path(uuid_, packageName.c_str()); + auto obbCodePath = create_data_media_package_path(uuid_, userId, + "obb", packageName.c_str()); calculate_tree_size(obbCodePath, &extStats.codeSize); } ATRACE_END(); @@ -1942,7 +1993,8 @@ binder::Status InstalldNativeService::getExternalSize(const std::unique_ptr<std: ATRACE_END(); ATRACE_BEGIN("obb"); - auto obbPath = create_data_media_obb_path(uuid_, ""); + auto obbPath = StringPrintf("%s/Android/obb", + create_data_media_path(uuid_, userId).c_str()); calculate_tree_size(obbPath, &obbSize); ATRACE_END(); } @@ -2462,7 +2514,7 @@ binder::Status InstalldNativeService::rmPackageDir(const std::string& packageDir if (validate_apk_path(packageDir.c_str())) { return error("Invalid path " + packageDir); } - if (delete_dir_contents_and_dir(packageDir) != 0) { + if (rm_package_dir(packageDir) != 0) { return error("Failed to delete " + packageDir); } return ok(); @@ -2764,5 +2816,16 @@ binder::Status InstalldNativeService::prepareAppProfile(const std::string& packa return ok(); } +binder::Status InstalldNativeService::migrateLegacyObbData() { + ENFORCE_UID(AID_SYSTEM); + // NOTE: The lint warning doesn't apply to the use of system(3) with + // absolute parse and no command line arguments. + if (system("/system/bin/migrate_legacy_obb_data.sh") != 0) { // NOLINT(cert-env33-c) + LOG(ERROR) << "Unable to migrate legacy obb data"; + } + + return ok(); +} + } // namespace installd } // namespace android diff --git a/cmds/installd/InstalldNativeService.h b/cmds/installd/InstalldNativeService.h index 0e91cb27ba..2b7bf33cbc 100644 --- a/cmds/installd/InstalldNativeService.h +++ b/cmds/installd/InstalldNativeService.h @@ -155,6 +155,8 @@ public: const std::string& codePath, const std::unique_ptr<std::string>& dexMetadata, bool* _aidl_return); + binder::Status migrateLegacyObbData(); + private: std::recursive_mutex mLock; diff --git a/cmds/installd/binder/android/os/IInstalld.aidl b/cmds/installd/binder/android/os/IInstalld.aidl index 51fe66bd9a..26e9984f11 100644 --- a/cmds/installd/binder/android/os/IInstalld.aidl +++ b/cmds/installd/binder/android/os/IInstalld.aidl @@ -112,6 +112,19 @@ interface IInstalld { void destroyAppDataSnapshot(@nullable @utf8InCpp String uuid, @utf8InCpp String packageName, int userId, long ceSnapshotInode, int snapshotId, int storageFlags); + void migrateLegacyObbData(); + const int FLAG_STORAGE_DE = 0x1; const int FLAG_STORAGE_CE = 0x2; + const int FLAG_STORAGE_EXTERNAL = 0x4; + + const int FLAG_CLEAR_CACHE_ONLY = 0x10; + const int FLAG_CLEAR_CODE_CACHE_ONLY = 0x20; + + const int FLAG_FREE_CACHE_V2 = 0x100; + const int FLAG_FREE_CACHE_V2_DEFY_QUOTA = 0x200; + const int FLAG_FREE_CACHE_NOOP = 0x400; + + const int FLAG_USE_QUOTA = 0x1000; + const int FLAG_FORCE = 0x2000; } diff --git a/cmds/installd/migrate_legacy_obb_data.sh b/cmds/installd/migrate_legacy_obb_data.sh new file mode 100644 index 0000000000..4f8a1ecb56 --- /dev/null +++ b/cmds/installd/migrate_legacy_obb_data.sh @@ -0,0 +1,27 @@ +#!/system/bin/sh + +# +# Copyright (C) 2019 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +if ! test -d /data/media/obb ; then + log -p i -t migrate_legacy_obb_data "No legacy obb data to migrate." + exit 0 +fi + +log -p i -t migrate_legacy_obb_data "Migrating legacy obb data." +rm -rf /data/media/0/Android/obb +cp -F -p -R -P -d /data/media/obb /data/media/0/Android +rm -rf /data/media/obb +log -p i -t migrate_legacy_obb_data "Done." diff --git a/cmds/installd/tests/installd_cache_test.cpp b/cmds/installd/tests/installd_cache_test.cpp index 2d58515b11..db0907017c 100644 --- a/cmds/installd/tests/installd_cache_test.cpp +++ b/cmds/installd/tests/installd_cache_test.cpp @@ -40,8 +40,8 @@ constexpr int64_t kMbInBytes = 1024 * kKbInBytes; constexpr int64_t kGbInBytes = 1024 * kMbInBytes; constexpr int64_t kTbInBytes = 1024 * kGbInBytes; -static constexpr int FLAG_FREE_CACHE_V2 = 1 << 13; -static constexpr int FLAG_FREE_CACHE_V2_DEFY_QUOTA = 1 << 14; +#define FLAG_FREE_CACHE_V2 InstalldNativeService::FLAG_FREE_CACHE_V2 +#define FLAG_FREE_CACHE_V2_DEFY_QUOTA InstalldNativeService::FLAG_FREE_CACHE_V2_DEFY_QUOTA int get_property(const char *key, char *value, const char *default_value) { return property_get(key, value, default_value); diff --git a/cmds/installd/tests/installd_service_test.cpp b/cmds/installd/tests/installd_service_test.cpp index cd63931e2a..a31d510565 100644 --- a/cmds/installd/tests/installd_service_test.cpp +++ b/cmds/installd/tests/installd_service_test.cpp @@ -45,7 +45,7 @@ namespace installd { constexpr const char* kTestUuid = "TEST"; -static constexpr int FLAG_FORCE = 1 << 16; +#define FLAG_FORCE InstalldNativeService::FLAG_FORCE int get_property(const char *key, char *value, const char *default_value) { return property_get(key, value, default_value); diff --git a/cmds/installd/utils.cpp b/cmds/installd/utils.cpp index da097db06b..4eb1df0b2e 100644 --- a/cmds/installd/utils.cpp +++ b/cmds/installd/utils.cpp @@ -244,10 +244,6 @@ std::string create_data_media_path(const char* volume_uuid, userid_t userid) { return StringPrintf("%s/media/%u", create_data_path(volume_uuid).c_str(), userid); } -std::string create_data_media_obb_path(const char* volume_uuid, const char* package_name) { - return StringPrintf("%s/media/obb/%s", create_data_path(volume_uuid).c_str(), package_name); -} - std::string create_data_media_package_path(const char* volume_uuid, userid_t userid, const char* data_type, const char* package_name) { return StringPrintf("%s/Android/%s/%s", create_data_media_path(volume_uuid, userid).c_str(), diff --git a/cmds/installd/utils.h b/cmds/installd/utils.h index 91d9e1343a..6a420261a1 100644 --- a/cmds/installd/utils.h +++ b/cmds/installd/utils.h @@ -75,7 +75,6 @@ std::string create_data_misc_de_rollback_package_path(const char* volume_uuid, userid_t user, int32_t snapshot_id, const char* package_name); std::string create_data_media_path(const char* volume_uuid, userid_t userid); -std::string create_data_media_obb_path(const char* volume_uuid, const char* package_name); std::string create_data_media_package_path(const char* volume_uuid, userid_t userid, const char* data_type, const char* package_name); @@ -125,6 +124,8 @@ int delete_dir_contents(const char *pathname, int delete_dir_contents_fd(int dfd, const char *name); +int rm_package_dir(const std::string& package_dir); + int copy_dir_files(const char *srcname, const char *dstname, uid_t owner, gid_t group); int64_t data_disk_free(const std::string& data_path); diff --git a/cmds/installd/utils_default.cpp b/cmds/installd/utils_default.cpp new file mode 100644 index 0000000000..a6025e67c8 --- /dev/null +++ b/cmds/installd/utils_default.cpp @@ -0,0 +1,30 @@ +/* +** Copyright 2019, The Android Open Source Project +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +#include "utils.h" + +namespace android { +namespace installd { + +// In this file are default definitions of the functions that may contain +// platform dependent logic. + +int rm_package_dir(const std::string& package_dir) { + return delete_dir_contents_and_dir(package_dir); +} + +} // namespace installd +} // namespace android diff --git a/cmds/service/service.cpp b/cmds/service/service.cpp index 34a3fdc420..d5dc6b741d 100644 --- a/cmds/service/service.cpp +++ b/cmds/service/service.cpp @@ -232,7 +232,6 @@ int main(int argc, char* const argv[]) else if (strcmp(key, "categories") == 0) { char* context2 = nullptr; - int categoryCount = 0; categories[categoryCount] = strtok_r(value, ",", &context2); while (categories[categoryCount] != nullptr) diff --git a/cmds/servicemanager/binder.c b/cmds/servicemanager/binder.c index fade8cfb72..cf3b1728b6 100644 --- a/cmds/servicemanager/binder.c +++ b/cmds/servicemanager/binder.c @@ -146,7 +146,19 @@ void binder_close(struct binder_state *bs) int binder_become_context_manager(struct binder_state *bs) { - return ioctl(bs->fd, BINDER_SET_CONTEXT_MGR, 0); + struct flat_binder_object obj; + memset(&obj, 0, sizeof(obj)); + obj.flags = FLAT_BINDER_FLAG_TXN_SECURITY_CTX; + + int result = ioctl(bs->fd, BINDER_SET_CONTEXT_MGR_EXT, &obj); + + // fallback to original method + if (result != 0) { + android_errorWriteLog(0x534e4554, "121035042"); + + result = ioctl(bs->fd, BINDER_SET_CONTEXT_MGR, 0); + } + return result; } int binder_write(struct binder_state *bs, void *data, size_t len) @@ -240,13 +252,28 @@ int binder_parse(struct binder_state *bs, struct binder_io *bio, #endif ptr += sizeof(struct binder_ptr_cookie); break; + case BR_TRANSACTION_SEC_CTX: case BR_TRANSACTION: { - struct binder_transaction_data *txn = (struct binder_transaction_data *) ptr; - if ((end - ptr) < sizeof(*txn)) { - ALOGE("parse: txn too small!\n"); - return -1; + struct binder_transaction_data_secctx txn; + if (cmd == BR_TRANSACTION_SEC_CTX) { + if ((end - ptr) < sizeof(struct binder_transaction_data_secctx)) { + ALOGE("parse: txn too small (binder_transaction_data_secctx)!\n"); + return -1; + } + memcpy(&txn, (void*) ptr, sizeof(struct binder_transaction_data_secctx)); + ptr += sizeof(struct binder_transaction_data_secctx); + } else /* BR_TRANSACTION */ { + if ((end - ptr) < sizeof(struct binder_transaction_data)) { + ALOGE("parse: txn too small (binder_transaction_data)!\n"); + return -1; + } + memcpy(&txn.transaction_data, (void*) ptr, sizeof(struct binder_transaction_data)); + ptr += sizeof(struct binder_transaction_data); + + txn.secctx = 0; } - binder_dump_txn(txn); + + binder_dump_txn(&txn.transaction_data); if (func) { unsigned rdata[256/4]; struct binder_io msg; @@ -254,15 +281,14 @@ int binder_parse(struct binder_state *bs, struct binder_io *bio, int res; bio_init(&reply, rdata, sizeof(rdata), 4); - bio_init_from_txn(&msg, txn); - res = func(bs, txn, &msg, &reply); - if (txn->flags & TF_ONE_WAY) { - binder_free_buffer(bs, txn->data.ptr.buffer); + bio_init_from_txn(&msg, &txn.transaction_data); + res = func(bs, &txn, &msg, &reply); + if (txn.transaction_data.flags & TF_ONE_WAY) { + binder_free_buffer(bs, txn.transaction_data.data.ptr.buffer); } else { - binder_send_reply(bs, &reply, txn->data.ptr.buffer, res); + binder_send_reply(bs, &reply, txn.transaction_data.data.ptr.buffer, res); } } - ptr += sizeof(*txn); break; } case BR_REPLY: { diff --git a/cmds/servicemanager/binder.h b/cmds/servicemanager/binder.h index c95b33f1b8..a9ccc74130 100644 --- a/cmds/servicemanager/binder.h +++ b/cmds/servicemanager/binder.h @@ -4,8 +4,8 @@ #ifndef _BINDER_H_ #define _BINDER_H_ -#include <sys/ioctl.h> #include <linux/android/binder.h> +#include <sys/ioctl.h> struct binder_state; @@ -42,7 +42,7 @@ enum { }; typedef int (*binder_handler)(struct binder_state *bs, - struct binder_transaction_data *txn, + struct binder_transaction_data_secctx *txn, struct binder_io *msg, struct binder_io *reply); diff --git a/cmds/servicemanager/service_manager.c b/cmds/servicemanager/service_manager.c index d776682d74..ec3fac538d 100644 --- a/cmds/servicemanager/service_manager.c +++ b/cmds/servicemanager/service_manager.c @@ -61,14 +61,14 @@ int str16eq(const uint16_t *a, const char *b) static char *service_manager_context; static struct selabel_handle* sehandle; -static bool check_mac_perms(pid_t spid, uid_t uid, const char *tctx, const char *perm, const char *name) +static bool check_mac_perms(pid_t spid, const char* sid, uid_t uid, const char *tctx, const char *perm, const char *name) { - char *sctx = NULL; + char *lookup_sid = NULL; const char *class = "service_manager"; bool allowed; struct audit_data ad; - if (getpidcon(spid, &sctx) < 0) { + if (sid == NULL && getpidcon(spid, &lookup_sid) < 0) { ALOGE("SELinux: getpidcon(pid=%d) failed to retrieve pid context.\n", spid); return false; } @@ -77,19 +77,23 @@ static bool check_mac_perms(pid_t spid, uid_t uid, const char *tctx, const char ad.uid = uid; ad.name = name; - int result = selinux_check_access(sctx, tctx, class, perm, (void *) &ad); + if (sid == NULL) { + android_errorWriteLog(0x534e4554, "121035042"); + } + + int result = selinux_check_access(sid ? sid : lookup_sid, tctx, class, perm, (void *) &ad); allowed = (result == 0); - freecon(sctx); + freecon(lookup_sid); return allowed; } -static bool check_mac_perms_from_getcon(pid_t spid, uid_t uid, const char *perm) +static bool check_mac_perms_from_getcon(pid_t spid, const char* sid, uid_t uid, const char *perm) { - return check_mac_perms(spid, uid, service_manager_context, perm, NULL); + return check_mac_perms(spid, sid, uid, service_manager_context, perm, NULL); } -static bool check_mac_perms_from_lookup(pid_t spid, uid_t uid, const char *perm, const char *name) +static bool check_mac_perms_from_lookup(pid_t spid, const char* sid, uid_t uid, const char *perm, const char *name) { bool allowed; char *tctx = NULL; @@ -104,12 +108,12 @@ static bool check_mac_perms_from_lookup(pid_t spid, uid_t uid, const char *perm, return false; } - allowed = check_mac_perms(spid, uid, tctx, perm, name); + allowed = check_mac_perms(spid, sid, uid, tctx, perm, name); freecon(tctx); return allowed; } -static int svc_can_register(const uint16_t *name, size_t name_len, pid_t spid, uid_t uid) +static int svc_can_register(const uint16_t *name, size_t name_len, pid_t spid, const char* sid, uid_t uid) { const char *perm = "add"; @@ -117,19 +121,19 @@ static int svc_can_register(const uint16_t *name, size_t name_len, pid_t spid, u return 0; /* Don't allow apps to register services */ } - return check_mac_perms_from_lookup(spid, uid, perm, str8(name, name_len)) ? 1 : 0; + return check_mac_perms_from_lookup(spid, sid, uid, perm, str8(name, name_len)) ? 1 : 0; } -static int svc_can_list(pid_t spid, uid_t uid) +static int svc_can_list(pid_t spid, const char* sid, uid_t uid) { const char *perm = "list"; - return check_mac_perms_from_getcon(spid, uid, perm) ? 1 : 0; + return check_mac_perms_from_getcon(spid, sid, uid, perm) ? 1 : 0; } -static int svc_can_find(const uint16_t *name, size_t name_len, pid_t spid, uid_t uid) +static int svc_can_find(const uint16_t *name, size_t name_len, pid_t spid, const char* sid, uid_t uid) { const char *perm = "find"; - return check_mac_perms_from_lookup(spid, uid, perm, str8(name, name_len)) ? 1 : 0; + return check_mac_perms_from_lookup(spid, sid, uid, perm, str8(name, name_len)) ? 1 : 0; } struct svcinfo @@ -175,7 +179,7 @@ uint16_t svcmgr_id[] = { }; -uint32_t do_find_service(const uint16_t *s, size_t len, uid_t uid, pid_t spid) +uint32_t do_find_service(const uint16_t *s, size_t len, uid_t uid, pid_t spid, const char* sid) { struct svcinfo *si = find_svc(s, len); @@ -192,7 +196,7 @@ uint32_t do_find_service(const uint16_t *s, size_t len, uid_t uid, pid_t spid) } } - if (!svc_can_find(s, len, spid, uid)) { + if (!svc_can_find(s, len, spid, sid, uid)) { return 0; } @@ -200,7 +204,7 @@ uint32_t do_find_service(const uint16_t *s, size_t len, uid_t uid, pid_t spid) } int do_add_service(struct binder_state *bs, const uint16_t *s, size_t len, uint32_t handle, - uid_t uid, int allow_isolated, uint32_t dumpsys_priority, pid_t spid) { + uid_t uid, int allow_isolated, uint32_t dumpsys_priority, pid_t spid, const char* sid) { struct svcinfo *si; //ALOGI("add_service('%s',%x,%s) uid=%d\n", str8(s, len), handle, @@ -209,7 +213,7 @@ int do_add_service(struct binder_state *bs, const uint16_t *s, size_t len, uint3 if (!handle || (len == 0) || (len > 127)) return -1; - if (!svc_can_register(s, len, spid, uid)) { + if (!svc_can_register(s, len, spid, sid, uid)) { ALOGE("add_service('%s',%x) uid=%d - PERMISSION DENIED\n", str8(s, len), handle, uid); return -1; @@ -248,7 +252,7 @@ int do_add_service(struct binder_state *bs, const uint16_t *s, size_t len, uint3 } int svcmgr_handler(struct binder_state *bs, - struct binder_transaction_data *txn, + struct binder_transaction_data_secctx *txn_secctx, struct binder_io *msg, struct binder_io *reply) { @@ -260,6 +264,8 @@ int svcmgr_handler(struct binder_state *bs, int allow_isolated; uint32_t dumpsys_priority; + struct binder_transaction_data *txn = &txn_secctx->transaction_data; + //ALOGI("target=%p code=%d pid=%d uid=%d\n", // (void*) txn->target.ptr, txn->code, txn->sender_pid, txn->sender_euid); @@ -274,6 +280,7 @@ int svcmgr_handler(struct binder_state *bs, // Note that we ignore the strict_policy and don't propagate it // further (since we do no outbound RPCs anyway). strict_policy = bio_get_uint32(msg); + bio_get_uint32(msg); // Ignore worksource header. s = bio_get_string16(msg, &len); if (s == NULL) { return -1; @@ -304,7 +311,8 @@ int svcmgr_handler(struct binder_state *bs, if (s == NULL) { return -1; } - handle = do_find_service(s, len, txn->sender_euid, txn->sender_pid); + handle = do_find_service(s, len, txn->sender_euid, txn->sender_pid, + (const char*) txn_secctx->secctx); if (!handle) break; bio_put_ref(reply, handle); @@ -319,7 +327,7 @@ int svcmgr_handler(struct binder_state *bs, allow_isolated = bio_get_uint32(msg) ? 1 : 0; dumpsys_priority = bio_get_uint32(msg); if (do_add_service(bs, s, len, handle, txn->sender_euid, allow_isolated, dumpsys_priority, - txn->sender_pid)) + txn->sender_pid, (const char*) txn_secctx->secctx)) return -1; break; @@ -327,7 +335,7 @@ int svcmgr_handler(struct binder_state *bs, uint32_t n = bio_get_uint32(msg); uint32_t req_dumpsys_priority = bio_get_uint32(msg); - if (!svc_can_list(txn->sender_pid, txn->sender_euid)) { + if (!svc_can_list(txn->sender_pid, (const char*) txn_secctx->secctx, txn->sender_euid)) { ALOGE("list_service() uid=%d - PERMISSION DENIED\n", txn->sender_euid); return -1; diff --git a/cmds/servicemanager/servicemanager.rc b/cmds/servicemanager/servicemanager.rc index 4d93cb4c73..152ac28ba4 100644 --- a/cmds/servicemanager/servicemanager.rc +++ b/cmds/servicemanager/servicemanager.rc @@ -13,5 +13,6 @@ service servicemanager /system/bin/servicemanager onrestart restart cameraserver onrestart restart keystore onrestart restart gatekeeperd + onrestart restart thermalservice writepid /dev/cpuset/system-background/tasks shutdown critical diff --git a/cmds/surfacereplayer/proto/src/trace.proto b/cmds/surfacereplayer/proto/src/trace.proto index 0bc08a91ab..c70bc3e5c1 100644 --- a/cmds/surfacereplayer/proto/src/trace.proto +++ b/cmds/surfacereplayer/proto/src/trace.proto @@ -30,14 +30,13 @@ message Transaction { message SurfaceChange { required int32 id = 1; - + reserved 7; oneof SurfaceChange { PositionChange position = 2; SizeChange size = 3; AlphaChange alpha = 4; LayerChange layer = 5; CropChange crop = 6; - FinalCropChange final_crop = 7; MatrixChange matrix = 8; OverrideScalingModeChange override_scaling_mode = 9; TransparentRegionHintChange transparent_region_hint = 10; @@ -46,6 +45,7 @@ message SurfaceChange { OpaqueFlagChange opaque_flag = 13; SecureFlagChange secure_flag = 14; DeferredTransactionChange deferred_transaction = 15; + CornerRadiusChange corner_radius = 16; } } @@ -63,6 +63,10 @@ message AlphaChange { required float alpha = 1; } +message CornerRadiusChange { + required float corner_radius = 1; +} + message LayerChange { required uint32 layer = 1; } @@ -71,10 +75,6 @@ message CropChange { required Rectangle rectangle = 1; } -message FinalCropChange { - required Rectangle rectangle = 1; -} - message MatrixChange { required float dsdx = 1; required float dtdx = 2; @@ -165,7 +165,7 @@ message VSyncEvent { message DisplayCreation { required int32 id = 1; required string name = 2; - required int32 type = 3; + optional uint64 display_id = 3; required bool is_secure = 4; } diff --git a/cmds/surfacereplayer/replayer/Replayer.cpp b/cmds/surfacereplayer/replayer/Replayer.cpp index 4140f40888..34886a99e9 100644 --- a/cmds/surfacereplayer/replayer/Replayer.cpp +++ b/cmds/surfacereplayer/replayer/Replayer.cpp @@ -286,10 +286,6 @@ status_t Replayer::dispatchEvent(int index) { std::thread(&Replayer::createSurfaceControl, this, increment.surface_creation(), event) .detach(); } break; - case increment.kSurfaceDeletion: { - std::thread(&Replayer::deleteSurfaceControl, this, increment.surface_deletion(), event) - .detach(); - } break; case increment.kBufferUpdate: { std::lock_guard<std::mutex> lock1(mLayerLock); std::lock_guard<std::mutex> lock2(mBufferQueueSchedulerLock); @@ -385,12 +381,12 @@ status_t Replayer::doSurfaceTransaction( case SurfaceChange::SurfaceChangeCase::kCrop: setCrop(transaction, change.id(), change.crop()); break; + case SurfaceChange::SurfaceChangeCase::kCornerRadius: + setCornerRadius(transaction, change.id(), change.corner_radius()); + break; case SurfaceChange::SurfaceChangeCase::kMatrix: setMatrix(transaction, change.id(), change.matrix()); break; - case SurfaceChange::SurfaceChangeCase::kFinalCrop: - setFinalCrop(transaction, change.id(), change.final_crop()); - break; case SurfaceChange::SurfaceChangeCase::kOverrideScalingMode: setOverrideScalingMode(transaction, change.id(), change.override_scaling_mode()); @@ -489,17 +485,14 @@ void Replayer::setCrop(SurfaceComposerClient::Transaction& t, Rect r = Rect(cc.rectangle().left(), cc.rectangle().top(), cc.rectangle().right(), cc.rectangle().bottom()); - t.setCrop(mLayers[id], r); + t.setCrop_legacy(mLayers[id], r); } -void Replayer::setFinalCrop(SurfaceComposerClient::Transaction& t, - layer_id id, const FinalCropChange& fcc) { - ALOGV("Layer %d: Setting Final Crop -- left=%d, top=%d, right=%d, bottom=%d", id, - fcc.rectangle().left(), fcc.rectangle().top(), fcc.rectangle().right(), - fcc.rectangle().bottom()); - Rect r = Rect(fcc.rectangle().left(), fcc.rectangle().top(), fcc.rectangle().right(), - fcc.rectangle().bottom()); - t.setFinalCrop(mLayers[id], r); +void Replayer::setCornerRadius(SurfaceComposerClient::Transaction& t, + layer_id id, const CornerRadiusChange& cc) { + ALOGV("Layer %d: Setting Corner Radius -- cornerRadius=%d", id, cc.corner_radius()); + + t.setCornerRadius(mLayers[id], cc.corner_radius()); } void Replayer::setMatrix(SurfaceComposerClient::Transaction& t, @@ -570,7 +563,7 @@ void Replayer::setDeferredTransaction(SurfaceComposerClient::Transaction& t, auto handle = mLayers[dtc.layer_id()]->getHandle(); - t.deferTransactionUntil(mLayers[id], handle, dtc.frame_number()); + t.deferTransactionUntil_legacy(mLayers[id], handle, dtc.frame_number()); } void Replayer::setDisplaySurface(SurfaceComposerClient::Transaction& t, @@ -631,47 +624,10 @@ status_t Replayer::createSurfaceControl( return NO_ERROR; } -status_t Replayer::deleteSurfaceControl( - const SurfaceDeletion& delete_, const std::shared_ptr<Event>& event) { - ALOGV("Deleting %d Surface Control", delete_.id()); - event->readyToExecute(); - - std::lock_guard<std::mutex> lock1(mPendingLayersLock); - - mLayersPendingRemoval.push_back(delete_.id()); - - const auto& iterator = mBufferQueueSchedulers.find(delete_.id()); - if (iterator != mBufferQueueSchedulers.end()) { - (*iterator).second->stopScheduling(); - } - - std::lock_guard<std::mutex> lock2(mLayerLock); - if (mLayers[delete_.id()] != nullptr) { - mComposerClient->destroySurface(mLayers[delete_.id()]->getHandle()); - } - - return NO_ERROR; -} - -void Replayer::doDeleteSurfaceControls() { - std::lock_guard<std::mutex> lock1(mPendingLayersLock); - std::lock_guard<std::mutex> lock2(mLayerLock); - if (!mLayersPendingRemoval.empty()) { - for (int id : mLayersPendingRemoval) { - mLayers.erase(id); - mColors.erase(id); - mBufferQueueSchedulers.erase(id); - } - mLayersPendingRemoval.clear(); - } -} - status_t Replayer::injectVSyncEvent( const VSyncEvent& vSyncEvent, const std::shared_ptr<Event>& event) { ALOGV("Injecting VSync Event"); - doDeleteSurfaceControls(); - event->readyToExecute(); SurfaceComposerClient::injectVSync(vSyncEvent.when()); diff --git a/cmds/surfacereplayer/replayer/Replayer.h b/cmds/surfacereplayer/replayer/Replayer.h index 295403eace..ad807ee950 100644 --- a/cmds/surfacereplayer/replayer/Replayer.h +++ b/cmds/surfacereplayer/replayer/Replayer.h @@ -70,8 +70,6 @@ class Replayer { status_t doTransaction(const Transaction& transaction, const std::shared_ptr<Event>& event); status_t createSurfaceControl(const SurfaceCreation& create, const std::shared_ptr<Event>& event); - status_t deleteSurfaceControl(const SurfaceDeletion& delete_, - const std::shared_ptr<Event>& event); status_t injectVSyncEvent(const VSyncEvent& vsyncEvent, const std::shared_ptr<Event>& event); void createDisplay(const DisplayCreation& create, const std::shared_ptr<Event>& event); void deleteDisplay(const DisplayDeletion& delete_, const std::shared_ptr<Event>& event); @@ -92,8 +90,8 @@ class Replayer { layer_id id, const LayerChange& lc); void setCrop(SurfaceComposerClient::Transaction& t, layer_id id, const CropChange& cc); - void setFinalCrop(SurfaceComposerClient::Transaction& t, - layer_id id, const FinalCropChange& fcc); + void setCornerRadius(SurfaceComposerClient::Transaction& t, + layer_id id, const CornerRadiusChange& cc); void setMatrix(SurfaceComposerClient::Transaction& t, layer_id id, const MatrixChange& mc); void setOverrideScalingMode(SurfaceComposerClient::Transaction& t, @@ -120,7 +118,6 @@ class Replayer { void setDisplayProjection(SurfaceComposerClient::Transaction& t, display_id id, const ProjectionChange& pc); - void doDeleteSurfaceControls(); void waitUntilTimestamp(int64_t timestamp); void waitUntilDeferredTransactionLayerExists( const DeferredTransactionChange& dtc, std::unique_lock<std::mutex>& lock); diff --git a/cmds/surfacereplayer/replayer/trace_creator/trace_creator.py b/cmds/surfacereplayer/replayer/trace_creator/trace_creator.py index a892e46816..d63d97f6b4 100644 --- a/cmds/surfacereplayer/replayer/trace_creator/trace_creator.py +++ b/cmds/surfacereplayer/replayer/trace_creator/trace_creator.py @@ -172,7 +172,7 @@ def surface_delete(increment): def display_create(increment): increment.display_creation.id = int(input("Enter id: ")) increment.display_creation.name = str(raw_input("Enter name: ")) - increment.display_creation.type = int(input("Enter type: ")) + increment.display_creation.display_id = int(input("Enter display ID: ")) increment.display_creation.is_secure = bool(input("Enter if secure: ")) def display_delete(increment): |