• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

system/core


Commit MetaInfo

Revision6031414c003ed0c74ecc9ac77f923abb1902cd39 (tree)
Zeit2019-05-19 08:18:15
Autorandroid-build-team Robot <android-build-team-robot@goog...>
Commiterandroid-build-team Robot

Log Message

Snap for 5582435 from 5c1b6041a420be82d457ee40f67f3904a2cb0760 to qt-qpr1-release

Change-Id: I685cef01984848104890618a0530370d87bd7fca

Ändern Zusammenfassung

Diff

--- a/adb/daemon/usb.cpp
+++ b/adb/daemon/usb.cpp
@@ -117,7 +117,7 @@ struct TransferId {
117117
118118 struct IoBlock {
119119 bool pending = false;
120- struct iocb control;
120+ struct iocb control = {};
121121 std::shared_ptr<Block> payload;
122122
123123 TransferId id() const { return TransferId::from_value(control.aio_data); }
--- a/fastboot/fuzzy_fastboot/main.cpp
+++ b/fastboot/fuzzy_fastboot/main.cpp
@@ -244,16 +244,29 @@ TEST_F(LogicalPartitionCompliance, FastbootRebootTest) {
244244 // Testing creation/resize/delete of logical partitions
245245 TEST_F(LogicalPartitionCompliance, CreateResizeDeleteLP) {
246246 ASSERT_TRUE(UserSpaceFastboot());
247+ std::string test_partition_name = "test_partition";
248+ std::string slot_count;
249+ // Add suffix to test_partition_name if device is slotted.
250+ EXPECT_EQ(fb->GetVar("slot-count", &slot_count), SUCCESS) << "getvar slot-count failed";
251+ int32_t num_slots = strtol(slot_count.c_str(), nullptr, 10);
252+ if (num_slots > 0) {
253+ std::string current_slot;
254+ EXPECT_EQ(fb->GetVar("current-slot", &current_slot), SUCCESS)
255+ << "getvar current-slot failed";
256+ std::string slot_suffix = "_" + current_slot;
257+ test_partition_name += slot_suffix;
258+ }
259+
247260 GTEST_LOG_(INFO) << "Testing 'fastboot create-logical-partition' command";
248- EXPECT_EQ(fb->CreatePartition("test_partition_a", "0"), SUCCESS)
261+ EXPECT_EQ(fb->CreatePartition(test_partition_name, "0"), SUCCESS)
249262 << "create-logical-partition failed";
250263 GTEST_LOG_(INFO) << "Testing 'fastboot resize-logical-partition' command";
251- EXPECT_EQ(fb->ResizePartition("test_partition_a", "4096"), SUCCESS)
264+ EXPECT_EQ(fb->ResizePartition(test_partition_name, "4096"), SUCCESS)
252265 << "resize-logical-partition failed";
253266 std::vector<char> buf(4096);
254267
255268 GTEST_LOG_(INFO) << "Flashing a logical partition..";
256- EXPECT_EQ(fb->FlashPartition("test_partition_a", buf), SUCCESS)
269+ EXPECT_EQ(fb->FlashPartition(test_partition_name, buf), SUCCESS)
257270 << "flash logical -partition failed";
258271 GTEST_LOG_(INFO) << "Rebooting to bootloader mode";
259272 // Reboot to bootloader mode and attempt to flash the logical partitions
@@ -262,7 +275,7 @@ TEST_F(LogicalPartitionCompliance, CreateResizeDeleteLP) {
262275 ReconnectFastbootDevice();
263276 ASSERT_FALSE(UserSpaceFastboot());
264277 GTEST_LOG_(INFO) << "Attempt to flash a logical partition..";
265- EXPECT_EQ(fb->FlashPartition("test_partition", buf), DEVICE_FAIL)
278+ EXPECT_EQ(fb->FlashPartition(test_partition_name, buf), DEVICE_FAIL)
266279 << "flash logical partition must fail in bootloader";
267280 GTEST_LOG_(INFO) << "Rebooting back to fastbootd mode";
268281 fb->RebootTo("fastboot");
@@ -270,7 +283,7 @@ TEST_F(LogicalPartitionCompliance, CreateResizeDeleteLP) {
270283 ReconnectFastbootDevice();
271284 ASSERT_TRUE(UserSpaceFastboot());
272285 GTEST_LOG_(INFO) << "Testing 'fastboot delete-logical-partition' command";
273- EXPECT_EQ(fb->DeletePartition("test_partition_a"), SUCCESS)
286+ EXPECT_EQ(fb->DeletePartition(test_partition_name), SUCCESS)
274287 << "delete logical-partition failed";
275288 }
276289
--- a/init/README.md
+++ b/init/README.md
@@ -414,7 +414,8 @@ Commands
414414
415415 `class_start_post_data <serviceclass>`
416416 > Like `class_start`, but only considers services that were started
417- after /data was mounted. Only used for FDE devices.
417+ after /data was mounted, and that were running at the time
418+ `class_reset_post_data` was called. Only used for FDE devices.
418419
419420 `class_stop <serviceclass>`
420421 > Stop and disable all services of the specified class if they are
--- a/init/builtins.cpp
+++ b/init/builtins.cpp
@@ -104,35 +104,36 @@ static void ForEachServiceInClass(const std::string& classname, F function) {
104104 }
105105 }
106106
107-static Result<Success> class_start(const std::string& class_name, bool post_data_only) {
107+static Result<Success> do_class_start(const BuiltinArguments& args) {
108108 // Do not start a class if it has a property persist.dont_start_class.CLASS set to 1.
109- if (android::base::GetBoolProperty("persist.init.dont_start_class." + class_name, false))
109+ if (android::base::GetBoolProperty("persist.init.dont_start_class." + args[1], false))
110110 return Success();
111111 // Starting a class does not start services which are explicitly disabled.
112112 // They must be started individually.
113113 for (const auto& service : ServiceList::GetInstance()) {
114- if (service->classnames().count(class_name)) {
115- if (post_data_only && !service->is_post_data()) {
116- continue;
117- }
114+ if (service->classnames().count(args[1])) {
118115 if (auto result = service->StartIfNotDisabled(); !result) {
119116 LOG(ERROR) << "Could not start service '" << service->name()
120- << "' as part of class '" << class_name << "': " << result.error();
117+ << "' as part of class '" << args[1] << "': " << result.error();
121118 }
122119 }
123120 }
124121 return Success();
125122 }
126123
127-static Result<Success> do_class_start(const BuiltinArguments& args) {
128- return class_start(args[1], false /* post_data_only */);
129-}
130-
131124 static Result<Success> do_class_start_post_data(const BuiltinArguments& args) {
132125 if (args.context != kInitContext) {
133126 return Error() << "command 'class_start_post_data' only available in init context";
134127 }
135- return class_start(args[1], true /* post_data_only */);
128+ for (const auto& service : ServiceList::GetInstance()) {
129+ if (service->classnames().count(args[1])) {
130+ if (auto result = service->StartIfPostData(); !result) {
131+ LOG(ERROR) << "Could not start service '" << service->name()
132+ << "' as part of class '" << args[1] << "': " << result.error();
133+ }
134+ }
135+ }
136+ return Success();
136137 }
137138
138139 static Result<Success> do_class_stop(const BuiltinArguments& args) {
--- a/init/service.cpp
+++ b/init/service.cpp
@@ -1154,10 +1154,23 @@ void Service::Reset() {
11541154
11551155 void Service::ResetIfPostData() {
11561156 if (post_data_) {
1157+ if (flags_ & SVC_RUNNING) {
1158+ running_at_post_data_reset_ = true;
1159+ }
11571160 StopOrReset(SVC_RESET);
11581161 }
11591162 }
11601163
1164+Result<Success> Service::StartIfPostData() {
1165+ // Start the service, but only if it was started after /data was mounted,
1166+ // and it was still running when we reset the post-data services.
1167+ if (running_at_post_data_reset_) {
1168+ return Start();
1169+ }
1170+
1171+ return Success();
1172+}
1173+
11611174 void Service::Stop() {
11621175 StopOrReset(SVC_DISABLED);
11631176 }
--- a/init/service.h
+++ b/init/service.h
@@ -79,6 +79,7 @@ class Service {
7979 Result<Success> ExecStart();
8080 Result<Success> Start();
8181 Result<Success> StartIfNotDisabled();
82+ Result<Success> StartIfPostData();
8283 Result<Success> Enable();
8384 void Reset();
8485 void ResetIfPostData();
@@ -248,6 +249,8 @@ class Service {
248249 bool pre_apexd_ = false;
249250
250251 bool post_data_ = false;
252+
253+ bool running_at_post_data_reset_ = false;
251254 };
252255
253256 class ServiceList {
--- a/rootdir/etc/ld.config.txt
+++ b/rootdir/etc/ld.config.txt
@@ -174,6 +174,7 @@ namespace.media.search.paths = /apex/com.android.media/${LIB}
174174 namespace.media.asan.search.paths = /apex/com.android.media/${LIB}
175175
176176 namespace.media.permitted.paths = /apex/com.android.media/${LIB}/extractors
177+namespace.media.asan.permitted.paths = /apex/com.android.media/${LIB}/extractors
177178
178179 namespace.media.links = default
179180 namespace.media.link.default.shared_libs = %LLNDK_LIBRARIES%
@@ -616,6 +617,7 @@ namespace.media.search.paths = /apex/com.android.media/${LIB}
616617 namespace.media.asan.search.paths = /apex/com.android.media/${LIB}
617618
618619 namespace.media.permitted.paths = /apex/com.android.media/${LIB}/extractors
620+namespace.media.asan.permitted.paths = /apex/com.android.media/${LIB}/extractors
619621
620622 namespace.media.links = default
621623 namespace.media.link.default.shared_libs = %LLNDK_LIBRARIES%