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

Commit 1f14b150 authored by Jeff Sharkey's avatar Jeff Sharkey Committed by android-build-merger
Browse files

Merge "Even more auto-doc work." into oc-dev am: 880f4f4c

am: 9652eef0

Change-Id: I96c77c62b6ee3b5acaa45e116d35c7114797a0b8
parents ee95a3ac 9652eef0
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -53,4 +53,9 @@ public @interface BroadcastBehavior {
     * @see Intent#FLAG_RECEIVER_INCLUDE_BACKGROUND
     * @see Intent#FLAG_RECEIVER_INCLUDE_BACKGROUND
     */
     */
    boolean includeBackground() default false;
    boolean includeBackground() default false;

    /**
     * This broadcast is protected and can only be sent by the OS.
     */
    boolean protectedBroadcast() default false;
}
}
+1 −1
Original line number Original line Diff line number Diff line
@@ -5841,7 +5841,7 @@ public class Activity extends ContextThemeWrapper
     * @return Returns the single SharedPreferences instance that can be used
     * @return Returns the single SharedPreferences instance that can be used
     *         to retrieve and modify the preference values.
     *         to retrieve and modify the preference values.
     */
     */
    public SharedPreferences getPreferences(int mode) {
    public SharedPreferences getPreferences(@Context.PreferencesMode int mode) {
        return getSharedPreferences(getLocalClassName(), mode);
        return getSharedPreferences(getLocalClassName(), mode);
    }
    }


