Closed ss14 closed 2 years ago
Closing all outstanding pull requests + issues as we've reworked the app to now build with Bazel. With this change, we should be able to properly accept pull requests going forward so these won't sit around for so long. If this is still relevant please check it with the latest version [Using the Android T SDK] and re-open.
Cause: When the device does not support file based encryption, dpm.lockNow(flags) in PolicyManagementFragment throws UnsupportedOperationException.
Possible Counter Measure: Put a check if the device supports FBE before pass
Exception Stack:
07-13 15:58:31.735 1210153 13801 13801 D AndroidRuntime: Shutting down VM 07-13 15:58:31.736 1210153 13801 13801 E AndroidRuntime: FATAL EXCEPTION: main 07-13 15:58:31.736 1210153 13801 13801 E AndroidRuntime: Process: com.afwsamples.testdpc, PID: 13801 07-13 15:58:31.736 1210153 13801 13801 E AndroidRuntime: java.lang.UnsupportedOperationException: FLAG_EVICT_CREDENTIAL_ENCRYPTION_KEY only applies to FBE devices 07-13 15:58:31.736 1210153 13801 13801 E AndroidRuntime: at android.os.Parcel.readException(Parcel.java:2033) 07-13 15:58:31.736 1210153 13801 13801 E AndroidRuntime: at android.os.Parcel.readException(Parcel.java:1967) 07-13 15:58:31.736 1210153 13801 13801 E AndroidRuntime: at android.app.admin.IDevicePolicyManager$Stub$Proxy.lockNow(IDevicePolicyManager.java:5749) 07-13 15:58:31.736 1210153 13801 13801 E AndroidRuntime: at android.app.admin.DevicePolicyManager.lockNow(DevicePolicyManager.java:3199) 07-13 15:58:31.736 1210153 13801 13801 E AndroidRuntime: at com.afwsamples.testdpc.policy.PolicyManagementFragment.lambda$showLockNowPrompt$13$PolicyManagementFragment(PolicyManagementFragment.java:1102) 07-13 15:58:31.736 1210153 13801 13801 E AndroidRuntime: at com.afwsamples.testdpc.policy.PolicyManagementFragment$$Lambda$14.onClick(Unknown Source:6) 07-13 15:58:31.736 1210153 13801 13801 E AndroidRuntime: at com.android.internal.app.AlertController$ButtonHandler.handleMessage(AlertController.java:177) 07-13 15:58:31.736 1210153 13801 13801 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:106) 07-13 15:58:31.736 1210153 13801 13801 E AndroidRuntime: at android.os.Looper.loop(Looper.java:164) 07-13 15:58:31.736 1210153 13801 13801 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:7000) 07-13 15:58:31.736 1210153 13801 13801 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method) 07-13 15:58:31.736 1210153 13801 13801 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:441)