code
stringlengths
11
173k
docstring
stringlengths
2
593k
func_name
stringlengths
2
189
language
stringclasses
1 value
repo
stringclasses
844 values
path
stringlengths
11
294
url
stringlengths
60
339
license
stringclasses
4 values
public @Nullable Collection<ProgramSelector.Identifier> getRelatedContent() { return mRelatedContent; }
Primary identifiers of related contents. Some radio technologies provide pointers to other programs that carry related content (i.e. DAB soft-links). This field is a list of pointers to other programs on the program list. Please note, that these identifiers does not have to exist on the program list - i.e. DAB tuner may provide information on FM RDS alternatives despite not supporting FM RDS. If the system has multiple tuners, another one may have it on its list.
ProgramInfo::getRelatedContent
java
Reginer/aosp-android-jar
android-32/src/android/hardware/radio/RadioManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/hardware/radio/RadioManager.java
MIT
public boolean isTuned() { return (mInfoFlags & FLAG_TUNED) != 0; }
{@code true} if the tuner is currently tuned on a valid station @return {@code true} if currently tuned, {@code false} otherwise.
ProgramInfo::isTuned
java
Reginer/aosp-android-jar
android-32/src/android/hardware/radio/RadioManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/hardware/radio/RadioManager.java
MIT
public boolean isStereo() { return (mInfoFlags & FLAG_STEREO) != 0; }
{@code true} if the received program is stereo @return {@code true} if stereo, {@code false} otherwise.
ProgramInfo::isStereo
java
Reginer/aosp-android-jar
android-32/src/android/hardware/radio/RadioManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/hardware/radio/RadioManager.java
MIT
public boolean isLive() { return (mInfoFlags & FLAG_LIVE) != 0; }
{@code true} if the program is currently playing live stream. This may result in a slightly altered reception parameters, usually targetted at reduced latency.
ProgramInfo::isLive
java
Reginer/aosp-android-jar
android-32/src/android/hardware/radio/RadioManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/hardware/radio/RadioManager.java
MIT
public boolean isMuted() { return (mInfoFlags & FLAG_MUTED) != 0; }
{@code true} if radio stream is not playing, ie. due to bad reception conditions or buffering. In this state volume knob MAY be disabled to prevent user increasing volume too much. It does NOT mean the user has muted audio.
ProgramInfo::isMuted
java
Reginer/aosp-android-jar
android-32/src/android/hardware/radio/RadioManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/hardware/radio/RadioManager.java
MIT
public boolean isTrafficProgram() { return (mInfoFlags & FLAG_TRAFFIC_PROGRAM) != 0; }
{@code true} if radio station transmits traffic information regularily.
ProgramInfo::isTrafficProgram
java
Reginer/aosp-android-jar
android-32/src/android/hardware/radio/RadioManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/hardware/radio/RadioManager.java
MIT
public boolean isTrafficAnnouncementActive() { return (mInfoFlags & FLAG_TRAFFIC_ANNOUNCEMENT) != 0; }
{@code true} if radio station transmits traffic information at the very moment.
ProgramInfo::isTrafficAnnouncementActive
java
Reginer/aosp-android-jar
android-32/src/android/hardware/radio/RadioManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/hardware/radio/RadioManager.java
MIT
public int getSignalStrength() { return mSignalQuality; }
Signal quality (as opposed to the name) indication from 0 (no signal) to 100 (excellent) @return the signal quality indication.
ProgramInfo::getSignalStrength
java
Reginer/aosp-android-jar
android-32/src/android/hardware/radio/RadioManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/hardware/radio/RadioManager.java
MIT
public RadioMetadata getMetadata() { return mMetadata; }
Metadata currently received from this station. null if no metadata have been received @return current meta data received from this program.
ProgramInfo::getMetadata
java
Reginer/aosp-android-jar
android-32/src/android/hardware/radio/RadioManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/hardware/radio/RadioManager.java
MIT
public @NonNull Map<String, String> getVendorInfo() { return mVendorInfo; }
A map of vendor-specific opaque strings, passed from HAL without changes. Format of these strings can vary across vendors. It may be used for extra features, that's not supported by a platform, for example: paid-service=true; bitrate=320kbps. Keys must be prefixed with unique vendor Java-style namespace, eg. 'com.somecompany.parameter1'.
ProgramInfo::getVendorInfo
java
Reginer/aosp-android-jar
android-32/src/android/hardware/radio/RadioManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/hardware/radio/RadioManager.java
MIT
public RadioManager(@NonNull Context context) throws ServiceNotFoundException { mContext = context; mService = IRadioService.Stub.asInterface( ServiceManager.getServiceOrThrow(Context.RADIO_SERVICE)); }
@hide
ProgramInfo::RadioManager
java
Reginer/aosp-android-jar
android-32/src/android/hardware/radio/RadioManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/hardware/radio/RadioManager.java
MIT
public static void setLoggingLevel() { final int defaultLevel = getDefaultLoggingLevel(); final int level = DeviceConfig.getInt(DeviceConfig.NAMESPACE_CONTENT_CAPTURE, DEVICE_CONFIG_PROPERTY_LOGGING_LEVEL, defaultLevel); setLoggingLevel(level); }
Sets the value of the static logging level constants based on device config.
getSimpleName::setLoggingLevel
java
Reginer/aosp-android-jar
android-33/src/android/view/contentcapture/ContentCaptureHelper.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/contentcapture/ContentCaptureHelper.java
MIT
public static void setLoggingLevel(@LoggingLevel int level) { Log.i(TAG, "Setting logging level to " + getLoggingLevelAsString(level)); sVerbose = sDebug = false; switch (level) { case LOGGING_LEVEL_VERBOSE: sVerbose = true; // fall through case LOGGING_LEVEL_DEBUG: sDebug = true; return; case LOGGING_LEVEL_OFF: // You log nothing, Jon Snow! return; default: Log.w(TAG, "setLoggingLevel(): invalud level: " + level); } }
Sets the value of the static logging level constants based the given level.
getSimpleName::setLoggingLevel
java
Reginer/aosp-android-jar
android-33/src/android/view/contentcapture/ContentCaptureHelper.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/contentcapture/ContentCaptureHelper.java
MIT
public static String getLoggingLevelAsString(@LoggingLevel int level) { switch (level) { case LOGGING_LEVEL_OFF: return "OFF"; case LOGGING_LEVEL_DEBUG: return "DEBUG"; case LOGGING_LEVEL_VERBOSE: return "VERBOSE"; default: return "UNKNOWN-" + level; } }
Gets a user-friendly value for a content capture logging level.
getSimpleName::getLoggingLevelAsString
java
Reginer/aosp-android-jar
android-33/src/android/view/contentcapture/ContentCaptureHelper.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/contentcapture/ContentCaptureHelper.java
MIT
void migrateToNewSurfaceControl(SurfaceControl.Transaction t) { t.remove(mSurfaceControl); // Clear the last position so the new SurfaceControl will get correct position mLastSurfacePosition.set(0, 0); final SurfaceControl.Builder b = mWmService.makeSurfaceBuilder(null) .setContainerLayer() .setName(getName()); setInitialSurfaceControlProperties(b); // If parent is null, the layer should be placed offscreen so reparent to null. Otherwise, // set to the available parent. t.reparent(mSurfaceControl, mParent == null ? null : mParent.getSurfaceControl()); if (mLastRelativeToLayer != null) { t.setRelativeLayer(mSurfaceControl, mLastRelativeToLayer, mLastLayer); } else { t.setLayer(mSurfaceControl, mLastLayer); } for (int i = 0; i < mChildren.size(); i++) { SurfaceControl sc = mChildren.get(i).getSurfaceControl(); if (sc != null) { t.reparent(sc, mSurfaceControl); } } scheduleAnimation(); }
Create a new SurfaceControl for this WindowContainer and migrate all properties to the new SurfaceControl. Properties include: 1. Children 2. Position 3. Z order Remove the old SurfaceControl since it's no longer needed. This is used to revoke control of the SurfaceControl from a client process that was previously organizing this WindowContainer.
WindowContainer::migrateToNewSurfaceControl
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
void onSurfaceShown(Transaction t) { // do nothing }
Called when the surface is shown for the first time.
WindowContainer::onSurfaceShown
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
int getPrefixOrderIndex() { if (mParent == null) { return 0; } return mParent.getPrefixOrderIndex(this); }
@return The index of this element in the hierarchy tree in prefix order.
WindowContainer::getPrefixOrderIndex
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
boolean hasChild(E child) { for (int i = mChildren.size() - 1; i >= 0; --i) { final E current = mChildren.get(i); if (current == child || current.hasChild(child)) { return true; } } return false; }
Removes this window container and its children taking care not to remove them during a critical stage in the system. For example, some containers will not be removed during animation if this method is called. // TODO: figure-out implementation that works best for this. // E.g. when do we remove from parent list? maybe not... void removeIfPossible() { for (int i = mChildren.size() - 1; i >= 0; --i) { final WindowContainer wc = mChildren.get(i); wc.removeIfPossible(); } } /** Returns true if this window container has the input child.
WindowContainer::hasChild
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
boolean isDescendantOf(WindowContainer ancestor) { final WindowContainer parent = getParent(); if (parent == ancestor) return true; return (parent != null) && parent.isDescendantOf(ancestor); }
Removes this window container and its children taking care not to remove them during a critical stage in the system. For example, some containers will not be removed during animation if this method is called. // TODO: figure-out implementation that works best for this. // E.g. when do we remove from parent list? maybe not... void removeIfPossible() { for (int i = mChildren.size() - 1; i >= 0; --i) { final WindowContainer wc = mChildren.get(i); wc.removeIfPossible(); } } /** Returns true if this window container has the input child. boolean hasChild(E child) { for (int i = mChildren.size() - 1; i >= 0; --i) { final E current = mChildren.get(i); if (current == child || current.hasChild(child)) { return true; } } return false; } /** @return true if this window container is a descendant of the input container.
WindowContainer::isDescendantOf
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
void onChildPositionChanged(WindowContainer child) { }
Notify that a child's position has changed. Possible changes are adding or removing a child.
WindowContainer::onChildPositionChanged
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
void onDescendantOverrideConfigurationChanged() { if (mParent != null) { mParent.onDescendantOverrideConfigurationChanged(); } }
Notify that a descendant's overrideConfiguration has changed.
WindowContainer::onDescendantOverrideConfigurationChanged
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
void onDisplayChanged(DisplayContent dc) { if (mDisplayContent != null && mDisplayContent.mChangingContainers.remove(this)) { // Cancel any change transition queued-up for this container on the old display. mSurfaceFreezer.unfreeze(getPendingTransaction()); } mDisplayContent = dc; if (dc != null && dc != this) { dc.getPendingTransaction().merge(mPendingTransaction); } for (int i = mChildren.size() - 1; i >= 0; --i) { final WindowContainer child = mChildren.get(i); child.onDisplayChanged(dc); } for (int i = mListeners.size() - 1; i >= 0; --i) { mListeners.get(i).onDisplayChanged(dc); } }
Notify that the display this container is on has changed. This could be either this container is moved to a new display, or some configurations on the display it is on changes. @param dc The display this container is on after changes.
WindowContainer::onDisplayChanged
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
boolean canCustomizeAppTransition() { return !WindowManagerService.sDisableCustomTaskAnimationProperty; }
@return {@code true} when an application can override an app transition animation on this container.
WindowContainer::canCustomizeAppTransition
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
final boolean isAnimating(int flags, int typesToCheck) { return getAnimatingContainer(flags, typesToCheck) != null; }
@return {@code true} when this container or its related containers are running an animation, {@code false} otherwise. By default this predicate only checks if this container itself is actually running an animation, but you can extend the check target over its relatives, or relax the condition so that this can return {@code true} if an animation starts soon by giving a combination of {@link AnimationFlags}. Note that you can give a combination of bitmask flags to specify targets and condition for checking animating status. e.g. {@code isAnimating(TRANSITION | PARENT)} returns {@code true} if either this container itself or one of its parents is running an animation or waiting for an app transition. Note that TRANSITION propagates to parents and children as well. @param flags The combination of bitmask flags to specify targets and condition for checking animating status. @param typesToCheck The combination of bitmask {@link AnimationType} to compare when determining if animating. @see AnimationFlags#TRANSITION @see AnimationFlags#PARENTS @see AnimationFlags#CHILDREN
WindowContainer::isAnimating
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
boolean isWaitingForTransitionStart() { return false; }
@return {@code true} when the container is waiting the app transition start, {@code false} otherwise.
WindowContainer::isWaitingForTransitionStart
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
boolean isAppTransitioning() { return getActivity(app -> app.isAnimating(PARENTS | TRANSITION)) != null; }
@return {@code true} if in this subtree of the hierarchy we have an {@code ActivityRecord#isAnimating(TRANSITION)}, {@code false} otherwise.
WindowContainer::isAppTransitioning
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
final boolean isAnimating() { return isAnimating(0 /* self only */); }
@return Whether our own container running an animation at the moment.
WindowContainer::isAnimating
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
boolean isChangingAppTransition() { return mDisplayContent != null && mDisplayContent.mChangingContainers.contains(this); }
@return {@code true} if the container is in changing app transition.
WindowContainer::isChangingAppTransition
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
boolean hasContentToDisplay() { for (int i = mChildren.size() - 1; i >= 0; --i) { final WindowContainer wc = mChildren.get(i); if (wc.hasContentToDisplay()) { return true; } } return false; }
Returns true if the container or one of its children as some content it can display or wants to display (e.g. app views or saved surface). NOTE: While this method will return true if the there is some content to display, it doesn't mean the container is visible. Use {@link #isVisible()} to determine if the container is visible.
WindowContainer::hasContentToDisplay
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
boolean isVisible() { // TODO: Will this be more correct if it checks the visibility of its parents? // It depends...For example, Tasks and Stacks are only visible if there children are visible // but, WindowState are not visible if there parent are not visible. Maybe have the // container specify which direction to traverse for visibility? for (int i = mChildren.size() - 1; i >= 0; --i) { final WindowContainer wc = mChildren.get(i); if (wc.isVisible()) { return true; } } return false; }
Returns true if the container or one of its children is considered visible from the WindowManager perspective which usually means valid surface and some other internal state are true. NOTE: While this method will return true if the surface is visible, it doesn't mean the client has actually displayed any content. Use {@link #hasContentToDisplay()} to determine if the container has any content to display.
WindowContainer::isVisible
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
boolean isVisibleRequested() { for (int i = mChildren.size() - 1; i >= 0; --i) { final WindowContainer child = mChildren.get(i); if (child.isVisibleRequested()) { return true; } } return false; }
Is this window's surface needed? This is almost like isVisible, except when participating in a transition, this will reflect the final visibility while isVisible won't change until the transition is finished.
WindowContainer::isVisibleRequested
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
void onChildVisibilityRequested(boolean visible) { // If we are losing visibility, then a snapshot isn't necessary and we are no-longer // part of a change transition. if (!visible) { mSurfaceFreezer.unfreeze(getSyncTransaction()); if (mDisplayContent != null) { mDisplayContent.mChangingContainers.remove(this); } } WindowContainer parent = getParent(); if (parent != null) { parent.onChildVisibilityRequested(visible); } }
Called when the visibility of a child is asked to change. This is before visibility actually changes (eg. a transition animation might play out first).
WindowContainer::onChildVisibilityRequested
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
boolean isFocusable() { final WindowContainer parent = getParent(); return (parent == null || parent.isFocusable()) && mIsFocusable; }
Returns {@code true} if this container is focusable. Generally, if a parent is not focusable, this will not be focusable either.
WindowContainer::isFocusable
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
boolean setFocusable(boolean focusable) { if (mIsFocusable == focusable) { return false; } mIsFocusable = focusable; return true; }
Returns {@code true} if this container is focusable. Generally, if a parent is not focusable, this will not be focusable either. boolean isFocusable() { final WindowContainer parent = getParent(); return (parent == null || parent.isFocusable()) && mIsFocusable; } /** Set whether this container or its children can be focusable
WindowContainer::setFocusable
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
boolean isOnTop() { final WindowContainer parent = getParent(); return parent != null && parent.getTopChild() == this && parent.isOnTop(); }
@return Whether this child is on top of the window hierarchy.
WindowContainer::isOnTop
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
E getTopChild() { return mChildren.peekLast(); }
@return Whether this child is on top of the window hierarchy. boolean isOnTop() { final WindowContainer parent = getParent(); return parent != null && parent.getTopChild() == this && parent.isOnTop(); } /** Returns the top child container.
WindowContainer::getTopChild
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
boolean handleCompleteDeferredRemoval() { boolean stillDeferringRemoval = false; for (int i = mChildren.size() - 1; i >= 0; --i) { final WindowContainer wc = mChildren.get(i); stillDeferringRemoval |= wc.handleCompleteDeferredRemoval(); if (!hasChild()) { // All child containers of current level could be removed from a removal of // descendant. E.g. if a display is pending to be removed because it contains an // activity with {@link ActivityRecord#mIsExiting} is true, the display may be // removed when completing the removal of the last activity from // {@link ActivityRecord#handleCompleteDeferredRemoval}. return false; } } return stillDeferringRemoval; }
Removes the containers which were deferred. @return {@code true} if there is still a removal being deferred.
WindowContainer::handleCompleteDeferredRemoval
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
void checkAppWindowsReadyToShow() { for (int i = mChildren.size() - 1; i >= 0; --i) { final WindowContainer wc = mChildren.get(i); wc.checkAppWindowsReadyToShow(); } }
Removes the containers which were deferred. @return {@code true} if there is still a removal being deferred. boolean handleCompleteDeferredRemoval() { boolean stillDeferringRemoval = false; for (int i = mChildren.size() - 1; i >= 0; --i) { final WindowContainer wc = mChildren.get(i); stillDeferringRemoval |= wc.handleCompleteDeferredRemoval(); if (!hasChild()) { // All child containers of current level could be removed from a removal of // descendant. E.g. if a display is pending to be removed because it contains an // activity with {@link ActivityRecord#mIsExiting} is true, the display may be // removed when completing the removal of the last activity from // {@link ActivityRecord#handleCompleteDeferredRemoval}. return false; } } return stillDeferringRemoval; } /** Checks if all windows in an app are all drawn and shows them if needed.
WindowContainer::checkAppWindowsReadyToShow
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
boolean onDescendantOrientationChanged(@Nullable WindowContainer requestingContainer) { final WindowContainer parent = getParent(); if (parent == null) { return false; } return parent.onDescendantOrientationChanged(requestingContainer); }
Called when this container or one of its descendants changed its requested orientation, and wants this container to handle it or pass it to its parent. @param requestingContainer the container which orientation request has changed @return {@code true} if handled; {@code false} otherwise.
WindowContainer::onDescendantOrientationChanged
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
boolean handlesOrientationChangeFromDescendant() { final WindowContainer parent = getParent(); return parent != null && parent.handlesOrientationChangeFromDescendant(); }
Check if this container or its parent will handle orientation changes from descendants. It's different from the return value of {@link #onDescendantOrientationChanged(WindowContainer)} in the sense that the return value of this method tells if this container or its parent will handle the request eventually, while the return value of the other method is if it handled the request synchronously. @return {@code true} if it handles or will handle orientation change in the future; {@code false} if it won't handle the change at anytime.
WindowContainer::handlesOrientationChangeFromDescendant
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
int getRequestedConfigurationOrientation() { return getRequestedConfigurationOrientation(false /* forDisplay */); }
Gets the configuration orientation by the requested screen orientation ({@link ActivityInfo.ScreenOrientation}) of this activity. @return orientation in ({@link Configuration#ORIENTATION_LANDSCAPE}, {@link Configuration#ORIENTATION_PORTRAIT}, {@link Configuration#ORIENTATION_UNDEFINED}).
WindowContainer::getRequestedConfigurationOrientation
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
int getRequestedConfigurationOrientation(boolean forDisplay) { int requestedOrientation = mOrientation; final RootDisplayArea root = getRootDisplayArea(); if (forDisplay && root != null && root.isOrientationDifferentFromDisplay()) { // Reverse the requested orientation if the orientation of its root is different from // the display, so that when the display rotates to the reversed orientation, the // requested app will be in the requested orientation. // For example, if the display is 1200x900 (landscape), and the DAG is 600x900 // (portrait). // When an app below the DAG is requesting landscape, it should actually request the // display to be portrait, so that the DAG and the app will be in landscape. requestedOrientation = reverseOrientation(mOrientation); } if (requestedOrientation == ActivityInfo.SCREEN_ORIENTATION_NOSENSOR) { // NOSENSOR means the display's "natural" orientation, so return that. if (mDisplayContent != null) { return mDisplayContent.getNaturalOrientation(); } } else if (requestedOrientation == ActivityInfo.SCREEN_ORIENTATION_LOCKED) { // LOCKED means the activity's orientation remains unchanged, so return existing value. return getConfiguration().orientation; } else if (isFixedOrientationLandscape(requestedOrientation)) { return ORIENTATION_LANDSCAPE; } else if (isFixedOrientationPortrait(requestedOrientation)) { return ORIENTATION_PORTRAIT; } return ORIENTATION_UNDEFINED; }
Gets the configuration orientation by the requested screen orientation ({@link ActivityInfo.ScreenOrientation}) of this activity. @param forDisplay whether it is the requested config orientation for display. If {@code true}, we may reverse the requested orientation if the root is different from the display, so that when the display rotates to the reversed orientation, the requested app will be in the requested orientation. @return orientation in ({@link Configuration#ORIENTATION_LANDSCAPE}, {@link Configuration#ORIENTATION_PORTRAIT}, {@link Configuration#ORIENTATION_UNDEFINED}).
WindowContainer::getRequestedConfigurationOrientation
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
void setOrientation(int orientation) { setOrientation(orientation, null /* requestingContainer */); }
Calls {@link #setOrientation(int, WindowContainer)} with {@code null} to the last 2 parameters. @param orientation the specified orientation.
WindowContainer::setOrientation
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
void setOrientation(int orientation, @Nullable WindowContainer requestingContainer) { if (mOrientation == orientation) { return; } mOrientation = orientation; final WindowContainer parent = getParent(); if (parent != null) { if (getConfiguration().orientation != getRequestedConfigurationOrientation() // Update configuration directly only if the change won't be dispatched from // ancestor. This prevents from computing intermediate configuration when the // parent also needs to be updated from the ancestor. E.g. the app requests // portrait but the task is still in landscape. While updating from display, // the task can be updated to portrait first so the configuration can be // computed in a consistent environment. && (inMultiWindowMode() || !handlesOrientationChangeFromDescendant())) { // Resolve the requested orientation. onConfigurationChanged(parent.getConfiguration()); } onDescendantOrientationChanged(requestingContainer); } }
Sets the specified orientation of this container. It percolates this change upward along the hierarchy to let each level of the hierarchy a chance to respond to it. @param orientation the specified orientation. Needs to be one of {@link android.content.pm.ActivityInfo.ScreenOrientation}. @param requestingContainer the container which orientation request has changed. Mostly used to ensure it gets correct configuration.
WindowContainer::setOrientation
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
int getOrientation(int candidate) { mLastOrientationSource = null; if (!fillsParent()) { // Ignore containers that don't completely fill their parents. return SCREEN_ORIENTATION_UNSET; } // The container fills its parent so we can use it orientation if it has one // specified; otherwise we prefer to use the orientation of its topmost child that has one // specified and fall back on this container's unset or unspecified value as a candidate // if none of the children have a better candidate for the orientation. if (mOrientation != SCREEN_ORIENTATION_UNSET && mOrientation != SCREEN_ORIENTATION_UNSPECIFIED) { mLastOrientationSource = this; return mOrientation; } for (int i = mChildren.size() - 1; i >= 0; --i) { final WindowContainer wc = mChildren.get(i); // TODO: Maybe mOrientation should default to SCREEN_ORIENTATION_UNSET vs. // SCREEN_ORIENTATION_UNSPECIFIED? final int orientation = wc.getOrientation(candidate == SCREEN_ORIENTATION_BEHIND ? SCREEN_ORIENTATION_BEHIND : SCREEN_ORIENTATION_UNSET); if (orientation == SCREEN_ORIENTATION_BEHIND) { // container wants us to use the orientation of the container behind it. See if we // can find one. Else return SCREEN_ORIENTATION_BEHIND so the caller can choose to // look behind this container. candidate = orientation; mLastOrientationSource = wc; continue; } if (orientation == SCREEN_ORIENTATION_UNSET) { continue; } if (wc.fillsParent() || orientation != SCREEN_ORIENTATION_UNSPECIFIED) { // Use the orientation if the container fills its parent or requested an explicit // orientation that isn't SCREEN_ORIENTATION_UNSPECIFIED. ProtoLog.v(WM_DEBUG_ORIENTATION, "%s is requesting orientation %d (%s)", wc.toString(), orientation, ActivityInfo.screenOrientationToString(orientation)); mLastOrientationSource = wc; return orientation; } } return candidate; }
Returns the specified orientation for this window container or one of its children is there is one set, or {@link android.content.pm.ActivityInfo#SCREEN_ORIENTATION_UNSET} if no specification is set. NOTE: {@link android.content.pm.ActivityInfo#SCREEN_ORIENTATION_UNSPECIFIED} is a specification... @param candidate The current orientation candidate that will be returned if we don't find a better match. @return The orientation as specified by this branch or the window hierarchy.
WindowContainer::getOrientation
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
boolean fillsParent() { return false; }
Returns true if this container is opaque and fills all the space made available by its parent container. NOTE: It is possible for this container to occupy more space than the parent has (or less), this is just a signal from the client to window manager stating its intent, but not what it actually does.
WindowContainer::fillsParent
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
boolean forAllWindows(ToBooleanFunction<WindowState> callback, boolean traverseTopToBottom) { if (traverseTopToBottom) { for (int i = mChildren.size() - 1; i >= 0; --i) { if (mChildren.get(i).forAllWindows(callback, traverseTopToBottom)) { return true; } } } else { final int count = mChildren.size(); for (int i = 0; i < count; i++) { if (mChildren.get(i).forAllWindows(callback, traverseTopToBottom)) { return true; } } } return false; }
For all windows at or below this container call the callback. @param callback Calls the {@link ToBooleanFunction#apply} method for each window found and stops the search if {@link ToBooleanFunction#apply} returns true. @param traverseTopToBottom If true traverses the hierarchy from top-to-bottom in terms of z-order, else from bottom-to-top. @return True if the search ended before we reached the end of the hierarchy due to {@link ToBooleanFunction#apply} returning true.
WindowContainer::forAllWindows
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
final boolean forAllActivities(Function<ActivityRecord, Boolean> callback, WindowContainer boundary, boolean includeBoundary, boolean traverseTopToBottom) { return forAllActivities( callback, boundary, includeBoundary, traverseTopToBottom, new boolean[1]); }
Process all activities in this branch of the tree. @param callback Called for each activity found. @param boundary We don't return activities via {@param callback} until we get to this node in the tree. @param includeBoundary If the boundary from be processed to return activities. @param traverseTopToBottom direction to traverse the tree. @return {@code true} if we ended the search before reaching the end of the tree.
WindowContainer::forAllActivities
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
boolean hasActivity() { for (int i = mChildren.size() - 1; i >= 0; --i) { if (mChildren.get(i).hasActivity()) { return true; } } return false; }
Process all activities in this branch of the tree. @param callback Called for each activity found. @param boundary We don't return activities via {@param callback} until we get to this node in the tree. @param includeBoundary If the boundary from be processed to return activities. @param traverseTopToBottom direction to traverse the tree. @return {@code true} if we ended the search before reaching the end of the tree. final boolean forAllActivities(Function<ActivityRecord, Boolean> callback, WindowContainer boundary, boolean includeBoundary, boolean traverseTopToBottom) { return forAllActivities( callback, boundary, includeBoundary, traverseTopToBottom, new boolean[1]); } private boolean forAllActivities(Function<ActivityRecord, Boolean> callback, WindowContainer boundary, boolean includeBoundary, boolean traverseTopToBottom, boolean[] boundaryFound) { if (traverseTopToBottom) { for (int i = mChildren.size() - 1; i >= 0; --i) { if (processForAllActivitiesWithBoundary(callback, boundary, includeBoundary, traverseTopToBottom, boundaryFound, mChildren.get(i))) { return true; } } } else { final int count = mChildren.size(); for (int i = 0; i < count; i++) { if (processForAllActivitiesWithBoundary(callback, boundary, includeBoundary, traverseTopToBottom, boundaryFound, mChildren.get(i))) { return true; } } } return false; } private boolean processForAllActivitiesWithBoundary(Function<ActivityRecord, Boolean> callback, WindowContainer boundary, boolean includeBoundary, boolean traverseTopToBottom, boolean[] boundaryFound, WindowContainer wc) { if (wc == boundary) { boundaryFound[0] = true; if (!includeBoundary) return false; } if (boundaryFound[0]) { return wc.forAllActivities(callback, traverseTopToBottom); } return wc.forAllActivities( callback, boundary, includeBoundary, traverseTopToBottom, boundaryFound); } /** @return {@code true} if this node or any of its children contains an activity.
WindowContainer::hasActivity
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
final ActivityRecord getActivity(Predicate<ActivityRecord> callback, WindowContainer boundary, boolean includeBoundary, boolean traverseTopToBottom) { return getActivity( callback, boundary, includeBoundary, traverseTopToBottom, new boolean[1]); }
Gets an activity in a branch of the tree. @param callback called to test if this is the activity that should be returned. @param boundary We don't return activities via {@param callback} until we get to this node in the tree. @param includeBoundary If the boundary from be processed to return activities. @param traverseTopToBottom direction to traverse the tree. @return The activity if found or null.
WindowContainer::getActivity
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
boolean forAllTasks(Function<Task, Boolean> callback) { for (int i = mChildren.size() - 1; i >= 0; --i) { if (mChildren.get(i).forAllTasks(callback)) { return true; } } return false; }
For all tasks at or below this container call the callback. @param callback Calls the {@link ToBooleanFunction#apply} method for each task found and stops the search if {@link ToBooleanFunction#apply} returns {@code true}.
WindowContainer::forAllTasks
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
boolean forAllRootTasks(Function<Task, Boolean> callback) { return forAllRootTasks(callback, true /* traverseTopToBottom */); }
For all root tasks at or below this container call the callback. @param callback Calls the {@link ToBooleanFunction#apply} method for each root task found and stops the search if {@link ToBooleanFunction#apply} returns {@code true}.
WindowContainer::forAllRootTasks
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
void forAllTasks(Consumer<Task> callback) { forAllTasks(callback, true /*traverseTopToBottom*/); }
For all tasks at or below this container call the callback. @param callback Callback to be called for every task.
WindowContainer::forAllTasks
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
void forAllRootTasks(Consumer<Task> callback) { forAllRootTasks(callback, true /* traverseTopToBottom */); }
For all root tasks at or below this container call the callback. @param callback Callback to be called for every root task.
WindowContainer::forAllRootTasks
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
final Task getTask(Predicate<Task> callback, WindowContainer boundary, boolean includeBoundary, boolean traverseTopToBottom) { return getTask(callback, boundary, includeBoundary, traverseTopToBottom, new boolean[1]); }
Gets an task in a branch of the tree. @param callback called to test if this is the task that should be returned. @param boundary We don't return tasks via {@param callback} until we get to this node in the tree. @param includeBoundary If the boundary from be processed to return tasks. @param traverseTopToBottom direction to traverse the tree. @return The task if found or null.
WindowContainer::getTask
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
boolean forAllTaskDisplayAreas(Function<TaskDisplayArea, Boolean> callback, boolean traverseTopToBottom) { int childCount = mChildren.size(); int i = traverseTopToBottom ? childCount - 1 : 0; while (i >= 0 && i < childCount) { if (mChildren.get(i).forAllTaskDisplayAreas(callback, traverseTopToBottom)) { return true; } i += traverseTopToBottom ? -1 : 1; } return false; }
For all {@link TaskDisplayArea} at or below this container call the callback. @param callback Applies on each {@link TaskDisplayArea} found and stops the search if it returns {@code true}. @param traverseTopToBottom If {@code true}, traverses the hierarchy from top-to-bottom in terms of z-order, else from bottom-to-top. @return {@code true} if the search ended before we reached the end of the hierarchy due to callback returning {@code true}.
WindowContainer::forAllTaskDisplayAreas
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
boolean forAllTaskDisplayAreas(Function<TaskDisplayArea, Boolean> callback) { return forAllTaskDisplayAreas(callback, true /* traverseTopToBottom */); }
For all {@link TaskDisplayArea} at or below this container call the callback. Traverses from top to bottom in terms of z-order. @param callback Applies on each {@link TaskDisplayArea} found and stops the search if it returns {@code true}. @return {@code true} if the search ended before we reached the end of the hierarchy due to callback returning {@code true}.
WindowContainer::forAllTaskDisplayAreas
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
void forAllTaskDisplayAreas(Consumer<TaskDisplayArea> callback, boolean traverseTopToBottom) { int childCount = mChildren.size(); int i = traverseTopToBottom ? childCount - 1 : 0; while (i >= 0 && i < childCount) { mChildren.get(i).forAllTaskDisplayAreas(callback, traverseTopToBottom); i += traverseTopToBottom ? -1 : 1; } }
For all {@link TaskDisplayArea} at or below this container call the callback. @param callback Applies on each {@link TaskDisplayArea} found. @param traverseTopToBottom If {@code true}, traverses the hierarchy from top-to-bottom in terms of z-order, else from bottom-to-top.
WindowContainer::forAllTaskDisplayAreas
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
void forAllTaskDisplayAreas(Consumer<TaskDisplayArea> callback) { forAllTaskDisplayAreas(callback, true /* traverseTopToBottom */); }
For all {@link TaskDisplayArea} at or below this container call the callback. Traverses from top to bottom in terms of z-order. @param callback Applies on each {@link TaskDisplayArea} found.
WindowContainer::forAllTaskDisplayAreas
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
SurfaceControl.Builder makeChildSurface(WindowContainer child) { final WindowContainer p = getParent(); // Give the parent a chance to set properties. In hierarchy v1 we rely // on this to set full-screen dimensions on all our Surface-less Layers. return p.makeChildSurface(child) .setParent(mSurfaceControl); }
@param child The WindowContainer this child surface is for, or null if the Surface is not assosciated with a WindowContainer (e.g. a surface used for Dimming).
WindowContainer::makeChildSurface
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
boolean shouldMagnify() { if (mSurfaceControl == null) { return false; } for (int i = 0; i < mChildren.size(); i++) { if (!mChildren.get(i).shouldMagnify()) { return false; } } return true; }
@return Whether this WindowContainer should be magnified by the accessibility magnifier.
WindowContainer::shouldMagnify
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
long getProtoFieldId() { return WINDOW_CONTAINER; }
@return a proto field id to identify where to add the derived class to the generic window container proto.
WindowContainer::getProtoFieldId
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
boolean hasCommittedReparentToAnimationLeash() { return mCommittedReparentToAnimationLeash; }
@return true if the reparent to animation leash transaction has been committed, false otherwise.
ForAllWindowsConsumerWrapper::hasCommittedReparentToAnimationLeash
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
void scheduleAnimation() { if (mParent != null) { mParent.scheduleAnimation(); } }
Trigger a call to prepareSurfaces from the animation thread, such that pending transactions will be applied.
ForAllWindowsConsumerWrapper::scheduleAnimation
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
public Transaction getSyncTransaction() { if (mSyncState != SYNC_STATE_NONE) { return mSyncTransaction; } return getPendingTransaction(); }
Use this method instead of {@link #getPendingTransaction()} if the Transaction should be synchronized with the client. @return {@link #mBLASTSyncTransaction} if available. Otherwise, returns {@link #getPendingTransaction()}
ForAllWindowsConsumerWrapper::getSyncTransaction
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
void startAnimation(Transaction t, AnimationAdapter anim, boolean hidden, @AnimationType int type, @Nullable OnAnimationFinishedCallback animationFinishedCallback) { if (DEBUG_ANIM) { Slog.v(TAG, "Starting animation on " + this + ": type=" + type + ", anim=" + anim); } // TODO: This should use isVisible() but because isVisible has a really weird meaning at // the moment this doesn't work for all animatable window containers. mSurfaceAnimator.startAnimation(t, anim, hidden, type, animationFinishedCallback, mSurfaceFreezer); }
Starts an animation on the container. @param anim The animation to run. @param hidden Whether our container is currently hidden. TODO This should use isVisible at some point but the meaning is too weird to work for all containers. @param type The type of animation defined as {@link AnimationType}. @param animationFinishedCallback The callback being triggered when the animation finishes.
ForAllWindowsConsumerWrapper::startAnimation
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
SurfaceControl getAppAnimationLayer(@AnimationLayer int animationLayer) { final WindowContainer parent = getParent(); if (parent != null) { return parent.getAppAnimationLayer(animationLayer); } return null; }
@return The layer on which all app animations are happening.
ForAllWindowsConsumerWrapper::getAppAnimationLayer
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
void getAnimationPosition(Point outPosition) { getRelativePosition(outPosition); }
@return The layer on which all app animations are happening. SurfaceControl getAppAnimationLayer(@AnimationLayer int animationLayer) { final WindowContainer parent = getParent(); if (parent != null) { return parent.getAppAnimationLayer(animationLayer); } return null; } // TODO: Remove this and use #getBounds() instead once we set an app transition animation // on TaskStack. Rect getAnimationBounds(int appRootTaskClipMode) { return getBounds(); } /** Gets the position relative to parent for animation.
ForAllWindowsConsumerWrapper::getAnimationPosition
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
boolean applyAnimation(WindowManager.LayoutParams lp, @TransitionOldType int transit, boolean enter, boolean isVoiceInteraction, @Nullable ArrayList<WindowContainer> sources) { if (mWmService.mDisableTransitionAnimation) { ProtoLog.v(WM_DEBUG_APP_TRANSITIONS_ANIM, "applyAnimation: transition animation is disabled or skipped. " + "container=%s", this); cancelAnimation(); return false; } // Only apply an animation if the display isn't frozen. If it is frozen, there is no reason // to animate and it can cause strange artifacts when we unfreeze the display if some // different animation is running. try { Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "WC#applyAnimation"); if (okToAnimate()) { ProtoLog.v(WM_DEBUG_APP_TRANSITIONS_ANIM, "applyAnimation: transit=%s, enter=%b, wc=%s", AppTransition.appTransitionOldToString(transit), enter, this); applyAnimationUnchecked(lp, enter, transit, isVoiceInteraction, sources); } else { cancelAnimation(); } } finally { Trace.traceEnd(TRACE_TAG_WINDOW_MANAGER); } return isAnimating(); }
Applies the app transition animation according the given the layout properties in the window hierarchy. @param lp The layout parameters of the window. @param transit The app transition type indicates what kind of transition to be applied. @param enter Whether the app transition is entering transition or not. @param isVoiceInteraction Whether the container is participating in voice interaction or not. @param sources {@link ActivityRecord}s which causes this app transition animation. @return {@code true} when the container applied the app transition, {@code false} if the app transition is disabled or skipped. @see #getAnimationAdapter
ForAllWindowsConsumerWrapper::applyAnimation
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
Pair<AnimationAdapter, AnimationAdapter> getAnimationAdapter(WindowManager.LayoutParams lp, @TransitionOldType int transit, boolean enter, boolean isVoiceInteraction) { final Pair<AnimationAdapter, AnimationAdapter> resultAdapters; final int appRootTaskClipMode = getDisplayContent().mAppTransition.getAppRootTaskClipMode(); // Separate position and size for use in animators. final Rect screenBounds = getAnimationBounds(appRootTaskClipMode); mTmpRect.set(screenBounds); getAnimationPosition(mTmpPoint); mTmpRect.offsetTo(0, 0); final RemoteAnimationController controller = getDisplayContent().mAppTransition.getRemoteAnimationController(); final boolean isChanging = AppTransition.isChangeTransitOld(transit) && enter && isChangingAppTransition(); // Delaying animation start isn't compatible with remote animations at all. if (controller != null && !mSurfaceAnimator.isAnimationStartDelayed()) { final Rect localBounds = new Rect(mTmpRect); localBounds.offsetTo(mTmpPoint.x, mTmpPoint.y); final RemoteAnimationController.RemoteAnimationRecord adapters = controller.createRemoteAnimationRecord(this, mTmpPoint, localBounds, screenBounds, (isChanging ? mSurfaceFreezer.mFreezeBounds : null)); resultAdapters = new Pair<>(adapters.mAdapter, adapters.mThumbnailAdapter); } else if (isChanging) { final float durationScale = mWmService.getTransitionAnimationScaleLocked(); final DisplayInfo displayInfo = getDisplayContent().getDisplayInfo(); mTmpRect.offsetTo(mTmpPoint.x, mTmpPoint.y); final AnimationAdapter adapter = new LocalAnimationAdapter( new WindowChangeAnimationSpec(mSurfaceFreezer.mFreezeBounds, mTmpRect, displayInfo, durationScale, true /* isAppAnimation */, false /* isThumbnail */), getSurfaceAnimationRunner()); final AnimationAdapter thumbnailAdapter = mSurfaceFreezer.mSnapshot != null ? new LocalAnimationAdapter(new WindowChangeAnimationSpec( mSurfaceFreezer.mFreezeBounds, mTmpRect, displayInfo, durationScale, true /* isAppAnimation */, true /* isThumbnail */), getSurfaceAnimationRunner()) : null; resultAdapters = new Pair<>(adapter, thumbnailAdapter); mTransit = transit; mTransitFlags = getDisplayContent().mAppTransition.getTransitFlags(); } else { mNeedsAnimationBoundsLayer = (appRootTaskClipMode == ROOT_TASK_CLIP_AFTER_ANIM); final Animation a = loadAnimation(lp, transit, enter, isVoiceInteraction); if (a != null) { // Only apply corner radius to animation if we're not in multi window mode. // We don't want rounded corners when in pip or split screen. final float windowCornerRadius = !inMultiWindowMode() ? getDisplayContent().getWindowCornerRadius() : 0; AnimationAdapter adapter = new LocalAnimationAdapter( new WindowAnimationSpec(a, mTmpPoint, mTmpRect, getDisplayContent().mAppTransition.canSkipFirstFrame(), appRootTaskClipMode, true /* isAppAnimation */, windowCornerRadius), getSurfaceAnimationRunner()); resultAdapters = new Pair<>(adapter, null); mNeedsZBoost = a.getZAdjustment() == Animation.ZORDER_TOP || AppTransition.isClosingTransitOld(transit); mTransit = transit; mTransitFlags = getDisplayContent().mAppTransition.getTransitFlags(); } else { resultAdapters = new Pair<>(null, null); } } return resultAdapters; }
Gets the {@link AnimationAdapter} according the given window layout properties in the window hierarchy. @return The return value will always contain two elements, one for normal animations and the other for thumbnail animation, both can be {@code null}. @See com.android.server.wm.RemoteAnimationController.RemoteAnimationRecord @See LocalAnimationAdapter
ForAllWindowsConsumerWrapper::getAnimationAdapter
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
protected void onAnimationFinished(@AnimationType int type, AnimationAdapter anim) { doAnimationFinished(type, anim); mWmService.onAnimationFinished(); mNeedsZBoost = false; }
Called when an animation has finished running.
ForAllWindowsConsumerWrapper::onAnimationFinished
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
AnimationAdapter getAnimation() { return mSurfaceAnimator.getAnimation(); }
@return The currently running animation, if any, or {@code null} otherwise.
ForAllWindowsConsumerWrapper::getAnimation
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
protected boolean isSelfAnimating(int flags, int typesToCheck) { if (mSurfaceAnimator.isAnimating() && (mSurfaceAnimator.getAnimationType() & typesToCheck) > 0) { return true; } if ((flags & TRANSITION) != 0 && isWaitingForTransitionStart()) { return true; } return false; }
Internal method only to be used during {@link #getAnimatingContainer(int, int)}.DO NOT CALL FROM OUTSIDE.
ForAllWindowsConsumerWrapper::isSelfAnimating
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
void startDelayingAnimationStart() { mSurfaceAnimator.startDelayingAnimationStart(); }
@see SurfaceAnimator#startDelayingAnimationStart
ForAllWindowsConsumerWrapper::startDelayingAnimationStart
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
void endDelayingAnimationStart() { mSurfaceAnimator.endDelayingAnimationStart(); }
@see SurfaceAnimator#endDelayingAnimationStart
ForAllWindowsConsumerWrapper::endDelayingAnimationStart
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
void getAnimationFrames(Rect outFrame, Rect outInsets, Rect outStableInsets, Rect outSurfaceInsets) { final DisplayInfo displayInfo = getDisplayContent().getDisplayInfo(); outFrame.set(0, 0, displayInfo.appWidth, displayInfo.appHeight); outInsets.setEmpty(); outStableInsets.setEmpty(); outSurfaceInsets.setEmpty(); }
The {@code outFrame} retrieved by this method specifies where the animation will finish the entrance animation, as the next frame will display the window at these coordinates. In case of exit animation, this is where the animation will start, as the frame before the animation is displaying the window at these bounds. @param outFrame The bounds where entrance animation finishes or exit animation starts. @param outInsets Insets that are covered by system windows. @param outStableInsets Insets that determine the area covered by the stable system windows. @param outSurfaceInsets Positive insets between the drawing surface and window content.
ForAllWindowsConsumerWrapper::getAnimationFrames
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
Task asTask() { return null; }
The {@code outFrame} retrieved by this method specifies where the animation will finish the entrance animation, as the next frame will display the window at these coordinates. In case of exit animation, this is where the animation will start, as the frame before the animation is displaying the window at these bounds. @param outFrame The bounds where entrance animation finishes or exit animation starts. @param outInsets Insets that are covered by system windows. @param outStableInsets Insets that determine the area covered by the stable system windows. @param outSurfaceInsets Positive insets between the drawing surface and window content. void getAnimationFrames(Rect outFrame, Rect outInsets, Rect outStableInsets, Rect outSurfaceInsets) { final DisplayInfo displayInfo = getDisplayContent().getDisplayInfo(); outFrame.set(0, 0, displayInfo.appWidth, displayInfo.appHeight); outInsets.setEmpty(); outStableInsets.setEmpty(); outSurfaceInsets.setEmpty(); } void getRelativePosition(Point outPos) { final Rect dispBounds = getBounds(); outPos.set(dispBounds.left, dispBounds.top); final WindowContainer parent = getParent(); if (parent != null) { final Rect parentBounds = parent.getBounds(); outPos.offset(-parentBounds.left, -parentBounds.top); } } void waitForAllWindowsDrawn() { forAllWindows(w -> { w.requestDrawIfNeeded(mWaitingForDrawn); }, true /* traverseTopToBottom */); } Dimmer getDimmer() { if (mParent == null) { return null; } return mParent.getDimmer(); } void setSurfaceControl(SurfaceControl sc) { mSurfaceControl = sc; } RemoteAnimationDefinition getRemoteAnimationDefinition() { return null; } /** Cheap way of doing cast and instanceof.
ForAllWindowsConsumerWrapper::asTask
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
WindowToken asWindowToken() { return null; }
The {@code outFrame} retrieved by this method specifies where the animation will finish the entrance animation, as the next frame will display the window at these coordinates. In case of exit animation, this is where the animation will start, as the frame before the animation is displaying the window at these bounds. @param outFrame The bounds where entrance animation finishes or exit animation starts. @param outInsets Insets that are covered by system windows. @param outStableInsets Insets that determine the area covered by the stable system windows. @param outSurfaceInsets Positive insets between the drawing surface and window content. void getAnimationFrames(Rect outFrame, Rect outInsets, Rect outStableInsets, Rect outSurfaceInsets) { final DisplayInfo displayInfo = getDisplayContent().getDisplayInfo(); outFrame.set(0, 0, displayInfo.appWidth, displayInfo.appHeight); outInsets.setEmpty(); outStableInsets.setEmpty(); outSurfaceInsets.setEmpty(); } void getRelativePosition(Point outPos) { final Rect dispBounds = getBounds(); outPos.set(dispBounds.left, dispBounds.top); final WindowContainer parent = getParent(); if (parent != null) { final Rect parentBounds = parent.getBounds(); outPos.offset(-parentBounds.left, -parentBounds.top); } } void waitForAllWindowsDrawn() { forAllWindows(w -> { w.requestDrawIfNeeded(mWaitingForDrawn); }, true /* traverseTopToBottom */); } Dimmer getDimmer() { if (mParent == null) { return null; } return mParent.getDimmer(); } void setSurfaceControl(SurfaceControl sc) { mSurfaceControl = sc; } RemoteAnimationDefinition getRemoteAnimationDefinition() { return null; } /** Cheap way of doing cast and instanceof. Task asTask() { return null; } /** Cheap way of doing cast and instanceof.
ForAllWindowsConsumerWrapper::asWindowToken
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
ActivityRecord asActivityRecord() { return null; }
The {@code outFrame} retrieved by this method specifies where the animation will finish the entrance animation, as the next frame will display the window at these coordinates. In case of exit animation, this is where the animation will start, as the frame before the animation is displaying the window at these bounds. @param outFrame The bounds where entrance animation finishes or exit animation starts. @param outInsets Insets that are covered by system windows. @param outStableInsets Insets that determine the area covered by the stable system windows. @param outSurfaceInsets Positive insets between the drawing surface and window content. void getAnimationFrames(Rect outFrame, Rect outInsets, Rect outStableInsets, Rect outSurfaceInsets) { final DisplayInfo displayInfo = getDisplayContent().getDisplayInfo(); outFrame.set(0, 0, displayInfo.appWidth, displayInfo.appHeight); outInsets.setEmpty(); outStableInsets.setEmpty(); outSurfaceInsets.setEmpty(); } void getRelativePosition(Point outPos) { final Rect dispBounds = getBounds(); outPos.set(dispBounds.left, dispBounds.top); final WindowContainer parent = getParent(); if (parent != null) { final Rect parentBounds = parent.getBounds(); outPos.offset(-parentBounds.left, -parentBounds.top); } } void waitForAllWindowsDrawn() { forAllWindows(w -> { w.requestDrawIfNeeded(mWaitingForDrawn); }, true /* traverseTopToBottom */); } Dimmer getDimmer() { if (mParent == null) { return null; } return mParent.getDimmer(); } void setSurfaceControl(SurfaceControl sc) { mSurfaceControl = sc; } RemoteAnimationDefinition getRemoteAnimationDefinition() { return null; } /** Cheap way of doing cast and instanceof. Task asTask() { return null; } /** Cheap way of doing cast and instanceof. WindowToken asWindowToken() { return null; } /** Cheap way of doing cast and instanceof.
ForAllWindowsConsumerWrapper::asActivityRecord
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
WallpaperWindowToken asWallpaperToken() { return null; }
The {@code outFrame} retrieved by this method specifies where the animation will finish the entrance animation, as the next frame will display the window at these coordinates. In case of exit animation, this is where the animation will start, as the frame before the animation is displaying the window at these bounds. @param outFrame The bounds where entrance animation finishes or exit animation starts. @param outInsets Insets that are covered by system windows. @param outStableInsets Insets that determine the area covered by the stable system windows. @param outSurfaceInsets Positive insets between the drawing surface and window content. void getAnimationFrames(Rect outFrame, Rect outInsets, Rect outStableInsets, Rect outSurfaceInsets) { final DisplayInfo displayInfo = getDisplayContent().getDisplayInfo(); outFrame.set(0, 0, displayInfo.appWidth, displayInfo.appHeight); outInsets.setEmpty(); outStableInsets.setEmpty(); outSurfaceInsets.setEmpty(); } void getRelativePosition(Point outPos) { final Rect dispBounds = getBounds(); outPos.set(dispBounds.left, dispBounds.top); final WindowContainer parent = getParent(); if (parent != null) { final Rect parentBounds = parent.getBounds(); outPos.offset(-parentBounds.left, -parentBounds.top); } } void waitForAllWindowsDrawn() { forAllWindows(w -> { w.requestDrawIfNeeded(mWaitingForDrawn); }, true /* traverseTopToBottom */); } Dimmer getDimmer() { if (mParent == null) { return null; } return mParent.getDimmer(); } void setSurfaceControl(SurfaceControl sc) { mSurfaceControl = sc; } RemoteAnimationDefinition getRemoteAnimationDefinition() { return null; } /** Cheap way of doing cast and instanceof. Task asTask() { return null; } /** Cheap way of doing cast and instanceof. WindowToken asWindowToken() { return null; } /** Cheap way of doing cast and instanceof. ActivityRecord asActivityRecord() { return null; } /** Cheap way of doing cast and instanceof.
ForAllWindowsConsumerWrapper::asWallpaperToken
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
DisplayArea asDisplayArea() { return null; }
The {@code outFrame} retrieved by this method specifies where the animation will finish the entrance animation, as the next frame will display the window at these coordinates. In case of exit animation, this is where the animation will start, as the frame before the animation is displaying the window at these bounds. @param outFrame The bounds where entrance animation finishes or exit animation starts. @param outInsets Insets that are covered by system windows. @param outStableInsets Insets that determine the area covered by the stable system windows. @param outSurfaceInsets Positive insets between the drawing surface and window content. void getAnimationFrames(Rect outFrame, Rect outInsets, Rect outStableInsets, Rect outSurfaceInsets) { final DisplayInfo displayInfo = getDisplayContent().getDisplayInfo(); outFrame.set(0, 0, displayInfo.appWidth, displayInfo.appHeight); outInsets.setEmpty(); outStableInsets.setEmpty(); outSurfaceInsets.setEmpty(); } void getRelativePosition(Point outPos) { final Rect dispBounds = getBounds(); outPos.set(dispBounds.left, dispBounds.top); final WindowContainer parent = getParent(); if (parent != null) { final Rect parentBounds = parent.getBounds(); outPos.offset(-parentBounds.left, -parentBounds.top); } } void waitForAllWindowsDrawn() { forAllWindows(w -> { w.requestDrawIfNeeded(mWaitingForDrawn); }, true /* traverseTopToBottom */); } Dimmer getDimmer() { if (mParent == null) { return null; } return mParent.getDimmer(); } void setSurfaceControl(SurfaceControl sc) { mSurfaceControl = sc; } RemoteAnimationDefinition getRemoteAnimationDefinition() { return null; } /** Cheap way of doing cast and instanceof. Task asTask() { return null; } /** Cheap way of doing cast and instanceof. WindowToken asWindowToken() { return null; } /** Cheap way of doing cast and instanceof. ActivityRecord asActivityRecord() { return null; } /** Cheap way of doing cast and instanceof. WallpaperWindowToken asWallpaperToken() { return null; } /** Cheap way of doing cast and instanceof.
ForAllWindowsConsumerWrapper::asDisplayArea
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
RootDisplayArea asRootDisplayArea() { return null; }
The {@code outFrame} retrieved by this method specifies where the animation will finish the entrance animation, as the next frame will display the window at these coordinates. In case of exit animation, this is where the animation will start, as the frame before the animation is displaying the window at these bounds. @param outFrame The bounds where entrance animation finishes or exit animation starts. @param outInsets Insets that are covered by system windows. @param outStableInsets Insets that determine the area covered by the stable system windows. @param outSurfaceInsets Positive insets between the drawing surface and window content. void getAnimationFrames(Rect outFrame, Rect outInsets, Rect outStableInsets, Rect outSurfaceInsets) { final DisplayInfo displayInfo = getDisplayContent().getDisplayInfo(); outFrame.set(0, 0, displayInfo.appWidth, displayInfo.appHeight); outInsets.setEmpty(); outStableInsets.setEmpty(); outSurfaceInsets.setEmpty(); } void getRelativePosition(Point outPos) { final Rect dispBounds = getBounds(); outPos.set(dispBounds.left, dispBounds.top); final WindowContainer parent = getParent(); if (parent != null) { final Rect parentBounds = parent.getBounds(); outPos.offset(-parentBounds.left, -parentBounds.top); } } void waitForAllWindowsDrawn() { forAllWindows(w -> { w.requestDrawIfNeeded(mWaitingForDrawn); }, true /* traverseTopToBottom */); } Dimmer getDimmer() { if (mParent == null) { return null; } return mParent.getDimmer(); } void setSurfaceControl(SurfaceControl sc) { mSurfaceControl = sc; } RemoteAnimationDefinition getRemoteAnimationDefinition() { return null; } /** Cheap way of doing cast and instanceof. Task asTask() { return null; } /** Cheap way of doing cast and instanceof. WindowToken asWindowToken() { return null; } /** Cheap way of doing cast and instanceof. ActivityRecord asActivityRecord() { return null; } /** Cheap way of doing cast and instanceof. WallpaperWindowToken asWallpaperToken() { return null; } /** Cheap way of doing cast and instanceof. DisplayArea asDisplayArea() { return null; } /** Cheap way of doing cast and instanceof.
ForAllWindowsConsumerWrapper::asRootDisplayArea
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
TaskDisplayArea asTaskDisplayArea() { return null; }
The {@code outFrame} retrieved by this method specifies where the animation will finish the entrance animation, as the next frame will display the window at these coordinates. In case of exit animation, this is where the animation will start, as the frame before the animation is displaying the window at these bounds. @param outFrame The bounds where entrance animation finishes or exit animation starts. @param outInsets Insets that are covered by system windows. @param outStableInsets Insets that determine the area covered by the stable system windows. @param outSurfaceInsets Positive insets between the drawing surface and window content. void getAnimationFrames(Rect outFrame, Rect outInsets, Rect outStableInsets, Rect outSurfaceInsets) { final DisplayInfo displayInfo = getDisplayContent().getDisplayInfo(); outFrame.set(0, 0, displayInfo.appWidth, displayInfo.appHeight); outInsets.setEmpty(); outStableInsets.setEmpty(); outSurfaceInsets.setEmpty(); } void getRelativePosition(Point outPos) { final Rect dispBounds = getBounds(); outPos.set(dispBounds.left, dispBounds.top); final WindowContainer parent = getParent(); if (parent != null) { final Rect parentBounds = parent.getBounds(); outPos.offset(-parentBounds.left, -parentBounds.top); } } void waitForAllWindowsDrawn() { forAllWindows(w -> { w.requestDrawIfNeeded(mWaitingForDrawn); }, true /* traverseTopToBottom */); } Dimmer getDimmer() { if (mParent == null) { return null; } return mParent.getDimmer(); } void setSurfaceControl(SurfaceControl sc) { mSurfaceControl = sc; } RemoteAnimationDefinition getRemoteAnimationDefinition() { return null; } /** Cheap way of doing cast and instanceof. Task asTask() { return null; } /** Cheap way of doing cast and instanceof. WindowToken asWindowToken() { return null; } /** Cheap way of doing cast and instanceof. ActivityRecord asActivityRecord() { return null; } /** Cheap way of doing cast and instanceof. WallpaperWindowToken asWallpaperToken() { return null; } /** Cheap way of doing cast and instanceof. DisplayArea asDisplayArea() { return null; } /** Cheap way of doing cast and instanceof. RootDisplayArea asRootDisplayArea() { return null; } /** Cheap way of doing cast and instanceof.
ForAllWindowsConsumerWrapper::asTaskDisplayArea
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
DisplayContent asDisplayContent() { return null; }
The {@code outFrame} retrieved by this method specifies where the animation will finish the entrance animation, as the next frame will display the window at these coordinates. In case of exit animation, this is where the animation will start, as the frame before the animation is displaying the window at these bounds. @param outFrame The bounds where entrance animation finishes or exit animation starts. @param outInsets Insets that are covered by system windows. @param outStableInsets Insets that determine the area covered by the stable system windows. @param outSurfaceInsets Positive insets between the drawing surface and window content. void getAnimationFrames(Rect outFrame, Rect outInsets, Rect outStableInsets, Rect outSurfaceInsets) { final DisplayInfo displayInfo = getDisplayContent().getDisplayInfo(); outFrame.set(0, 0, displayInfo.appWidth, displayInfo.appHeight); outInsets.setEmpty(); outStableInsets.setEmpty(); outSurfaceInsets.setEmpty(); } void getRelativePosition(Point outPos) { final Rect dispBounds = getBounds(); outPos.set(dispBounds.left, dispBounds.top); final WindowContainer parent = getParent(); if (parent != null) { final Rect parentBounds = parent.getBounds(); outPos.offset(-parentBounds.left, -parentBounds.top); } } void waitForAllWindowsDrawn() { forAllWindows(w -> { w.requestDrawIfNeeded(mWaitingForDrawn); }, true /* traverseTopToBottom */); } Dimmer getDimmer() { if (mParent == null) { return null; } return mParent.getDimmer(); } void setSurfaceControl(SurfaceControl sc) { mSurfaceControl = sc; } RemoteAnimationDefinition getRemoteAnimationDefinition() { return null; } /** Cheap way of doing cast and instanceof. Task asTask() { return null; } /** Cheap way of doing cast and instanceof. WindowToken asWindowToken() { return null; } /** Cheap way of doing cast and instanceof. ActivityRecord asActivityRecord() { return null; } /** Cheap way of doing cast and instanceof. WallpaperWindowToken asWallpaperToken() { return null; } /** Cheap way of doing cast and instanceof. DisplayArea asDisplayArea() { return null; } /** Cheap way of doing cast and instanceof. RootDisplayArea asRootDisplayArea() { return null; } /** Cheap way of doing cast and instanceof. TaskDisplayArea asTaskDisplayArea() { return null; } /** Cheap way of doing cast and instanceof.
ForAllWindowsConsumerWrapper::asDisplayContent
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
boolean isOrganized() { return false; }
@return {@code true} if window container is manage by a {@link android.window.WindowOrganizer}
ForAllWindowsConsumerWrapper::isOrganized
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
boolean showSurfaceOnCreation() { return true; }
@return {@code true} if this container's surface should be shown when it is created.
ForAllWindowsConsumerWrapper::showSurfaceOnCreation
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
boolean showWallpaper() { if (!isVisibleRequested() // in multi-window mode, wallpaper is always visible at the back and not tied to // the app (there is no wallpaper target). || inMultiWindowMode()) { return false; } for (int i = mChildren.size() - 1; i >= 0; --i) { final WindowContainer child = mChildren.get(i); if (child.showWallpaper()) { return true; } } return false; }
@return {@code true} if this container's surface should be shown when it is created. boolean showSurfaceOnCreation() { return true; } /** @return {@code true} if the wallpaper is visible behind this container.
ForAllWindowsConsumerWrapper::showWallpaper
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
boolean onSyncFinishedDrawing() { if (mSyncState == SYNC_STATE_NONE) return false; mSyncState = SYNC_STATE_READY; mWmService.mWindowPlacerLocked.requestTraversal(); ProtoLog.v(WM_DEBUG_SYNC_ENGINE, "onSyncFinishedDrawing %s", this); return true; }
Call this when this container finishes drawing content. @return {@code true} if consumed (this container is part of a sync group).
RemoteToken::onSyncFinishedDrawing
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
boolean prepareSync() { if (mSyncState != SYNC_STATE_NONE) { // Already part of sync return false; } for (int i = getChildCount() - 1; i >= 0; --i) { final WindowContainer child = getChildAt(i); child.prepareSync(); } mSyncState = SYNC_STATE_READY; return true; }
Prepares this container for participation in a sync-group. This includes preparing all its children. @return {@code true} if something changed (eg. this wasn't already in the sync group).
RemoteToken::prepareSync
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
void finishSync(Transaction outMergedTransaction, boolean cancel) { if (mSyncState == SYNC_STATE_NONE) return; ProtoLog.v(WM_DEBUG_SYNC_ENGINE, "finishSync cancel=%b for %s", cancel, this); outMergedTransaction.merge(mSyncTransaction); for (int i = mChildren.size() - 1; i >= 0; --i) { mChildren.get(i).finishSync(outMergedTransaction, cancel); } mSyncState = SYNC_STATE_NONE; if (cancel && mSyncGroup != null) mSyncGroup.onCancelSync(this); mSyncGroup = null; }
Recursively finishes/cleans-up sync state of this subtree and collects all the sync transactions into `outMergedTransaction`. @param outMergedTransaction A transaction to merge all the recorded sync operations into. @param cancel If true, this is being finished because it is leaving the sync group rather than due to the sync group completing.
RemoteToken::finishSync
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
boolean isSyncFinished() { if (!isVisibleRequested()) { return true; } if (mSyncState == SYNC_STATE_NONE) { prepareSync(); } if (mSyncState == SYNC_STATE_WAITING_FOR_DRAW) { return false; } // READY // Loop from top-down. for (int i = mChildren.size() - 1; i >= 0; --i) { final WindowContainer child = mChildren.get(i); final boolean childFinished = child.isSyncFinished(); if (childFinished && child.isVisibleRequested() && child.fillsParent()) { // Any lower children will be covered-up, so we can consider this finished. return true; } if (!childFinished) { return false; } } return true; }
Checks if the subtree rooted at this container is finished syncing (everything is ready or not visible). NOTE, this is not const: it will cancel/prepare itself depending on its state in the hierarchy. @return {@code true} if this subtree is finished waiting for sync participants.
RemoteToken::isSyncFinished
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
private void onSyncReparent(WindowContainer oldParent, WindowContainer newParent) { if (newParent == null || newParent.mSyncState == SYNC_STATE_NONE) { if (mSyncState == SYNC_STATE_NONE) { return; } if (newParent == null) { // This is getting removed. if (oldParent.mSyncState != SYNC_STATE_NONE) { // In order to keep the transaction in sync, merge it into the parent. finishSync(oldParent.mSyncTransaction, true /* cancel */); } else if (mSyncGroup != null) { // This is watched directly by the sync-group, so merge this transaction into // into the sync-group so it isn't lost finishSync(mSyncGroup.getOrphanTransaction(), true /* cancel */); } else { throw new IllegalStateException("This container is in sync mode without a sync" + " group: " + this); } return; } else if (mSyncGroup == null) { // This is being reparented out of the sync-group. To prevent ordering issues on // this container, immediately apply/cancel sync on it. finishSync(getPendingTransaction(), true /* cancel */); return; } // Otherwise this is the "root" of a synced subtree, so continue on to preparation. } // This container's situation has changed so we need to restart its sync. mSyncState = SYNC_STATE_NONE; prepareSync(); }
Called during reparent to handle sync state when the hierarchy changes. If this is in a sync group and gets reparented out, it will cancel syncing. If this is not in a sync group and gets parented into one, it will prepare itself. If its moving around within a sync-group, it needs to restart its syncing since a hierarchy change implies a configuration change.
RemoteToken::onSyncReparent
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
@WindowManager.LayoutParams.WindowType int getWindowType() { return INVALID_WINDOW_TYPE; }
Returns the {@link WindowManager.LayoutParams.WindowType}.
RemoteToken::getWindowType
java
Reginer/aosp-android-jar
android-31/src/com/android/server/wm/WindowContainer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/wm/WindowContainer.java
MIT
public BootstrapMethodError() { super(); }
Constructs a {@code BootstrapMethodError} with no detail message.
BootstrapMethodError::BootstrapMethodError
java
Reginer/aosp-android-jar
android-35/src/java/lang/BootstrapMethodError.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/java/lang/BootstrapMethodError.java
MIT
public BootstrapMethodError(String s) { super(s); }
Constructs a {@code BootstrapMethodError} with the specified detail message. @param s the detail message.
BootstrapMethodError::BootstrapMethodError
java
Reginer/aosp-android-jar
android-35/src/java/lang/BootstrapMethodError.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/java/lang/BootstrapMethodError.java
MIT
public BootstrapMethodError(String s, Throwable cause) { super(s, cause); }
Constructs a {@code BootstrapMethodError} with the specified detail message and cause. @param s the detail message. @param cause the cause, may be {@code null}.
BootstrapMethodError::BootstrapMethodError
java
Reginer/aosp-android-jar
android-35/src/java/lang/BootstrapMethodError.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/java/lang/BootstrapMethodError.java
MIT
public BootstrapMethodError(Throwable cause) { // cf. Throwable(Throwable cause) constructor. super(cause == null ? null : cause.toString()); initCause(cause); }
Constructs a {@code BootstrapMethodError} with the specified cause. @param cause the cause, may be {@code null}.
BootstrapMethodError::BootstrapMethodError
java
Reginer/aosp-android-jar
android-35/src/java/lang/BootstrapMethodError.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/java/lang/BootstrapMethodError.java
MIT
public void setMatchStatusClass(boolean flag) { matchStatusClass = flag; }
set the flag on a match template. If this set to true, then the whole status code is matched (default behavior) else only the class of the response is matched.
StatusLine::setMatchStatusClass
java
Reginer/aosp-android-jar
android-34/src/gov/nist/javax/sip/header/StatusLine.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/gov/nist/javax/sip/header/StatusLine.java
MIT
public StatusLine() { reasonPhrase = null; sipVersion = SIPConstants.SIP_VERSION_STRING; }
Default Constructor
StatusLine::StatusLine
java
Reginer/aosp-android-jar
android-34/src/gov/nist/javax/sip/header/StatusLine.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/gov/nist/javax/sip/header/StatusLine.java
MIT
public String encode() { String encoding = SIPConstants.SIP_VERSION_STRING + SP + statusCode; if (reasonPhrase != null) encoding += SP + reasonPhrase; encoding += NEWLINE; return encoding; }
Encode into a canonical form. @return String
StatusLine::encode
java
Reginer/aosp-android-jar
android-34/src/gov/nist/javax/sip/header/StatusLine.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/gov/nist/javax/sip/header/StatusLine.java
MIT