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

Commit def3de00 authored by Ivan Chiang's avatar Ivan Chiang
Browse files

[PM] Only enable PIA V2 when the version is larger than BAKLAVA

Flag: android.content.pm.use_pia_v2
Test: manual
Bug: 274120822
Change-Id: Ib53af653dde4be0d0979bf3dc7ab8c351df9696f
parent e9592db2
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
@@ -416,6 +417,12 @@ public class PackageUtil {
            return false;
        }

        // Only enable PIA V2 on the version that is newer than BAKLAVA
        if (Build.VERSION.SDK_INT_FULL <= Build.VERSION_CODES_FULL.BAKLAVA) {
            Log.d(LOG_TAG, "The OS version doesn't support PIA version 2");
            return false;
        }

        boolean testOverrideForPiaV2 = Settings.System.getInt(context.getContentResolver(),
                "use_pia_v2", 0) == 1;
        boolean usePiaV2aConfig = Flags.usePiaV2();