Port notification showcase to android-support-v4.

Includes OS-appropriate iconography for pre-Gingerbread,
Gingerbread, and HC+, thanks to Android Asset Studio.

Bug: 6316809
Change-Id: I348c0951a0329ac6ad65bf9838781c8e2b0c9397
diff --git a/NotificationShowcase/Android.mk b/NotificationShowcase/Android.mk
index 1130c70..acc9930 100644
--- a/NotificationShowcase/Android.mk
+++ b/NotificationShowcase/Android.mk
@@ -24,6 +24,8 @@
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
+LOCAL_STATIC_JAVA_LIBRARIES := android-support-v4
+
 LOCAL_PACKAGE_NAME := NotificationShowcase
 LOCAL_CERTIFICATE := platform
 include $(BUILD_PACKAGE)
diff --git a/NotificationShowcase/AndroidManifest.xml b/NotificationShowcase/AndroidManifest.xml
index 4b96a9a..a36da78 100644
--- a/NotificationShowcase/AndroidManifest.xml
+++ b/NotificationShowcase/AndroidManifest.xml
@@ -3,7 +3,7 @@
       package="com.android.example.notificationshowcase"
       android:versionCode="1"
       android:versionName="1.0">
-    <uses-sdk android:minSdkVersion="13" />
+    <uses-sdk android:minSdkVersion="4" />
 
     <application android:icon="@drawable/icon" android:label="@string/app_name">
         <activity android:name=".NotificationShowcaseActivity"
@@ -13,8 +13,7 @@
                 <category android:name="android.intent.category.LAUNCHER" />
             </intent-filter>
         </activity>
-        <activity android:name=".NotificationShowcaseActivity$ToastFeedbackActivity">
-        </activity>
-
+        <service  android:name=".NotificationShowcaseActivity$UpdateService"/>
+        <service  android:name=".NotificationShowcaseActivity$ProgressService"/>
     </application>
 </manifest>
