• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * Copyright (c) 2014, 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.app;
18 
19 import android.app.ActivityManager;
20 import android.content.ComponentName;
21 
22 /** @hide */
23 oneway interface ITaskStackListener {
24     /** Activity was resized to be displayed in split-screen. */
25     const int FORCED_RESIZEABLE_REASON_SPLIT_SCREEN = 1;
26     /** Activity was resized to be displayed on a secondary display. */
27     const int FORCED_RESIZEABLE_REASON_SECONDARY_DISPLAY = 2;
28 
29     /** Called whenever there are changes to the state of tasks in a stack. */
onTaskStackChanged()30     void onTaskStackChanged();
31 
32     /** Called whenever an Activity is moved to the pinned stack from another stack. */
onActivityPinned(String packageName, int userId, int taskId)33     void onActivityPinned(String packageName, int userId, int taskId);
34 
35     /** Called whenever an Activity is moved from the pinned stack to another stack. */
onActivityUnpinned()36     void onActivityUnpinned();
37 
38     /**
39      * Called whenever IActivityManager.startActivity is called on an activity that is already
40      * running in the pinned stack and the activity is not actually started, but the task is either
41      * brought to the front or a new Intent is delivered to it.
42      *
43      * @param clearedTask whether or not the launch activity also cleared the task as a part of
44      * starting
45      */
onPinnedActivityRestartAttempt(boolean clearedTask)46     void onPinnedActivityRestartAttempt(boolean clearedTask);
47 
48     /**
49      * Called whenever the pinned stack is starting animating a resize.
50      */
onPinnedStackAnimationStarted()51     void onPinnedStackAnimationStarted();
52 
53     /**
54      * Called whenever the pinned stack is done animating a resize.
55      */
onPinnedStackAnimationEnded()56     void onPinnedStackAnimationEnded();
57 
58     /**
59      * Called when we launched an activity that we forced to be resizable.
60      *
61      * @param packageName Package name of the top activity in the task.
62      * @param taskId Id of the task.
63      * @param reason {@link #FORCED_RESIZEABLE_REASON_SPLIT_SCREEN} or
64       *              {@link #FORCED_RESIZEABLE_REASON_SECONDARY_DISPLAY}.
65      */
onActivityForcedResizable(String packageName, int taskId, int reason)66     void onActivityForcedResizable(String packageName, int taskId, int reason);
67 
68     /**
69      * Called when we launched an activity that dismissed the docked stack.
70      */
onActivityDismissingDockedStack()71     void onActivityDismissingDockedStack();
72 
73     /**
74      * Called when an activity was requested to be launched on a secondary display but was not
75      * allowed there.
76      */
onActivityLaunchOnSecondaryDisplayFailed()77     void onActivityLaunchOnSecondaryDisplayFailed();
78 
79     /**
80      * Called when a task is added.
81      *
82      * @param taskId id of the task.
83      * @param componentName of the activity that the task is being started with.
84     */
onTaskCreated(int taskId, in ComponentName componentName)85     void onTaskCreated(int taskId, in ComponentName componentName);
86 
87     /**
88      * Called when a task is removed.
89      *
90      * @param taskId id of the task.
91     */
onTaskRemoved(int taskId)92     void onTaskRemoved(int taskId);
93 
94     /**
95      * Called when a task is moved to the front of its stack.
96      *
97      * @param taskId id of the task.
98     */
onTaskMovedToFront(int taskId)99     void onTaskMovedToFront(int taskId);
100 
101     /**
102      * Called when a task’s description is changed due to an activity calling
103      * ActivityManagerService.setTaskDescription
104      *
105      * @param taskId id of the task.
106      * @param td the new TaskDescription.
107     */
onTaskDescriptionChanged(int taskId, in ActivityManager.TaskDescription td)108     void onTaskDescriptionChanged(int taskId, in ActivityManager.TaskDescription td);
109 
110     /**
111      * Called when a activity’s orientation is changed due to it calling
112      * ActivityManagerService.setRequestedOrientation
113      *
114      * @param taskId id of the task that the activity is in.
115      * @param requestedOrientation the new requested orientation.
116     */
onActivityRequestedOrientationChanged(int taskId, int requestedOrientation)117     void onActivityRequestedOrientationChanged(int taskId, int requestedOrientation);
118 
119     /**
120      * Called when the task is about to be finished but before its surfaces are
121      * removed from the window manager. This allows interested parties to
122      * perform relevant animations before the window disappears.
123      */
onTaskRemovalStarted(int taskId)124     void onTaskRemovalStarted(int taskId);
125 
126     /**
127      * Called when the task has been put in a locked state because one or more of the
128      * activities inside it belong to a managed profile user, and that user has just
129      * been locked.
130      */
onTaskProfileLocked(int taskId, int userId)131     void onTaskProfileLocked(int taskId, int userId);
132 
133     /**
134      * Called when a task snapshot got updated.
135      */
onTaskSnapshotChanged(int taskId, in ActivityManager.TaskSnapshot snapshot)136     void onTaskSnapshotChanged(int taskId, in ActivityManager.TaskSnapshot snapshot);
137 }
138