Draw Over Other Apps ~ Disabled / Grayed Out ~ - android

Android states i must ask for permission if my app wants to "Draw over other apps" when on Android v 6.0+. This permission can only be given manually by the user navigating to the appropriate Settings area.
When sent to Settings (via my app calling the intent) i noticed the "Draw over other apps" option for my app is always set to Disabled; it cannot be modified. Furthermore, if one were to navigate to the Apps permissions manually you'll notice the desired app isnt even listed in the "Draw over other apps" page making it impossible to adjust the setting.
I've already followed the baffling instructions by others to disable all the other apps listed then to try running my app again but to no luck. I've also tried restarting the emulator, factory reset, and other emulators. No luck.
Are there any other solutions to resolving this disabled issue?

Ok i discovered the problem and this is likely the same issue all others have had. Within my AndroidManifest.xml i forgot to include the SYSTEM_ALERT_WINDOW permission.
So add the following just before the application element:
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
Problem solved. Everyone should ignore the ridiculous claim that you need to disable all the other Draw over apps or Force stop others. Completely unnecessary in my case.

Related

Some Samsung phones with Android 6 or higher don't have android.settings.IGNORE_BATTERY_OPTIMIZATION_SETTINGS

My app needs to allow users to disable doze mode for my app, so for that the app needs to open android.settings.IGNORE_BATTERY_OPTIMIZATION_SETTINGS but I get android.content.ActivityNotFoundException when trying to open that intent on some Samsung phones like the Galaxy A5.
Is there an equivalent on those phones? What about other phones?
Thanks.
Edit: I just want to be clear, I'm trying to find what the actual setting screen is on Samsung Phones like the A5, not just how to open settings. I need to direct the users to the right location.
Edit: To clarify further, we have no found the setting on that Samsung phone to make isIgnoringBatteryOptimizations() return true. That is my main question, what setting needs to change on that phone for that to become true.
The Samsung Galaxy A5 ran on three OSs:
Android 6.0.1, Android 7.0, Android 8.0.0 (GFX Bench)
The android.settings.IGNORE_BATTERY_OPTIMIZATION_SETTINGS activity was added in API 23. It was not removed afterwards. For some reason, this bug was never addressed by Samsung. The only solution is to bring the user to the system settings screen. See the following solution:
https://github.com/kontalk/androidclient/commit/be78119687940545d3613ae0d4280f4068125f6a
EDIT
After misunderstanding the question and with the clarification of the OP, I've added a potential solution to address which power setting needs to be accessed.
If you haven't already, make sure you are using android.settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS. Be sure that you add REQUEST_IGNORE_BATTERY_OPTIMIZATIONS in your manifest prior to using this activity.
Activity Action: Ask the user to allow an app to ignore battery optimizations (that is, put them on the whitelist of apps shown by ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS). For an app to use this, it also must hold the Manifest.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS permission.
This should bring the user to the exact option necessary.
If you have one of these phones (maybe virtual from some online services) you can run the adb command to find the running activities, this way you can check the intent and maybe you are allowed to call it:
adb shell dumpsys activity activities

How to permanently disable car mode?

I'm running Android 7.1 and I cannot for the life of me figure out how to ensure "car mode" doesn't start when the device (honeywell CT60) is docked. I've already tried the following:
installing app "no dock"
installing app "car mode off"
getting app devs to add uiMode to the <ACITIVTY> element in the manifest.xml file.
None of these seem to work.
Does anyone have any advice or ideas?
Perhaps even an app that force the device to not go into car mode.
You're on the right track. According to Honeywell the app's AndroidManifest.xml has to be modified in the following way:
<manifest>
<application>
<activity android:configChanges="uiMode">
[...]
</activity>
</application>
</manifest>
This has to be added for each activity, where CAR_MODE should be disabled. It signals to the OS that the app will handle changes regarding the UiMode itself. Now instead of restarting the app to apply changes, the OS will leave handling this change up to the app.
If you want to find out how exactly it works, there already is a post explaining it. Alternatively you can find a guide about this topic at the Android Developer Docs.

Android Marshmallow location permission does not work even though permission is granted by user