diff --git a/NotificationShowcase/res/drawable-hdpi-v11/stat_notify_alarm.png b/NotificationShowcase/res/drawable-hdpi-v11/stat_notify_alarm.png
new file mode 100644
index 0000000..cdeb74b
--- /dev/null
+++ b/NotificationShowcase/res/drawable-hdpi-v11/stat_notify_alarm.png
Binary files differ
diff --git a/NotificationShowcase/res/drawable-hdpi-v9/ic_menu_upload.png b/NotificationShowcase/res/drawable-hdpi-v9/ic_menu_upload.png
new file mode 100644
index 0000000..6e1aed7
--- /dev/null
+++ b/NotificationShowcase/res/drawable-hdpi-v9/ic_menu_upload.png
Binary files differ
diff --git a/NotificationShowcase/res/drawable-hdpi-v9/ic_stat_gplus.png b/NotificationShowcase/res/drawable-hdpi-v9/ic_stat_gplus.png
new file mode 100644
index 0000000..ee45687
--- /dev/null
+++ b/NotificationShowcase/res/drawable-hdpi-v9/ic_stat_gplus.png
Binary files differ
diff --git a/NotificationShowcase/res/drawable-hdpi-v9/stat_notify_alarm.png b/NotificationShowcase/res/drawable-hdpi-v9/stat_notify_alarm.png
new file mode 100644
index 0000000..8de7bc8
--- /dev/null
+++ b/NotificationShowcase/res/drawable-hdpi-v9/stat_notify_alarm.png
Binary files differ
diff --git a/NotificationShowcase/res/drawable-hdpi-v9/stat_notify_calendar.png b/NotificationShowcase/res/drawable-hdpi-v9/stat_notify_calendar.png
new file mode 100644
index 0000000..1234158
--- /dev/null
+++ b/NotificationShowcase/res/drawable-hdpi-v9/stat_notify_calendar.png
Binary files differ
diff --git a/NotificationShowcase/res/drawable-hdpi-v9/stat_notify_email.png b/NotificationShowcase/res/drawable-hdpi-v9/stat_notify_email.png
new file mode 100644
index 0000000..83816f8
--- /dev/null
+++ b/NotificationShowcase/res/drawable-hdpi-v9/stat_notify_email.png
Binary files differ
diff --git a/NotificationShowcase/res/drawable-hdpi-v9/stat_notify_missed_call.png b/NotificationShowcase/res/drawable-hdpi-v9/stat_notify_missed_call.png
new file mode 100644
index 0000000..9f2d2fb
--- /dev/null
+++ b/NotificationShowcase/res/drawable-hdpi-v9/stat_notify_missed_call.png
Binary files differ
diff --git a/NotificationShowcase/res/drawable-hdpi-v9/stat_notify_sms.png b/NotificationShowcase/res/drawable-hdpi-v9/stat_notify_sms.png
new file mode 100644
index 0000000..a0f23f2
--- /dev/null
+++ b/NotificationShowcase/res/drawable-hdpi-v9/stat_notify_sms.png
Binary files differ
diff --git a/NotificationShowcase/res/drawable-hdpi-v9/stat_notify_talk_text.png b/NotificationShowcase/res/drawable-hdpi-v9/stat_notify_talk_text.png
new file mode 100644
index 0000000..36642db
--- /dev/null
+++ b/NotificationShowcase/res/drawable-hdpi-v9/stat_notify_talk_text.png
Binary files differ
diff --git a/NotificationShowcase/res/drawable-hdpi-v9/stat_sys_phone_call.png b/NotificationShowcase/res/drawable-hdpi-v9/stat_sys_phone_call.png
new file mode 100644
index 0000000..bdb3a7b
--- /dev/null
+++ b/NotificationShowcase/res/drawable-hdpi-v9/stat_sys_phone_call.png
Binary files differ
diff --git a/NotificationShowcase/res/drawable-hdpi-v9/twitter_icon.png b/NotificationShowcase/res/drawable-hdpi-v9/twitter_icon.png
new file mode 100644
index 0000000..5dd8cf2
--- /dev/null
+++ b/NotificationShowcase/res/drawable-hdpi-v9/twitter_icon.png
Binary files differ
diff --git a/NotificationShowcase/res/drawable-hdpi/stat_notify_alarm.png b/NotificationShowcase/res/drawable-hdpi/stat_notify_alarm.png
index cdeb74b..c2dc079 100644
--- a/NotificationShowcase/res/drawable-hdpi/stat_notify_alarm.png
+++ b/NotificationShowcase/res/drawable-hdpi/stat_notify_alarm.png
Binary files differ
diff --git a/NotificationShowcase/res/drawable-xhdpi-v11/ic_menu_upload.png b/NotificationShowcase/res/drawable-xhdpi-v11/ic_menu_upload.png
new file mode 100644
index 0000000..f1438ed
--- /dev/null
+++ b/NotificationShowcase/res/drawable-xhdpi-v11/ic_menu_upload.png
Binary files differ
diff --git a/NotificationShowcase/res/drawable-xhdpi-v11/ic_stat_gplus.png b/NotificationShowcase/res/drawable-xhdpi-v11/ic_stat_gplus.png
new file mode 100644
index 0000000..9593484
--- /dev/null
+++ b/NotificationShowcase/res/drawable-xhdpi-v11/ic_stat_gplus.png
Binary files differ
diff --git a/NotificationShowcase/res/drawable-xhdpi-v11/stat_notify_alarm.png b/NotificationShowcase/res/drawable-xhdpi-v11/stat_notify_alarm.png
new file mode 100644
index 0000000..658d04f
--- /dev/null
+++ b/NotificationShowcase/res/drawable-xhdpi-v11/stat_notify_alarm.png
Binary files differ
diff --git a/NotificationShowcase/res/drawable-xhdpi-v11/stat_notify_calendar.png b/NotificationShowcase/res/drawable-xhdpi-v11/stat_notify_calendar.png
new file mode 100644
index 0000000..5ae7782
--- /dev/null
+++ b/NotificationShowcase/res/drawable-xhdpi-v11/stat_notify_calendar.png
Binary files differ
diff --git a/NotificationShowcase/res/drawable-xhdpi-v11/stat_notify_email.png b/NotificationShowcase/res/drawable-xhdpi-v11/stat_notify_email.png
new file mode 100644
index 0000000..23c4672
--- /dev/null
+++ b/NotificationShowcase/res/drawable-xhdpi-v11/stat_notify_email.png
Binary files differ
diff --git a/NotificationShowcase/res/drawable-xhdpi-v11/stat_notify_missed_call.png b/NotificationShowcase/res/drawable-xhdpi-v11/stat_notify_missed_call.png
new file mode 100644
index 0000000..8719eff
--- /dev/null
+++ b/NotificationShowcase/res/drawable-xhdpi-v11/stat_notify_missed_call.png
Binary files differ
diff --git a/NotificationShowcase/res/drawable-xhdpi-v11/stat_notify_sms.png b/NotificationShowcase/res/drawable-xhdpi-v11/stat_notify_sms.png
new file mode 100644
index 0000000..323cb3d
--- /dev/null
+++ b/NotificationShowcase/res/drawable-xhdpi-v11/stat_notify_sms.png
Binary files differ
diff --git a/NotificationShowcase/res/drawable-xhdpi-v11/stat_notify_snooze.png b/NotificationShowcase/res/drawable-xhdpi-v11/stat_notify_snooze.png
new file mode 100644
index 0000000..26dcda3
--- /dev/null
+++ b/NotificationShowcase/res/drawable-xhdpi-v11/stat_notify_snooze.png
Binary files differ
diff --git a/NotificationShowcase/res/drawable-xhdpi-v11/stat_notify_snooze_longer.png b/NotificationShowcase/res/drawable-xhdpi-v11/stat_notify_snooze_longer.png
new file mode 100644
index 0000000..b8b2f8a
--- /dev/null
+++ b/NotificationShowcase/res/drawable-xhdpi-v11/stat_notify_snooze_longer.png
Binary files differ
diff --git a/NotificationShowcase/res/drawable-xhdpi-v11/stat_notify_talk_text.png b/NotificationShowcase/res/drawable-xhdpi-v11/stat_notify_talk_text.png
new file mode 100644
index 0000000..12cae9f
--- /dev/null
+++ b/NotificationShowcase/res/drawable-xhdpi-v11/stat_notify_talk_text.png
Binary files differ
diff --git a/NotificationShowcase/res/drawable-xhdpi-v11/stat_sys_phone_call.png b/NotificationShowcase/res/drawable-xhdpi-v11/stat_sys_phone_call.png
new file mode 100644
index 0000000..db42b7c
--- /dev/null
+++ b/NotificationShowcase/res/drawable-xhdpi-v11/stat_sys_phone_call.png
Binary files differ
diff --git a/NotificationShowcase/res/drawable-xhdpi-v11/twitter_icon.png b/NotificationShowcase/res/drawable-xhdpi-v11/twitter_icon.png
new file mode 100644
index 0000000..f982849
--- /dev/null
+++ b/NotificationShowcase/res/drawable-xhdpi-v11/twitter_icon.png
Binary files differ
diff --git a/NotificationShowcase/res/drawable-xhdpi-v9/ic_menu_upload.png b/NotificationShowcase/res/drawable-xhdpi-v9/ic_menu_upload.png
new file mode 100644
index 0000000..bf84214
--- /dev/null
+++ b/NotificationShowcase/res/drawable-xhdpi-v9/ic_menu_upload.png
Binary files differ
diff --git a/NotificationShowcase/res/drawable-xhdpi-v9/ic_stat_gplus.png b/NotificationShowcase/res/drawable-xhdpi-v9/ic_stat_gplus.png
new file mode 100644
index 0000000..b928bcd
--- /dev/null
+++ b/NotificationShowcase/res/drawable-xhdpi-v9/ic_stat_gplus.png
Binary files differ
diff --git a/NotificationShowcase/res/drawable-xhdpi-v9/stat_notify_alarm.png b/NotificationShowcase/res/drawable-xhdpi-v9/stat_notify_alarm.png
new file mode 100644
index 0000000..687b96c
--- /dev/null
+++ b/NotificationShowcase/res/drawable-xhdpi-v9/stat_notify_alarm.png
Binary files differ
diff --git a/NotificationShowcase/res/drawable-xhdpi-v9/stat_notify_calendar.png b/NotificationShowcase/res/drawable-xhdpi-v9/stat_notify_calendar.png
new file mode 100644
index 0000000..0bf5514
--- /dev/null
+++ b/NotificationShowcase/res/drawable-xhdpi-v9/stat_notify_calendar.png
Binary files differ
diff --git a/NotificationShowcase/res/drawable-xhdpi-v9/stat_notify_email.png b/NotificationShowcase/res/drawable-xhdpi-v9/stat_notify_email.png
new file mode 100644
index 0000000..a6d541a
--- /dev/null
+++ b/NotificationShowcase/res/drawable-xhdpi-v9/stat_notify_email.png
Binary files differ
diff --git a/NotificationShowcase/res/drawable-xhdpi-v9/stat_notify_missed_call.png b/NotificationShowcase/res/drawable-xhdpi-v9/stat_notify_missed_call.png
new file mode 100644
index 0000000..a8d8c49
--- /dev/null
+++ b/NotificationShowcase/res/drawable-xhdpi-v9/stat_notify_missed_call.png
Binary files differ
diff --git a/NotificationShowcase/res/drawable-xhdpi-v9/stat_notify_sms.png b/NotificationShowcase/res/drawable-xhdpi-v9/stat_notify_sms.png
new file mode 100644
index 0000000..403a283
--- /dev/null
+++ b/NotificationShowcase/res/drawable-xhdpi-v9/stat_notify_sms.png
Binary files differ
diff --git a/NotificationShowcase/res/drawable-xhdpi-v9/stat_notify_talk_text.png b/NotificationShowcase/res/drawable-xhdpi-v9/stat_notify_talk_text.png
new file mode 100644
index 0000000..87b3614
--- /dev/null
+++ b/NotificationShowcase/res/drawable-xhdpi-v9/stat_notify_talk_text.png
Binary files differ
diff --git a/NotificationShowcase/res/drawable-xhdpi-v9/stat_sys_phone_call.png b/NotificationShowcase/res/drawable-xhdpi-v9/stat_sys_phone_call.png
new file mode 100644
index 0000000..2d2b7ee
--- /dev/null
+++ b/NotificationShowcase/res/drawable-xhdpi-v9/stat_sys_phone_call.png
Binary files differ
diff --git a/NotificationShowcase/res/drawable-xhdpi-v9/twitter_icon.png b/NotificationShowcase/res/drawable-xhdpi-v9/twitter_icon.png
new file mode 100644
index 0000000..2b6bfa8
--- /dev/null
+++ b/NotificationShowcase/res/drawable-xhdpi-v9/twitter_icon.png
Binary files differ
diff --git a/NotificationShowcase/res/drawable-xhdpi/ic_media_next.png b/NotificationShowcase/res/drawable-xhdpi/ic_media_next.png
new file mode 100644
index 0000000..4def965
--- /dev/null
+++ b/NotificationShowcase/res/drawable-xhdpi/ic_media_next.png
Binary files differ
diff --git a/NotificationShowcase/res/drawable-xhdpi/ic_menu_upload.png b/NotificationShowcase/res/drawable-xhdpi/ic_menu_upload.png
new file mode 100644
index 0000000..8bd27ae
--- /dev/null
+++ b/NotificationShowcase/res/drawable-xhdpi/ic_menu_upload.png
Binary files differ
diff --git a/NotificationShowcase/res/drawable-xhdpi/ic_stat_gplus.png b/NotificationShowcase/res/drawable-xhdpi/ic_stat_gplus.png
index b928bcd..77aa9ba 100644
--- a/NotificationShowcase/res/drawable-xhdpi/ic_stat_gplus.png
+++ b/NotificationShowcase/res/drawable-xhdpi/ic_stat_gplus.png
Binary files differ
diff --git a/NotificationShowcase/res/drawable-xhdpi/stat_notify_alarm.png b/NotificationShowcase/res/drawable-xhdpi/stat_notify_alarm.png
index 658d04f..8d2f5da 100644
--- a/NotificationShowcase/res/drawable-xhdpi/stat_notify_alarm.png
+++ b/NotificationShowcase/res/drawable-xhdpi/stat_notify_alarm.png
Binary files differ
diff --git a/NotificationShowcase/res/drawable-xhdpi/stat_notify_calendar.png b/NotificationShowcase/res/drawable-xhdpi/stat_notify_calendar.png
index 5ae7782..14c43a5 100644
--- a/NotificationShowcase/res/drawable-xhdpi/stat_notify_calendar.png
+++ b/NotificationShowcase/res/drawable-xhdpi/stat_notify_calendar.png
Binary files differ
diff --git a/NotificationShowcase/res/drawable-xhdpi/stat_notify_email.png b/NotificationShowcase/res/drawable-xhdpi/stat_notify_email.png
index 23c4672..db2539f 100644
--- a/NotificationShowcase/res/drawable-xhdpi/stat_notify_email.png
+++ b/NotificationShowcase/res/drawable-xhdpi/stat_notify_email.png
Binary files differ
diff --git a/NotificationShowcase/res/drawable-xhdpi/stat_notify_missed_call.png b/NotificationShowcase/res/drawable-xhdpi/stat_notify_missed_call.png
new file mode 100644
index 0000000..5076d1a
--- /dev/null
+++ b/NotificationShowcase/res/drawable-xhdpi/stat_notify_missed_call.png
Binary files differ
diff --git a/NotificationShowcase/res/drawable-xhdpi/stat_notify_sms.png b/NotificationShowcase/res/drawable-xhdpi/stat_notify_sms.png
index 323cb3d..82da1a5 100644
--- a/NotificationShowcase/res/drawable-xhdpi/stat_notify_sms.png
+++ b/NotificationShowcase/res/drawable-xhdpi/stat_notify_sms.png
Binary files differ
diff --git a/NotificationShowcase/res/drawable-xhdpi/stat_notify_talk_text.png b/NotificationShowcase/res/drawable-xhdpi/stat_notify_talk_text.png
index 12cae9f..496cf28 100644
--- a/NotificationShowcase/res/drawable-xhdpi/stat_notify_talk_text.png
+++ b/NotificationShowcase/res/drawable-xhdpi/stat_notify_talk_text.png
Binary files differ
diff --git a/NotificationShowcase/res/drawable-xhdpi/stat_sys_phone_call.png b/NotificationShowcase/res/drawable-xhdpi/stat_sys_phone_call.png
index db42b7c..098bf72 100644
--- a/NotificationShowcase/res/drawable-xhdpi/stat_sys_phone_call.png
+++ b/NotificationShowcase/res/drawable-xhdpi/stat_sys_phone_call.png
Binary files differ
diff --git a/NotificationShowcase/res/drawable-xhdpi/twitter_icon.png b/NotificationShowcase/res/drawable-xhdpi/twitter_icon.png
index f982849..97e7a39 100644
--- a/NotificationShowcase/res/drawable-xhdpi/twitter_icon.png
+++ b/NotificationShowcase/res/drawable-xhdpi/twitter_icon.png
Binary files differ
diff --git a/NotificationShowcase/res/values/dimens.xml b/NotificationShowcase/res/values/dimens.xml
new file mode 100644
index 0000000..21e7bc3
--- /dev/null
+++ b/NotificationShowcase/res/values/dimens.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+** Copyright 2012, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+<resources>
+    <!-- The width of the big icons in notifications. -->
+    <dimen name="notification_large_icon_width">64dp</dimen>
+    <!-- The width of the big icons in notifications. -->
+    <dimen name="notification_large_icon_height">64dp</dimen>
+</resources>
diff --git a/NotificationShowcase/src/com/android/example/notificationshowcase/NotificationShowcaseActivity.java b/NotificationShowcase/src/com/android/example/notificationshowcase/NotificationShowcaseActivity.java
index 5c3a60a..ee060ce 100644
--- a/NotificationShowcase/src/com/android/example/notificationshowcase/NotificationShowcaseActivity.java
+++ b/NotificationShowcase/src/com/android/example/notificationshowcase/NotificationShowcaseActivity.java
@@ -4,11 +4,12 @@
 package com.android.example.notificationshowcase;
 
 import java.util.ArrayList;
