diff options
author | Hung-ying Tyan <tyanh@google.com> | 2009-07-04 00:24:48 +0800 |
---|---|---|
committer | Hung-ying Tyan <tyanh@google.com> | 2009-07-04 00:24:48 +0800 |
commit | 0102dc6b226aaebe0f437cabf715b9da61890c36 (patch) | |
tree | 21ad75ff9baf6ac5f9f595f5d0981ff051301a47 /packages/VpnServices/src | |
parent | 116d890aea63a4191a93412f5cecf5defad25201 (diff) | |
download | frameworks_base-0102dc6b226aaebe0f437cabf715b9da61890c36.zip frameworks_base-0102dc6b226aaebe0f437cabf715b9da61890c36.tar.gz frameworks_base-0102dc6b226aaebe0f437cabf715b9da61890c36.tar.bz2 |
Fix strings.
* Changes
+ Remove "Up time:" from ongoing event display.
+ Add hint in disconnected notification.
Diffstat (limited to 'packages/VpnServices/src')
-rw-r--r-- | packages/VpnServices/src/com/android/server/vpn/VpnService.java | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/packages/VpnServices/src/com/android/server/vpn/VpnService.java b/packages/VpnServices/src/com/android/server/vpn/VpnService.java index 6e5d46b..a60788a 100644 --- a/packages/VpnServices/src/com/android/server/vpn/VpnService.java +++ b/packages/VpnServices/src/com/android/server/vpn/VpnService.java @@ -490,16 +490,15 @@ abstract class VpnService<E extends VpnProfile> { } private String getNotificationTitle(boolean connected) { - String connectedOrNot = connected - ? mContext.getString(R.string.vpn_notification_connected) + String formatString = connected + ? mContext.getString( + R.string.vpn_notification_title_connected) : mContext.getString( - R.string.vpn_notification_disconnected); - return String.format( - mContext.getString(R.string.vpn_notification_title), - mProfile.getName(), connectedOrNot); + R.string.vpn_notification_title_disconnected); + return String.format(formatString, mProfile.getName()); } - private String getTimeFormat(long duration) { + private String getFormattedTime(long duration) { long hours = duration / 3600; StringBuilder sb = new StringBuilder(); if (hours > 0) sb.append(hours).append(':'); @@ -511,11 +510,10 @@ abstract class VpnService<E extends VpnProfile> { private String getNotificationMessage(boolean connected) { if (connected) { long time = (System.currentTimeMillis() - mStartTime) / 1000; - return String.format(mContext.getString( - R.string.vpn_notification_connected_message), - getTimeFormat(time)); + return getFormattedTime(time); } else { - return ""; + return mContext.getString( + R.string.vpn_notification_hint_disconnected); } } } |