I am developing an application which requires location permission for Android Marshmallow. I followed all the steps (function calls) required to implement that.
When I run the application it pop up a box asking for the user permission. When I select yes, it display another pop up saying "Screen overlay detected" and that takes me to setting screen where list of applications is shown. There I uncheck all the applications and press back button to return to my app.
When onRequestPermissionsResult() callback is called, I can see the permission is not granted. It happen all the time.
Why does it display "screen overlay detected" all the time as I have already unselected/unchecked all the apps in the list?
Why permission is not granted although I have pressed yes when it ask for the permission?
The reason: This message appears when you’re running a floating app, and then start a newly installed one, which requests access rights. Floating apps include the chat heads of Facebook Messenger that can appear floating above other apps, etc.
Affected Smartphones: Users across the internet have reported experiencing this problem on Samsung and Motorola smartphones. It seems likely to affect many manufacturers. AndroidPIT managed to replicate the behavior on a Vodafone and a Samsung smartphone.
Problem apps: We replicated the problem using Drupe, but CleanMaster, Lux and Twilight have all been blamed for the problem.
The technical background: As a security measure, apps ask for permission to use certain parts of your phone (internal storage, camera, etc.). In theory, a display overlay can interfere with the dialogue requesting permission, so you need to disable the feature to interact with the dialogue.
Now the Solution, how to fix it:
Step one: "Screen overlay detected" fix
Find you what apps have permission to draw over the screen. On a non-Samsung smartphone, follow these steps:
Open the Settings
Tap the search icon at the top right
Enter the search term “draw”
Tap Draw over other apps
Select Draw over other apps
For Samsung users:
Open the Settings
Then Applications > Application manager
Press on More > Apps that can appear on top
Step two:
You will find yourself in front of a list of apps that have permission to use floating buttons or other screen overlays. Now you need to identify the problem app and temporarily deny it permission to draw over the screen. Here is are some pointers on how to identify the app that’s causing trouble:
Do you see an app bubble on your screen? If do, this app is almost certainly the cause. Either you hide the app bubble or disable the app in the list
Do you have an app installed that changes the colors on the display or adjusts the brightness?
Reportedly, Clean Master can be a trouble maker. If you see Clean Master in the list, disable it
If there’s no obvious cause, disable everything
Step three:
Now you can try launching the app again, and it should request permissions without the “Display overlay detected” error getting in the way.
For Samsung users: The one-handed keyboard setting could be the root cause. Deactivate it by going to Settings> Advanced features > One-handed operation.
Step four: reactivate screen overlays
In order for the app(s) that you have disabled in step two to work again, you need to re-enable its overlay permissions. If you turned off all apps, it might be worth considering only reactivating those apps that you actually use.
This is a rather inelegant workaround, but it's the best we have until Google makes the necessary changes to prevent app overlays from interfering with permission dialogues.
Has this guide helped? If you are still experiencing the error after following our guide, leave a comment, so I can try and address the problem.
This is the issue reported many times.
The possible solutions are:
1) delete apps like(cleanmaster, battery saver, etc.) or go to settings/app/cleanmaster/force stop.
2) Or you can also remove the permissions for cleanmaster.
3) determine which app is drawing over other apps. Turn that off beforehand.
Note: Sometimes unchecking does not actually solve the problem of the overlay.

Draw on top of screen without permission request above 6.0

I want to know how to draw something on top on screen without permission request.
I had implement an app can draw something on the top on screen by this post, it worked fine before my device version update to 6.0.
When my app run on devices above 6.0, I met a permission issue that I need to ask user to request SYSTEM_ALERT_WINDOW permission in app as this post says, and it worked fine when I implement the permission request code.
But I found many apps can draw many things on top of screen without this permission on google play store, like Draw on screen, Screen Draw Screenshot, etc.
How can I implement this function with permission like these apps?
Can someone help me?
just set target sdk version = 22 and you can do it without asking permission.
Btw it is not a good practice you should absolutely use the new Runtime Permission of 6.0

Is android:excludeFromRecents broken for the first app that is launched on the device on Android L?

Is seems like the current way to exclude apps from the recent apps-lists in android L is broken. Our app is using android:excludeFromRecents and it works just fine. Unless our app is the FIRST app to start when the device reboots.
This is how it looks when our app is exited as the first app on the device:
And here is how it looks if we first start the camera (or any other app), then our app and exit both:
Simply put: If an app with android:excludeFromRecents is started as the first app on the device, the directive android:excludeFromRecents isn't working. If another app has been started before the android:excludeFromRecents-app, it works as expected.
Is this a really weird edge-case bug or am i'm missing something very obvious here?
We build a very privacy cautious web browser (http://inbrowserapp.com), so we cannot have any screenshots from the app showing once the app is closed. But this should also affect banking-apps, password-managers etc since sensitive information will be screenshotted if the app is the first to start after a reboot.
Maybe we can go about the route and hide the sensitive information with a blank view when the user is exiting on Android L. But its seems like something is buggy here?
I'm happy to say that this is fixed for Android 5.1. Just confirmed it on a device running 5.1.
So the correct solution, for us anyways, is to deny screenshots with getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE); for Lollipop with SDK version 21, anything below or above that should be fine.
You can at least prevent the screenshot in recents by setting this flag:
getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
But it's still a bug that never should have made it to release..

Categories

Resources