summaryrefslogtreecommitdiffstats
path: root/packages/PrintSpooler
diff options
context:
space:
mode:
authorSvetoslav <svetoslavganov@google.com>2013-10-14 19:02:00 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-10-14 19:02:00 -0700
commita337895682d86e9d71b04562a8b6e0dae889c8ac (patch)
tree81d5358d6ab7c897eefd178a72a9c679a3e13237 /packages/PrintSpooler
parent9aded5abd65a2c69090abece37a7825a52ca3af0 (diff)
parent2c163ee4eb1e1ec835bba1c906e4ba1f86983c46 (diff)
downloadframeworks_base-a337895682d86e9d71b04562a8b6e0dae889c8ac.zip
frameworks_base-a337895682d86e9d71b04562a8b6e0dae889c8ac.tar.gz
frameworks_base-a337895682d86e9d71b04562a8b6e0dae889c8ac.tar.bz2
am 2c163ee4: am 1e639d2d: Merge "Update the message for unavailable printers." into klp-dev
* commit '2c163ee4eb1e1ec835bba1c906e4ba1f86983c46': Update the message for unavailable printers.
Diffstat (limited to 'packages/PrintSpooler')
-rw-r--r--packages/PrintSpooler/src/com/android/printspooler/PrintJobConfigActivity.java15
1 files changed, 11 insertions, 4 deletions
diff --git a/packages/PrintSpooler/src/com/android/printspooler/PrintJobConfigActivity.java b/packages/PrintSpooler/src/com/android/printspooler/PrintJobConfigActivity.java
index 3a23b3e..2997707 100644
--- a/packages/PrintSpooler/src/com/android/printspooler/PrintJobConfigActivity.java
+++ b/packages/PrintSpooler/src/com/android/printspooler/PrintJobConfigActivity.java
@@ -2175,10 +2175,17 @@ public class PrintJobConfigActivity extends Activity {
mIsPosted = false;
if (mDestinationSpinner.getSelectedItemPosition() >= 0) {
View itemView = mDestinationSpinner.getSelectedView();
- TextView titleView = (TextView) itemView.findViewById(R.id.title);
- String title = getString(R.string.printer_unavailable,
- mCurrentPrinter.getName());
- titleView.setText(title);
+ TextView titleView = (TextView) itemView.findViewById(R.id.subtitle);
+ try {
+ PackageInfo packageInfo = getPackageManager().getPackageInfo(
+ mCurrentPrinter.getId().getServiceName().getPackageName(), 0);
+ CharSequence service = packageInfo.applicationInfo.loadLabel(
+ getPackageManager());
+ String subtitle = getString(R.string.printer_unavailable, service.toString());
+ titleView.setText(subtitle);
+ } catch (NameNotFoundException nnfe) {
+ /* ignore */
+ }
}
}
}