Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8f424abc authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add the skelton of NativeActivityThread" into main

parents 1f466d50 e7b13fd6
Loading
Loading
Loading
Loading
+32 −0
Original line number Original line Diff line number Diff line
//
// Copyright (C) 2025 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.

package {
    default_applicable_licenses: ["Android-Apache-2.0"],
    default_visibility: ["//system/zygote:__subpackages__"],
}

rust_library {
    name: "libnative_activity_thread",
    crate_name: "native_activity_thread",
    edition: "2021",
    srcs: [
        "src/lib.rs",
    ],
    rustlibs: [
        "liblogger",
        "liblog_rust",
    ],
}
+4 −0
Original line number Original line Diff line number Diff line
chibar@google.com
ishitatsuyuki@google.com
jham@google.com
uekawa@google.com
+32 −0
Original line number Original line Diff line number Diff line
//
// Copyright (C) 2025 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.

//! The crate providing the functionality to manage the native application process.

use log::{info, LevelFilter};

/// Start NativeActivityThread to manage the process.
pub fn run_native_activity_thread(start_seq: i64) -> ! {
    logger::init(
        logger::Config::default()
            .with_tag_on_device("native_activity_thread")
            .with_max_level(LevelFilter::Trace),
    );
    info!("Hello from the native activity thread! start_seq={}", start_seq);

    // TODO(b/402614577): Implement the ActivityThread logic.

    panic!("Something wrong happened!");
}