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

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

Snap for 8994498 from f3b18885 to tm-qpr1-release

Change-Id: Ie9236ea7e6516e5b0055ffe97244f2a861e75415
parents e2afd78e f3b18885
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -72,6 +72,7 @@ import android.view.IRemoteAnimationRunner;
import android.view.IWindowFocusObserver;
import android.view.RemoteAnimationDefinition;
import android.view.RemoteAnimationAdapter;
import android.window.BackAnimationAdaptor;
import android.window.IWindowOrganizerController;
import android.window.BackNavigationInfo;
import android.window.SplashScreenView;
@@ -356,5 +357,5 @@ interface IActivityTaskManager {
     * @param focusObserver a remote callback to nofify shell when the focused window lost focus.
     */
    android.window.BackNavigationInfo startBackNavigation(in boolean requestAnimation,
            in IWindowFocusObserver focusObserver);
            in IWindowFocusObserver focusObserver, in BackAnimationAdaptor adaptor);
}
+37 −3
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ import android.net.ipsec.ike.IkeSessionParams.IkeAuthPskConfig;
import android.net.ipsec.ike.IkeSessionParams.IkeConfigRequest;
import android.os.PersistableBundle;
import android.util.ArraySet;
import android.util.Log;

import com.android.internal.annotations.VisibleForTesting;
import com.android.server.vcn.util.PersistableBundleUtils;
@@ -58,6 +59,8 @@ import java.util.Set;
 */
@VisibleForTesting(visibility = Visibility.PRIVATE)
public final class IkeSessionParamsUtils {
    private static final String TAG = IkeSessionParamsUtils.class.getSimpleName();

