Merge tag 'android-16.0.0_r3' into 16-dev

Android 16.0.0 Release 3 (BP3A.250905.014)

Signed-off-by: Pun Butrach <pun.butrach@gmail.com>
This commit is contained in:
Pun Butrach committed 2026-01-10 20:46:04 +07:00
commit dd4a08be61
2757 files changed
+260625 -114908

No files matched your search

+27 -32
View File
@@ -17,6 +17,7 @@
package com.android.launcher3;
import static com.android.app.animation.Interpolators.SCROLL;
import static com.android.launcher3.RemoveAnimationSettingsTracker.WINDOW_ANIMATION_SCALE_URI;
import static com.android.launcher3.compat.AccessibilityManagerCompat.isAccessibilityEnabled;
import static com.android.launcher3.compat.AccessibilityManagerCompat.isObservedEventType;
import static com.android.launcher3.testing.shared.TestProtocol.SCROLL_FINISHED_MESSAGE;
@@ -33,7 +34,6 @@ import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.os.Bundle;
import android.provider.Settings;
import android.util.AttributeSet;
import android.util.Log;
import android.view.InputDevice;
@@ -65,7 +65,6 @@ import com.android.launcher3.views.ActivityContext;
import java.util.ArrayList;
import java.util.function.Consumer;
import app.lawnchair.preferences.PreferenceManager;
import app.lawnchair.ui.StretchEdgeEffect;
/**
@@ -86,8 +85,6 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou
private static final float SIGNIFICANT_MOVE_THRESHOLD = 0.4f;
private static final float MAX_SCROLL_PROGRESS = 1.0f;
private PreferenceManager prefs = PreferenceManager.getInstance(getContext());
private boolean mFreeScroll = false;
@@ -723,12 +720,14 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou
}
/**
* Queues the given callback to be run once {@code mPageScrolls} has been initialized.
* Run the given `callback` immediately once {@code mPageScrolls} has been initialized,
* otherwise queue the callback to `mOnPageScrollsInitializedCallbacks`.
*/
public void runOnPageScrollsInitialized(Runnable callback) {
mOnPageScrollsInitializedCallbacks.add(callback);
if (isPageScrollsInitialized()) {
onPageScrollsInitialized();
callback.run();
} else {
mOnPageScrollsInitializedCallbacks.add(callback);
}
}
@@ -791,13 +790,6 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou
}
if (mScroller.isFinished() && pageScrollChanged) {
// TODO(b/246283207): Remove logging once root cause of flake detected.
if (Utilities.isRunningInTestHarness() && !(this instanceof Workspace)) {
Log.d("b/246283207", TAG + "#onLayout() -> "
+ "if(mScroller.isFinished() && pageScrollChanged) -> getNextPage(): "
+ getNextPage() + ", getScrollForPage(getNextPage()): "
+ getScrollForPage(getNextPage()));
}
setCurrentPage(getNextPage());
}
onPageScrollsInitialized();
@@ -1424,27 +1416,19 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou
// test for a large move if a fling has been registered. That is, a large
// move to the left and fling to the right will register as a fling to the right.
boolean infiniteScroll = prefs.getInstance(getContext()).getInfiniteScrolling().get();
if (((isSignificantMove && !isDeltaLeft && !isFling) ||
(isFling && !isVelocityLeft)) && mCurrentPage > 0) {
finalPage = returnToOriginalPage
? mCurrentPage : mCurrentPage - getPanelCount();
runOnPageScrollsInitialized(
() -> snapToPageWithVelocity(finalPage, velocity));
} else if (((isSignificantMove && isDeltaLeft && !isFling) || (isFling && isVelocityLeft)) && mCurrentPage < getChildCount() - 1) {
finalPage = returnToOriginalPage ? mCurrentPage : mCurrentPage + getPanelCount();
runOnPageScrollsInitialized(() -> snapToPageWithVelocity(finalPage, velocity));
} else if (mCurrentPage == getChildCount() - 1 && infiniteScroll) {
finalPage = returnToOriginalPage ? mCurrentPage : 0;
snapToPageWithVelocity(finalPage, velocity);
} else if (mCurrentPage == 0 && infiniteScroll) {
finalPage = returnToOriginalPage ? mCurrentPage : getChildCount() - 1;
snapToPageWithVelocity(finalPage, velocity);
() -> snapToPageWithVelocity(finalPage, velocity));
} else if (((isSignificantMove && isDeltaLeft && !isFling) ||
(isFling && isVelocityLeft)) &&
mCurrentPage < getChildCount() - 1) {
finalPage = returnToOriginalPage
? mCurrentPage : mCurrentPage + getPanelCount();
runOnPageScrollsInitialized(
() -> snapToPageWithVelocity(finalPage, velocity));
} else {
runOnPageScrollsInitialized(this::snapToDestination);
}
@@ -1476,6 +1460,15 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou
mEdgeGlowLeft.onFlingVelocity(velocity);
mEdgeGlowRight.onFlingVelocity(velocity);
}
// Detect if user tries to swipe to -1 page but gets disallowed by checking if there was
// left-over values in mEdgeGlowLeft (or mEdgeGlowRight in RLT).
final int layoutDir = getLayoutDirection();
if ((mEdgeGlowLeft.getDistance() > 0 && layoutDir == LAYOUT_DIRECTION_LTR)
|| (mEdgeGlowRight.getDistance() > 0 && layoutDir == LAYOUT_DIRECTION_RTL)) {
onDisallowSwipeToMinusOnePage();
}
mEdgeGlowLeft.onRelease(ev);
mEdgeGlowRight.onRelease(ev);
// End any intermediate reordering states
@@ -1500,6 +1493,8 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou
return true;
}
protected void onDisallowSwipeToMinusOnePage() {}
protected void onNotSnappingToPageInFreeScroll() { }
/**
@@ -1756,8 +1751,8 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou
}
if (FeatureFlags.IS_STUDIO_BUILD && !Utilities.isRunningInTestHarness()) {
duration *= Settings.Global.getFloat(getContext().getContentResolver(),
Settings.Global.WINDOW_ANIMATION_SCALE, 1);
duration *= RemoveAnimationSettingsTracker.INSTANCE.get(getContext()).getValue(
WINDOW_ANIMATION_SCALE_URI);
}
whichPage = validateNewPage(whichPage);