1 /* 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 */ 16 17 package android.view; 18 19 import android.content.res.Configuration; 20 21 /** 22 * Interface to listen for changes to display window-containers. 23 * 24 * This differs from DisplayManager's DisplayListener in a couple ways: 25 * - onDisplayAdded is always called after the display is actually added to the WM hierarchy. 26 * This corresponds to the DisplayContent and not the raw Dislay from DisplayManager. 27 * - onDisplayConfigurationChanged is called for all configuration changes, not just changes 28 * to displayinfo (eg. windowing-mode). 29 * 30 * @hide 31 */ 32 oneway interface IDisplayWindowListener { 33 34 /** 35 * Called when a display is added to the WM hierarchy. 36 */ onDisplayAdded(int displayId)37 void onDisplayAdded(int displayId); 38 39 /** 40 * Called when a display's window-container configuration has changed. 41 */ onDisplayConfigurationChanged(int displayId, in Configuration newConfig)42 void onDisplayConfigurationChanged(int displayId, in Configuration newConfig); 43 44 /** 45 * Called when a display is removed from the hierarchy. 46 */ onDisplayRemoved(int displayId)47 void onDisplayRemoved(int displayId); 48 49 /** 50 * Called when fixed rotation is started on a display. 51 */ onFixedRotationStarted(int displayId, int newRotation)52 void onFixedRotationStarted(int displayId, int newRotation); 53 54 /** 55 * Called when the previous fixed rotation on a display is finished. 56 */ onFixedRotationFinished(int displayId)57 void onFixedRotationFinished(int displayId); 58 } 59