diff --git a/res/layout/status_bar_ongoing_event_progress_bar.xml b/res/layout/status_bar_ongoing_event_progress_bar.xml
index d1bce1a..5eb4e9d 100644
--- a/res/layout/status_bar_ongoing_event_progress_bar.xml
+++ b/res/layout/status_bar_ongoing_event_progress_bar.xml
@@ -31,7 +31,6 @@
         android:layout_height="match_parent"
         android:orientation="horizontal"
         >
-        
         <LinearLayout
             android:layout_width="40dp"
             android:layout_height="match_parent"
@@ -40,14 +39,14 @@
             android:focusable="true"
             android:clickable="true"
             >
-            <com.android.server.status.AnimatedImageView 
-                android:id="@+id/appIcon"
+            <com.android.contacts.vcard.AnimatedImageView
+                android:id="@+id/status_icon"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_gravity="center"
                 android:src="@android:drawable/sym_def_app_icon"
                 />
-            <TextView android:id="@+id/progress_text" 
+            <TextView android:id="@+id/status_progress_text"
                 android:layout_width="wrap_content" 
                 android:layout_height="wrap_content"
                 android:textColor="#ff000000"
@@ -73,7 +72,7 @@
                 android:layout_alignParentTop="true"
                 android:paddingTop="10dp"
                 >
-                <TextView android:id="@+id/title"
+                <TextView android:id="@+id/status_title"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:singleLine="true"
@@ -81,7 +80,7 @@
                     android:textColor="#ff000000"
                     android:paddingLeft="2dp"
                     />
-                <TextView android:id="@+id/description"
+                <TextView android:id="@+id/status_description"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:textColor="#ff000000"
@@ -90,7 +89,7 @@
                     android:paddingLeft="5dp"
                     />
             </LinearLayout>
-            <ProgressBar android:id="@+id/progress_bar"
+            <ProgressBar android:id="@+id/status_progress_bar"
                 style="?android:attr/progressBarStyleHorizontal"
                 android:layout_width="match_parent" 
                 android:layout_height="wrap_content"
@@ -101,7 +100,7 @@
         </RelativeLayout>
     </LinearLayout>
         
-    <com.android.server.status.AnimatedImageView 
+    <com.android.contacts.vcard.AnimatedImageView
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:src="@android:drawable/divider_horizontal_bright"
diff --git a/src/com/android/contacts/vcard/AnimatedImageView.java b/src/com/android/contacts/vcard/AnimatedImageView.java
new file mode 100644
index 0000000..8911b52
--- /dev/null
+++ b/src/com/android/contacts/vcard/AnimatedImageView.java
@@ -0,0 +1,87 @@
+/*
+ * Copyright (C) 2008 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.
+ */
+
+package com.android.contacts.vcard;
+
+import android.content.Context;
+import android.graphics.drawable.AnimationDrawable;
+import android.graphics.drawable.Drawable;
+import android.util.AttributeSet;
+import android.widget.ImageView;
+import android.widget.RemoteViews.RemoteView;
+
+/**
+ * Just a bare copy from SystemUI. Do not edit. 
+ */
+public class AnimatedImageView extends ImageView {
+    AnimationDrawable mAnim;
+    boolean mAttached;
+
+    public AnimatedImageView(Context context) {
+        super(context);
+    }
+
+    public AnimatedImageView(Context context, AttributeSet attrs) {
+        super(context, attrs);
+    }
+
+    private void updateAnim() {
+        Drawable drawable = getDrawable();
+        if (mAttached && mAnim != null) {
+            mAnim.stop();
+        }
+        if (drawable instanceof AnimationDrawable) {
+            mAnim = (AnimationDrawable)drawable;
+            if (mAttached) {
+                mAnim.start();
+            }
+        } else {
+            mAnim = null;
+        }
+    }
+
+    @Override
+    public void setImageDrawable(Drawable drawable) {
+        super.setImageDrawable(drawable);
+        updateAnim();
+    }
+
+    @Override
+    @android.view.RemotableViewMethod
+    public void setImageResource(int resid) {
+        super.setImageResource(resid);
+        updateAnim();
+    }
+
+    @Override
+    public void onAttachedToWindow() {
+        super.onAttachedToWindow();
+        if (mAnim != null) {
+            mAnim.start();
+        }
+        mAttached = true;
+    }
+
+    @Override
+    public void onDetachedFromWindow() {
+        super.onDetachedFromWindow();
+        if (mAnim != null) {
+            mAnim.stop();
+        }
+        mAttached = false;
+    }
+}
+
diff --git a/src/com/android/contacts/vcard/ExportProcessor.java b/src/com/android/contacts/vcard/ExportProcessor.java
index 7e7c7c8..fd3498a 100644
--- a/src/com/android/contacts/vcard/ExportProcessor.java
+++ b/src/com/android/contacts/vcard/ExportProcessor.java
@@ -224,13 +224,13 @@
 
         final RemoteViews remoteViews = new RemoteViews(mService.getPackageName(),
                 R.layout.status_bar_ongoing_event_progress_bar);
