diff options
author | Costin Manolache <costin@google.com> | 2011-10-07 17:54:05 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-10-07 17:54:05 -0700 |
commit | 6d288bd2f3596ce268a3a3278f005d8757c79d63 (patch) | |
tree | 5c974dfe5058ce62f99c9170c87710e81233c2cb /core/java/android/accounts | |
parent | da71e80c5c53a8078a107f451bc222c81d3c1f3f (diff) | |
parent | 85e7279d9cc1ee8e4dd1f993a9e61a9eb547ecbc (diff) | |
download | frameworks_base-6d288bd2f3596ce268a3a3278f005d8757c79d63.zip frameworks_base-6d288bd2f3596ce268a3a3278f005d8757c79d63.tar.gz frameworks_base-6d288bd2f3596ce268a3a3278f005d8757c79d63.tar.bz2 |
Merge "b/5399355 StringIndexOutOfBoundsException from AccountManagerService"
Diffstat (limited to 'core/java/android/accounts')
-rw-r--r-- | core/java/android/accounts/AccountManagerService.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/core/java/android/accounts/AccountManagerService.java b/core/java/android/accounts/AccountManagerService.java index 91def67..1ba8eee 100644 --- a/core/java/android/accounts/AccountManagerService.java +++ b/core/java/android/accounts/AccountManagerService.java @@ -1033,8 +1033,12 @@ public class AccountManagerService mContext.getString(R.string.permission_request_notification_with_subtitle, account.name); final int index = titleAndSubtitle.indexOf('\n'); - final String title = titleAndSubtitle.substring(0, index); - final String subtitle = titleAndSubtitle.substring(index + 1); + String title = titleAndSubtitle; + String subtitle = ""; + if (index > 0) { + title = titleAndSubtitle.substring(0, index); + subtitle = titleAndSubtitle.substring(index + 1); + } n.setLatestEventInfo(mContext, title, subtitle, PendingIntent.getActivity(mContext, 0, intent, PendingIntent.FLAG_CANCEL_CURRENT)); |