Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .bazelignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
android_env/apps
android_env/playground/frontend/node_modules
3 changes: 3 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
build --cxxopt=-std=c++17
build --host_cxxopt=-std=c++17
build --incompatible_enable_proto_toolchain_resolution

# Required by aspect_rules_ts (Playground frontend).
common --@aspect_rules_ts//ts:skipLibCheck=always
8 changes: 8 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,11 @@ register_toolchains("@nodejs_toolchains//:all")
rules_ts_ext = use_extension("@aspect_rules_ts//ts:extensions.bzl", "ext")
rules_ts_ext.deps()
use_repo(rules_ts_ext, "npm_typescript")
# npm dependencies for the Playground frontend.
npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm")
npm.npm_translate_lock(
name = "npm",
pnpm_lock = "//android_env/playground/frontend:pnpm-lock.yaml",
verify_node_modules_ignored = "//:.bazelignore",
)
use_repo(npm, "npm")
11 changes: 11 additions & 0 deletions android_env/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ py_package(
packages = ["android_env"],
deps = [
":loader",
"//android_env/components:android_device_loader",
"//android_env/mcp:android_mcp_tools",
"//android_env/playground:playground_lib",
"//android_env/rl:environment",
"//android_env/wrappers:a11y_grpc_wrapper",
"//android_env/wrappers:discrete_action_wrapper",
"//android_env/wrappers:flat_interface_wrapper",
Expand All @@ -104,13 +108,18 @@ py_package(
"//android_env/wrappers:rate_limit_wrapper",
"//android_env/wrappers:swipe_action_wrapper",
"//android_env/wrappers:tap_action_wrapper",
"//android_env/wrappers:task_wrapper",
],
)

py_wheel(
name = "android_env_wheel",
author = "DeepMind",
distribution = "android_env",
extra_requires = {
"mcp": ["mcp>=1.26,<2"],
"playground": ["ml-collections"],
},
license = "Apache License, Version 2.0",
requires = [
"absl-py>=0.1.0",
Expand All @@ -122,6 +131,8 @@ py_wheel(
"gymnasium>=0.29.1",
"protobuf>=5.27.2",
"grpcio>=1.64.2",
"opencv-python-headless>=4.10.0",
"websocket-client>=1.8.0",
],
summary = "AndroidEnv: A Gym/Gymnasium Environment for Android",
version = "1.3.0",
Expand Down
39 changes: 39 additions & 0 deletions android_env/apps/java/com/google/androidenv/core/Action.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// Copyright 2026 DeepMind Technologies Limited.
//
// 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 com.google.androidenv.core

/** Types of actions that can be injected. */
enum class ActionType {
TOUCH_DOWN,
TOUCH_UP,
TOUCH_MOVE,
KEY_EVENT,
SET_TEXT,
SET_SELECTION,
CUT,
COPY,
PASTE,
}

/** Represents an action to be injected into the device. */
data class Action(
val actionType: ActionType,
val touchPosition: List<Float>?, // [x, y] normalized 0.0-1.0
val keycode: Int?,
val pointerId: Int? = null,
val text: String? = null,
val selectionStart: Int? = null,
val selectionEnd: Int? = null,
)
Loading
Loading