Implement some control over ALLOW_WHILE_IDLE alarms.

Since these alarms allow you to bypass the idle restrictions,
we don't want them to be so open-ended like other alarms.  This
implements a policy where the alarm manager will only deliver these
types of alarms every X minutes to each application.  For this
initial implementation, X is 1 minute under normal operation and
15 minutes when in idle mode.

To do this, I needed to introduce a new internal allow-while-idle
flag for system alarms, which applications can't get, and doesn't
have these new restrictions.

Also tweaked how the alarm manager handles the alarm window, so it
doesn't change if the alarm gets rescheduld; the window is now always
what as computed based on the time when the alarm was first
given to it.

Finally, fix TimeUtils to be able to correctly print times that
are > 999 days.

Change-Id: Ibad8c6a7c14b0624b54e82267be23224b4c31e84
diff --git a/tests/ActivityTests/AndroidManifest.xml b/tests/ActivityTests/AndroidManifest.xml
index c105491..dae7cc5 100644
--- a/tests/ActivityTests/AndroidManifest.xml
+++ b/tests/ActivityTests/AndroidManifest.xml
@@ -76,5 +76,6 @@
             android:authorities="com.google.android.test.activity.single_user"
             android:singleUser="true" android:exported="true" />
         <receiver android:name="TrackTimeReceiver" />
+        <receiver android:name="AlarmSpamReceiver" />
     </application>
 </manifest>