microsoftconnect / ms-intune-app-sdk-android

Intune App SDK for Android enables data protection features and mobile app management via Microsoft Intune
43 stars 17 forks source link

Crash observed in FileEncryptionServiceBehavior.java at line 315 due to "Fatal Exception: java.lang.SecurityException" #125

Closed naquee-rizwan closed 2 years ago

naquee-rizwan commented 2 years ago

Describe the bug: App is crashing as soon as it is getting launched. This crash is observed only for device named Avaya CU360. Specifications of this device is added under "Smartphone" bucket.

To Reproduce App is crashing as soon as it is launched.

Expected behavior: App should not crash and users should be able to seamlessly use the application.

Screenshots and logs:

Fatal Exception: java.lang.SecurityException: Permission Denial: getIntentForIntentSender() from pid=23986, uid=10079 requires android.permission.GET_INTENT_SENDER_INTENT
       at android.os.Parcel.readException(Parcel.java:1684)
       at android.os.Parcel.readException(Parcel.java:1637)
       at android.app.IAlarmManager$Stub$Proxy.set(IAlarmManager.java:245)
       at android.app.AlarmManager.setImpl(AlarmManager.java:668)
       at android.app.AlarmManager.set(AlarmManager.java:338)
       at com.microsoft.intune.mam.client.fileencryption.FileEncryptionServiceBehavior.schedule(FileEncryptionServiceBehavior.java:315)
       at com.microsoft.intune.mam.client.fileencryption.FileEncryptionServiceBehavior.schedule(FileEncryptionServiceBehavior.java:250)
       at com.microsoft.intune.mam.client.fileencryption.FileEncryptionManager.lambda$initialize$0$FileEncryptionManager(FileEncryptionManager.java:496)
       at com.microsoft.intune.mam.client.fileencryption.-$$Lambda$FileEncryptionManager$crU8Qt28IblNqn6HVFMhvdxkCUI.run(-.java)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
       at java.lang.Thread.run(Thread.java:761)

Smartphone: All occurrences of the crash is on one device as mentioned below - Device - Avaya CU360 OS - Android 7.1.2 Device State - Background in all crashes

Intune App SDK for Android:

Additional context: The website for the device where crash is happening - Link

meghandaly commented 2 years ago

@naquee-rizwan In this particular instance, this appears to be an OEM issue within the Avaya CU360 device itself. The MAM SDK is monitored for potential violations that could prompt a SecurityException and the error comes from deeper in the stack. If the device has side-loaded an older CP and/or is built upon the AOSP code in a non-compliant way, this issue could occur.

Please keep in mind, the MAM team does not have the bandwidth to review every crash stack you may observe for your app and that certain Android OS versions are in limited support, such as Android 7.1.2 (as noted in the reference for the Android versions requirements for integrating the Android MAM SDK).

When opening issues in the future, it is helpful to provide additional context for the issue, aided by your own investigation, and to only open an issue if there is a definite pattern that can be attributed to MAM, or you suspect there may be. A single crash for a single user, does not meet that bar.

naquee-rizwan commented 2 years ago

Thanks @meghandaly. The issue raised up here was put after investigations were done from my side. Basis this, I had emphasised the device, the OS version it is using and device's state too in the device's description and link was also provided for their website speculating that it was a device related issue.

Saying that, crash logs (I know it was a Security Exception) were not enough for me to infer the reason you were able to infer - "MAM SDK is monitored for potential violations that could prompt a SecurityException". Reason being, I did not conclude it to keep under OEM issue bucket but prior to your explanation, I could do the same.

Also, this was not a single crash. Its instance per day was quite high (1.1k) and it met the bar for the issue to be raised.

However, thanks for looking into the issue and confirming it to be an OEM issue.

meghandaly commented 2 years ago

@naquee-rizwan We appreciate the detail you did provide in the bug and we were able to readily identify it as an OEM issue as a result, so thank you again for that 😃

My intention in stating "A single crash for a single user, does not meet that bar." is to highlight that the resources available to address these reported issues are finite. Although the instance per day was high (1.1k) it still qualified as one type of crash for a single user, so for our team, that does not meet the bar.