Skip to content
Snippets Groups Projects
Commit 6bb15094 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 8883296 from 51fadda8 to udc-release

Change-Id: Id976c961564322433758a12e489a95e76d410072
parents 4b1aea9d 51fadda8
No related branches found
No related tags found
No related merge requests found
......@@ -12,6 +12,7 @@ alanstokes@google.com
ardb@google.com
ascull@google.com
inseob@google.com
jeffv@google.com
jooyung@google.com
mzyngier@google.com
ptosi@google.com
......
......@@ -11,7 +11,7 @@ rust_defaults {
rustlibs: [
"libanyhow",
"libbitflags",
"libclap",
"libclap_deprecated",
"libdata_model",
"libidsig",
"libitertools",
......
......@@ -13,7 +13,7 @@ rust_binary {
"libbinder_common",
"libbinder_rpc_unstable_bindgen",
"libbinder_rs",
"libclap",
"libclap_deprecated",
"liblibc",
"liblog_rust",
"libnix",
......
......@@ -31,7 +31,7 @@ rust_test {
rustlibs: [
"libandroid_logger",
"libanyhow",
"libclap",
"libclap_deprecated",
"libcommand_fds",
"liblog_rust",
"libnix",
......
......@@ -30,7 +30,7 @@ rust_binary {
"libapexutil_rust",
"libapkverify",
"libavmd",
"libclap",
"libclap_deprecated",
"libserde",
"libserde_cbor",
"libvbmeta_rust",
......
......@@ -12,9 +12,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.
extern crate alloc;
use alloc::{
string::{String, ToString},
vec::Vec,
};
use apexutil::to_hex_string;
use core::fmt;
use serde::{Deserialize, Serialize};
use std::fmt;
/// An Avmd struct contains
/// - A header with version information that allows rollback when needed.
......
......@@ -14,6 +14,8 @@
//! Library for handling AVMD blobs.
#![no_std]
mod avmd;
pub use avmd::{ApkDescriptor, Avmd, Descriptor, ResourceIdentifier, VbMetaDescriptor};
......@@ -14,7 +14,7 @@ rust_defaults {
"libbinder_common",
"libbinder_rpc_unstable_bindgen",
"libbinder_rs",
"libclap",
"libclap_deprecated",
"libcompos_common",
"liblibc",
"liblog_rust",
......
......@@ -10,7 +10,7 @@ rust_binary {
"android.system.composd-rust",
"libanyhow",
"libbinder_rs",
"libclap",
"libclap_deprecated",
"libcompos_common",
],
prefer_rlib: true,
......
......@@ -11,7 +11,7 @@ rust_binary {
"libandroid_logger",
"libanyhow",
"libbinder_rs",
"libclap",
"libclap_deprecated",
"libcompos_common",
"libcompos_verify_native_rust",
"liblog_rust",
......
......@@ -68,7 +68,7 @@ private:
char buf[kBlockSizeBytes];
clock_t start = clock();
unique_fd fd(open(filename.c_str(), O_RDONLY));
unique_fd fd(open(filename.c_str(), O_RDONLY | O_CLOEXEC));
if (fd.get() == -1) {
return ErrnoError() << "Read: opening " << filename << " failed";
}
......
......@@ -156,6 +156,26 @@ public class MicrodroidTests extends MicrodroidDeviceTestBase {
assertThat(testResults.mExtraApkTestProp).isEqualTo("PASS");
}
@Test
public void bootFailsWhenLowMem() throws VirtualMachineException, InterruptedException {
VirtualMachineConfig lowMemConfig = mInner.newVmConfigBuilder("assets/vm_config.json")
.memoryMib(20)
.debugLevel(DebugLevel.NONE)
.build();
VirtualMachine vm = mInner.forceCreateNewVirtualMachine("low_mem", lowMemConfig);
final CompletableFuture<Integer> exception = new CompletableFuture<>();
VmEventListener listener =
new VmEventListener() {
@Override
public void onDied(VirtualMachine vm, @DeathReason int reason) {
exception.complete(reason);
super.onDied(vm, reason);
}
};
listener.runToFinish(TAG, vm);
assertThat(exception.getNow(0)).isAnyOf(DeathReason.REBOOT, DeathReason.HANGUP);
}
@Test
public void changingDebugLevelInvalidatesVmIdentity()
throws VirtualMachineException, InterruptedException, IOException {
......
......@@ -10,7 +10,7 @@ rust_defaults {
prefer_rlib: true,
rustlibs: [
"libanyhow",
"libclap",
"libclap_deprecated",
"libfuse_rust",
"liblibc",
"libzip",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment