blob: 042f051df4d03a8692f66a072f52fff9fd8e9592 [file] [log] [blame]
Terry Wangfebbead2019-10-17 17:05:18 -07001/*
2 * Copyright (C) 2019 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package com.android.server.appsearch;
17
18import android.app.appsearch.IAppSearchManager;
19import android.content.Context;
20
Alexander Dorokhinefd07eba2020-01-13 20:22:20 -080021import com.android.internal.infra.AndroidFuture;
Terry Wangfebbead2019-10-17 17:05:18 -070022import com.android.server.SystemService;
23
Alexander Dorokhinefd07eba2020-01-13 20:22:20 -080024import com.google.android.icing.proto.SchemaProto;
25
Terry Wangfebbead2019-10-17 17:05:18 -070026/**
27 * TODO(b/142567528): add comments when implement this class
28 */
29public class AppSearchManagerService extends SystemService {
30
31 public AppSearchManagerService(Context context) {
32 super(context);
33 }
34
35 @Override
36 public void onStart() {
37 publishBinderService(Context.APP_SEARCH_SERVICE, new Stub());
38 }
39
40 private class Stub extends IAppSearchManager.Stub {
Alexander Dorokhinefd07eba2020-01-13 20:22:20 -080041 @Override
42 public void setSchema(byte[] schemaBytes, AndroidFuture callback) {
43 try {
44 SchemaProto schema = SchemaProto.parseFrom(schemaBytes);
45 throw new UnsupportedOperationException("setSchema not yet implemented: " + schema);
Alexander Dorokhine179c8b82020-01-11 00:17:48 -080046
47 } catch (Throwable t) {
48 callback.completeExceptionally(t);
49 }
50 }
51
52 @Override
53 public void put(byte[] documentBytes, AndroidFuture callback) {
54 try {
55 throw new UnsupportedOperationException("Put document not yet implemented");
Alexander Dorokhinefd07eba2020-01-13 20:22:20 -080056 } catch (Throwable t) {
57 callback.completeExceptionally(t);
58 }
59 }
Terry Wangfebbead2019-10-17 17:05:18 -070060 }
61}