0

My app was sent a stack trace for device Y625-U21 (HWY625-U), the app doesn't ask for READ_PHONE_STATE because the docs say nothing about using this permission for getting dateFormat. We have tested the app in various devices and this doesn't happen.

java.lang.SecurityException: Requires READ_PHONE_STATE: Neither user 10149 nor current process has android.permission.READ_PHONE_STATE.
at android.os.Parcel.readException(Parcel.java:1472)
at android.os.Parcel.readException(Parcel.java:1426)
at com.android.internal.telephony.IPhoneSubInfo$Stub$Proxy.getSubscriberId(IPhoneSubInfo.java:317)
at android.telephony.TelephonyManager.getSubscriberId(TelephonyManager.java:1094)
at android.text.format.DateFormat.getDateFormatStringForSetting(DateFormat.java:262)
at android.text.format.DateFormat.getDateFormatForSetting(DateFormat.java:250)
at android.text.format.DateFormat.getDateFormat(DateFormat.java:236)
at edu.usf.cutr.opentripplanner.android.util.ConversionUtils.getTimeWithContext(ConversionUtils.java:217)
at edu.usf.cutr.opentripplanner.android.util.ConversionUtils.getTimeWithContext(ConversionUtils.java:210)
at edu.usf.cutr.opentripplanner.android.fragments.MainFragment.fillItinerariesSpinner(MainFragment.java:3521)
at edu.usf.cutr.opentripplanner.android.fragments.MainFragment.onTripRequestComplete(MainFragment.java:3462)
at edu.usf.cutr.opentripplanner.android.tasks.TripRequest.onPostExecute(TripRequest.java:171)
at edu.usf.cutr.opentripplanner.android.tasks.TripRequest.onPostExecute(TripRequest.java:60)
at android.os.AsyncTask.finish(AsyncTask.java:632)
at android.os.AsyncTask.access$600(AsyncTask.java:177)
at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:645)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5135)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:606)
at dalvik.system.NativeStart.main(Native Method)
josue.0
  • 775
  • 1
  • 10
  • 23
  • 1
    Presumably, the manufacturer (or developer of a custom ROM on that device) screwed up and added this dependency. Other than to wrap `getDateFormat()` in a `try`/`catch` block and have some fallback implementation, there is little that you can do about this. – CommonsWare Nov 02 '15 at 18:04

2 Answers2

0

I can say that when your app gets a lot of installs in Google Play you will receive a lot of strange crash reports in Google Developer console. Sometimes there is nothing you can do with it and you have to put your code in try/catch block.

I don't know all the details about your case, but in mine it was the only solution.

try {
    //your code here
} catch (SecurityException e) {
    e.printStackTrace();
    //do smth in this scenario
} 
Kirill Karmazin
  • 6,256
  • 2
  • 54
  • 42
-1

include this permission in manifest file READ_PHONE_STATE You are getting this exception becoz you haven't declare this permission in manifest file.