diff options
Diffstat (limited to 'libs')
| -rw-r--r-- | libs/androidfw/ApkAssets.cpp | 9 | ||||
| -rw-r--r-- | libs/androidfw/ZipFileRO.cpp | 7 | ||||
| -rw-r--r-- | libs/androidfw/tests/TestHelpers.cpp | 3 | ||||
| -rw-r--r-- | libs/hwui/JankTracker.cpp | 2 | ||||
| -rw-r--r-- | libs/hwui/tests/macrobench/TestSceneRunner.cpp | 6 | ||||
| -rw-r--r-- | libs/usb/tests/AccessoryChat/Android.bp | 24 | ||||
| -rw-r--r-- | libs/usb/tests/AccessoryChat/Android.mk | 28 |
7 files changed, 34 insertions, 45 deletions
diff --git a/libs/androidfw/ApkAssets.cpp b/libs/androidfw/ApkAssets.cpp index 7b7599ff74ec..61e32301dc85 100644 --- a/libs/androidfw/ApkAssets.cpp +++ b/libs/androidfw/ApkAssets.cpp @@ -125,9 +125,8 @@ std::unique_ptr<const ApkAssets> ApkAssets::LoadImpl( std::unique_ptr<ApkAssets> loaded_apk(new ApkAssets(unmanaged_handle, path, last_mod_time)); // Find the resource table. - ::ZipString entry_name(kResourcesArsc.c_str()); ::ZipEntry entry; - result = ::FindEntry(loaded_apk->zip_handle_.get(), entry_name, &entry); + result = ::FindEntry(loaded_apk->zip_handle_.get(), kResourcesArsc, &entry); if (result != 0) { // There is no resources.arsc, so create an empty LoadedArsc and return. loaded_apk->loaded_arsc_ = LoadedArsc::CreateEmpty(); @@ -165,9 +164,8 @@ std::unique_ptr<const ApkAssets> ApkAssets::LoadImpl( std::unique_ptr<Asset> ApkAssets::Open(const std::string& path, Asset::AccessMode mode) const { CHECK(zip_handle_ != nullptr); - ::ZipString name(path.c_str()); ::ZipEntry entry; - int32_t result = ::FindEntry(zip_handle_.get(), name, &entry); + int32_t result = ::FindEntry(zip_handle_.get(), path, &entry); if (result != 0) { return {}; } @@ -213,9 +211,8 @@ bool ApkAssets::ForEachFile(const std::string& root_path, root_path_full += '/'; } - ::ZipString prefix(root_path_full.c_str()); void* cookie; - if (::StartIteration(zip_handle_.get(), &cookie, &prefix, nullptr) != 0) { + if (::StartIteration(zip_handle_.get(), &cookie, root_path_full, "") != 0) { return false; } diff --git a/libs/androidfw/ZipFileRO.cpp b/libs/androidfw/ZipFileRO.cpp index 6e2ca60cc3d3..ee5f7783635d 100644 --- a/libs/androidfw/ZipFileRO.cpp +++ b/libs/androidfw/ZipFileRO.cpp @@ -98,7 +98,7 @@ ZipEntryRO ZipFileRO::findEntryByName(const char* entryName) const data->name = ZipString(entryName); - const int32_t error = FindEntry(mHandle, data->name, &(data->entry)); + const int32_t error = FindEntry(mHandle, entryName, &(data->entry)); if (error) { delete data; return NULL; @@ -149,11 +149,8 @@ bool ZipFileRO::startIteration(void** cookie) { bool ZipFileRO::startIteration(void** cookie, const char* prefix, const char* suffix) { _ZipEntryRO* ze = new _ZipEntryRO; - ZipString pe(prefix ? prefix : ""); - ZipString se(suffix ? suffix : ""); int32_t error = StartIteration(mHandle, &(ze->cookie), - prefix ? &pe : NULL, - suffix ? &se : NULL); + prefix ? prefix : "", suffix ? suffix : ""); if (error) { ALOGW("Could not start iteration over %s: %s", mFileName != NULL ? mFileName : "<null>", ErrorCodeString(error)); diff --git a/libs/androidfw/tests/TestHelpers.cpp b/libs/androidfw/tests/TestHelpers.cpp index 9e320a21b534..a81bb6ffab06 100644 --- a/libs/androidfw/tests/TestHelpers.cpp +++ b/libs/androidfw/tests/TestHelpers.cpp @@ -34,9 +34,8 @@ AssertionResult ReadFileFromZipToString(const std::string& zip_path, const std:: << "': " << ::ErrorCodeString(result); } - ::ZipString name(file.c_str()); ::ZipEntry entry; - result = ::FindEntry(handle, name, &entry); + result = ::FindEntry(handle, file.c_str(), &entry); if (result != 0) { ::CloseArchive(handle); return AssertionFailure() << "Could not find file '" << file << "' in zip '" << zip_path diff --git a/libs/hwui/JankTracker.cpp b/libs/hwui/JankTracker.cpp index ccbb6c10d3af..53c5ad8eff3c 100644 --- a/libs/hwui/JankTracker.cpp +++ b/libs/hwui/JankTracker.cpp @@ -139,7 +139,7 @@ void JankTracker::finishFrame(const FrameInfo& frame) { (*mGlobalData)->reportJank(); } - bool isTripleBuffered = mSwapDeadline > frame[FrameInfoIndex::IntendedVsync]; + bool isTripleBuffered = (mSwapDeadline - frame[FrameInfoIndex::IntendedVsync]) > (mFrameInterval * 0.1); mSwapDeadline = std::max(mSwapDeadline + mFrameInterval, frame[FrameInfoIndex::IntendedVsync] + mFrameInterval); diff --git a/libs/hwui/tests/macrobench/TestSceneRunner.cpp b/libs/hwui/tests/macrobench/TestSceneRunner.cpp index aa579adfb2ce..9c845f04e820 100644 --- a/libs/hwui/tests/macrobench/TestSceneRunner.cpp +++ b/libs/hwui/tests/macrobench/TestSceneRunner.cpp @@ -82,7 +82,7 @@ void outputBenchmarkReport(const TestScene::Info& info, const TestScene::Options // mean and stddev which doesn't make sense for our usage std::vector<BenchmarkReporter::Run> reports; BenchmarkReporter::Run report; - report.run_name = info.name; + report.run_name.function_name = info.name; report.iterations = static_cast<int64_t>(opts.count); report.real_accumulated_time = durationInS; report.cpu_accumulated_time = durationInS; @@ -95,8 +95,8 @@ void outputBenchmarkReport(const TestScene::Info& info, const TestScene::Options // in that test case than percentiles. if (!opts.renderOffscreen) { for (auto& ri : REPORTS) { - reports[0].run_name = info.name; - reports[0].run_name += ri.suffix; + reports[0].run_name.function_name = info.name; + reports[0].run_name.function_name += ri.suffix; durationInS = proxy->frameTimePercentile(ri.percentile) / 1000.0; reports[0].real_accumulated_time = durationInS; reports[0].cpu_accumulated_time = durationInS; diff --git a/libs/usb/tests/AccessoryChat/Android.bp b/libs/usb/tests/AccessoryChat/Android.bp index 4af6274b7ece..63a670c67bfc 100644 --- a/libs/usb/tests/AccessoryChat/Android.bp +++ b/libs/usb/tests/AccessoryChat/Android.bp @@ -1 +1,25 @@ subdirs = ["accessorychat"] +// +// Copyright (C) 2011 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. +// + +android_test { + name: "AccessoryChat", + + srcs: ["**/*.java"], + + platform_apis: true, + +} diff --git a/libs/usb/tests/AccessoryChat/Android.mk b/libs/usb/tests/AccessoryChat/Android.mk deleted file mode 100644 index cfe2da1eb471..000000000000 --- a/libs/usb/tests/AccessoryChat/Android.mk +++ /dev/null @@ -1,28 +0,0 @@ -# -# Copyright (C) 2011 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. -# - -LOCAL_PATH:= $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_MODULE_TAGS := tests - -LOCAL_SRC_FILES := $(call all-subdir-java-files) - -LOCAL_PACKAGE_NAME := AccessoryChat - -LOCAL_PRIVATE_PLATFORM_APIS := true - -include $(BUILD_PACKAGE) |