Loading api/current.txt +7 −6 Original line number Diff line number Diff line Loading @@ -3052,17 +3052,18 @@ package android.app { public class AlarmManager { method public void cancel(android.app.PendingIntent); method public void set(int, long, android.app.PendingIntent); method public void setInexactRepeating(int, long, long, android.app.PendingIntent); method public void setExact(int, long, android.app.PendingIntent); method public deprecated void setInexactRepeating(int, long, long, android.app.PendingIntent); method public void setRepeating(int, long, long, android.app.PendingIntent); method public void setTime(long); method public void setTimeZone(java.lang.String); field public static final int ELAPSED_REALTIME = 3; // 0x3 field public static final int ELAPSED_REALTIME_WAKEUP = 2; // 0x2 field public static final long INTERVAL_DAY = 86400000L; // 0x5265c00L field public static final long INTERVAL_FIFTEEN_MINUTES = 900000L; // 0xdbba0L field public static final long INTERVAL_HALF_DAY = 43200000L; // 0x2932e00L field public static final long INTERVAL_HALF_HOUR = 1800000L; // 0x1b7740L field public static final long INTERVAL_HOUR = 3600000L; // 0x36ee80L field public static final deprecated long INTERVAL_DAY = 86400000L; // 0x5265c00L field public static final deprecated long INTERVAL_FIFTEEN_MINUTES = 900000L; // 0xdbba0L field public static final deprecated long INTERVAL_HALF_DAY = 43200000L; // 0x2932e00L field public static final deprecated long INTERVAL_HALF_HOUR = 1800000L; // 0x1b7740L field public static final deprecated long INTERVAL_HOUR = 3600000L; // 0x36ee80L field public static final int RTC = 1; // 0x1 field public static final int RTC_WAKEUP = 0; // 0x0 } core/java/android/app/AlarmManager.java +56 −13 Original line number Diff line number Diff line Loading @@ -16,7 +16,9 @@ package android.app; import android.content.Context; import android.content.Intent; import android.os.Build; import android.os.RemoteException; /** Loading Loading @@ -52,6 +54,8 @@ import android.os.RemoteException; */ public class AlarmManager { private static final String TAG = "AlarmManager"; /** * Alarm time in {@link System#currentTimeMillis System.currentTimeMillis()} * (wall clock time in UTC), which will wake up the device when Loading Loading @@ -81,12 +85,16 @@ public class AlarmManager public static final int ELAPSED_REALTIME = 3; private final IAlarmManager mService; private final boolean mAlwaysExact; /** * package private on purpose */ AlarmManager(IAlarmManager service) { AlarmManager(IAlarmManager service, Context ctx) { mService = service; final int sdkVersion = ctx.getApplicationInfo().targetSdkVersion; mAlwaysExact = (sdkVersion < Build.VERSION_CODES.KEY_LIME_PIE); } /** Loading Loading @@ -133,10 +141,7 @@ public class AlarmManager * @see #RTC_WAKEUP */ public void set(int type, long triggerAtMillis, PendingIntent operation) { try { mService.set(type, triggerAtMillis, operation); } catch (RemoteException ex) { } setImpl(type, triggerAtMillis, 0, operation, mAlwaysExact); } /** Loading Loading @@ -188,20 +193,58 @@ public class AlarmManager */ public void setRepeating(int type, long triggerAtMillis, long intervalMillis, PendingIntent operation) { setImpl(type, triggerAtMillis, intervalMillis, operation, mAlwaysExact); } /** * TBW: new 'exact' alarm that must be delivered as nearly as possible * to the precise time specified. */ public void setExact(int type, long triggerAtMillis, PendingIntent operation) { setImpl(type, triggerAtMillis, 0, operation, true); } private void setImpl(int type, long triggerAtMillis, long intervalMillis, PendingIntent operation, boolean isExact) { try { mService.setRepeating(type, triggerAtMillis, intervalMillis, operation); mService.set(type, triggerAtMillis, intervalMillis, operation, isExact); } catch (RemoteException ex) { } } /** * Available inexact recurrence intervals recognized by * {@link #setInexactRepeating(int, long, long, PendingIntent)} * @deprecated setInexactRepeating() is deprecated; as of API 19 all * repeating alarms are inexact. */ @Deprecated public static final long INTERVAL_FIFTEEN_MINUTES = 15 * 60 * 1000; /** * @deprecated setInexactRepeating() is deprecated; as of API 19 all * repeating alarms are inexact. */ @Deprecated public static final long INTERVAL_HALF_HOUR = 2*INTERVAL_FIFTEEN_MINUTES; /** * @deprecated setInexactRepeating() is deprecated; as of API 19 all * repeating alarms are inexact. */ @Deprecated public static final long INTERVAL_HOUR = 2*INTERVAL_HALF_HOUR; /** * @deprecated setInexactRepeating() is deprecated; as of API 19 all * repeating alarms are inexact. */ @Deprecated public static final long INTERVAL_HALF_DAY = 12*INTERVAL_HOUR; /** * @deprecated setInexactRepeating() is deprecated; as of API 19 all * repeating alarms are inexact. */ @Deprecated public static final long INTERVAL_DAY = 2*INTERVAL_HALF_DAY; /** Loading Loading @@ -236,6 +279,8 @@ public class AlarmManager * typically comes from {@link PendingIntent#getBroadcast * IntentSender.getBroadcast()}. * * @deprecated As of API 19, all repeating alarms are inexact. * * @see android.os.Handler * @see #set * @see #cancel Loading @@ -252,12 +297,10 @@ public class AlarmManager * @see #INTERVAL_HALF_DAY * @see #INTERVAL_DAY */ @Deprecated public void setInexactRepeating(int type, long triggerAtMillis, long intervalMillis, PendingIntent operation) { try { mService.setInexactRepeating(type, triggerAtMillis, intervalMillis, operation); } catch (RemoteException ex) { } setRepeating(type, triggerAtMillis, intervalMillis, operation); } /** Loading core/java/android/app/ContextImpl.java +3 −3 Original line number Diff line number Diff line Loading @@ -309,11 +309,11 @@ class ContextImpl extends Context { return new ActivityManager(ctx.getOuterContext(), ctx.mMainThread.getHandler()); }}); registerService(ALARM_SERVICE, new StaticServiceFetcher() { public Object createStaticService() { registerService(ALARM_SERVICE, new ServiceFetcher() { public Object createService(ContextImpl ctx) { IBinder b = ServiceManager.getService(ALARM_SERVICE); IAlarmManager service = IAlarmManager.Stub.asInterface(b); return new AlarmManager(service); return new AlarmManager(service, ctx); }}); registerService(AUDIO_SERVICE, new ServiceFetcher() { Loading core/java/android/app/IAlarmManager.aidl +1 −3 Original line number Diff line number Diff line Loading @@ -24,9 +24,7 @@ import android.app.PendingIntent; * {@hide} */ interface IAlarmManager { void set(int type, long triggerAtTime, in PendingIntent operation); void setRepeating(int type, long triggerAtTime, long interval, in PendingIntent operation); void setInexactRepeating(int type, long triggerAtTime, long interval, in PendingIntent operation); void set(int type, long triggerAtTime, long interval, in PendingIntent operation, boolean isExact); void setTime(long millis); void setTimeZone(String zone); void remove(in PendingIntent operation); Loading services/java/com/android/server/AlarmManagerService.java +497 −314 File changed.Preview size limit exceeded, changes collapsed. Show changes Loading
api/current.txt +7 −6 Original line number Diff line number Diff line Loading @@ -3052,17 +3052,18 @@ package android.app { public class AlarmManager { method public void cancel(android.app.PendingIntent); method public void set(int, long, android.app.PendingIntent); method public void setInexactRepeating(int, long, long, android.app.PendingIntent); method public void setExact(int, long, android.app.PendingIntent); method public deprecated void setInexactRepeating(int, long, long, android.app.PendingIntent); method public void setRepeating(int, long, long, android.app.PendingIntent); method public void setTime(long); method public void setTimeZone(java.lang.String); field public static final int ELAPSED_REALTIME = 3; // 0x3 field public static final int ELAPSED_REALTIME_WAKEUP = 2; // 0x2 field public static final long INTERVAL_DAY = 86400000L; // 0x5265c00L field public static final long INTERVAL_FIFTEEN_MINUTES = 900000L; // 0xdbba0L field public static final long INTERVAL_HALF_DAY = 43200000L; // 0x2932e00L field public static final long INTERVAL_HALF_HOUR = 1800000L; // 0x1b7740L field public static final long INTERVAL_HOUR = 3600000L; // 0x36ee80L field public static final deprecated long INTERVAL_DAY = 86400000L; // 0x5265c00L field public static final deprecated long INTERVAL_FIFTEEN_MINUTES = 900000L; // 0xdbba0L field public static final deprecated long INTERVAL_HALF_DAY = 43200000L; // 0x2932e00L field public static final deprecated long INTERVAL_HALF_HOUR = 1800000L; // 0x1b7740L field public static final deprecated long INTERVAL_HOUR = 3600000L; // 0x36ee80L field public static final int RTC = 1; // 0x1 field public static final int RTC_WAKEUP = 0; // 0x0 }
core/java/android/app/AlarmManager.java +56 −13 Original line number Diff line number Diff line Loading @@ -16,7 +16,9 @@ package android.app; import android.content.Context; import android.content.Intent; import android.os.Build; import android.os.RemoteException; /** Loading Loading @@ -52,6 +54,8 @@ import android.os.RemoteException; */ public class AlarmManager { private static final String TAG = "AlarmManager"; /** * Alarm time in {@link System#currentTimeMillis System.currentTimeMillis()} * (wall clock time in UTC), which will wake up the device when Loading Loading @@ -81,12 +85,16 @@ public class AlarmManager public static final int ELAPSED_REALTIME = 3; private final IAlarmManager mService; private final boolean mAlwaysExact; /** * package private on purpose */ AlarmManager(IAlarmManager service) { AlarmManager(IAlarmManager service, Context ctx) { mService = service; final int sdkVersion = ctx.getApplicationInfo().targetSdkVersion; mAlwaysExact = (sdkVersion < Build.VERSION_CODES.KEY_LIME_PIE); } /** Loading Loading @@ -133,10 +141,7 @@ public class AlarmManager * @see #RTC_WAKEUP */ public void set(int type, long triggerAtMillis, PendingIntent operation) { try { mService.set(type, triggerAtMillis, operation); } catch (RemoteException ex) { } setImpl(type, triggerAtMillis, 0, operation, mAlwaysExact); } /** Loading Loading @@ -188,20 +193,58 @@ public class AlarmManager */ public void setRepeating(int type, long triggerAtMillis, long intervalMillis, PendingIntent operation) { setImpl(type, triggerAtMillis, intervalMillis, operation, mAlwaysExact); } /** * TBW: new 'exact' alarm that must be delivered as nearly as possible * to the precise time specified. */ public void setExact(int type, long triggerAtMillis, PendingIntent operation) { setImpl(type, triggerAtMillis, 0, operation, true); } private void setImpl(int type, long triggerAtMillis, long intervalMillis, PendingIntent operation, boolean isExact) { try { mService.setRepeating(type, triggerAtMillis, intervalMillis, operation); mService.set(type, triggerAtMillis, intervalMillis, operation, isExact); } catch (RemoteException ex) { } } /** * Available inexact recurrence intervals recognized by * {@link #setInexactRepeating(int, long, long, PendingIntent)} * @deprecated setInexactRepeating() is deprecated; as of API 19 all * repeating alarms are inexact. */ @Deprecated public static final long INTERVAL_FIFTEEN_MINUTES = 15 * 60 * 1000; /** * @deprecated setInexactRepeating() is deprecated; as of API 19 all * repeating alarms are inexact. */ @Deprecated public static final long INTERVAL_HALF_HOUR = 2*INTERVAL_FIFTEEN_MINUTES; /** * @deprecated setInexactRepeating() is deprecated; as of API 19 all * repeating alarms are inexact. */ @Deprecated public static final long INTERVAL_HOUR = 2*INTERVAL_HALF_HOUR; /** * @deprecated setInexactRepeating() is deprecated; as of API 19 all * repeating alarms are inexact. */ @Deprecated public static final long INTERVAL_HALF_DAY = 12*INTERVAL_HOUR; /** * @deprecated setInexactRepeating() is deprecated; as of API 19 all * repeating alarms are inexact. */ @Deprecated public static final long INTERVAL_DAY = 2*INTERVAL_HALF_DAY; /** Loading Loading @@ -236,6 +279,8 @@ public class AlarmManager * typically comes from {@link PendingIntent#getBroadcast * IntentSender.getBroadcast()}. * * @deprecated As of API 19, all repeating alarms are inexact. * * @see android.os.Handler * @see #set * @see #cancel Loading @@ -252,12 +297,10 @@ public class AlarmManager * @see #INTERVAL_HALF_DAY * @see #INTERVAL_DAY */ @Deprecated public void setInexactRepeating(int type, long triggerAtMillis, long intervalMillis, PendingIntent operation) { try { mService.setInexactRepeating(type, triggerAtMillis, intervalMillis, operation); } catch (RemoteException ex) { } setRepeating(type, triggerAtMillis, intervalMillis, operation); } /** Loading
core/java/android/app/ContextImpl.java +3 −3 Original line number Diff line number Diff line Loading @@ -309,11 +309,11 @@ class ContextImpl extends Context { return new ActivityManager(ctx.getOuterContext(), ctx.mMainThread.getHandler()); }}); registerService(ALARM_SERVICE, new StaticServiceFetcher() { public Object createStaticService() { registerService(ALARM_SERVICE, new ServiceFetcher() { public Object createService(ContextImpl ctx) { IBinder b = ServiceManager.getService(ALARM_SERVICE); IAlarmManager service = IAlarmManager.Stub.asInterface(b); return new AlarmManager(service); return new AlarmManager(service, ctx); }}); registerService(AUDIO_SERVICE, new ServiceFetcher() { Loading
core/java/android/app/IAlarmManager.aidl +1 −3 Original line number Diff line number Diff line Loading @@ -24,9 +24,7 @@ import android.app.PendingIntent; * {@hide} */ interface IAlarmManager { void set(int type, long triggerAtTime, in PendingIntent operation); void setRepeating(int type, long triggerAtTime, long interval, in PendingIntent operation); void setInexactRepeating(int type, long triggerAtTime, long interval, in PendingIntent operation); void set(int type, long triggerAtTime, long interval, in PendingIntent operation, boolean isExact); void setTime(long millis); void setTimeZone(String zone); void remove(in PendingIntent operation); Loading
services/java/com/android/server/AlarmManagerService.java +497 −314 File changed.Preview size limit exceeded, changes collapsed. Show changes