Setup frameworks/libs/systemui/searchuilib for AA+Search
Bug: 162234997
Test: system image builds, search_ui lib builds
Change-Id: If958ac3eb94c9a52ab3ba691c998f48ae846b11e
diff --git a/searchuilib/Android.bp b/searchuilib/Android.bp
new file mode 100644
index 0000000..c01c710
--- /dev/null
+++ b/searchuilib/Android.bp
@@ -0,0 +1,24 @@
+// Copyright (C) 2020 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.
+
+android_library {
+ name: "search_ui",
+
+ sdk_version: "system_current",
+ min_sdk_version: "system_current",
+
+ srcs: [
+ "src/**/*.java",
+ ],
+}
diff --git a/searchuilib/AndroidManifest.xml b/searchuilib/AndroidManifest.xml
new file mode 100644
index 0000000..6c6c5f6
--- /dev/null
+++ b/searchuilib/AndroidManifest.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2020 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.
+-->
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.android.app.search">
+</manifest>
diff --git a/searchuilib/build.gradle b/searchuilib/build.gradle
new file mode 100644
index 0000000..4f372e3
--- /dev/null
+++ b/searchuilib/build.gradle
@@ -0,0 +1,37 @@
+apply plugin: 'com.android.library'
+
+android {
+ compileSdkVersion COMPILE_SDK
+ buildToolsVersion BUILD_TOOLS_VERSION
+
+ defaultConfig {
+ minSdkVersion 25
+ targetSdkVersion 28
+ versionCode 1
+ versionName "1.0"
+ }
+
+ sourceSets {
+ main {
+ java.srcDirs = ['src']
+ manifest.srcFile 'AndroidManifest.xml'
+ }
+ }
+
+ lintOptions {
+ abortOnError false
+ }
+
+ tasks.withType(JavaCompile) {
+ options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
+ }
+
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
+}
+
+dependencies {
+ implementation "androidx.core:core:${ANDROID_X_VERSION}"
+}
diff --git a/searchuilib/src/com/android/app/search/LayoutType.java b/searchuilib/src/com/android/app/search/LayoutType.java
new file mode 100644
index 0000000..055d551
--- /dev/null
+++ b/searchuilib/src/com/android/app/search/LayoutType.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2020 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.app.search;
+
+/**
+ * Constants to be used with {@link android.app.search.SearchTarget}.
+ */
+public class LayoutType {
+
+ // ------
+ // | icon |
+ // ------
+ // text
+ //
+ public static final String ICON_SINGLE_VERTICAL_TEXT = "icon";
+
+ // ------
+ // | icon | text
+ // ------
+ public static final String ICON_SINGLE_HORIZONTAL_TEXT = "icon_text_row";
+
+ // ------ ------ ------
+ // | icon | text | icon | | icon |
+ // ------ ------ ------
+ public static final String ICON_INLINE_ICONS = "icon_text_icons";
+
+ // ------
+ // | | text1
+ // | icon | text2
+ // ------
+ public static final String ICON_DOUBLE_HORIZONTAL_TEXT = "icon_texts_row";
+
+ // TODO: add diagram
+ public static final String ICON_DOUBLE_HORIZONTAL_TEXT_BUTTON =
+ "icon_texts_button";
+
+ // TODO: add diagram
+ public static final String TEXT_HEADER = "header";
+
+ // TODO: replace the plugin item types with these string constants
+}
diff --git a/searchuilib/src/com/android/app/search/ResultType.java b/searchuilib/src/com/android/app/search/ResultType.java
new file mode 100644
index 0000000..43ac626
--- /dev/null
+++ b/searchuilib/src/com/android/app/search/ResultType.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2020 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.app.search;
+
+/**
+ * Constants to be used with {@link android.app.search.SearchContext} and
+ * {@link android.app.search.SearchInfo}.
+ */
+public class ResultType {
+
+ public static final int APPLICATION = 1 << 0;
+ public static final int SHORTCUT = 1 << 1;
+ public static final int PEOPLE = 1 << 2;
+ public static final int ACTION = 1 << 3;
+ public static final int SETTING = 1 << 4;
+ public static final int SCREENSHOT = 1 << 5;
+ public static final int TIPS = 1 << 2;
+ public static final int WIDGETS = 1 << 3;
+}