Application names are now lazily loaded

Previously when SmsApplication.getDefaultApplication was called, application
names were loaded for all candidate apps. The problem with that approach
that names are expensive to load and not always needed.

The implementation has been changed to only load application name when
it's requested by getApplicationName(Context).

Bug: 26237300
Change-Id: Ia711b7db8b979af8f7a1be7eefbce20f3e0ab1df
diff --git a/src/com/android/settings/SmsDefaultDialog.java b/src/com/android/settings/SmsDefaultDialog.java
index e38c9b8..830187c 100644
--- a/src/com/android/settings/SmsDefaultDialog.java
+++ b/src/com/android/settings/SmsDefaultDialog.java
@@ -109,11 +109,11 @@
             // Compose dialog; get
             if (oldSmsApplicationData != null) {
                 p.mMessage = getString(R.string.sms_change_default_dialog_text,
-                        mNewSmsApplicationData.mApplicationName,
-                        oldSmsApplicationData.mApplicationName);
+                        mNewSmsApplicationData.getApplicationName(this),
+                        oldSmsApplicationData.getApplicationName(this));
             } else {
                 p.mMessage = getString(R.string.sms_change_default_no_previous_dialog_text,
-                        mNewSmsApplicationData.mApplicationName);
+                        mNewSmsApplicationData.getApplicationName(this));
             }
             p.mPositiveButtonText = getString(R.string.yes);
             p.mNegativeButtonText = getString(R.string.no);