OSDN Git Service

Abbreviate permission labels less aggressively
authorPhilip P. Moltmann <moltmann@google.com>
Thu, 14 Jun 2018 18:52:14 +0000 (11:52 -0700)
committerPhilip P. Moltmann <moltmann@google.com>
Thu, 14 Jun 2018 18:52:14 +0000 (11:52 -0700)
commit004e489a251d6adf94922368e98a730185642123
tree8ac13fcbec3d143b1790d53b961a62e99fe76541
parentf910fdb1daf1bd3c28222efde503e2ff8de5c027
Abbreviate permission labels less aggressively

We switched the package installer app to always abbreviate all labels
loaded from foreign packages. This is done so that a foreign app cannot
crorrupt the UI via super-long strings.

The default abbreviation is very aggressive and abbreviates to ~5 cm.

When an app with a targetSDK <= M gets installed, all permissions will
get auto-granted. Hence when a user side-loads such an app, we show the
permissions during install so that the user is aware of this.

Unfortunately most permission labels and restrictions do not fit into a
single line.

This change allows much longer strings for permissions names and
descriptions. It still abbreviates eventually and handles permission
descriptions with weird characters (such as back-space) correctly.

Fixes: 110209410
Test: Side-loaded old app and verified that permission labels and
      descriptions are not abbreviated.

Change-Id: Ie1db240883c9f5cb9c1b74ca7bdcb80625e3f7f2
core/java/android/widget/AppSecurityPermissions.java