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

Commit 9fdd44f6 authored by Alan Viverette's avatar Alan Viverette
Browse files

Remove unused code from CompatModePackages, clean up CompileSdk strings

"Preview version" didn't translate well.

Fixes: 69791947
Test: make (no behavior change so didn't run CTS)
Change-Id: I8249dc1c4569fd2444dcbdf525eb5638ca448d4a
parent 71b4882d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2853,7 +2853,7 @@
    <string name="unsupported_display_size_show">Always show</string>

    <!-- [CHAR LIMIT=200] Unsupported compile SDK dialog: message. Shown when an app may not be compatible with the device's current version of Android. -->
    <string name="unsupported_compile_sdk_message"><xliff:g id="app_name">%1$s</xliff:g> was built for preview version %2$s of the Android OS and may behave unexpectedly. An updated version of the app may be available.</string>
    <string name="unsupported_compile_sdk_message"><xliff:g id="app_name">%1$s</xliff:g> was built for an incompatible version of the Android OS and may behave unexpectedly. An updated version of the app may be available.</string>
    <!-- [CHAR LIMIT=50] Unsupported compile SDK dialog: check box label. -->
    <string name="unsupported_compile_sdk_show">Always show</string>
    <!-- [CHAR LIMIT=50] Unsupported compile SDK dialog: label for button to check for an app update. -->
+0 −20
Original line number Diff line number Diff line
@@ -58,10 +58,6 @@ public final class CompatModePackages {
    public static final int COMPAT_FLAG_DONT_ASK = 1<<0;
    // Compatibility state: compatibility mode is enabled.
    public static final int COMPAT_FLAG_ENABLED = 1<<1;
    // Unsupported zoom state: don't warn the user about unsupported zoom mode.
    public static final int UNSUPPORTED_ZOOM_FLAG_DONT_NOTIFY = 1<<2;
    // Unsupported compile SDK state: don't warn the user about unsupported compile SDK.
    public static final int UNSUPPORTED_COMPILE_SDK_FLAG_DONT_NOTIFY = 1<<3;

    private final HashMap<String, Integer> mPackages = new HashMap<String, Integer>();

@@ -235,14 +231,6 @@ public final class CompatModePackages {
        return (getPackageFlags(packageName)&COMPAT_FLAG_DONT_ASK) == 0;
    }

    public boolean getPackageNotifyUnsupportedZoomLocked(String packageName) {
        return (getPackageFlags(packageName)&UNSUPPORTED_ZOOM_FLAG_DONT_NOTIFY) == 0;
    }

    public boolean getPackageNotifyUnsupportedCompileSdkLocked(String packageName) {
        return (getPackageFlags(packageName)&UNSUPPORTED_COMPILE_SDK_FLAG_DONT_NOTIFY) == 0;
    }

    public void setFrontActivityAskCompatModeLocked(boolean ask) {
        ActivityRecord r = mService.getFocusedStack().topRunningActivityLocked();
        if (r != null) {
@@ -254,14 +242,6 @@ public final class CompatModePackages {
        setPackageFlagLocked(packageName, COMPAT_FLAG_DONT_ASK, ask);
    }

    public void setPackageNotifyUnsupportedZoomLocked(String packageName, boolean notify) {
        setPackageFlagLocked(packageName, UNSUPPORTED_ZOOM_FLAG_DONT_NOTIFY, notify);
    }

    public void setPackageNotifyUnsupportedCompileSdkLocked(String packageName, boolean notify) {
        setPackageFlagLocked(packageName, UNSUPPORTED_COMPILE_SDK_FLAG_DONT_NOTIFY, notify);
    }

    private void setPackageFlagLocked(String packageName, int flag, boolean set) {
        final int curFlags = getPackageFlags(packageName);
        final int newFlags = set ? (curFlags & ~flag) : (curFlags | flag);
+1 −1
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ public class UnsupportedCompileSdkDialog {
        final PackageManager pm = context.getPackageManager();
        final CharSequence label = appInfo.loadSafeLabel(pm);
        final CharSequence message = context.getString(R.string.unsupported_compile_sdk_message,
                label, appInfo.compileSdkVersionCodename);
                label);

        final AlertDialog.Builder builder = new AlertDialog.Builder(context)
                .setPositiveButton(R.string.ok, null)