diff --git a/res/layout/installed_app_details.xml b/res/layout/installed_app_details.xml index f623d04b650..d69f98a9052 100644 --- a/res/layout/installed_app_details.xml +++ b/res/layout/installed_app_details.xml @@ -393,7 +393,7 @@ style="?android:attr/listSeparatorTextViewStyle" android:layout_marginTop="8dip" android:text="@string/permissions_label" /> - This app can access the following on your tablet: This app can access the following on your phone: + + This app can access the following on your tablet. + In order to improve performance and reduce memory usage, some of these permissions + are available to %1$s + because it runs in the same process as %2$s: + + This app can access the following on your phone. + In order to improve performance and reduce memory usage, some of these permissions + are available to %1$s + because it runs in the same process as %2$s: + + %1$s and %2$s + + %1$s and %2$s + + %1$s, %2$s + + %1$s, %2$s Computing\u2026 Couldn\'t compute package size. diff --git a/src/com/android/settings/applications/InstalledAppDetails.java b/src/com/android/settings/applications/InstalledAppDetails.java index c2e358c2a7a..9166b15e222 100644 --- a/src/com/android/settings/applications/InstalledAppDetails.java +++ b/src/com/android/settings/applications/InstalledAppDetails.java @@ -27,7 +27,6 @@ import android.app.Dialog; import android.app.DialogFragment; import android.app.Fragment; import android.app.INotificationManager; -import android.app.NotificationManager; import android.app.admin.DevicePolicyManager; import android.appwidget.AppWidgetManager; import android.content.BroadcastReceiver; @@ -43,6 +42,7 @@ import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.content.pm.PackageManager.NameNotFoundException; +import android.content.res.Resources; import android.hardware.usb.IUsbManager; import android.net.Uri; import android.os.AsyncTask; @@ -72,7 +72,6 @@ import android.widget.CheckBox; import android.widget.CompoundButton; import android.widget.ImageView; import android.widget.LinearLayout; -import android.widget.Switch; import android.widget.TextView; /** @@ -595,6 +594,46 @@ public class InstalledAppDetails extends Fragment R.id.security_settings_list); securityList.removeAllViews(); securityList.addView(asp.getPermissionsView()); + // If this app is running under a shared user ID with other apps, + // update the description to explain this. + String[] packages = mPm.getPackagesForUid(mPackageInfo.applicationInfo.uid); + if (packages != null && packages.length > 1) { + ArrayList pnames = new ArrayList(); + for (int i=0; i 0) { + final Resources res = getActivity().getResources(); + String appListStr; + if (N == 1) { + appListStr = pnames.get(0).toString(); + } else if (N == 2) { + appListStr = res.getString(R.string.join_two_items, pnames.get(0), + pnames.get(1)); + } else { + appListStr = pnames.get(N-2).toString(); + for (int i=N-3; i>=0; i--) { + appListStr = res.getString(i == 0 ? R.string.join_many_items_first + : R.string.join_many_items_middle, pnames.get(i), appListStr); + } + appListStr = res.getString(R.string.join_many_items_last, + appListStr, pnames.get(N-1)); + } + TextView descr = (TextView) mRootView.findViewById( + R.id.security_settings_desc); + descr.setText(res.getString(R.string.security_settings_desc_multi, + mPackageInfo.applicationInfo.loadLabel(mPm), appListStr)); + } + } } else { permsView.setVisibility(View.GONE); }