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

Commit 5107e09b authored by Varun Shah's avatar Varun Shah Committed by Automerger Merge Worker
Browse files

Add a new flag to represent a user-initiated job notification. am: 9de342ab

parents 9d4cd6d7 9de342ab
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@ import static com.android.internal.os.SafeZipPathValidatorCallback.VALIDATE_ZIP_
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.app.RemoteServiceException.BadForegroundServiceNotificationException;
import android.app.RemoteServiceException.BadUserInitiatedJobNotificationException;
import android.app.RemoteServiceException.CannotPostForegroundServiceNotificationException;
import android.app.RemoteServiceException.CrashedByAdbException;
import android.app.RemoteServiceException.ForegroundServiceDidNotStartInTimeException;
@@ -2078,6 +2079,9 @@ public final class ActivityThread extends ClientTransactionHandler
            case BadForegroundServiceNotificationException.TYPE_ID:
                throw new BadForegroundServiceNotificationException(message);

            case BadUserInitiatedJobNotificationException.TYPE_ID:
                throw new BadUserInitiatedJobNotificationException(message);

            case MissingRequestPasswordComplexityPermissionException.TYPE_ID:
                throw new MissingRequestPasswordComplexityPermissionException(message);

+11 −1
Original line number Diff line number Diff line
@@ -722,6 +722,15 @@ public class Notification implements Parcelable
     */
    public static final int FLAG_FSI_REQUESTED_BUT_DENIED = 0x00004000;
    /**
     * Bit to be bitwise-ored into the {@link #flags} field that should be
     * set if this notification represents a currently running user-initiated job.
     *
     * This flag is for internal use only; applications cannot set this flag directly.
     * @hide
     */
    public static final int FLAG_USER_INITIATED_JOB = 0x00008000;
    private static final List<Class<? extends Style>> PLATFORM_STYLE_CLASSES = Arrays.asList(
            BigTextStyle.class, BigPictureStyle.class, InboxStyle.class, MediaStyle.class,
            DecoratedCustomViewStyle.class, DecoratedMediaCustomViewStyle.class,
@@ -731,7 +740,8 @@ public class Notification implements Parcelable
    @IntDef(flag = true, prefix = { "FLAG_" }, value = {FLAG_SHOW_LIGHTS, FLAG_ONGOING_EVENT,
            FLAG_INSISTENT, FLAG_ONLY_ALERT_ONCE,
            FLAG_AUTO_CANCEL, FLAG_NO_CLEAR, FLAG_FOREGROUND_SERVICE, FLAG_HIGH_PRIORITY,
            FLAG_LOCAL_ONLY, FLAG_GROUP_SUMMARY, FLAG_AUTOGROUP_SUMMARY, FLAG_BUBBLE})
            FLAG_LOCAL_ONLY, FLAG_GROUP_SUMMARY, FLAG_AUTOGROUP_SUMMARY, FLAG_BUBBLE,
            FLAG_USER_INITIATED_JOB})
    @Retention(RetentionPolicy.SOURCE)
    public @interface NotificationFlags{};
+15 −0
Original line number Diff line number Diff line
@@ -101,6 +101,21 @@ public class RemoteServiceException extends AndroidRuntimeException {
        }
    }

    /**
     * Exception used to crash an app process when the system finds an error in a user-initiated job
     * notification.
     *
     * @hide
     */
    public static class BadUserInitiatedJobNotificationException extends RemoteServiceException {
        /** The type ID passed to {@link IApplicationThread#scheduleCrash}. */
        public static final int TYPE_ID = 6;

        public BadUserInitiatedJobNotificationException(String msg) {
            super(msg);
        }
    }

    /**
     * Exception used to crash an app process when it calls a setting activity that requires
     * the {@code REQUEST_PASSWORD_COMPLEXITY} permission.