From: Lixin Yue Date: Fri, 5 Mar 2010 07:11:06 +0000 (+0800) Subject: Remove the number above status icon for Opp transfers X-Git-Tag: android-7.1.2_r17~1429 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=509a6cd43906cce5f9bc78a83bd2058a4e5249e7;p=android-x86%2Fpackages-apps-Bluetooth.git Remove the number above status icon for Opp transfers --- diff --git a/res/values/strings.xml b/res/values/strings.xml index 89e6c063..b0dea34a 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -181,7 +181,6 @@ All items will be cleared from the list. Bluetooth share: Sent files Bluetooth share: Received files - Bluetooth share %1$s successful, %2$s failed. Clear list diff --git a/src/com/android/bluetooth/opp/BluetoothOppNotification.java b/src/com/android/bluetooth/opp/BluetoothOppNotification.java index 80d7a72a..e72ef3e5 100644 --- a/src/com/android/bluetooth/opp/BluetoothOppNotification.java +++ b/src/com/android/bluetooth/opp/BluetoothOppNotification.java @@ -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) {