1/**
2 * Copyright (c) 2016, 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 */
16
17package com.android.car.stream;
18
19import com.android.car.stream.IStreamConsumer;
20import com.android.car.stream.StreamCard;
21
22/**
23 * An API for clients to communicate with StreamService.
24 */
25interface IStreamService {
26    /**
27     * Registers the stream consumer to listen for changes to cards within the StreamService.
28     */
29    void registerConsumer(in IStreamConsumer consumer) = 0;
30
31    /**
32     * Removes the given stream consumer from the list of listeners within the StreamService.
33     */
34    void unregisterConsumer(in IStreamConsumer consumer) = 1;
35
36    /**
37     * Returns all {@link StreamCard}s that the StreamService currently has.
38     */
39    List<StreamCard> fetchAllStreamCards() = 2;
40
41    /**
42     * Notifies the stream service that a card was dismissed.
43     */
44    void notifyStreamCardDismissed(in StreamCard card) = 3;
45
46    /**
47     * Notifies the stream service that a card interation has occured.
48     */
49    void notifyStreamCardInteracted(in StreamCard card) = 4;
50}
51