+18 −15
Original line number Original line Diff line number Diff line
@@ -2366,6 +2366,14 @@ public class ActivityManager {
        }
        }
    }
    }


    /** @hide */
    @IntDef(flag = true, prefix = { "MOVE_TASK_" }, value = {
            MOVE_TASK_WITH_HOME,
            MOVE_TASK_NO_USER_ACTION,
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface MoveTaskFlags {}

    /**
    /**
     * Flag for {@link #moveTaskToFront(int, int)}: also move the "home"
     * Flag for {@link #moveTaskToFront(int, int)}: also move the "home"
     * activity along with the task, so it is positioned immediately behind
     * activity along with the task, so it is positioned immediately behind
@@ -2386,28 +2394,26 @@ public class ActivityManager {
     *
     *
     * @param taskId The identifier of the task to be moved, as found in
     * @param taskId The identifier of the task to be moved, as found in
     * {@link RunningTaskInfo} or {@link RecentTaskInfo}.
     * {@link RunningTaskInfo} or {@link RecentTaskInfo}.
     * @param flags Additional operational flags, 0 or more of
     * @param flags Additional operational flags.
     * {@link #MOVE_TASK_WITH_HOME}, {@link #MOVE_TASK_NO_USER_ACTION}.
     */
     */
    public void moveTaskToFront(int taskId, int flags) {
    @RequiresPermission(android.Manifest.permission.REORDER_TASKS)
    public void moveTaskToFront(int taskId, @MoveTaskFlags int flags) {
        moveTaskToFront(taskId, flags, null);
        moveTaskToFront(taskId, flags, null);
    }
    }


    /**
    /**
     * Ask that the task associated with a given task ID be moved to the
     * Ask that the task associated with a given task ID be moved to the
     * front of the stack, so it is now visible to the user.  Requires that
     * front of the stack, so it is now visible to the user.
     * the caller hold permission {@link android.Manifest.permission#REORDER_TASKS}
     * or a SecurityException will be thrown.
     *
     *
     * @param taskId The identifier of the task to be moved, as found in
     * @param taskId The identifier of the task to be moved, as found in
     * {@link RunningTaskInfo} or {@link RecentTaskInfo}.
     * {@link RunningTaskInfo} or {@link RecentTaskInfo}.
     * @param flags Additional operational flags, 0 or more of
     * @param flags Additional operational flags.
     * {@link #MOVE_TASK_WITH_HOME}, {@link #MOVE_TASK_NO_USER_ACTION}.
     * @param options Additional options for the operation, either null or
     * @param options Additional options for the operation, either null or
     * as per {@link Context#startActivity(Intent, android.os.Bundle)
     * as per {@link Context#startActivity(Intent, android.os.Bundle)
     * Context.startActivity(Intent, Bundle)}.
     * Context.startActivity(Intent, Bundle)}.
     */
     */
    public void moveTaskToFront(int taskId, int flags, Bundle options) {
    @RequiresPermission(android.Manifest.permission.REORDER_TASKS)
    public void moveTaskToFront(int taskId, @MoveTaskFlags int flags, Bundle options) {
        try {
        try {
            getService().moveTaskToFront(taskId, flags, options);
            getService().moveTaskToFront(taskId, flags, options);
        } catch (RemoteException e) {
        } catch (RemoteException e) {
@@ -3653,13 +3659,10 @@ public class ActivityManager {
     * processes to reclaim memory; the system will take care of restarting
     * processes to reclaim memory; the system will take care of restarting
     * these processes in the future as needed.
     * these processes in the future as needed.
     *
     *
     * <p>You must hold the permission
     * {@link android.Manifest.permission#KILL_BACKGROUND_PROCESSES} to be able to
     * call this method.
     *
     * @param packageName The name of the package whose processes are to
     * @param packageName The name of the package whose processes are to
     * be killed.
     * be killed.
     */
     */
    @RequiresPermission(Manifest.permission.KILL_BACKGROUND_PROCESSES)
    public void killBackgroundProcesses(String packageName) {
    public void killBackgroundProcesses(String packageName) {
        try {
        try {
            getService().killBackgroundProcesses(packageName,
            getService().killBackgroundProcesses(packageName,
@@ -4031,13 +4034,13 @@ public class ActivityManager {
     * Perform a system dump of various state associated with the given application
     * Perform a system dump of various state associated with the given application
     * package name.  This call blocks while the dump is being performed, so should
     * package name.  This call blocks while the dump is being performed, so should
     * not be done on a UI thread.  The data will be written to the given file
     * not be done on a UI thread.  The data will be written to the given file
     * descriptor as text.  An application must hold the
     * descriptor as text.
     * {@link android.Manifest.permission#DUMP} permission to make this call.
     * @param fd The file descriptor that the dump should be written to.  The file
     * @param fd The file descriptor that the dump should be written to.  The file
     * descriptor is <em>not</em> closed by this function; the caller continues to
     * descriptor is <em>not</em> closed by this function; the caller continues to
     * own it.
     * own it.
     * @param packageName The name of the package that is to be dumped.
     * @param packageName The name of the package that is to be dumped.
     */
     */
    @RequiresPermission(Manifest.permission.DUMP)
    public void dumpPackageState(FileDescriptor fd, String packageName) {
    public void dumpPackageState(FileDescriptor fd, String packageName) {
        dumpPackageStateStatic(fd, packageName);
        dumpPackageStateStatic(fd, packageName);
    }
    }
+48 −38
Original line number Original line Diff line number Diff line
@@ -16,6 +16,7 @@


package android.app;
package android.app;


import android.annotation.IntDef;
import android.annotation.SdkConstant;
import android.annotation.SdkConstant;
import android.annotation.SystemApi;
import android.annotation.SystemApi;
import android.content.Context;
import android.content.Context;
@@ -34,6 +35,8 @@ import android.util.Log;
import libcore.util.ZoneInfoDB;
import libcore.util.ZoneInfoDB;


import java.io.IOException;
import java.io.IOException;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;


/**
/**
 * This class provides access to the system alarm services.  These allow you
 * This class provides access to the system alarm services.  These allow you
@@ -78,6 +81,16 @@ import java.io.IOException;
public class AlarmManager {
public class AlarmManager {
    private static final String TAG = "AlarmManager";
    private static final String TAG = "AlarmManager";


    /** @hide */
    @IntDef(prefix = { "RTC", "ELAPSED" }, value = {
            RTC_WAKEUP,
            RTC,
            ELAPSED_REALTIME_WAKEUP,
            ELAPSED_REALTIME,
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface AlarmType {}

    /**
    /**
     * Alarm time in {@link System#currentTimeMillis System.currentTimeMillis()}
     * Alarm time in {@link System#currentTimeMillis System.currentTimeMillis()}
     * (wall clock time in UTC), which will wake up the device when
     * (wall clock time in UTC), which will wake up the device when
@@ -311,8 +324,7 @@ public class AlarmManager {
     * will be treated as exact.
     * will be treated as exact.
     * </div>
     * </div>
     *
     *
     * @param type One of {@link #ELAPSED_REALTIME}, {@link #ELAPSED_REALTIME_WAKEUP},
     * @param type type of alarm.
     *        {@link #RTC}, or {@link #RTC_WAKEUP}.
     * @param triggerAtMillis time in milliseconds that the alarm should go
     * @param triggerAtMillis time in milliseconds that the alarm should go
     * off, using the appropriate clock (depending on the alarm type).
     * off, using the appropriate clock (depending on the alarm type).
     * @param operation Action to perform when the alarm goes off;
     * @param operation Action to perform when the alarm goes off;
@@ -332,7 +344,7 @@ public class AlarmManager {
     * @see #RTC
     * @see #RTC
     * @see #RTC_WAKEUP
     * @see #RTC_WAKEUP
     */
     */
    public void set(int type, long triggerAtMillis, PendingIntent operation) {
    public void set(@AlarmType int type, long triggerAtMillis, PendingIntent operation) {
        setImpl(type, triggerAtMillis, legacyExactLength(), 0, 0, operation, null, null,
        setImpl(type, triggerAtMillis, legacyExactLength(), 0, 0, operation, null, null,
                null, null, null);
                null, null, null);
    }
    }
@@ -346,8 +358,7 @@ public class AlarmManager {
     * invoked via the specified target Handler, or on the application's main looper
     * invoked via the specified target Handler, or on the application's main looper
     * if {@code null} is passed as the {@code targetHandler} parameter.
     * if {@code null} is passed as the {@code targetHandler} parameter.
     *
     *
     * @param type One of {@link #ELAPSED_REALTIME}, {@link #ELAPSED_REALTIME_WAKEUP},
     * @param type type of alarm.
     *         {@link #RTC}, or {@link #RTC_WAKEUP}.
     * @param triggerAtMillis time in milliseconds that the alarm should go
     * @param triggerAtMillis time in milliseconds that the alarm should go
     *         off, using the appropriate clock (depending on the alarm type).
     *         off, using the appropriate clock (depending on the alarm type).
     * @param tag string describing the alarm, used for logging and battery-use
     * @param tag string describing the alarm, used for logging and battery-use
@@ -360,7 +371,7 @@ public class AlarmManager {
     * @param targetHandler {@link Handler} on which to execute the listener's onAlarm()
     * @param targetHandler {@link Handler} on which to execute the listener's onAlarm()
     *         callback, or {@code null} to run that callback on the main looper.
     *         callback, or {@code null} to run that callback on the main looper.
     */
     */
    public void set(int type, long triggerAtMillis, String tag, OnAlarmListener listener,
    public void set(@AlarmType int type, long triggerAtMillis, String tag, OnAlarmListener listener,
            Handler targetHandler) {
            Handler targetHandler) {
        setImpl(type, triggerAtMillis, legacyExactLength(), 0, 0, null, listener, tag,
        setImpl(type, triggerAtMillis, legacyExactLength(), 0, 0, null, listener, tag,
                targetHandler, null, null);
                targetHandler, null, null);
@@ -399,8 +410,7 @@ public class AlarmManager {
     * whose {@code targetSdkVersion} is earlier than API 19 will continue to have all
     * whose {@code targetSdkVersion} is earlier than API 19 will continue to have all
     * of their alarms, including repeating alarms, treated as exact.
     * of their alarms, including repeating alarms, treated as exact.
     *
     *
     * @param type One of {@link #ELAPSED_REALTIME}, {@link #ELAPSED_REALTIME_WAKEUP},
     * @param type type of alarm.
     *        {@link #RTC}, or {@link #RTC_WAKEUP}.
     * @param triggerAtMillis time in milliseconds that the alarm should first
     * @param triggerAtMillis time in milliseconds that the alarm should first
     * go off, using the appropriate clock (depending on the alarm type).
     * go off, using the appropriate clock (depending on the alarm type).
     * @param intervalMillis interval in milliseconds between subsequent repeats
     * @param intervalMillis interval in milliseconds between subsequent repeats
@@ -422,7 +432,7 @@ public class AlarmManager {
     * @see #RTC
     * @see #RTC
     * @see #RTC_WAKEUP
     * @see #RTC_WAKEUP
     */
     */
    public void setRepeating(int type, long triggerAtMillis,
    public void setRepeating(@AlarmType int type, long triggerAtMillis,
            long intervalMillis, PendingIntent operation) {
            long intervalMillis, PendingIntent operation) {
        setImpl(type, triggerAtMillis, legacyExactLength(), intervalMillis, 0, operation,
        setImpl(type, triggerAtMillis, legacyExactLength(), intervalMillis, 0, operation,
                null, null, null, null, null);
                null, null, null, null, null);
@@ -448,8 +458,7 @@ public class AlarmManager {
     * at precisely-specified times with no acceptable variation, applications can use
     * at precisely-specified times with no acceptable variation, applications can use
     * {@link #setExact(int, long, PendingIntent)}.
     * {@link #setExact(int, long, PendingIntent)}.
     *
     *
     * @param type One of {@link #ELAPSED_REALTIME}, {@link #ELAPSED_REALTIME_WAKEUP},
     * @param type type of alarm.
     *        {@link #RTC}, or {@link #RTC_WAKEUP}.
     * @param windowStartMillis The earliest time, in milliseconds, that the alarm should
     * @param windowStartMillis The earliest time, in milliseconds, that the alarm should
     *        be delivered, expressed in the appropriate clock's units (depending on the alarm
     *        be delivered, expressed in the appropriate clock's units (depending on the alarm
     *        type).
     *        type).
@@ -473,7 +482,7 @@ public class AlarmManager {
     * @see #RTC
     * @see #RTC
     * @see #RTC_WAKEUP
     * @see #RTC_WAKEUP
     */
     */
    public void setWindow(int type, long windowStartMillis, long windowLengthMillis,
    public void setWindow(@AlarmType int type, long windowStartMillis, long windowLengthMillis,
            PendingIntent operation) {
            PendingIntent operation) {
        setImpl(type, windowStartMillis, windowLengthMillis, 0, 0, operation,
        setImpl(type, windowStartMillis, windowLengthMillis, 0, 0, operation,
                null, null, null, null, null);
                null, null, null, null, null);
@@ -488,7 +497,7 @@ public class AlarmManager {
     * invoked via the specified target Handler, or on the application's main looper
     * invoked via the specified target Handler, or on the application's main looper
     * if {@code null} is passed as the {@code targetHandler} parameter.
     * if {@code null} is passed as the {@code targetHandler} parameter.
     */
     */
    public void setWindow(int type, long windowStartMillis, long windowLengthMillis,
    public void setWindow(@AlarmType int type, long windowStartMillis, long windowLengthMillis,
            String tag, OnAlarmListener listener, Handler targetHandler) {
            String tag, OnAlarmListener listener, Handler targetHandler) {
        setImpl(type, windowStartMillis, windowLengthMillis, 0, 0, null, listener, tag,
        setImpl(type, windowStartMillis, windowLengthMillis, 0, 0, null, listener, tag,
                targetHandler, null, null);
                targetHandler, null, null);
@@ -508,8 +517,7 @@ public class AlarmManager {
     * scheduled as exact.  Applications are strongly discouraged from using exact
     * scheduled as exact.  Applications are strongly discouraged from using exact
     * alarms unnecessarily as they reduce the OS's ability to minimize battery use.
     * alarms unnecessarily as they reduce the OS's ability to minimize battery use.
     *
     *
     * @param type One of {@link #ELAPSED_REALTIME}, {@link #ELAPSED_REALTIME_WAKEUP},
     * @param type type of alarm.
     *        {@link #RTC}, or {@link #RTC_WAKEUP}.
     * @param triggerAtMillis time in milliseconds that the alarm should go
     * @param triggerAtMillis time in milliseconds that the alarm should go
     *        off, using the appropriate clock (depending on the alarm type).
     *        off, using the appropriate clock (depending on the alarm type).
     * @param operation Action to perform when the alarm goes off;
     * @param operation Action to perform when the alarm goes off;
@@ -528,7 +536,7 @@ public class AlarmManager {
     * @see #RTC
     * @see #RTC
     * @see #RTC_WAKEUP
     * @see #RTC_WAKEUP
     */
     */
    public void setExact(int type, long triggerAtMillis, PendingIntent operation) {
    public void setExact(@AlarmType int type, long triggerAtMillis, PendingIntent operation) {
        setImpl(type, triggerAtMillis, WINDOW_EXACT, 0, 0, operation, null, null, null,
        setImpl(type, triggerAtMillis, WINDOW_EXACT, 0, 0, operation, null, null, null,
                null, null);
                null, null);
    }
    }
@@ -542,8 +550,8 @@ public class AlarmManager {
     * invoked via the specified target Handler, or on the application's main looper
     * invoked via the specified target Handler, or on the application's main looper
     * if {@code null} is passed as the {@code targetHandler} parameter.
     * if {@code null} is passed as the {@code targetHandler} parameter.
     */
     */
    public void setExact(int type, long triggerAtMillis, String tag, OnAlarmListener listener,
    public void setExact(@AlarmType int type, long triggerAtMillis, String tag,
            Handler targetHandler) {
            OnAlarmListener listener, Handler targetHandler) {
        setImpl(type, triggerAtMillis, WINDOW_EXACT, 0, 0, null, listener, tag,
        setImpl(type, triggerAtMillis, WINDOW_EXACT, 0, 0, null, listener, tag,
                targetHandler, null, null);
                targetHandler, null, null);
    }
    }
@@ -553,8 +561,8 @@ public class AlarmManager {
     * the given time.
     * the given time.
     * @hide
     * @hide
     */
     */
    public void setIdleUntil(int type, long triggerAtMillis, String tag, OnAlarmListener listener,
    public void setIdleUntil(@AlarmType int type, long triggerAtMillis, String tag,
            Handler targetHandler) {
            OnAlarmListener listener, Handler targetHandler) {
        setImpl(type, triggerAtMillis, WINDOW_EXACT, 0, FLAG_IDLE_UNTIL, null,
        setImpl(type, triggerAtMillis, WINDOW_EXACT, 0, FLAG_IDLE_UNTIL, null,
                listener, tag, targetHandler, null, null);
                listener, tag, targetHandler, null, null);
    }
    }
@@ -590,8 +598,8 @@ public class AlarmManager {


    /** @hide */
    /** @hide */
    @SystemApi
    @SystemApi
    public void set(int type, long triggerAtMillis, long windowMillis, long intervalMillis,
    public void set(@AlarmType int type, long triggerAtMillis, long windowMillis,
            PendingIntent operation, WorkSource workSource) {
            long intervalMillis, PendingIntent operation, WorkSource workSource) {
        setImpl(type, triggerAtMillis, windowMillis, intervalMillis, 0, operation, null, null,
        setImpl(type, triggerAtMillis, windowMillis, intervalMillis, 0, operation, null, null,
                null, workSource, null);
                null, workSource, null);
    }
    }
@@ -606,8 +614,9 @@ public class AlarmManager {
     *
     *
     * @hide
     * @hide
     */
     */
    public void set(int type, long triggerAtMillis, long windowMillis, long intervalMillis,
    public void set(@AlarmType int type, long triggerAtMillis, long windowMillis,
            String tag, OnAlarmListener listener, Handler targetHandler, WorkSource workSource) {
            long intervalMillis, String tag, OnAlarmListener listener, Handler targetHandler,
            WorkSource workSource) {
        setImpl(type, triggerAtMillis, windowMillis, intervalMillis, 0, null, listener, tag,
        setImpl(type, triggerAtMillis, windowMillis, intervalMillis, 0, null, listener, tag,
                targetHandler, workSource, null);
                targetHandler, workSource, null);
    }
    }
@@ -623,15 +632,17 @@ public class AlarmManager {
     * @hide
     * @hide
     */
     */
    @SystemApi
    @SystemApi
    public void set(int type, long triggerAtMillis, long windowMillis, long intervalMillis,
    public void set(@AlarmType int type, long triggerAtMillis, long windowMillis,
            OnAlarmListener listener, Handler targetHandler, WorkSource workSource) {
            long intervalMillis, OnAlarmListener listener, Handler targetHandler,
            WorkSource workSource) {
        setImpl(type, triggerAtMillis, windowMillis, intervalMillis, 0, null, listener, null,
        setImpl(type, triggerAtMillis, windowMillis, intervalMillis, 0, null, listener, null,
                targetHandler, workSource, null);
                targetHandler, workSource, null);
    }
    }


    private void setImpl(int type, long triggerAtMillis, long windowMillis, long intervalMillis,
    private void setImpl(@AlarmType int type, long triggerAtMillis, long windowMillis,
            int flags, PendingIntent operation, final OnAlarmListener listener, String listenerTag,
            long intervalMillis, int flags, PendingIntent operation, final OnAlarmListener listener,
            Handler targetHandler, WorkSource workSource, AlarmClockInfo alarmClock) {
            String listenerTag, Handler targetHandler, WorkSource workSource,
            AlarmClockInfo alarmClock) {
        if (triggerAtMillis < 0) {
        if (triggerAtMillis < 0) {
            /* NOTYET
            /* NOTYET
            if (mAlwaysExact) {
            if (mAlwaysExact) {
@@ -728,8 +739,7 @@ public class AlarmManager {
     * assured that it will get similar behavior on both current and older versions
     * assured that it will get similar behavior on both current and older versions
     * of Android.
     * of Android.
     *
     *
     * @param type One of {@link #ELAPSED_REALTIME}, {@link #ELAPSED_REALTIME_WAKEUP},
     * @param type type of alarm.
     *        {@link #RTC}, or {@link #RTC_WAKEUP}.
     * @param triggerAtMillis time in milliseconds that the alarm should first
     * @param triggerAtMillis time in milliseconds that the alarm should first
     * go off, using the appropriate clock (depending on the alarm type).  This
     * go off, using the appropriate clock (depending on the alarm type).  This
     * is inexact: the alarm will not fire before this time, but there may be a
     * is inexact: the alarm will not fire before this time, but there may be a
@@ -763,7 +773,7 @@ public class AlarmManager {
     * @see #INTERVAL_HALF_DAY
     * @see #INTERVAL_HALF_DAY
     * @see #INTERVAL_DAY
     * @see #INTERVAL_DAY
     */
     */
    public void setInexactRepeating(int type, long triggerAtMillis,
    public void setInexactRepeating(@AlarmType int type, long triggerAtMillis,
            long intervalMillis, PendingIntent operation) {
            long intervalMillis, PendingIntent operation) {
        setImpl(type, triggerAtMillis, WINDOW_HEURISTIC, intervalMillis, 0, operation, null,
        setImpl(type, triggerAtMillis, WINDOW_HEURISTIC, intervalMillis, 0, operation, null,
                null, null, null, null);
                null, null, null, null);
@@ -795,8 +805,7 @@ public class AlarmManager {
     * <p>Regardless of the app's target SDK version, this call always allows batching of the
     * <p>Regardless of the app's target SDK version, this call always allows batching of the
     * alarm.</p>
     * alarm.</p>
     *
     *
     * @param type One of {@link #ELAPSED_REALTIME}, {@link #ELAPSED_REALTIME_WAKEUP},
     * @param type type of alarm.
     *        {@link #RTC}, or {@link #RTC_WAKEUP}.
     * @param triggerAtMillis time in milliseconds that the alarm should go
     * @param triggerAtMillis time in milliseconds that the alarm should go
     * off, using the appropriate clock (depending on the alarm type).
     * off, using the appropriate clock (depending on the alarm type).
     * @param operation Action to perform when the alarm goes off;
     * @param operation Action to perform when the alarm goes off;
@@ -814,7 +823,8 @@ public class AlarmManager {
     * @see #RTC
     * @see #RTC
     * @see #RTC_WAKEUP
     * @see #RTC_WAKEUP
     */
     */
    public void setAndAllowWhileIdle(int type, long triggerAtMillis, PendingIntent operation) {
    public void setAndAllowWhileIdle(@AlarmType int type, long triggerAtMillis,
            PendingIntent operation) {
        setImpl(type, triggerAtMillis, WINDOW_HEURISTIC, 0, FLAG_ALLOW_WHILE_IDLE,
        setImpl(type, triggerAtMillis, WINDOW_HEURISTIC, 0, FLAG_ALLOW_WHILE_IDLE,
                operation, null, null, null, null, null);
                operation, null, null, null, null, null);
    }
    }
@@ -848,8 +858,7 @@ public class AlarmManager {
     * device is idle it may take even more liberties with scheduling in order to optimize
     * device is idle it may take even more liberties with scheduling in order to optimize
     * for battery life.</p>
     * for battery life.</p>
     *
     *
     * @param type One of {@link #ELAPSED_REALTIME}, {@link #ELAPSED_REALTIME_WAKEUP},
     * @param type type of alarm.
     *        {@link #RTC}, or {@link #RTC_WAKEUP}.
     * @param triggerAtMillis time in milliseconds that the alarm should go
     * @param triggerAtMillis time in milliseconds that the alarm should go
     *        off, using the appropriate clock (depending on the alarm type).
     *        off, using the appropriate clock (depending on the alarm type).
     * @param operation Action to perform when the alarm goes off;
     * @param operation Action to perform when the alarm goes off;
@@ -868,7 +877,8 @@ public class AlarmManager {
     * @see #RTC
     * @see #RTC
     * @see #RTC_WAKEUP
     * @see #RTC_WAKEUP
     */
     */
    public void setExactAndAllowWhileIdle(int type, long triggerAtMillis, PendingIntent operation) {
    public void setExactAndAllowWhileIdle(@AlarmType int type, long triggerAtMillis,
            PendingIntent operation) {
        setImpl(type, triggerAtMillis, WINDOW_EXACT, 0, FLAG_ALLOW_WHILE_IDLE, operation,
        setImpl(type, triggerAtMillis, WINDOW_EXACT, 0, FLAG_ALLOW_WHILE_IDLE, operation,
                null, null, null, null, null);
                null, null, null, null, null);
    }
    }
+11 −5
Original line number Original line Diff line number Diff line
@@ -676,7 +676,16 @@ public class Notification implements Parcelable
     * Finally, a notification can be made {@link #VISIBILITY_SECRET}, which will suppress its icon
     * Finally, a notification can be made {@link #VISIBILITY_SECRET}, which will suppress its icon
     * and ticker until the user has bypassed the lockscreen.
     * and ticker until the user has bypassed the lockscreen.
     */
     */
    public int visibility;
    public @Visibility int visibility;

    /** @hide */
    @IntDef(prefix = { "VISIBILITY_" }, value = {
            VISIBILITY_PUBLIC,
            VISIBILITY_PRIVATE,
            VISIBILITY_SECRET,
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface Visibility {}


    /**
    /**
     * Notification visibility: Show this notification in its entirety on all lockscreens.
     * Notification visibility: Show this notification in its entirety on all lockscreens.
@@ -3545,12 +3554,9 @@ public class Notification implements Parcelable
        /**
        /**
         * Specify the value of {@link #visibility}.
         * Specify the value of {@link #visibility}.
         *
         *
         * @param visibility One of {@link #VISIBILITY_PRIVATE} (the default),
         * {@link #VISIBILITY_SECRET}, or {@link #VISIBILITY_PUBLIC}.
         *
         * @return The same Builder.
         * @return The same Builder.
         */
         */
        public Builder setVisibility(int visibility) {
        public Builder setVisibility(@Visibility int visibility) {
            mN.visibility = visibility;
            mN.visibility = visibility;
            return this;
            return this;
        }
        }
Loading