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

Commit 05b34396 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Revert "Deprecate the DATA_SYNC FGS type."" into main

parents d62103c2 3abb2169
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -13508,7 +13508,7 @@ package android.content.pm {
    field public static final int FLAG_USE_APP_ZYGOTE = 8; // 0x8
    field @RequiresPermission(allOf={android.Manifest.permission.FOREGROUND_SERVICE_CAMERA}, anyOf={android.Manifest.permission.CAMERA}, conditional=true) public static final int FOREGROUND_SERVICE_TYPE_CAMERA = 64; // 0x40
    field @RequiresPermission(allOf={android.Manifest.permission.FOREGROUND_SERVICE_CONNECTED_DEVICE}, anyOf={android.Manifest.permission.BLUETOOTH_ADVERTISE, android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_SCAN, android.Manifest.permission.CHANGE_NETWORK_STATE, android.Manifest.permission.CHANGE_WIFI_STATE, android.Manifest.permission.CHANGE_WIFI_MULTICAST_STATE, android.Manifest.permission.NFC, android.Manifest.permission.TRANSMIT_IR, android.Manifest.permission.UWB_RANGING}, conditional=true) public static final int FOREGROUND_SERVICE_TYPE_CONNECTED_DEVICE = 16; // 0x10
    field @Deprecated @RequiresPermission(value=android.Manifest.permission.FOREGROUND_SERVICE_DATA_SYNC, conditional=true) public static final int FOREGROUND_SERVICE_TYPE_DATA_SYNC = 1; // 0x1
    field @RequiresPermission(value=android.Manifest.permission.FOREGROUND_SERVICE_DATA_SYNC, conditional=true) public static final int FOREGROUND_SERVICE_TYPE_DATA_SYNC = 1; // 0x1
    field @RequiresPermission(allOf={android.Manifest.permission.FOREGROUND_SERVICE_HEALTH}, anyOf={android.Manifest.permission.ACTIVITY_RECOGNITION, android.Manifest.permission.BODY_SENSORS, android.Manifest.permission.HIGH_SAMPLING_RATE_SENSORS}) public static final int FOREGROUND_SERVICE_TYPE_HEALTH = 256; // 0x100
    field @RequiresPermission(allOf={android.Manifest.permission.FOREGROUND_SERVICE_LOCATION}, anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}, conditional=true) public static final int FOREGROUND_SERVICE_TYPE_LOCATION = 8; // 0x8
    field public static final int FOREGROUND_SERVICE_TYPE_MANIFEST = -1; // 0xffffffff
+1 −6
Original line number Diff line number Diff line
@@ -62,7 +62,6 @@ import android.content.pm.ServiceInfo.ForegroundServiceType;
import android.hardware.usb.UsbAccessory;
import android.hardware.usb.UsbDevice;
import android.hardware.usb.UsbManager;
import android.os.Build;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.UserHandle;
@@ -128,14 +127,10 @@ public abstract class ForegroundServiceTypePolicy {
     * The FGS type enforcement:
     * deprecating the {@link android.content.pm.ServiceInfo#FOREGROUND_SERVICE_TYPE_DATA_SYNC}.
     *
     * <p>Starting a FGS with this type from apps with targetSdkVersion
     * {@link android.os.Build.VERSION_CODES#VANILLA_ICE_CREAM} or later will result in a warning
     * in the log.
     *
     * @hide
     */
    @ChangeId
    @EnabledAfter(targetSdkVersion = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
    @Disabled
    @Overridable
    public static final long FGS_TYPE_DATA_SYNC_DEPRECATION_CHANGE_ID = 255039210L;

+1 −14
Original line number Diff line number Diff line
@@ -163,25 +163,12 @@ public class ServiceInfo extends ComponentInfo
     * Because of this, developers must make sure to stop the foreground service even if
     * {@link android.app.Service#onTimeout(int, int)} is not called on such versions.
     *
     * <p>Apps targeting API level {@link android.os.Build.VERSION_CODES#VANILLA_ICE_CREAM} and
     * later should <b>NOT</b> use this type: calling
     * {@link android.app.Service#startForeground(int, android.app.Notification, int)} with
     * this type on devices running {@link android.os.Build.VERSION_CODES#VANILLA_ICE_CREAM} is
     * still allowed, but it may throw an {@link android.app.InvalidForegroundServiceTypeException}
     * in future platform releases.
     *
     * <p class="note">
     * Use the {@link android.app.job.JobInfo.Builder#setUserInitiated(boolean)} API for
     * user-initiated, network data transfers.
     *
     * @deprecated Use {@link android.app.job.JobInfo.Builder} APIs or alternate FGS types
     * (like {@link #FOREGROUND_SERVICE_TYPE_MEDIA_PROCESSING}) applicable to your use-case.
     * @see android.app.Service#onTimeout(int, int)
     */
    @RequiresPermission(
            value = Manifest.permission.FOREGROUND_SERVICE_DATA_SYNC,
            conditional = true
    )
    @Deprecated
    public static final int FOREGROUND_SERVICE_TYPE_DATA_SYNC = 1 << 0;

    /**
+7 −9
Original line number Diff line number Diff line
@@ -1618,15 +1618,13 @@
        <!-- Data (photo, file, account) upload/download, backup/restore, import/export, fetch,
            transfer over network between device and cloud.

            <p><b>THIS TYPE IS DEPRECATED.</b>
            <p><em>Note: For apps with <code>targetSdkVersion</code>
            {@link android.os.Build.VERSION_CODES#VANILLA_ICE_CREAM} and above, this type should
            <b>NOT</b> be used: calling
            {@link android.app.Service#startForeground(int, android.app.Notification, int)}
            with this type on devices running
            {@link android.os.Build.VERSION_CODES#VANILLA_ICE_CREAM} is still allowed, but it may
            throw an {@link android.app.InvalidForegroundServiceTypeException} in future platform
            releases.</em>
            <p>For apps with <code>targetSdkVersion</code>
            {@link android.os.Build.VERSION_CODES#UPSIDE_DOWN_CAKE} and above, this type should NOT
            be used: calling
            {@link android.app.Service#startForeground(int, android.app.Notification, int)} with
            this type on devices running {@link android.os.Build.VERSION_CODES#UPSIDE_DOWN_CAKE}
            is still allowed, but calling it with this type on devices running future platform
            releases may get a {@link android.app.InvalidForegroundServiceTypeException}.
        -->
        <flag name="dataSync" value="0x01" />
        <!-- Music, video, news or other media play.