Loading res/values/strings.xml +1 −1 Original line number Diff line number Diff line Loading @@ -172,7 +172,7 @@ <!-- Template for the warning message when an app requests a permission. --> <string name="permission_warning_template">Allow <xliff:g id="app_name" example="Gmail">%1$s</xliff:g> to <b><xliff:g id="app_name" example="Gmail">%1$s</xliff:g></b> to <xliff:g id="action" example="do something">%2$s</xliff:g>?</string> <!-- Permissions --> Loading src/com/android/packageinstaller/permission/ui/GrantPermissionsActivity.java +4 −11 Original line number Diff line number Diff line Loading @@ -27,13 +27,12 @@ import android.content.pm.PackageManager.NameNotFoundException; import android.content.pm.PermissionInfo; import android.content.res.Configuration; import android.content.res.Resources; import android.graphics.Typeface; import android.graphics.drawable.Icon; import android.hardware.camera2.utils.ArrayUtils; import android.os.Build; import android.os.Bundle; import android.text.SpannableString; import android.text.style.StyleSpan; import android.text.Html; import android.text.Spanned; import android.util.Log; import android.view.KeyEvent; import android.view.MotionEvent; Loading Loading @@ -231,16 +230,10 @@ public class GrantPermissionsActivity extends OverlayTouchActivity for (GroupState groupState : mRequestGrantPermissionGroups.values()) { if (groupState.mState == GroupState.STATE_UNKNOWN) { CharSequence appLabel = mAppPermissions.getAppLabel(); SpannableString message = new SpannableString(getString( R.string.permission_warning_template, appLabel, groupState.mGroup.getDescription())); Spanned message = Html.fromHtml(getString(R.string.permission_warning_template, appLabel, groupState.mGroup.getDescription()), 0); // Set the permission message as the title so it can be announced. setTitle(message); // Color the app name. int appLabelStart = message.toString().indexOf(" " + appLabel.toString() + " ", 0); int appLabelLength = appLabel.length() + 1; message.setSpan(new StyleSpan(Typeface.BOLD), appLabelStart, appLabelStart + appLabelLength, 0); // Set the new grant view // TODO: Use a real message for the action. We need group action APIs Loading Loading
res/values/strings.xml +1 −1 Original line number Diff line number Diff line Loading @@ -172,7 +172,7 @@ <!-- Template for the warning message when an app requests a permission. --> <string name="permission_warning_template">Allow <xliff:g id="app_name" example="Gmail">%1$s</xliff:g> to <b><xliff:g id="app_name" example="Gmail">%1$s</xliff:g></b> to <xliff:g id="action" example="do something">%2$s</xliff:g>?</string> <!-- Permissions --> Loading
src/com/android/packageinstaller/permission/ui/GrantPermissionsActivity.java +4 −11 Original line number Diff line number Diff line Loading @@ -27,13 +27,12 @@ import android.content.pm.PackageManager.NameNotFoundException; import android.content.pm.PermissionInfo; import android.content.res.Configuration; import android.content.res.Resources; import android.graphics.Typeface; import android.graphics.drawable.Icon; import android.hardware.camera2.utils.ArrayUtils; import android.os.Build; import android.os.Bundle; import android.text.SpannableString; import android.text.style.StyleSpan; import android.text.Html; import android.text.Spanned; import android.util.Log; import android.view.KeyEvent; import android.view.MotionEvent; Loading Loading @@ -231,16 +230,10 @@ public class GrantPermissionsActivity extends OverlayTouchActivity for (GroupState groupState : mRequestGrantPermissionGroups.values()) { if (groupState.mState == GroupState.STATE_UNKNOWN) { CharSequence appLabel = mAppPermissions.getAppLabel(); SpannableString message = new SpannableString(getString( R.string.permission_warning_template, appLabel, groupState.mGroup.getDescription())); Spanned message = Html.fromHtml(getString(R.string.permission_warning_template, appLabel, groupState.mGroup.getDescription()), 0); // Set the permission message as the title so it can be announced. setTitle(message); // Color the app name. int appLabelStart = message.toString().indexOf(" " + appLabel.toString() + " ", 0); int appLabelLength = appLabel.length() + 1; message.setSpan(new StyleSpan(Typeface.BOLD), appLabelStart, appLabelStart + appLabelLength, 0); // Set the new grant view // TODO: Use a real message for the action. We need group action APIs Loading