android-permissions

Package Installer crashes in Android M after requesting permission READ_SMS

混江龙づ霸主 提交于 2019-12-02 00:04:14
问题 I have a Login Fragment that tries to access (TelephonyManager) getActivity().getSystemService(Context.TELEPHONY_SERVICE); this works well with devices up to Lollipop 5.1. And when I tried it in Marshmallow 6.01 it showed security exception. So I added code from android docs to request permission on runtime. Here is the code int permissionCheck = ContextCompat.checkSelfPermission(getActivity(),Manifest.permission.READ_SMS); if (permissionCheck != PackageManager.PERMISSION_GRANTED) { // Should

Why does removing permission from AndroidManifest.xml not work?

萝らか妹 提交于 2019-12-01 22:44:01
问题 There is an app called bodyweight fitness on the play store without any permissions . It is available on git hub as well: https://github.com/mazurio/bodyweight-fitness-android I used the files from git hub and compiled the apk myself with Android Studio (without changing the files). When I try to install the self compiled app apk, it tells me that it will use the INTERNET though the play store app did not. There is no reason why this app should need any internet connection. Thus I removed

Android M - custom permission dialog style

自古美人都是妖i 提交于 2019-12-01 22:16:11
While implementing the new Android M permission model I noticed that the permissions dialog does not respect the theming of my styles.xml. In my styles.xml I override the dialog and alertdialog style like this: <item name="android:dialogTheme">@style/Theme.dialog</item> <item name="android:alertDialogTheme">@style/Theme.dialog</item> Is it possible to change the theming? Or is it because this is a system dialog like in the device settings? No, it's not possible. The permissions dialog is system dialog , hence you can't change its theme: The M Developer Preview introduces a new app permissions

Android permission denied for window type 2010 in Marshmallow or higher

荒凉一梦 提交于 2019-12-01 21:21:15
I am try to make Chathead type overly draw via Android Service on my app like bellow image. This chat head app works on Android Version 5 or lower versions(kitkat,lollipop etc).But I am trying it in Marshmallow and higher versions,Then get this error. android.view.WindowManager$BadTokenException: Unable to add window android.view.ViewRootImpl$W@48f5767 -- permission denied for window type 2010 Chat head code Note :I am calling this function from Android Service Permission List: <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" /> <uses-permission android:name="android

Why does my app say I am requesting permission for Contacts?

∥☆過路亽.° 提交于 2019-12-01 19:46:10
I have a watch face app that says I am requesting permissions for Contacts... but I'm not. I can't figure out why this is... I have in-app billing and I access Google fit data... as well as Google Analytics. Here is a list of the permissions in my manifest: <!-- Normal Permissions --> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> <uses-permission android:name="com.android.vending.BILLING" /> <!-- Dangerous Permissions --> <uses

“Write settings” permission not granted marshmallow android

放肆的年华 提交于 2019-12-01 19:09:31
<uses-permission android:name="android.permission.WRITE_SETTINGS" I have declared above line in my manifest ,and i ask for permission on activity start but unlike other permissions,after restarting my app,it again asks for permission.When i check if permission has been granted or not,i get result that says not granted for only this permission but when i checked the same thing with other permissions ,they are granted after the user has done so. ActivityCompat.requestPermissions(SplashScreen.this,PERMISSIONS, 1); i check with : EasyPermissions.hasPermissions(this,PERMISSIONS) use this for write

How to take CLEAR_APP_CACHE permission in Android Marshmallow at runtime?

旧街凉风 提交于 2019-12-01 16:14:12
问题 Code : void clearCache() { if (mClearCacheObserver == null) { mClearCacheObserver = new CachePackageDataObserver(); } PackageManager mPM = getPackageManager(); @SuppressWarnings("rawtypes") final Class[] classes = {Long.TYPE, IPackageDataObserver.class}; Long localLong = Long.valueOf(CACHE_APP); try { Method localMethod = mPM.getClass().getMethod("freeStorageAndNotify", classes); localMethod.setAccessible(true); // Start of inner try-catch block try { localMethod.invoke(mPM, localLong,

Android 6.0 needs restart after granting user permission at runtime

瘦欲@ 提交于 2019-12-01 15:13:50
I follow this guide to ask for permissions for Android 6.0, https://developer.android.com/preview/features/runtime-permissions.html#support-lib However, I have to destroy my application and re-launch to actually have the WRITE_EXTERNAL_STORAGE permission, otherwise it keeps failing for file creation. Am I missing something? if(ActivityCompat.checkSelfPermission(mContext, Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_DENIED){ ActivityCompat.requestPermissions((MainActivity)mContext,new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},MY_PERMISSION_REQUEST_WRITE

Android API 23 Requesting Multiple Permissions

女生的网名这么多〃 提交于 2019-12-01 13:11:30
I am trying to request permissions on my Launcher Activity. For API < 23, it works perfect. However, when I test the app on a device running API 23, it says: "PostPaid Balance has stopped." I hit the "close App button," the app closes and immediately asks for one permission. I hit accept. Then I tap on the app icon to reopen and the same thing happens, except that now it asks for the next permission. Then I tap on the app icon and this time executes correctly. It seems like it is asking for permissions one at a time. Any ideas on how to go about this? // Below code is implemented on onCreate()

Permission Denial: MediaDocumentsProvider

☆樱花仙子☆ 提交于 2019-12-01 13:07:58
I am getting the following exception when trying to display a URI. I think it occurs after my activity is stopped and I try to access a viable URI again. There are other questions addressing this problem but I am very confused as to how to apply any solutions to my code since my takePhotoIntent allows for a picture to either be taken or chosen from gallery (found below). Unable to open content: content://com.android.providers.media.documents/document/image%3A49688 java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaDocumentsProvider uri content://com