Merge "Fixed name of autofill service on save UI." into pi-dev
diff --git a/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java b/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java
index 6ff9539..4bd8063 100644
--- a/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java
+++ b/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java
@@ -32,6 +32,7 @@
import android.content.ComponentName;
import android.content.Context;
import android.content.pm.ApplicationInfo;
+import android.content.pm.PackageItemInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.pm.ServiceInfo;
@@ -667,7 +668,10 @@
@NonNull
CharSequence getServiceLabel() {
- return mInfo.getServiceInfo().loadLabel(mContext.getPackageManager());
+ final CharSequence label = mInfo.getServiceInfo().loadSafeLabel(
+ mContext.getPackageManager(), 0 /* do not ellipsize */,
+ PackageItemInfo.SAFE_LABEL_FLAG_FIRST_LINE | PackageItemInfo.SAFE_LABEL_FLAG_TRIM);
+ return label;
}
@NonNull
@@ -912,6 +916,7 @@
} else {
pw.println();
mInfo.dump(prefix2, pw);
+ pw.print(prefix); pw.print("Service Label: "); pw.println(getServiceLabel());
}
pw.print(prefix); pw.print("Component from settings: ");
pw.println(getComponentNameFromSettings());