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

Commit ad473078 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 5667566 from 702c5199 to qt-release

Change-Id: I66658812a46e0d3d35914d64795dac1e2fd05785
parents 2d9673c9 702c5199
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -305,6 +305,8 @@ message Atom {
        LocationManagerApiUsageReported location_manager_api_usage_reported = 210;
        ReviewPermissionsFragmentResultReported review_permissions_fragment_result_reported
            = 211 [(log_from_module) = "permissioncontroller"];
        RuntimePermissionsUpgradeResult runtime_permissions_upgrade_result =
            212 [(log_from_module) = "permissioncontroller"];
    }

    // Pulled events will start at field 10000.
@@ -6567,3 +6569,18 @@ message ReviewPermissionsFragmentResultReported {
    // The result of the permission grant
    optional bool permission_granted = 5;
}

/**
* Information about results of permission upgrade by RuntimePermissionsUpgradeController
* Logged from: RuntimePermissionUpdgradeController
*/
message RuntimePermissionsUpgradeResult {
    // Permission granted as result of upgrade
    optional string permission_name = 1;

    // UID of package granted permission
    optional int32 uid = 2 [(is_uid) = true];

    // Name of package granted permission
    optional string package_name = 3;
}
 No newline at end of file
+6 −5
Original line number Diff line number Diff line
@@ -77,6 +77,7 @@ public abstract class ConditionProviderService extends Service {

    private Provider mProvider;
    private INotificationManager mNoMan;
    boolean mIsConnected;

    /**
     * The {@link Intent} that must be declared as handled by the service.
@@ -179,7 +180,7 @@ public abstract class ConditionProviderService extends Service {
        try {
            noMan.requestUnbindProvider(mProvider);
            // Disable future messages.
            mProvider = null;
            mIsConnected = false;
        } catch (RemoteException ex) {
            throw ex.rethrowFromSystemServer();
        }
@@ -233,16 +234,16 @@ public abstract class ConditionProviderService extends Service {
     */
    @TestApi
    public boolean isBound() {
        if (mProvider == null) {
        if (!mIsConnected) {
            Log.w(TAG, "Condition provider service not yet bound.");
            return false;
        }
        return true;
        return mIsConnected;
    }

    private final class Provider extends IConditionProvider.Stub {
        @Override
        public void onConnected() {
            mIsConnected = true;
            mHandler.obtainMessage(H.ON_CONNECTED).sendToTarget();
        }

@@ -265,7 +266,7 @@ public abstract class ConditionProviderService extends Service {
        @Override
        public void handleMessage(Message msg) {
            String name = null;
            if (!isBound()) {
            if (!mIsConnected) {
                return;
            }
            try {
+7 −0
Original line number Diff line number Diff line
@@ -55,9 +55,16 @@ interface ISystemUiProxy {
    /**
     * Control the {@param alpha} of the back button in the navigation bar and {@param animate} if
     * needed from current value
     * @deprecated
     */
    void setBackButtonAlpha(float alpha, boolean animate) = 8;

    /**
     * Control the {@param alpha} of the option nav bar button (back-button in 2 button mode
     * and home bar in no-button mode) and {@param animate} if needed from current value
     */
    void setNavBarButtonAlpha(float alpha, boolean animate) = 19;

    /**
     * Proxies motion events from the homescreen UI to the status bar. Only called when
     * swipe down is detected on WORKSPACE. The sender guarantees the following order of events on
+4 −0
Original line number Diff line number Diff line
@@ -365,6 +365,10 @@ public class BatteryMeterView extends LinearLayout implements
            } else {
                setPercentTextAtCurrentLevel();
            }
        } else {
            setContentDescription(
                    getContext().getString(mCharging ? R.string.accessibility_battery_level_charging
                            : R.string.accessibility_battery_level, mLevel));
        }
    }

+38 −16
Original line number Diff line number Diff line
@@ -27,6 +27,9 @@ import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_INP
import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_SUPPORTS_WINDOW_CORNERS;
import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_SYSUI_PROXY;
import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_WINDOW_CORNER_RADIUS;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_BOUNCER_SHOWING;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_STATUS_BAR_KEYGUARD_SHOWING;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_STATUS_BAR_KEYGUARD_SHOWING_OCCLUDED;

import android.annotation.FloatRange;
import android.app.ActivityTaskManager;
@@ -67,6 +70,7 @@ import com.android.systemui.statusbar.phone.NavigationBarFragment;
import com.android.systemui.statusbar.phone.NavigationBarView;
import com.android.systemui.statusbar.phone.NavigationModeController;
import com.android.systemui.statusbar.phone.StatusBar;
import com.android.systemui.statusbar.phone.StatusBarWindowCallback;
import com.android.systemui.statusbar.phone.StatusBarWindowController;
import com.android.systemui.statusbar.policy.CallbackController;
import com.android.systemui.statusbar.policy.DeviceProvisionedController;
@@ -90,7 +94,6 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
    private static final String ACTION_QUICKSTEP = "android.intent.action.QUICKSTEP_SERVICE";

    public static final String TAG_OPS = "OverviewProxyService";
    public static final boolean DEBUG_OVERVIEW_PROXY = false;
    private static final long BACKOFF_MILLIS = 1000;
    private static final long DEFERRED_CALLBACK_MILLIS = 5000;

@@ -115,7 +118,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
    private boolean mBound;
    private boolean mIsEnabled;
    private int mCurrentBoundedUserId = -1;
    private float mBackButtonAlpha;
    private float mNavBarButtonAlpha;
    private MotionEvent mStatusBarGestureDownEvent;
    private float mWindowCornerRadius;
    private boolean mSupportsRoundedCornersOnWindows;
@@ -241,21 +244,24 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
        }

        @Override
        public void setBackButtonAlpha(float alpha, boolean animate) {
            if (!verifyCaller("setBackButtonAlpha")) {
        public void setNavBarButtonAlpha(float alpha, boolean animate) {
            if (!verifyCaller("setNavBarButtonAlpha")) {
                return;
            }
            long token = Binder.clearCallingIdentity();
            try {
                mBackButtonAlpha = alpha;
                mHandler.post(() -> {
                    notifyBackButtonAlphaChanged(alpha, animate);
                });
                mNavBarButtonAlpha = alpha;
                mHandler.post(() -> notifyNavBarButtonAlphaChanged(alpha, animate));
            } finally {
                Binder.restoreCallingIdentity(token);
            }
        }

        @Override
        public void setBackButtonAlpha(float alpha, boolean animate) {
            setNavBarButtonAlpha(alpha, animate);
        }

        @Override
        public void onAssistantProgress(@FloatRange(from = 0.0, to = 1.0) float progress) {
            if (!verifyCaller("onAssistantProgress")) {
@@ -442,6 +448,8 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
        }
    };

    private final StatusBarWindowCallback mStatusBarWindowCallback = this::onStatusBarStateChanged;

    // This is the death handler for the binder from the launcher service
    private final IBinder.DeathRecipient mOverviewServiceDeathRcpt
            = this::cleanupAfterDeath;
@@ -465,7 +473,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
                .supportsRoundedCornersOnWindows(mContext.getResources());

        // Assumes device always starts with back button until launcher tells it that it does not
        mBackButtonAlpha = 1.0f;
        mNavBarButtonAlpha = 1.0f;

        // Listen for nav bar mode changes
        mNavBarMode = navModeController.addListener(this);
@@ -481,6 +489,9 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
                PatternMatcher.PATTERN_LITERAL);
        filter.addAction(Intent.ACTION_PACKAGE_CHANGED);
        mContext.registerReceiver(mLauncherStateChangedReceiver, filter);

        // Listen for status bar state changes
        statusBarWinController.registerCallback(mStatusBarWindowCallback);
    }

    public void notifyBackAction(boolean completed, int downX, int downY, boolean isButton,
@@ -531,7 +542,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
            navBarView.updateSystemUiStateFlags();
        }
        if (mStatusBarWinController != null) {
            mStatusBarWinController.updateSystemUiStateFlags();
            mStatusBarWinController.notifyStateChangedCallbacks();
        }
        notifySystemUiStateFlags(mSysUiStateFlags);
    }
@@ -546,6 +557,16 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
        }
    }

    private void onStatusBarStateChanged(boolean keyguardShowing, boolean keyguardOccluded,
            boolean bouncerShowing) {
        int displayId = mContext.getDisplayId();
        setSystemUiStateFlag(SYSUI_STATE_STATUS_BAR_KEYGUARD_SHOWING,
                keyguardShowing && !keyguardOccluded, displayId);
        setSystemUiStateFlag(SYSUI_STATE_STATUS_BAR_KEYGUARD_SHOWING_OCCLUDED,
                keyguardShowing && keyguardOccluded, displayId);
        setSystemUiStateFlag(SYSUI_STATE_BOUNCER_SHOWING, bouncerShowing, displayId);
    }

    /**
     * Sets the navbar region which can receive touch inputs
     */
@@ -565,7 +586,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
    }

    public float getBackButtonAlpha() {
        return mBackButtonAlpha;
        return mNavBarButtonAlpha;
    }

    public void cleanupAfterDeath() {
@@ -637,7 +658,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
    public void addCallback(OverviewProxyListener listener) {
        mConnectionCallbacks.add(listener);
        listener.onConnectionChanged(mOverviewProxy != null);
        listener.onBackButtonAlphaChanged(mBackButtonAlpha, false);
        listener.onNavBarButtonAlphaChanged(mNavBarButtonAlpha, false);
        listener.onSystemUiStateChanged(mSysUiStateFlags);
    }

@@ -668,14 +689,14 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
        if (mOverviewProxy != null) {
            mOverviewProxy.asBinder().unlinkToDeath(mOverviewServiceDeathRcpt, 0);
            mOverviewProxy = null;
            notifyBackButtonAlphaChanged(1f, false /* animate */);
            notifyNavBarButtonAlphaChanged(1f, false /* animate */);
            notifyConnectionChanged();
        }
    }

    private void notifyBackButtonAlphaChanged(float alpha, boolean animate) {
    private void notifyNavBarButtonAlphaChanged(float alpha, boolean animate) {
        for (int i = mConnectionCallbacks.size() - 1; i >= 0; --i) {
            mConnectionCallbacks.get(i).onBackButtonAlphaChanged(alpha, animate);
            mConnectionCallbacks.get(i).onNavBarButtonAlphaChanged(alpha, animate);
        }
    }

@@ -766,7 +787,8 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
        default void onQuickStepStarted() {}
        default void onOverviewShown(boolean fromHome) {}
        default void onQuickScrubStarted() {}
        default void onBackButtonAlphaChanged(float alpha, boolean animate) {}
        /** Notify changes in the nav bar button alpha */
        default void onNavBarButtonAlphaChanged(float alpha, boolean animate) {}
        default void onSystemUiStateChanged(int sysuiStateFlags) {}
        default void onAssistantProgress(@FloatRange(from = 0.0, to = 1.0) float progress) {}
        default void onAssistantGestureCompletion(float velocity) {}
Loading