-        remoteViews.setTextViewText(R.id.description, message);
-        remoteViews.setProgressBar(R.id.progress_bar, total, current, (total == -1));
+        remoteViews.setTextViewText(R.id.status_description, message);
+        remoteViews.setProgressBar(R.id.status_progress_bar, total, current, (total == -1));
 
         final String percentage = mService.getString(R.string.percentage,
                 String.valueOf((current * 100)/total));
-        remoteViews.setTextViewText(R.id.progress_text, percentage);
-        remoteViews.setImageViewResource(R.id.appIcon, android.R.drawable.stat_sys_upload);
+        remoteViews.setTextViewText(R.id.status_progress_text, percentage);
+        remoteViews.setImageViewResource(R.id.status_icon, android.R.drawable.stat_sys_upload);
 
         final Notification notification = new Notification();
         notification.icon = android.R.drawable.stat_sys_upload;
diff --git a/src/com/android/contacts/vcard/ImportProgressNotifier.java b/src/com/android/contacts/vcard/ImportProgressNotifier.java
index eec75f6..afd6c3a 100644
--- a/src/com/android/contacts/vcard/ImportProgressNotifier.java
+++ b/src/com/android/contacts/vcard/ImportProgressNotifier.java
@@ -20,8 +20,6 @@
 import android.app.PendingIntent;
 import android.content.Context;
 import android.content.Intent;
-import android.util.Log;
-import android.widget.RemoteViews;
 
 import com.android.contacts.ContactsListActivity;
 import com.android.contacts.R;
@@ -58,11 +56,6 @@
         // - There's high probability where name comes soon after the beginning of entry, so
         //   we don't need to hurry to show something.
 
-        // TODO: should not create this every time?
-        final RemoteViews remoteViews =
-                new RemoteViews(mContext.getPackageName(),
-                R.layout.status_bar_ongoing_event_progress_bar);
-
         final String title = mContext.getString(R.string.reading_vcard_title);
 
         String totalCountString;
@@ -74,29 +67,47 @@
                 totalCountString,
                 contactStruct.getDisplayName());
 
-        remoteViews.setTextViewText(R.id.title, title);
-        remoteViews.setTextViewText(R.id.description, description);
-        remoteViews.setProgressBar(R.id.progress_bar, mTotalCount, mCurrentCount,
+        final Context context = mContext.getApplicationContext();
+
+        /* TODO: fix this.
+        final RemoteViews remoteViews =
+                new RemoteViews(context.getPackageName(),
+                R.layout.status_bar_ongoing_event_progress_bar);
+        remoteViews.setTextViewText(R.id.status_title, title);
+        remoteViews.setTextViewText(R.id.status_description, description);
+        remoteViews.setProgressBar(R.id.status_progress_bar, mTotalCount, mCurrentCount,
                 mTotalCount == -1);
         final String percentage;
         if (mTotalCount > 0) {
-            percentage = mContext.getString(R.string.percentage,
+            percentage = context.getString(R.string.percentage,
                     String.valueOf(mCurrentCount * 100/mTotalCount));
         } else {
             percentage = "";
         }
-
-        remoteViews.setTextViewText(R.id.progress_text, percentage);
-        remoteViews.setImageViewResource(R.id.appIcon, android.R.drawable.stat_sys_download);
+        remoteViews.setTextViewText(R.id.status_progress_text, percentage);
+        remoteViews.setImageViewResource(R.id.status_icon, android.R.drawable.stat_sys_download);
 
         final Notification notification = new Notification();
         notification.icon = android.R.drawable.stat_sys_download;
+        notification.tickerText = description;
         notification.flags |= Notification.FLAG_ONGOING_EVENT;
         notification.tickerText = description;
-        notification.contentView = remoteViews;
-        notification.contentIntent =
-                PendingIntent.getActivity(mContext, 0,
-                        new Intent(mContext, ContactsListActivity.class), 0);
+        notification.contentView = remoteViews;*/
+
+        final long when = System.currentTimeMillis();
+        final Notification notification = new Notification(
+                android.R.drawable.stat_sys_download,
+                description,
+                when);
+
+        final PendingIntent pendingIntent =
+            PendingIntent.getActivity(context, 0,
+                    new Intent(context, ContactsListActivity.class),
+                    PendingIntent.FLAG_UPDATE_CURRENT);
+
+        // notification.contentIntent = pendingIntent;
+        notification.setLatestEventInfo(context, title, description, pendingIntent);
+
         mNotificationManager.notify(VCardService.IMPORT_NOTIFICATION_ID, notification);
     }
 
