diff options
author | 2018-11-14 11:59:02 -0800 | |
---|---|---|
committer | 2019-01-10 15:53:25 -0800 | |
commit | 54e91344e2a0072c40d09405fe5a295467b36c07 (patch) | |
tree | 8e25640c130c1ca8e6975a513c69a21f1961ba02 /packages/AppPredictionLib | |
parent | 00112e6f6f23edf15cc01be5fd099bc0f88cdd4f (diff) |
Adding initial implementation of Prediction client/service API
Test: Build sample app, ensure that app prediction service gets client
requests
Bug: 111701043
Change-Id: I33aceb2de31552b2d740dc333559d68728753e40
Signed-off-by: Winson Chung <winsonc@google.com>
Diffstat (limited to 'packages/AppPredictionLib')
-rw-r--r-- | packages/AppPredictionLib/Android.bp | 24 | ||||
-rw-r--r-- | packages/AppPredictionLib/AndroidManifest.xml | 20 | ||||
-rw-r--r-- | packages/AppPredictionLib/src/com/android/app/prediction/Constants.java | 71 |
3 files changed, 115 insertions, 0 deletions
diff --git a/packages/AppPredictionLib/Android.bp b/packages/AppPredictionLib/Android.bp new file mode 100644 index 000000000000..e0f4dedc9368 --- /dev/null +++ b/packages/AppPredictionLib/Android.bp @@ -0,0 +1,24 @@ +// Copyright (C) 2018 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: "app_prediction", + + sdk_version: "system_current", + min_sdk_version: "system_current", + + srcs: [ + "src/**/*.java", + ], +} diff --git a/packages/AppPredictionLib/AndroidManifest.xml b/packages/AppPredictionLib/AndroidManifest.xml new file mode 100644 index 000000000000..b99278881281 --- /dev/null +++ b/packages/AppPredictionLib/AndroidManifest.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (C) 2018 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.prediction"> +</manifest> diff --git a/packages/AppPredictionLib/src/com/android/app/prediction/Constants.java b/packages/AppPredictionLib/src/com/android/app/prediction/Constants.java new file mode 100644 index 000000000000..0993c9a13f99 --- /dev/null +++ b/packages/AppPredictionLib/src/com/android/app/prediction/Constants.java @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2018 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.prediction; + +/** + * Constants to be used with {@link android.app.prediction.AppPredictor}. + */ +public class Constants { + + /** + * UI surface for predictions displayed on the user's home screen + */ + public static final String UI_SURFACE_HOME = "home"; + + /** + * UI surface for predictions displayed on the recents/task switcher view + */ + public static final String UI_SURFACE_RECENTS = "recents"; + + /** + * UI surface for predictions displayed on the share sheet. + */ + public static final String UI_SURFACE_SHARE = "share"; + + /** + * Location constant when an app target or shortcut is started from the apps list + */ + public static final String LAUNCH_LOCATION_APPS_LIST = "apps_list"; + + /** + * Location constant when an app target or shortcut is started from the user's home screen + */ + public static final String LAUNCH_LOCATION_APPS_HOME = "home"; + + /** + * Location constant when an app target or shortcut is started from task switcher + */ + public static final String LAUNCH_LOCATION_APPS_RECENTS = "recents"; + + /** + * Location constant when an app target or shortcut is started in the share sheet while it is + * in collapsed state (showing a limited set of result). + */ + public static final String LAUNCH_LOCATION_APPS_SHARE_COLLAPSED = "share_collapsed"; + + /** + * Location constant when an app target or shortcut is started in the share sheet while it is + * in expended state and showing all the results. + */ + public static final String LAUNCH_LOCATION_APPS_SHARE_EXPANDED = "shared_expanded"; + + /** + * Location constant when an app target or shortcut is started in the share sheet when the + * target is displayed as a placeholder for an deprecated object. + */ + public static final String LAUNCH_LOCATION_APPS_SHARE_LEGACY = "share_legacy"; +} |