android-permissions

Avoid Screen Overlay Detected for service that uses SYSTEM_ALERT_WINDOW

 ̄綄美尐妖づ 提交于 2020-01-03 03:21:15
问题 My app main usage is overlay, the overlay is running from a service. Android Security add the nice "Screen Overlay Detected" I want to avoid "Screen Overlay Detected" when user tries to change permissions. so... I've add an AccessiblityService that detects: if ( event.getPackageName().equals("com.google.android.packageinstaller") ){ stopService(myServiceIntent); } However, even now I see this message popping. (when my service is stopped...). I saw Twilight does it without problem. What am I

Requesting Runtime permissions on Xiaomi devices

吃可爱长大的小学妹 提交于 2020-01-02 16:23:55
问题 When requesting permissions on devices with API level 23+ the documentation states you need to request each permission you need, and in case you are requesting a permission from a permissions group that you already have access to the permission is granted by by the system. Handle the permissions request response However, while adjusting my app to target API level 23 I noted that it is sufficient to request permission for one representative of the group - and the following checks for other

Requesting Runtime permissions on Xiaomi devices

左心房为你撑大大i 提交于 2020-01-02 16:23:52
问题 When requesting permissions on devices with API level 23+ the documentation states you need to request each permission you need, and in case you are requesting a permission from a permissions group that you already have access to the permission is granted by by the system. Handle the permissions request response However, while adjusting my app to target API level 23 I noted that it is sufficient to request permission for one representative of the group - and the following checks for other

Cannot read system files even after obtaining platform signature

白昼怎懂夜的黑 提交于 2020-01-02 16:15:08
问题 I've build a custom android ROM. I've signed my application with platform signature and have added android:sharedUserId="android.uid.system" in the manifest file. My app is granted all "signature" and "system" level permission but access to system files are not granted. Log.w("PC", String.valueOf(checkCallingOrSelfPermission("android.permission.ACCESS_SURFACE_FLINGER")== PackageManager.PERMISSION_GRANTED)); // true Log.w("PC", String.valueOf(checkCallingOrSelfPermission("android.permission

How to ask for multiple permissions one after another?

可紊 提交于 2020-01-02 07:27:28
问题 My app requires to access CAMERA and WRITE_EXTERNAL_STORAGE permissions. Once my app loads I want to ask user to allow both of these permissions one after another. I have this code: if (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, 2); } if (ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA) !=

How to have Read + Write external storage after targeting android O (26) 8.0

白昼怎懂夜的黑 提交于 2020-01-02 05:23:16
问题 Before targetting android O code below worked perfectly. After setting targetApi=27 (8.1) this stopped working. context.requestPermissions(new String[]{ Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE}, requestCode); I am presented with a permission dialog we all know, I gladly allow App to access photos media and files on a device. and in onRequestPermissionResult() it returns android.permission.READ_EXTERNAL_STORAGE == 0, android.permission.WRITE

How Do I determine which app is causing the “Screen Overlay Detected” error?

╄→尐↘猪︶ㄣ 提交于 2020-01-01 12:01:19
问题 Let me preface this with I have already read through Android "Screen Overlay Detected" message if user is trying to grant a permission when a notification is showing and I understand exactly what the overlay problem is. I also understand how to request it as well as how to check if my current running app has permission to draw on overlays (!Settings.canDrawOverlays(this)). I was getting scolded for my app because every time a permission request would popup, the overlays popup would be shown

Android Marshmallow permission model on OS 4.0 READ_EXTERNAL_STORAGE permission always not granted

折月煮酒 提交于 2020-01-01 08:35:28
问题 I have a problem when running my app on Android OS 4.0 and requesting READ_EXTERNAL_STORAGE permission with: ActivityCompat.requestPermissions(ctx, requestedPermissions, requestCode); I always get on the callback public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { grantResults != PackageManager.PERMISSION_GRANTED Checking the permission with ActivityCompat.checkSelfPermission is always returning permissionDenied . It works well

Android M permissions close my app

送分小仙女□ 提交于 2020-01-01 08:01:47
问题 I check for the required permissions on my Log In screen. The dialog shows asking for the 4 permissions I need. All good, but when the dialog appears, the background becomes black and my app closes (doesn't crash, just closes). When I'm done with choosing the permissions I open the app again and it continues running from where it stopped. How can I make the app continue running while the permissions dialog is shown? I use a class which checks for permissions and call it in the Log In activity

How to edit already present file in SD CARD using SAF(storage access framework)?

吃可爱长大的小学妹 提交于 2020-01-01 05:59:49
问题 I have a doubt I read these tutorials just to get the clear understanding of the SAF introduced in kitkat in higher version of android How to use the new SD card access API presented for Android 5.0 (Lollipop)? How to persist permission in android API 19 (KitKat)? Android API below 19 equivalent for ContentResolver takePersistableUriPermission Android Gallery on KitKat returns different Uri for Intent.ACTION_GET_CONTENT Now i have a question when the intent is fired and i get select the sd