OSDN Git Service

Report move to display for activities that handle config changes
[android-x86/frameworks-base.git] / core / java / com / android / internal / view / BaseIWindow.java
1 /*
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
17 package com.android.internal.view;
18
19 import android.content.res.Configuration;
20 import android.graphics.Rect;
21 import android.hardware.input.InputManager;
22 import android.os.Bundle;
23 import android.os.ParcelFileDescriptor;
24 import android.os.RemoteException;
25 import android.view.DragEvent;
26 import android.view.IWindow;
27 import android.view.IWindowSession;
28 import android.view.PointerIcon;
29
30 import com.android.internal.os.IResultReceiver;
31
32 public class BaseIWindow extends IWindow.Stub {
33     private IWindowSession mSession;
34     public int mSeq;
35
36     public void setSession(IWindowSession session) {
37         mSession = session;
38     }
39
40     @Override
41     public void resized(Rect frame, Rect overscanInsets, Rect contentInsets, Rect visibleInsets,
42             Rect stableInsets, Rect outsets, boolean reportDraw, Configuration newConfig,
43             Rect backDropFrame, boolean forceLayout, boolean alwaysConsumeNavBar, int displayId) {
44         if (reportDraw) {
45             try {
46                 mSession.finishDrawing(this);
47             } catch (RemoteException e) {
48             }
49         }
50     }
51
52     @Override
53     public void moved(int newX, int newY) {
54     }
55
56     @Override
57     public void dispatchAppVisibility(boolean visible) {
58     }
59
60     @Override
61     public void dispatchGetNewSurface() {
62     }
63
64     @Override
65     public void windowFocusChanged(boolean hasFocus, boolean touchEnabled) {
66     }
67
68     @Override
69     public void executeCommand(String command, String parameters, ParcelFileDescriptor out) {
70     }
71
72     @Override
73     public void closeSystemDialogs(String reason) {
74     }
75
76     @Override
77     public void dispatchWallpaperOffsets(float x, float y, float xStep, float yStep, boolean sync) {
78         if (sync) {
79             try {
80                 mSession.wallpaperOffsetsComplete(asBinder());
81             } catch (RemoteException e) {
82             }
83         }
84     }
85
86     @Override
87     public void dispatchDragEvent(DragEvent event) {
88         if (event.getAction() == DragEvent.ACTION_DROP) {
89             try {
90                 mSession.reportDropResult(this, false);
91             } catch (RemoteException e) {
92             }
93         }
94     }
95
96     @Override
97     public void updatePointerIcon(float x, float y) {
98         InputManager.getInstance().setPointerIconType(PointerIcon.TYPE_NOT_SPECIFIED);
99     }
100
101     @Override
102     public void dispatchSystemUiVisibilityChanged(int seq, int globalUi,
103             int localValue, int localChanges) {
104         mSeq = seq;
105     }
106
107     @Override
108     public void dispatchWallpaperCommand(String action, int x, int y,
109             int z, Bundle extras, boolean sync) {
110         if (sync) {
111             try {
112                 mSession.wallpaperCommandComplete(asBinder(), null);
113             } catch (RemoteException e) {
114             }
115         }
116     }
117
118     @Override
119     public void dispatchWindowShown() {
120     }
121
122     @Override
123     public void requestAppKeyboardShortcuts(IResultReceiver receiver, int deviceId) {
124     }
125
126     @Override
127     public void dispatchPointerCaptureChanged(boolean hasCapture) {
128     }
129 }