Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9a9fc0fc authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 10186302 from 5b4d32eb to udc-qpr1-release

Change-Id: Ibb2aa334cf3214ec21fe18abd9884e50a37121b1
parents 1a960e60 5b4d32eb
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -80,7 +80,7 @@ public class BenchmarkRunner {

    private void prepareForNextRun() {
        SystemClock.sleep(COOL_OFF_PERIOD_MS);
        ShellHelper.runShellCommand("am wait-for-broadcast-idle");
        ShellHelper.runShellCommand("am wait-for-broadcast-idle --flush-broadcast-loopers");
        mStartTimeNs = System.nanoTime();
        mPausedDurationNs = 0;
    }
@@ -102,7 +102,7 @@ public class BenchmarkRunner {
     * to avoid unnecessary waiting.
     */
    public void resumeTiming() {
        ShellHelper.runShellCommand("am wait-for-broadcast-idle");
        ShellHelper.runShellCommand("am wait-for-broadcast-idle --flush-broadcast-loopers");
        resumeTimer();
    }

+2 −1
Original line number Diff line number Diff line
@@ -1541,7 +1541,8 @@ public class UserLifecycleTests {

    private void waitForBroadcastIdle() {
        try {
            ShellHelper.runShellCommandWithTimeout("am wait-for-broadcast-idle", TIMEOUT_IN_SECOND);
            ShellHelper.runShellCommandWithTimeout(
                    "am wait-for-broadcast-idle --flush-broadcast-loopers", TIMEOUT_IN_SECOND);
        } catch (TimeoutException e) {
            Log.e(TAG, "Ending waitForBroadcastIdle because it is taking too long", e);
        }
+24 −12
Original line number Diff line number Diff line
@@ -24,9 +24,11 @@ import android.annotation.RequiresPermission;
import android.annotation.SystemApi;
import android.annotation.SystemService;
import android.annotation.TestApi;
import android.annotation.UserIdInt;
import android.app.compat.CompatChanges;
import android.compat.annotation.ChangeId;
import android.compat.annotation.EnabledSince;
import android.compat.annotation.LoggingOnly;
import android.compat.annotation.UnsupportedAppUsage;
import android.content.ComponentName;
import android.content.Context;
@@ -49,6 +51,7 @@ import android.util.Slog;
import android.view.KeyEvent;
import android.view.View;

import com.android.internal.compat.IPlatformCompat;
import com.android.internal.statusbar.AppClipsServiceConnector;
import com.android.internal.statusbar.IAddTileResultCallback;
import com.android.internal.statusbar.IStatusBarService;
@@ -170,6 +173,8 @@ public class StatusBarManager {
    public @interface Disable2Flags {}
    // LINT.ThenChange(frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/disableflags/DisableFlagsLogger.kt)

    private static final String TAG = "StatusBarManager";

    /**
     * Default disable flags for setup
     *
@@ -572,13 +577,13 @@ public class StatusBarManager {
    private static final long MEDIA_CONTROL_SESSION_ACTIONS = 203800354L;

    /**
     * Media controls based on {@link android.app.Notification.MediaStyle} notifications will be
     * required to include a non-empty title, either in the {@link android.media.MediaMetadata} or
     * Media controls based on {@link android.app.Notification.MediaStyle} notifications should
     * include a non-empty title, either in the {@link android.media.MediaMetadata} or
     * notification title.
     */
    @ChangeId
    @EnabledSince(targetSdkVersion = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
    private static final long MEDIA_CONTROL_REQUIRES_TITLE = 274775190L;
    @LoggingOnly
    private static final long MEDIA_CONTROL_BLANK_TITLE = 274775190L;

    @UnsupportedAppUsage
    private Context mContext;
@@ -586,6 +591,9 @@ public class StatusBarManager {
    @UnsupportedAppUsage
    private IBinder mToken = new Binder();

    private final IPlatformCompat mPlatformCompat = IPlatformCompat.Stub.asInterface(
            ServiceManager.getService(Context.PLATFORM_COMPAT_SERVICE));

    @UnsupportedAppUsage
    StatusBarManager(Context context) {
        mContext = context;
@@ -597,7 +605,7 @@ public class StatusBarManager {
            mService = IStatusBarService.Stub.asInterface(
                    ServiceManager.getService(Context.STATUS_BAR_SERVICE));
            if (mService == null) {
                Slog.w("StatusBarManager", "warning: no STATUS_BAR_SERVICE");
                Slog.w(TAG, "warning: no STATUS_BAR_SERVICE");
            }
        }
        return mService;
@@ -1226,18 +1234,22 @@ public class StatusBarManager {
    }

    /**
     * Checks whether the given package must include a non-empty title for its media controls.
     * Log that the given package has posted media controls with a blank title
     *
     * @param packageName App posting media controls
     * @param user Current user handle
     * @return true if the app is required to provide a non-empty title
     * @param userId Current user ID
     * @throws RuntimeException if there is an error reporting the change
     *
     * @hide
     */
    @RequiresPermission(allOf = {android.Manifest.permission.READ_COMPAT_CHANGE_CONFIG,
            android.Manifest.permission.LOG_COMPAT_CHANGE})
    public static boolean isMediaTitleRequiredForApp(String packageName, UserHandle user) {
        return CompatChanges.isChangeEnabled(MEDIA_CONTROL_REQUIRES_TITLE, packageName, user);
    public void logBlankMediaTitle(String packageName, @UserIdInt int userId)
            throws RuntimeException {
        try {
            mPlatformCompat.reportChangeByPackageName(MEDIA_CONTROL_BLANK_TITLE, packageName,
                        userId);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }

    /**
+52 −48
Original line number Diff line number Diff line
@@ -246,8 +246,7 @@ final class NavigationBarController {
        @Override
        public void updateTouchableInsets(@NonNull InputMethodService.Insets originalInsets,
                @NonNull ViewTreeObserver.InternalInsetsInfo dest) {
            if (!mImeDrawsImeNavBar || mNavigationBarFrame == null
                    || mService.isExtractViewShown()) {
            if (!mImeDrawsImeNavBar || mNavigationBarFrame == null) {
                return;
            }

@@ -255,6 +254,10 @@ final class NavigationBarController {
            if (systemInsets != null) {
                final Window window = mService.mWindow.getWindow();
                final View decor = window.getDecorView();

                // If the extract view is shown, everything is touchable, so no need to update
                // touchable insets, but we still update normal insets below.
                if (!mService.isExtractViewShown()) {
                    Region touchableRegion = null;
                    final View inputFrame = mService.mInputFrame;
                    switch (originalInsets.touchableInsets) {
@@ -302,6 +305,7 @@ final class NavigationBarController {
                    dest.touchableRegion.set(touchableRegion);
                    dest.setTouchableInsets(
                            ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_REGION);
                }

                // TODO(b/215443343): See if we can use View#OnLayoutChangeListener().
                // TODO(b/215443343): See if we can replace DecorView#mNavigationColorViewState.view
+4 −0
Original line number Diff line number Diff line
@@ -164,6 +164,10 @@ public class InsetsFrameProvider implements Parcelable {
        return mFlags;
    }

    public boolean hasFlags(@Flags int mask) {
        return (mFlags & mask) == mask;
    }

    public InsetsFrameProvider setInsetsSize(Insets insetsSize) {
        mInsetsSize = insetsSize;
        return this;
Loading