1 /** 2 * Copyright (c) 2024, 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 package android.app.dream.cts.app; 17 18 import android.app.dream.cts.app.IControlledDream; 19 import android.app.dream.cts.app.IDreamListener; 20 21 /** 22 * {@link IDreamProxy} defines the interface of a hub for proxying controllable dreams to listeners. 23 */ 24 interface IDreamProxy { 25 /** 26 * Informs any registered listeners that the supplied {@link IControlledDream} is ready for use. 27 */ publishDream(IControlledDream dream)28 void publishDream(IControlledDream dream); 29 30 /** 31 * Registers a listener to be notified of any future published {@link IControlledDream}. 32 */ registerListener(IDreamListener listener)33 void registerListener(IDreamListener listener); 34 35 /** 36 * Removes a listener from receiving any future notifications about published 37 * {@link IControlledDream}. 38 */ unregisterListener(IDreamListener listener)39 void unregisterListener(IDreamListener listener); 40 }