Guard new privileged extension package manager query with API check

This commit is contained in:
Oliver Scott 2021-02-22 18:05:22 -05:00
parent 08b45d3518
commit bb8fce0272

View File

@ -8,6 +8,7 @@ import android.content.ServiceConnection;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Build;
import android.os.IBinder;
import android.os.Process;
import android.os.RemoteException;
@ -186,7 +187,9 @@ public class InstalledAppProviderService extends JobIntentService {
public static void compareToPackageManager(final Context context) {
Utils.debugLog(TAG, "Comparing package manager to our installed app cache.");
if (PrivilegedInstaller.isExtensionInstalledCorrectly(context) == PrivilegedInstaller.IS_EXTENSION_INSTALLED_YES) {
if (Build.VERSION.SDK_INT >= 29 &&
PrivilegedInstaller.isExtensionInstalledCorrectly(context) ==
PrivilegedInstaller.IS_EXTENSION_INSTALLED_YES) {
ServiceConnection mServiceConnection = new ServiceConnection() {
@Override
public void onServiceConnected(ComponentName name, IBinder service) {