My app requires Gmail app (NOT Android version) needs to be at version 2.3.6 or higher on Froyo or Gingerbread; 4.0.5 or higher on Honeycomb and ICS.
Also, I use "com.google.android.gm.permission.READ_CONTENT_PROVIDER" permission. I believe above permission is either not granted or not available with older Gmail app versions.
My app works well if the device already has up-to-date Gmail app installed. However, if the user installs my app first and then update the Gmail app, my app will fail.
Here's the Logcat:
Launched with older Gmail app:
08-14 16:13:12.370 E/DatabaseUtils(22386): java.lang.SecurityException: Permission Denial: reading com.google.android.gm.provider.PublicContentProvider uri content://com.google.android.gm/[email protected]/labels from pid=22456, uid=10113 requires com.google.android.gm.permission.READ_CONTENT_PROVIDER
Launched after the latest gmail app installed:
08-14 16:14:17.105 W/PackageManager( 1974): Not granting permission com.google.android.gm.permission.READ_CONTENT_PROVIDER to package com.ellevsoft.gmailunread because it was previously installed without
I know the easiest solution is to uninstall my app and re-install again.
I want to make it easy for users. Is there a way to re-request the permission? Is there a broadcastreceiver to detect if Gmail app is being updated(installed) and request a permission again?
Thank you.
No, you can't do that. Android (PacakgeManagerService) will only grant you permissions it knows about. It only knows about permissions from already installed apps. Everything else is ignored. Best you can do is check the installed Gmail version and instruct people to update it and then re-install your app. BTW, is this permission public? I don't think Gmail allows third party apps to reads its data any more, they changed this quite a while ago.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With