Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 20dd431f authored by Philip P. Moltmann's avatar Philip P. Moltmann
Browse files

Do not allow to revert setForceSafeLabel

Test: Built
Bug: 116798569
Change-Id: I3f26d4466c84d3decb1c4962fb45e900ba35f68e
parent 918bc902
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1118,9 +1118,9 @@ package android.content.pm {
  }

  public class PackageItemInfo {
    method public static void forceSafeLabels();
    method public deprecated java.lang.CharSequence loadSafeLabel(android.content.pm.PackageManager);
    method public java.lang.CharSequence loadSafeLabel(android.content.pm.PackageManager, float, int);
    method public static void setForceSafeLabels(boolean);
    field public static final int SAFE_LABEL_FLAG_FIRST_LINE = 4; // 0x4
    field public static final int SAFE_LABEL_FLAG_SINGLE_LINE = 2; // 0x2
    field public static final int SAFE_LABEL_FLAG_TRIM = 1; // 0x1
+2 −4
Original line number Diff line number Diff line
@@ -105,13 +105,11 @@ public class PackageItemInfo {
    /**
     * Always use {@link #loadSafeLabel safe labels} when calling {@link #loadLabel}.
     *
     * @param forceSafeLabels {@code true} to enforce safe labels
     *
     * @hide
     */
    @SystemApi
    public static void setForceSafeLabels(boolean forceSafeLabels) {
        sForceSafeLabels = forceSafeLabels;
    public static void forceSafeLabels() {
        sForceSafeLabels = true;
    }

    /**
+1 −1
Original line number Diff line number Diff line
@@ -23,6 +23,6 @@ public class PackageInstallerApplication extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
        PackageItemInfo.setForceSafeLabels(true);
        PackageItemInfo.forceSafeLabels();
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -359,7 +359,7 @@ public final class SystemServer {
            // The system server should never make non-oneway calls
            Binder.setWarnOnBlocking(true);
            // The system server should always load safe labels
            PackageItemInfo.setForceSafeLabels(true);
            PackageItemInfo.forceSafeLabels();

            // Default to FULL within the system server.
            SQLiteGlobal.sDefaultSyncMode = SQLiteGlobal.SYNC_MODE_FULL;