blob: dfd6f95c00af55f9995a8a7ca8fb67dfff6f0426 [file] [log] [blame]
Kenny Root15a4d2f2010-03-11 18:20:12 -08001/*
2 * Copyright (C) 2009 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
Dianne Hackborn4c62fc02009-08-08 20:40:27 -070017package com.android.internal.view;
18
Jackal Guoc43a0a62019-04-23 09:15:14 +080019import android.graphics.Point;
Dianne Hackborn4c62fc02009-08-08 20:40:27 -070020import android.graphics.Rect;
Vladislav Kaznacheevefbebb82016-04-29 16:57:33 -070021import android.hardware.input.InputManager;
Dianne Hackborn75804932009-10-20 20:15:20 -070022import android.os.Bundle;
Dianne Hackborn4c62fc02009-08-08 20:40:27 -070023import android.os.ParcelFileDescriptor;
24import android.os.RemoteException;
Andrii Kulian44607962017-03-16 11:06:24 -070025import android.util.MergedConfiguration;
Adrian Roos5c6b6222017-11-07 17:36:10 +010026import android.view.DisplayCutout;
Christopher Tatea53146c2010-09-07 11:57:52 -070027import android.view.DragEvent;
Dianne Hackborn4c62fc02009-08-08 20:40:27 -070028import android.view.IWindow;
29import android.view.IWindowSession;
Jorim Jaggib6030952018-10-23 18:31:52 +020030import android.view.InsetsSourceControl;
Jorim Jaggif96c90a2018-09-26 16:55:15 +020031import android.view.InsetsState;
Tiger Huang51c5a1d2018-12-11 20:24:51 +080032import android.view.PointerIcon;
Dianne Hackborn4c62fc02009-08-08 20:40:27 -070033
Clara Bayarri75e09792015-07-29 16:20:40 +010034import com.android.internal.os.IResultReceiver;
35
Dianne Hackborn4c62fc02009-08-08 20:40:27 -070036public class BaseIWindow extends IWindow.Stub {
37 private IWindowSession mSession;
Dianne Hackborn9a230e02011-10-06 11:51:27 -070038 public int mSeq;
Craig Mautner5702d4d2012-06-30 14:10:16 -070039
Dianne Hackborn4c62fc02009-08-08 20:40:27 -070040 public void setSession(IWindowSession session) {
41 mSession = session;
42 }
Craig Mautner5702d4d2012-06-30 14:10:16 -070043
44 @Override
Filip Gruszczynski2217f612015-05-26 11:32:08 -070045 public void resized(Rect frame, Rect overscanInsets, Rect contentInsets, Rect visibleInsets,
Andrii Kulian44607962017-03-16 11:06:24 -070046 Rect stableInsets, Rect outsets, boolean reportDraw,
47 MergedConfiguration mergedConfiguration, Rect backDropFrame, boolean forceLayout,
Brad Stenninge0573692019-03-11 13:52:46 -070048 boolean alwaysConsumeSystemBars, int displayId,
Adrian Roos5c6b6222017-11-07 17:36:10 +010049 DisplayCutout.ParcelableWrapper displayCutout) {
Dianne Hackborn4c62fc02009-08-08 20:40:27 -070050 if (reportDraw) {
51 try {
Vishnu Nairf7645aa2019-06-18 11:14:01 -070052 mSession.finishDrawing(this, null /* postDrawTransaction */);
Dianne Hackborn4c62fc02009-08-08 20:40:27 -070053 } catch (RemoteException e) {
54 }
55 }
56 }
57
Craig Mautner5702d4d2012-06-30 14:10:16 -070058 @Override
Jackal Guoc43a0a62019-04-23 09:15:14 +080059 public void locationInParentDisplayChanged(Point offset) {
60 }
61
62 @Override
Jorim Jaggif96c90a2018-09-26 16:55:15 +020063 public void insetsChanged(InsetsState insetsState) {
64 }
65
66 @Override
Jorim Jaggib6030952018-10-23 18:31:52 +020067 public void insetsControlChanged(InsetsState insetsState,
68 InsetsSourceControl[] activeControls) throws RemoteException {
69 }
70
71 @Override
Craig Mautner5702d4d2012-06-30 14:10:16 -070072 public void moved(int newX, int newY) {
73 }
74
75 @Override
Dianne Hackborn4c62fc02009-08-08 20:40:27 -070076 public void dispatchAppVisibility(boolean visible) {
77 }
78
Craig Mautner5702d4d2012-06-30 14:10:16 -070079 @Override
Dianne Hackborn4c62fc02009-08-08 20:40:27 -070080 public void dispatchGetNewSurface() {
81 }
82
Craig Mautner5702d4d2012-06-30 14:10:16 -070083 @Override
Tiger Huang51c5a1d2018-12-11 20:24:51 +080084 public void windowFocusChanged(boolean hasFocus, boolean touchEnabled) {
Dianne Hackborn4c62fc02009-08-08 20:40:27 -070085 }
86
Craig Mautner5702d4d2012-06-30 14:10:16 -070087 @Override
Dianne Hackborn4c62fc02009-08-08 20:40:27 -070088 public void executeCommand(String command, String parameters, ParcelFileDescriptor out) {
89 }
Craig Mautner5702d4d2012-06-30 14:10:16 -070090
91 @Override
Dianne Hackbornffa42482009-09-23 22:20:11 -070092 public void closeSystemDialogs(String reason) {
93 }
Craig Mautner5702d4d2012-06-30 14:10:16 -070094
95 @Override
Marco Nelissenbf6956b2009-11-09 15:21:13 -080096 public void dispatchWallpaperOffsets(float x, float y, float xStep, float yStep, boolean sync) {
Dianne Hackborn19382ac2009-09-11 21:13:37 -070097 if (sync) {
98 try {
99 mSession.wallpaperOffsetsComplete(asBinder());
100 } catch (RemoteException e) {
101 }
102 }
Dianne Hackborn72c82ab2009-08-11 21:13:54 -0700103 }
Christopher Tatea53146c2010-09-07 11:57:52 -0700104
Craig Mautner5702d4d2012-06-30 14:10:16 -0700105 @Override
Christopher Tatea53146c2010-09-07 11:57:52 -0700106 public void dispatchDragEvent(DragEvent event) {
Vladislav Kaznacheevefbebb82016-04-29 16:57:33 -0700107 if (event.getAction() == DragEvent.ACTION_DROP) {
108 try {
109 mSession.reportDropResult(this, false);
110 } catch (RemoteException e) {
111 }
112 }
Christopher Tatea53146c2010-09-07 11:57:52 -0700113 }
114
Craig Mautner5702d4d2012-06-30 14:10:16 -0700115 @Override
Vladislav Kaznacheevec6a4472016-01-22 12:21:52 -0800116 public void updatePointerIcon(float x, float y) {
Michael Wrighte051f6f2016-05-13 17:44:16 +0100117 InputManager.getInstance().setPointerIconType(PointerIcon.TYPE_NOT_SPECIFIED);
Vladislav Kaznacheevec6a4472016-01-22 12:21:52 -0800118 }
119
120 @Override
Dianne Hackborn9a230e02011-10-06 11:51:27 -0700121 public void dispatchSystemUiVisibilityChanged(int seq, int globalUi,
122 int localValue, int localChanges) {
123 mSeq = seq;
Joe Onorato664644d2011-01-23 17:53:23 -0800124 }
125
Craig Mautner5702d4d2012-06-30 14:10:16 -0700126 @Override
Dianne Hackborn75804932009-10-20 20:15:20 -0700127 public void dispatchWallpaperCommand(String action, int x, int y,
128 int z, Bundle extras, boolean sync) {
129 if (sync) {
130 try {
131 mSession.wallpaperCommandComplete(asBinder(), null);
132 } catch (RemoteException e) {
133 }
134 }
135 }
Dianne Hackborn12d3a942012-04-27 14:16:30 -0700136
Craig Mautner5702d4d2012-06-30 14:10:16 -0700137 @Override
Craig Mautner9c795042014-10-28 19:59:59 -0700138 public void dispatchWindowShown() {
139 }
Clara Bayarri75e09792015-07-29 16:20:40 +0100140
141 @Override
Clara Bayarrifcd7e802016-03-10 12:58:18 +0000142 public void requestAppKeyboardShortcuts(IResultReceiver receiver, int deviceId) {
Clara Bayarri75e09792015-07-29 16:20:40 +0100143 }
Vladislav Kaznacheev3787de12016-12-21 10:36:35 -0800144
145 @Override
146 public void dispatchPointerCaptureChanged(boolean hasCapture) {
147 }
Dianne Hackborn4c62fc02009-08-08 20:40:27 -0700148}