Upgrading app in background using Device Policy Controller

前端 未结 1 2074
再見小時候
再見小時候 2021-01-07 15:16

I have a working DPC app which is the Device Owner. I have tried this on two different Android 6.0.1 devices to rule out any device/manufacturer issues.

I used

相关标签:
1条回答
  • 2021-01-07 16:03

    The error was coming from the following Android 6.0.1 code in frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java.

    if ((pkg.applicationInfo.flags&ApplicationInfo.FLAG_TEST_ONLY) != 0) {
        if ((installFlags & PackageManager.INSTALL_ALLOW_TEST) == 0) {
            res.setError(INSTALL_FAILED_TEST_ONLY, "installPackageLI");
            return;
        }
    }
    

    I checked the app which I was trying to install, and found that the FLAG_TEST_ONLY bit was set. Why is Android Studio 3.0.0 setting FLAG_TEST_ONLY on APKs?

    0 讨论(0)
提交回复
热议问题