diff options
author | Daniel Sandler <dsandler@android.com> | 2013-04-08 19:46:01 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-04-08 19:46:02 +0000 |
commit | dc634351d4f8a59e4b5743c58571d1ef04da668a (patch) | |
tree | b4d3c34d0c3dca8d3a275d4bf95938c681de67c8 | |
parent | 50b9eb1c7375a87525d44a036337a8ba18eba55b (diff) | |
parent | 91fe8455d66ef4ac000ba3ba0fb043dd1fbaee49 (diff) | |
download | frameworks_base-dc634351d4f8a59e4b5743c58571d1ef04da668a.zip frameworks_base-dc634351d4f8a59e4b5743c58571d1ef04da668a.tar.gz frameworks_base-dc634351d4f8a59e4b5743c58571d1ef04da668a.tar.bz2 |
Merge "Clean up language in forced foreground service notifications." into jb-mr2-dev
-rw-r--r-- | core/res/res/values/strings.xml | 6 | ||||
-rw-r--r-- | services/java/com/android/server/am/ServiceRecord.java | 62 |
2 files changed, 34 insertions, 34 deletions
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml index 1995670..a0e1603 100644 --- a/core/res/res/values/strings.xml +++ b/core/res/res/values/strings.xml @@ -2997,11 +2997,11 @@ <!-- [CHAR LIMIT=NONE] Stub notification title for an app running a service that has provided a bad bad notification for itself. --> <string name="app_running_notification_title"><xliff:g id="app_name">%1$s</xliff:g> - running</string> + is running</string> <!-- [CHAR LIMIT=NONE] Stub notification text for an app running a service that has provided a bad bad notification for itself. --> - <string name="app_running_notification_text"><xliff:g id="app_name">%1$s</xliff:g> - is currently running</string> + <string name="app_running_notification_text">Touch for more information + or to stop the app.</string> <!-- Preference framework strings. --> <string name="ok">OK</string> diff --git a/services/java/com/android/server/am/ServiceRecord.java b/services/java/com/android/server/am/ServiceRecord.java index 8ff1c7d..fccaab5 100644 --- a/services/java/com/android/server/am/ServiceRecord.java +++ b/services/java/com/android/server/am/ServiceRecord.java @@ -376,37 +376,37 @@ class ServiceRecord extends Binder { // icon, but this used to be able to slip through, so for // those dirty apps give it the app's icon. foregroundNoti.icon = appInfo.icon; - if (foregroundNoti.contentView == null) { - // In this case the app may not have specified a - // content view... so we'll give them something to show. - CharSequence appName = appInfo.loadLabel( - ams.mContext.getPackageManager()); - if (appName == null) { - appName = appInfo.packageName; - } - Context ctx = null; - try { - ctx = ams.mContext.createPackageContext( - appInfo.packageName, 0); - Intent runningIntent = new Intent( - Settings.ACTION_APPLICATION_DETAILS_SETTINGS); - runningIntent.setData(Uri.fromParts("package", - appInfo.packageName, null)); - PendingIntent pi = PendingIntent.getActivity(ams.mContext, 0, - runningIntent, PendingIntent.FLAG_UPDATE_CURRENT); - foregroundNoti.setLatestEventInfo(ctx, - ams.mContext.getString( - com.android.internal.R.string - .app_running_notification_title, - appName), - ams.mContext.getString( - com.android.internal.R.string - .app_running_notification_text, - appName), - pi); - } catch (PackageManager.NameNotFoundException e) { - foregroundNoti.icon = 0; - } + + // Do not allow apps to present a sneaky invisible content view either. + foregroundNoti.contentView = null; + foregroundNoti.bigContentView = null; + CharSequence appName = appInfo.loadLabel( + ams.mContext.getPackageManager()); + if (appName == null) { + appName = appInfo.packageName; + } + Context ctx = null; + try { + ctx = ams.mContext.createPackageContext( + appInfo.packageName, 0); + Intent runningIntent = new Intent( + Settings.ACTION_APPLICATION_DETAILS_SETTINGS); + runningIntent.setData(Uri.fromParts("package", + appInfo.packageName, null)); + PendingIntent pi = PendingIntent.getActivity(ams.mContext, 0, + runningIntent, PendingIntent.FLAG_UPDATE_CURRENT); + foregroundNoti.setLatestEventInfo(ctx, + ams.mContext.getString( + com.android.internal.R.string + .app_running_notification_title, + appName), + ams.mContext.getString( + com.android.internal.R.string + .app_running_notification_text, + appName), + pi); + } catch (PackageManager.NameNotFoundException e) { + foregroundNoti.icon = 0; } } if (foregroundNoti.icon == 0) { |