OSDN Git Service

Remove the number above status icon for Opp transfers
authorLixin Yue <L.X.YUE@motorola.com>
Fri, 5 Mar 2010 07:11:06 +0000 (15:11 +0800)
committerMichael Chan <mchan@android.com>
Sat, 6 Mar 2010 01:24:43 +0000 (17:24 -0800)
res/values/strings.xml
src/com/android/bluetooth/opp/BluetoothOppNotification.java

index 89e6c06..b0dea34 100644 (file)
     <string name="transfer_clear_dlg_msg">All items will be cleared from the list.</string>
     <string name="outbound_noti_title">Bluetooth share: Sent files</string>
     <string name="inbound_noti_title">Bluetooth share: Received files</string>
-    <string name="noti_title">Bluetooth share</string>
     <string name="noti_caption"> %1$s successful, %2$s failed.</string>
 
     <string name="transfer_menu_clear_all">Clear list</string>
index 80d7a72..e72ef3e 100644 (file)
@@ -346,33 +346,18 @@ class BluetoothOppNotification {
         cursor.close();
 
         outboundNum = outboundSuccNumber + outboundFailNumber;
-        title = mContext.getString(R.string.outbound_noti_title);
-        intent = new Intent(Constants.ACTION_OPEN_OUTBOUND_TRANSFER);
-        intent.setClassName(Constants.THIS_PACKAGE_NAME, BluetoothOppReceiver.class.getName());
-
         // create the outbound notification
-        if (mOutNoti == null && outboundNum > 0) {
+        if (outboundNum > 0) {
             mOutNoti = new Notification();
             mOutNoti.icon = android.R.drawable.stat_sys_upload_done;
+            title = mContext.getString(R.string.outbound_noti_title);
             caption = mContext.getString(R.string.noti_caption, outboundSuccNumber,
                     outboundFailNumber);
+            intent = new Intent(Constants.ACTION_OPEN_OUTBOUND_TRANSFER);
+            intent.setClassName(Constants.THIS_PACKAGE_NAME, BluetoothOppReceiver.class.getName());
             mOutNoti.setLatestEventInfo(mContext, title, caption, PendingIntent.getBroadcast(
                     mContext, 0, intent, 0));
             mOutNoti.when = timeStamp;
-            // To make number take effect, must set to 1 when creating the
-            // notification
-            mOutNoti.number = 1;
-            mNotificationMgr.notify(NOTIFICATION_ID_OUTBOUND, mOutNoti);
-        }
-
-        // update the outbound notification
-        if (outboundNum > 0) {
-            caption = mContext.getString(R.string.noti_caption, outboundSuccNumber,
-                    outboundFailNumber);
-            mOutNoti.when = timeStamp;
-            mOutNoti.setLatestEventInfo(mContext, title, caption, PendingIntent.getBroadcast(
-                    mContext, 0, intent, 0));
-            mOutNoti.number = outboundNum;
             mNotificationMgr.notify(NOTIFICATION_ID_OUTBOUND, mOutNoti);
         } else {
             if (mNotificationMgr != null && mOutNoti != null) {
@@ -406,33 +391,18 @@ class BluetoothOppNotification {
         cursor.close();
 
         inboundNum = inboundSuccNumber + inboundFailNumber;
-        title = mContext.getString(R.string.inbound_noti_title);
-        intent = new Intent(Constants.ACTION_OPEN_INBOUND_TRANSFER);
-        intent.setClassName(Constants.THIS_PACKAGE_NAME, BluetoothOppReceiver.class.getName());
-
         // create the inbound notification
-        if (mInNoti == null && inboundNum > 0) {
+        if (inboundNum > 0) {
             mInNoti = new Notification();
             mInNoti.icon = android.R.drawable.stat_sys_download_done;
+            title = mContext.getString(R.string.inbound_noti_title);
             caption = mContext.getString(R.string.noti_caption, inboundSuccNumber,
                     inboundFailNumber);
+            intent = new Intent(Constants.ACTION_OPEN_INBOUND_TRANSFER);
+            intent.setClassName(Constants.THIS_PACKAGE_NAME, BluetoothOppReceiver.class.getName());
             mInNoti.setLatestEventInfo(mContext, title, caption, PendingIntent.getBroadcast(
                     mContext, 0, intent, 0));
             mInNoti.when = timeStamp;
-            // To make number take effect, must set to 1 when creating the
-            // notification
-            mInNoti.number = 1;
-            mNotificationMgr.notify(NOTIFICATION_ID_INBOUND, mInNoti);
-        }
-
-        // update the inbound notification
-        if (inboundNum > 0) {
-            caption = mContext.getString(R.string.noti_caption, inboundSuccNumber,
-                    inboundFailNumber);
-            mInNoti.when = timeStamp;
-            mInNoti.setLatestEventInfo(mContext, title, caption, PendingIntent.getBroadcast(
-                    mContext, 0, intent, 0));
-            mInNoti.number = inboundNum;
             mNotificationMgr.notify(NOTIFICATION_ID_INBOUND, mInNoti);
         } else {
             if (mNotificationMgr != null && mInNoti != null) {