Wrap WebView with TerminalView
TerminalView allows us to modify behavior of the WebView for things like
accessibility and to localize WebView related code in one place.
Bug: N/A
Test: N/A
Change-Id: I566fb708f64e4639712f9f785c66b5b0055fa4c0
diff --git a/android/TerminalApp/java/com/android/virtualization/terminal/TerminalView.java b/android/TerminalApp/java/com/android/virtualization/terminal/TerminalView.java
new file mode 100644
index 0000000..d40ae8f
--- /dev/null
+++ b/android/TerminalApp/java/com/android/virtualization/terminal/TerminalView.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2024 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 com.android.virtualization.terminal;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.webkit.WebView;
+
+public class TerminalView extends WebView {
+ public TerminalView(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ }
+}
diff --git a/android/TerminalApp/res/layout/activity_headless.xml b/android/TerminalApp/res/layout/activity_headless.xml
index 8a15dd8..3b01179 100644
--- a/android/TerminalApp/res/layout/activity_headless.xml
+++ b/android/TerminalApp/res/layout/activity_headless.xml
@@ -47,7 +47,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
- <WebView
+ <com.android.virtualization.terminal.TerminalView
android:id="@+id/webview"
android:layout_marginBottom="5dp"
android:layout_gravity="fill"