LogmeinRescue / Android-SDK

Rescue In-App Support Android SDK
http://secure.logmeinrescue.com/welcome/webhelp/EN/SDKa/MobileSDK/c_rasdk_overview.html
Other
5 stars 6 forks source link

Crash on camera/screen share start when targeting Android 11 #48

Closed cswagner closed 3 years ago

cswagner commented 3 years ago

Testing on a device running Android 11 with compileSdkVersion and targetSdkVersion set to 30, I'm getting a crash when starting either a camera or screen share session:

java.lang.SecurityException: getDataNetworkTypeForSubscriber
        at android.os.Parcel.createExceptionOrNull(Parcel.java:2373)
        at android.os.Parcel.createException(Parcel.java:2357)
        at android.os.Parcel.readException(Parcel.java:2340)
        at android.os.Parcel.readException(Parcel.java:2282)
        at com.android.internal.telephony.ITelephony$Stub$Proxy.getNetworkTypeForSubscriber(ITelephony.java:8762)
        at android.telephony.TelephonyManager.getNetworkType(TelephonyManager.java:3021)
        at android.telephony.TelephonyManager.getNetworkType(TelephonyManager.java:2985)
        at com.logmein.rescuesdk.internal.jb$a.onSignalStrengthsChanged(SourceFile:53)
        at android.telephony.PhoneStateListener$IPhoneStateListenerStub.lambda$onSignalStrengthsChanged$18(PhoneStateListener.java:1222)
        at android.telephony.-$$Lambda$PhoneStateListener$IPhoneStateListenerStub$lP7_Xy6P82nXGbUQ_ZUY6rZR4bI.run(Unknown Source:4)
        at android.os.Handler.handleCallback(Handler.java:938)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:223)
        at android.app.ActivityThread.main(ActivityThread.java:7656)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

The failing method requires the READ_PHONE_STATE permission which I don't want to request from the user. Could the case where this permission is denied be handled gracefully to prevent the crash?

tamasgyongyosi commented 3 years ago

Hi @cswagner ,

This is because of using DeviceInfoExtension. You can prevent SecurityException If you are not using this extension. Also you have to enable "Classic display for mobile" setting in Admin Center. You can find this option in the "Organization" tab when you select a Technician Group in the left side panel. ac_classic_display

Furthermore you have to select "Launch Display Viewing Session" during the session creation process in the Technician Console to get thorough to screen sharing. tc_classic_display

In the camera share case it will works out of the box if you leave DeviceInfoExtension.

Please let me know if this solution works for you.

tamasgyongyosi commented 3 years ago

Hi @cswagner ,

We have just released a new version of the SDK (3.7.2). If you use the DeviceInfoExtension then the SDK ask the READ_PHONE_STATE permission from the user. If the user deny this permission then there is no SecurityException and the Technician Console does not get network type information from the phone.

cswagner commented 3 years ago

Everything looks good on our end after updating to v3.7.2. Thanks!

tamasgyongyosi commented 3 years ago

I'm glad to hear that :) Thank you for bringing this issue to our attention.