-
 import android.app.Activity;
 import android.app.Notification;
 import android.app.NotificationManager;
 import android.app.PendingIntent;
+import android.app.Service;
+import android.content.ComponentName;
 import android.content.Context;
 import android.content.Intent;
 import android.graphics.Bitmap;
@@ -17,7 +18,10 @@
 import android.graphics.drawable.BitmapDrawable;
 import android.graphics.drawable.Drawable;
 import android.net.Uri;
+import android.os.Binder;
 import android.os.Bundle;
+import android.os.IBinder;
+import android.support.v4.app.NotificationCompat;
 import android.text.SpannableString;
 import android.text.style.StyleSpan;
 import android.util.Log;
@@ -29,6 +33,9 @@
     
     private static final int NOTIFICATION_ID = 31338;
 
+    private static int bigtextId;
+    private static int uploadId;
+
     private static final boolean FIRE_AND_FORGET = true;
     
     public static class ToastFeedbackActivity extends Activity {
@@ -49,14 +56,84 @@
             finish();
         }
     }
+
+    public static class UpdateService extends Service {
+        @Override
+            public IBinder onBind(Intent intent) {
+            Log.v(TAG, "onbind");
+            return null;
+        }
+        
+        @Override
+        public void onStart(Intent i, int startId) {
+            super.onStart(i, startId);
+            try {
+                // allow the user close the shade, if they want to test that.
+                Thread.sleep(3000);
+            } catch (Exception e) {
+            }
+            Log.v(TAG, "clicked a thing! intent=" + i.toString());
+            if (i.hasExtra("id") && i.hasExtra("when")) {
+                final int id = i.getIntExtra("id", 0);
+                if (id == bigtextId) {
+                    NotificationManager noMa =
+                            (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
+                    final int update = i.getIntExtra("update", 0);
+                    final long when = i.getLongExtra("when", 0L);
+                    Log.v(TAG, "id: " + id + " when: " + when + " update: " + update);
+                    noMa.notify(NOTIFICATION_ID + id,
+                                makeBigTextNotification(this, update, id, when));
+                }
+            } else {
+                Log.v(TAG, "id extra was " + (i.hasExtra("id") ? "present" : "missing"));
+                Log.v(TAG, "when extra was " + (i.hasExtra("when") ? "present"  : "missing"));
+            }
+        }
+    }
+    
+    public static class ProgressService extends Service {
+        @Override
+            public IBinder onBind(Intent intent) {
+            Log.v(TAG, "onbind");
+            return null;
+        }
+        
+        @Override
+        public void onStart(Intent i, int startId) {
+            super.onStart(i, startId);
+            if (i.hasExtra("id") && i.hasExtra("when") && i.hasExtra("progress")) {
+                final int id = i.getIntExtra("id", 0);
+                if (id == uploadId) {
+                    final long when = i.getLongExtra("when", 0L);
+                    int progress = i.getIntExtra("progress", 0);
+                    NotificationManager noMa = (NotificationManager)
+                            getSystemService(Context.NOTIFICATION_SERVICE);
+                    while (progress <= 100) {
+                        try {
+                            // allow the user close the shade, if they want to test that.
+                            Thread.sleep(1000);
+                        } catch (Exception e) {
+                        }
+                        Log.v(TAG, "id: " + id + " when: " + when + " progress: " + progress);
+                        noMa.notify(NOTIFICATION_ID + id,
+                                    makeUploadNotification(this, progress, id, when));
+                        progress+=10;
+                    }
+                }
+            } else {
+                Log.v(TAG, "id extra " + (i.hasExtra("id") ? "present" : "missing"));
+                Log.v(TAG, "when extra " + (i.hasExtra("when") ? "present"  : "missing"));
+                Log.v(TAG, "progress extra " + (i.hasExtra("progress") ? "present"  : "missing"));
+            }
+        }
+    }
     
     private ArrayList<Notification> mNotifications = new ArrayList<Notification>();
-    
     NotificationManager mNoMa;
-    int mLargeIconWidth, mLargeIconHeight;
-    
-    private Bitmap getBitmap(int resId) {
-        Drawable d = getResources().getDrawable(resId);
+
+    static int mLargeIconWidth, mLargeIconHeight;
+    private static Bitmap getBitmap(Context context, int resId) {
+        Drawable d = context.getResources().getDrawable(resId);
         Bitmap b = Bitmap.createBitmap(mLargeIconWidth, mLargeIconHeight, Bitmap.Config.ARGB_8888);
         Canvas c = new Canvas(b);
         d.setBounds(0, 0, mLargeIconWidth, mLargeIconHeight);
@@ -64,101 +141,172 @@
         return b;
     }
     
-    private PendingIntent makeToastIntent(String s) {
-        Intent toastIntent = new Intent(this, ToastFeedbackActivity.class);
+    private static PendingIntent makeToastIntent(Context context, String s) {
+        Intent toastIntent = new Intent(context, ToastFeedbackActivity.class);
         toastIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
         toastIntent.putExtra("text", s);
         PendingIntent pi = PendingIntent.getActivity(
-                this, 58, toastIntent, PendingIntent.FLAG_CANCEL_CURRENT);
+                context, 58, toastIntent, PendingIntent.FLAG_CANCEL_CURRENT);
         return pi;
     }
     
-    private PendingIntent makeEmailIntent(String who) {
-        final Intent intent = new Intent(android.content.Intent.ACTION_SENDTO, Uri.parse("mailto:" + who));
+    private static PendingIntent makeEmailIntent(Context context, String who) {
+        final Intent intent = new Intent(android.content.Intent.ACTION_SENDTO,
+                Uri.parse("mailto:" + who));
         return PendingIntent.getActivity(
-                this, 0, intent,
+                context, 0, intent,
                 PendingIntent.FLAG_CANCEL_CURRENT);
     }
     
+    // this is a service, it will only close the notification shade if used as a contentIntent.
+    private static int updateId = 3000;
+    private static PendingIntent makeUpdateIntent(Context context, int update, int id, long when) {
+        Intent updateIntent = new Intent();
+        updateIntent.setComponent(
+                new ComponentName(context, UpdateService.class));
+        updateIntent.putExtra("id", id);
+        updateIntent.putExtra("when", when);
+        updateIntent.putExtra("update", update);
+        Log.v(TAG, "added id extra " + id);
+        Log.v(TAG, "added when extra " + when);
+        PendingIntent pi = PendingIntent.getService(
+                context, updateId++, updateIntent, PendingIntent.FLAG_UPDATE_CURRENT);
+        return pi;
+    }
+
+    private static Notification makeBigTextNotification(Context context, int update, int id,
+                                                        long when) {
+        String addendum = update > 0 ? "(updated) " : "";
+        String longSmsText = "Hey, looks like\nI'm getting kicked out of this conference" + 
+                " room";
+        if (update > 1) {
+            longSmsText += ", so stay in the hangout and I'll rejoin in about 5-10 minutes" + 
+                ". If you don't see me, assume I got pulled into another meeting. And" + 
+                " now \u2026 I have to find my shoes.  Four score and seven years "+
+                "ago our fathers brought forth on this continent, a new nation, conceived "+
+                "in Liberty, and dedicated to the proposition that all men are created "+
+                "equal. Now we are engaged in a great civil war, testing whether that "+
+                "nation, or any nation so conceived and so dedicated, can long "+
+                "endure. We are met on a great battle-field of that war. We have come "+
+                "to dedicate a portion of that field, as a final resting place for "+
+                "those who here gave their lives that that nation might live. It is "+
+                "altogether fitting and proper that we should do this.But, in a larger "+
+                "sense, we can not dedicate -- we can not consecrate -- we can not "+
+                "hallow -- this ground.The brave men, living and dead, who struggled "+
+                "here, have consecrated it, far above our poor power to add or detract."+
+                " The world will little note, nor long remember what we say here, but "+
+                "it can never forget what they did here. It is for us the living, rather,"+
+                " to be dedicated here to the unfinished work which they who fought "+
+                "here have thus far so nobly advanced.It is rather for us to be here "+
+                "dedicated to the great task remaining before us -- that from these "+
+                "honored dead we take increased devotion to that cause for which they "+
+                "gave the last full measure of devotion -- that we here highly resolve "+
+                "that these dead shall not have died in vain -- that this nation, under "+
+                "God, shall have a new birth of freedom -- and that government of "+
+                "the people, by the people, for the people, shall not perish from the earth.";
+        }
+        if (update > 2) {
+            when = System.currentTimeMillis();
+        }
+        NotificationCompat.BigTextStyle bigTextStyle = new NotificationCompat.BigTextStyle();
+        bigTextStyle.bigText(addendum + longSmsText);
+        NotificationCompat.Builder bigTextNotification = new NotificationCompat.Builder(context)
+                .setContentTitle(addendum + "Mike Cleron")
+                .setContentIntent(makeToastIntent(context, "Clicked on bigText"))
+                .setContentText(addendum + longSmsText)
+                .setTicker(addendum + "Mike Cleron: " + longSmsText)
+                .setWhen(when)
+                .setLargeIcon(getBitmap(context, R.drawable.bucket))
+                .setPriority(NotificationCompat.PRIORITY_HIGH)
+                .addAction(R.drawable.ic_media_next,
+                           "update: " + update,
+                           makeUpdateIntent(context, update+1, id, when))
+                .setSmallIcon(R.drawable.stat_notify_talk_text)
+                .setStyle(bigTextStyle);
+        return bigTextNotification.build();
+    }
+    
+    // this is a service, it will only close the notification shade if used as a contentIntent.
+    private static void startProgressUpdater(Context context, int progress, int id, long when) {
+        Intent progressIntent = new Intent();
+        progressIntent.setComponent(new ComponentName(context, ProgressService.class));
+        progressIntent.putExtra("id", id);
+        progressIntent.putExtra("when", when);
+        progressIntent.putExtra("progress", progress);
+        context.startService(progressIntent);
+    }
+
+    private static Notification makeUploadNotification(Context context, int progress, int id,
+                                                       long when) {
+        NotificationCompat.Builder uploadNotification = new NotificationCompat.Builder(context)
+                .setContentTitle("File Upload")
+                .setContentText("foo.txt")
+                .setPriority(NotificationCompat.PRIORITY_MIN)
+                .setContentIntent(makeToastIntent(context, "Clicked on Upload"))
+                .setWhen(when)
+                .setSmallIcon(R.drawable.ic_menu_upload)
+                .setProgress(100, Math.min(progress, 100), false);
+        return uploadNotification.build();
+    }
+
     @Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.main);
         
-        mLargeIconWidth = (int) getResources().getDimension(android.R.dimen.notification_large_icon_width);
-        mLargeIconHeight = (int) getResources().getDimension(android.R.dimen.notification_large_icon_height);
+        mLargeIconWidth = (int) getResources().getDimension(R.dimen.notification_large_icon_width);
+        mLargeIconHeight = (int) getResources().getDimension(R.dimen.notification_large_icon_height);
         
         mNoMa = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
         
-        // none of them does anything; if you want them to auto-destruct when tapped, add a 
-        //   .setAutoCancel(true)
-        // if you want to launch an app, you need to do more work, but then again it won't launch the 
-        // right thing anyway because these notifications are just dummies. :) 
+        bigtextId = mNotifications.size();
+        mNotifications.add(makeBigTextNotification(this, 0, bigtextId,
+                                                   System.currentTimeMillis()));
         
-//        mNotifications.add(new Notification.Builder(this)
-//            .setContentTitle("Larry Page")
-//            .setContentText("hey, free nachos at MoMA!")
-//            .setLargeIcon(getBitmap(R.drawable.page_hed))
-//            .setSmallIcon(android.R.drawable.stat_notify_chat)
-//            .setPriority(Notification.PRIORITY_HIGH)
-//            .setNumber(2)
-//            .build());
+        uploadId = mNotifications.size();
+        long uploadWhen = System.currentTimeMillis();
+        mNotifications.add(makeUploadNotification(this, 10, uploadId, uploadWhen));
 
-//        mNotifications.add(new Notification.Builder(this)
-//        .setContentTitle("Andy Rubin")
-//        .setContentText("Drinks tonight?")
-//        .setTicker("Andy Rubin: Drinks tonight?")
-//        .setLargeIcon(getBitmap(R.drawable.arubin_hed))
-//        .setSmallIcon(R.drawable.stat_notify_sms)
-//        .setPriority(Notification.PRIORITY_MAX)
-//        .build());
-
-        String longSmsText = "Hey, looks like I'm getting kicked out of this conference room, so stay in the hangout and I'll rejoin in about 5-10 minutes. If you don't see me, assume I got pulled into another meeting. And now \u2026 I have to find my shoes.";
-        Notification.BigTextStyle bigTextStyle = new Notification.BigTextStyle();
-        bigTextStyle.bigText(longSmsText);
-        Notification.Builder bigTextNotification = new Notification.Builder(this)
-                .setContentTitle("Mike Cleron")
-                .setContentText(longSmsText)
-                .setTicker("Mike Cleron: " + longSmsText)
-                .setLargeIcon(getBitmap(R.drawable.bucket))
-                .setPriority(Notification.PRIORITY_HIGH)
-                .addAction(R.drawable.stat_notify_email, "Email mcleron@test.com",
-                           makeEmailIntent("mcleron@test.com"))
-                .setSmallIcon(R.drawable.stat_notify_talk_text)
-                .setStyle(bigTextStyle);
-        mNotifications.add(bigTextNotification.build());
-        
-        mNotifications.add(new Notification.Builder(this)
+        mNotifications.add(new NotificationCompat.Builder(this)
         .setContentTitle("Incoming call")
         .setContentText("Matias Duarte")
-        .setLargeIcon(getBitmap(R.drawable.matias_hed))
+        .setLargeIcon(getBitmap(this, R.drawable.matias_hed))
         .setSmallIcon(R.drawable.stat_sys_phone_call)
-        .setPriority(Notification.PRIORITY_MAX)
-        .setContentIntent(makeToastIntent("Clicked on Matias"))
-        .addAction(R.drawable.ic_dial_action_call, "Answer", makeToastIntent("call answered"))
-        .addAction(R.drawable.ic_end_call, "Ignore", makeToastIntent("call ignored"))
-        //.setUsesIntruderAlert(true)
-        //.setIntruderActionsShowText(true)
+        .setPriority(NotificationCompat.PRIORITY_MAX)
+        .setContentIntent(makeToastIntent(this, "Clicked on Matias"))
+        .addAction(R.drawable.ic_dial_action_call, "Answer", makeToastIntent(this, "call answered"))
+        .addAction(R.drawable.ic_end_call, "Ignore", makeToastIntent(this, "call ignored"))
         .setAutoCancel(true)
         .build());
 
-        mNotifications.add(new Notification.Builder(this)
+        mNotifications.add(new NotificationCompat.Builder(this)
         .setContentTitle("Stopwatch PRO")
         .setContentText("Counting up")
+        .setContentIntent(makeToastIntent(this, "Clicked on Stopwatch"))
         .setSmallIcon(R.drawable.stat_notify_alarm)
         .setUsesChronometer(true)
         .build());
 
-        mNotifications.add(new Notification.Builder(this)
-        .setContentTitle("J Planning")
-        .setContentText("The Botcave")
-        .setSmallIcon(R.drawable.stat_notify_calendar)
-        .setContentInfo("7PM")
-        .build());
+        mNotifications.add(new NotificationCompat.Builder(this)
+            .setContentTitle("J Planning")
+            .setContentText("The Botcave")
+            .setWhen(System.currentTimeMillis())
+            .setSmallIcon(R.drawable.stat_notify_calendar)
+            .setContentIntent(makeToastIntent(this, "tapped in the calendar event"))
+            .setContentInfo("7PM")
+            .addAction(R.drawable.stat_notify_snooze, "+10 min",
+                       makeToastIntent(this, "snoozed 10 min"))
+            .addAction(R.drawable.stat_notify_snooze_longer, "+1 hour",
+                       makeToastIntent(this, "snoozed 1 hr"))
+            .addAction(R.drawable.stat_notify_email, "Email",
+                       makeEmailIntent(this, 
+                               "gabec@example.com,mcleron@example.com,dsandler@example.com"))
+            .build());
 
-        BitmapDrawable d = (BitmapDrawable) getResources().getDrawable(R.drawable.romainguy_rockaway);
-        mNotifications.add(new Notification.BigPictureStyle(
-                new Notification.Builder(this)
+        BitmapDrawable d =
+                (BitmapDrawable) getResources().getDrawable(R.drawable.romainguy_rockaway);
+        mNotifications.add(new NotificationCompat.BigPictureStyle(
+                new NotificationCompat.Builder(this)
                     .setContentTitle("Romain Guy")
                     .setContentText("I was lucky to find a Canon 5D Mk III at a local Bay Area store last "
                             + "week but I had not been able to try it in the field until tonight. After a "
@@ -166,8 +314,10 @@
                             + "and I was finally able to see what my new camera feels like when shooting "
                             + "landscapes.")
                     .setSmallIcon(R.drawable.ic_stat_gplus)
-                    .setLargeIcon(getBitmap(R.drawable.romainguy_hed))
-                    .addAction(R.drawable.add, "Add to Gallery", makeToastIntent("added! (just kidding)"))
+                    .setContentIntent(makeToastIntent(this, "Clicked on bigPicture"))
+                    .setLargeIcon(getBitmap(this, R.drawable.romainguy_hed))
+                    .addAction(R.drawable.add, "Add to Gallery",
+                               makeToastIntent(this, "added! (just kidding)"))
                     .setSubText("talk rocks!")
                 )
                 .bigPicture(d.getBitmap())
@@ -181,11 +331,12 @@
         line2.setSpan(bold, 0, 3, 0);
         SpannableString line3 = new SpannableString("Charlie: Iz IN UR EMAILZ!!");
         line3.setSpan(bold, 0, 7, 0);
-        mNotifications.add(new Notification.InboxStyle(
-            new Notification.Builder(this)
+        mNotifications.add(new NotificationCompat.InboxStyle(
+                new NotificationCompat.Builder(this)
                 .setContentTitle("24 new messages")
                 .setContentText("You have mail!")
                 .setSubText("test.hugo2@gmail.com")
+                .setContentIntent(makeToastIntent(this, "Clicked on Email"))
                 .setSmallIcon(R.drawable.stat_notify_email))
            .setSummaryText("+21 more")
            .addLine(line1)
@@ -193,24 +344,18 @@
            .addLine(line3)
            .build());
 
-        // No idea what this would really look like since the app is in flux
-        mNotifications.add(new Notification.Builder(this)
-        .setContentTitle("Google+")
-        .setContentText("Kanye West has added you to his circles")
-        .setSmallIcon(R.drawable.googleplus_icon)
-        .setPriority(Notification.PRIORITY_LOW)
-        .build());
-        
-        mNotifications.add(new Notification.Builder(this)
+        mNotifications.add(new NotificationCompat.Builder(this)
         .setContentTitle("Twitter")
         .setContentText("New mentions")
+        .setContentIntent(makeToastIntent(this, "Clicked on Twitter"))
         .setSmallIcon(R.drawable.twitter_icon)
         .setNumber(15)
-        .setPriority(Notification.PRIORITY_LOW)
+        .setPriority(NotificationCompat.PRIORITY_LOW)
         .build());
 
         if (FIRE_AND_FORGET) {
             doPost(null);
+            startProgressUpdater(this, 10, uploadId, uploadWhen);
             finish();
         }
     }