    private static final String SERVER_HOST_NAME_KEY = "SERVER_HOST_NAME_KEY";
    private static final String SA_PROPOSALS_KEY = "SA_PROPOSALS_KEY";
    private static final String LOCAL_ID_KEY = "LOCAL_ID_KEY";
@@ -72,6 +75,13 @@ public final class IkeSessionParamsUtils {
    private static final String NATT_KEEPALIVE_DELAY_SEC_KEY = "NATT_KEEPALIVE_DELAY_SEC_KEY";
    private static final String IKE_OPTIONS_KEY = "IKE_OPTIONS_KEY";

    // TODO: b/243181760 Use the IKE API when they are exposed
    @VisibleForTesting(visibility = Visibility.PRIVATE)
    public static final int IKE_OPTION_AUTOMATIC_ADDRESS_FAMILY_SELECTION = 6;

    @VisibleForTesting(visibility = Visibility.PRIVATE)
    public static final int IKE_OPTION_AUTOMATIC_NATT_KEEPALIVES = 7;

    private static final Set<Integer> IKE_OPTIONS = new ArraySet<>();

    static {
@@ -80,6 +90,26 @@ public final class IkeSessionParamsUtils {
        IKE_OPTIONS.add(IkeSessionParams.IKE_OPTION_MOBIKE);
        IKE_OPTIONS.add(IkeSessionParams.IKE_OPTION_FORCE_PORT_4500);
        IKE_OPTIONS.add(IkeSessionParams.IKE_OPTION_INITIAL_CONTACT);
        IKE_OPTIONS.add(IkeSessionParams.IKE_OPTION_REKEY_MOBILITY);
        IKE_OPTIONS.add(IKE_OPTION_AUTOMATIC_ADDRESS_FAMILY_SELECTION);
        IKE_OPTIONS.add(IKE_OPTION_AUTOMATIC_NATT_KEEPALIVES);
    }

    /**
     * Check if an IKE option is supported in the IPsec module installed on the device
     *
     * <p>This method ensures caller to safely access options that are added between dessert
     * releases.
     */
    @VisibleForTesting(visibility = Visibility.PRIVATE)
    public static boolean isIkeOptionValid(int option) {
        try {
            new IkeSessionParams.Builder().addIkeOption(option);
            return true;
        } catch (IllegalArgumentException e) {
            Log.d(TAG, "Option not supported; discarding: " + option);
            return false;
        }
    }

    /** Serializes an IkeSessionParams to a PersistableBundle. */
@@ -130,7 +160,7 @@ public final class IkeSessionParamsUtils {
        // IKE_OPTION is defined in IKE module and added in the IkeSessionParams
        final List<Integer> enabledIkeOptions = new ArrayList<>();
        for (int option : IKE_OPTIONS) {
            if (params.hasIkeOption(option)) {
            if (isIkeOptionValid(option) && params.hasIkeOption(option)) {
                enabledIkeOptions.add(option);
            }
        }
@@ -205,13 +235,17 @@ public final class IkeSessionParamsUtils {

        // Clear IKE Options that are by default enabled
        for (int option : IKE_OPTIONS) {
            if (isIkeOptionValid(option)) {
                builder.removeIkeOption(option);
            }
        }

        final int[] optionArray = in.getIntArray(IKE_OPTIONS_KEY);
        for (int option : optionArray) {
            if (isIkeOptionValid(option)) {
                builder.addIkeOption(option);
            }
        }

        return builder.build();
    }
+2 −11
Original line number Diff line number Diff line
@@ -956,16 +956,7 @@ public abstract class BatteryStats implements Parcelable {

        public static final int NUM_WIFI_BATCHED_SCAN_BINS = 5;

        /**
         * Note that these must match the constants in android.os.PowerManager.
         * Also, if the user activity types change, the BatteryStatsImpl.VERSION must
         * also be bumped.
         */
        static final String[] USER_ACTIVITY_TYPES = {
            "other", "button", "touch", "accessibility", "attention"
        };

        public static final int NUM_USER_ACTIVITY_TYPES = USER_ACTIVITY_TYPES.length;
        public static final int NUM_USER_ACTIVITY_TYPES = PowerManager.USER_ACTIVITY_EVENT_MAX + 1;

        public abstract void noteUserActivityLocked(int type);
        public abstract boolean hasUserActivity();
@@ -6177,7 +6168,7 @@ public abstract class BatteryStats implements Parcelable {
                        }
                        sb.append(val);
                        sb.append(" ");
                        sb.append(Uid.USER_ACTIVITY_TYPES[i]);
                        sb.append(PowerManager.userActivityEventToString(i));
                    }
                }
                if (hasData) {
+38 −0
Original line number Diff line number Diff line
@@ -344,6 +344,44 @@ public final class PowerManager {
     */
    public static final int USER_ACTIVITY_EVENT_DEVICE_STATE = 6;

    /**
     * @hide
     */
    public static final int USER_ACTIVITY_EVENT_MAX =  USER_ACTIVITY_EVENT_DEVICE_STATE;

    /**
     * @hide
     */
    @IntDef(prefix = { "USER_ACTIVITY_EVENT_" }, value = {
            USER_ACTIVITY_EVENT_OTHER,
            USER_ACTIVITY_EVENT_BUTTON,
            USER_ACTIVITY_EVENT_TOUCH,
            USER_ACTIVITY_EVENT_ACCESSIBILITY,
            USER_ACTIVITY_EVENT_ATTENTION,
            USER_ACTIVITY_EVENT_FACE_DOWN,
            USER_ACTIVITY_EVENT_DEVICE_STATE,
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface UserActivityEvent{}

    /**
     *
     * Convert the user activity event to a string for debugging purposes.
     * @hide
     */
    public static String userActivityEventToString(@UserActivityEvent int userActivityEvent) {
        switch (userActivityEvent) {
            case USER_ACTIVITY_EVENT_OTHER: return "other";
            case USER_ACTIVITY_EVENT_BUTTON: return "button";
            case USER_ACTIVITY_EVENT_TOUCH: return "touch";
            case USER_ACTIVITY_EVENT_ACCESSIBILITY: return "accessibility";
            case USER_ACTIVITY_EVENT_ATTENTION: return "attention";
            case USER_ACTIVITY_EVENT_FACE_DOWN: return "faceDown";
            case USER_ACTIVITY_EVENT_DEVICE_STATE: return "deviceState";
            default: return Integer.toString(userActivityEvent);
        }
    }

    /**
     * User activity flag: If already dimmed, extend the dim timeout
     * but do not brighten.  This flag is useful for keeping the screen on
+16 −0
Original line number Diff line number Diff line
@@ -90,6 +90,22 @@ public abstract class NotificationAssistantService extends NotificationListenerS
    public static final String SERVICE_INTERFACE
            = "android.service.notification.NotificationAssistantService";

    /**
     * Activity Action: Show notification assistant detail setting page in NAS app.
     * <p>
     * In some cases, a matching Activity may not exist, so ensure you
     * safeguard against this.
     * <p>
     * Input: Nothing.
     * <p>
     * Output: Nothing.
     * @hide
     */
    @SdkConstant(SdkConstant.SdkConstantType.ACTIVITY_INTENT_ACTION)
    public static final String ACTION_NOTIFICATION_ASSISTANT_DETAIL_SETTINGS =
            "android.service.notification.action.NOTIFICATION_ASSISTANT_DETAIL_SETTINGS";


    /**
     * Data type: int, the feedback rating score provided by user. The score can be any integer
     *            value depends on the experimental and feedback UX design.
Loading