I ran into a bit of trouble with a project I'm working on. I'm building out the permission logic (prompting the user in runtime) do display the user on the map, but as a response I always get never_ask_again. If I check the apps permission settings then location is enabled there. This makes it hard to build out and test some of the logic. I've tried uninstalling the app and cleaning the project, nothing seems to help.
Is there a way how I could reset the permission settings for this app on my phone or what's the solution to this?
Thanks in advance!
I found a solution to this, this command seems to give me the desired result - adb shell pm clear com.appName
Related
I am developing a flutter alarm application and I ran into a problem. Probably it is easy to solve, but as I do not know how I thought you might know. I attached a file showing the other permissions feed of the alarm application alarmy which I found in the playstore. In the file, you can see that the "Show on Lock screen" and the "Display pop-up windows while running in the background" permission are both accepted from the start. On the other hand in case of the alarm application "Ultra Alarm" I am developing the two permission are denied from the start and I do not know how to change that. Maybe you can help me. It is a mi device.
I'm not sure if it's disabled by the system or if you haven't asked for the permissions, in the second case I recommend you to use permission handler, on the other hand, if the system is blocking the app to grant the permission it's becasuse you haven't made the setup on your Info.plist
I recommend you to check this post
I've implemented a short Flutter App which is requesting and checking the camera permission which works as expected. But, when manually changing the camera permission from the app settings, for both Android and iOS, it will restart my app. I need to mention that I've added in AndroidManifest.xml and Info.plist the required keys for camera. One interesting thing is that for the location the behaviour is fine and the app does not get restarted.
For permissions I'm using the permission_handler flutter library.
I don't know if is a flutter issue or a general mobile known behaviour but if someone knows more please let me know. If someone need some code example I can also provide this. Thank you.
It doesn't get 'restarted', it gets killed. Meaning, it will run from app launch the next time. This is because some permission settings cannot be changed while the App is running. This is by design.
I know from https://developer.android.com/guide/topics/connectivity/telecom/selfManaged, that you can set the default dialer by having the necessary items in your manifest and permissions listed. One of those being the Dial intent.
What i'm trying to do is build a library that does all of these content provider calls and provide a nice reactive way of doing things to my application. While building the library I would like to add some integration tests around these device calls.
There's the GrantPermissionsRule that helps with setting permissions already defined in your manifest but how does one deal with becoming the default dialer or SMS application? I'd accept even an adb command that you could run using a Runtime execute command.
I also tried testing on an emulator and I noticed that you can give your app WRITE_SECURE_SETTINGS but not MANAGE_USERS which is the other necessary permission you need if you were to use reflection to access the https://android.googlesource.com/platform/frameworks/base/+/master/telecomm/java/android/telecom/DefaultDialerManager.java
Any help is much appreciated!
you can try adb command:
adb shell settings put secure dialer_default_application com.google.android.dialer
replacing com.google.android.dialer with your package.
While I try to get new Android 8 (or P) Application Standby Bucket using UsageStatsManager.getAppStandbyBucket, I receive this error, gave every permission possible to app, but still crashes :
java.lang.SecurityException: MATCH_ANY_USER flag requires
INTERACT_ACROSS_USERS permission at
com.android.server.pm.PackageManagerService.getPackageUid:4959
com.android.server.pm.PackageManagerService$PackageManagerInternalImpl.getPackageUid:25142
com.android.server.usage.UsageStatsService$BinderService.getAppStandbyBucket:932
android.app.usage.IUsageStatsManager$Stub.onTransact:274
android.os.Binder.execTransact:731 : Neither user 10228 nor current
process has android.permission.INTERACT_ACROSS_USERS.
I posted the same question some days ago, like chrispher said, it's a bug, two issues has been filled in :
https://issuetracker.google.com/issues/111102580
https://issuetracker.google.com/issues/111857669
I know that on the first developer preview, the function was working, so maybe you can download the factory image, put it on an emulator or a device and make your test, a bit of a trick but at least we can test this way...
Edit: Good news ! https://issuetracker.google.com/issues/111102580
We are good to test, the release is here !
I'd like to know if there is any way to determine the permissions my app needs.
There is a similar question here:How do I determine why my Android app requires certain permissions?
But the answer states, that you basically have to find out yourself and I can't believe this.
Is there really no way to tell Eclipse to take a look at my code and determine the needed permissions or something like this? There should be no problem to automate this.
Or is there a way to test permissions on a device. When I install my app on my local device I'm not asked for any permissions.
Any help is really welcome.
This should work:
boolean crashes = true
while (crashes) {
ReadLogCat()
AddPermissionFoundMissingAccordingToLogCat()
crashes = TryAgain()
}
PS: This is pseudocode ;)
PPS: You didn't copy this to Eclipse, did you? Just kiddin' ;)
Believe it.
The app crashes and tells you the reason why: it expected some permission(s) declared in its manifest file.
It normally tells you in 2 ways: in a Dialog (FC Dialog) and in the LogCat.
You have to define permissions according to what your apps doing, if it's accessing the internet, it needs permission to do it. If it wants to locate you via GPS, it needs a permission for it and no you can't automate it, not officially anyway.
Think your app as a virtual child, you need to grant it permission to do stuff or else it won't do anything. So you have to pretty much decide yourself.
But you need not worry, if you're missing a permission, the log will let you know which one it is.
well i won't consider this as official solution for this problem
usually when i miss any permission in my application say i am using internet connectivity or get tasks but i didn't declared them in manifest
when i run my app i get it in log cat saying internet permission and get tasks permissions are required for this app to run
hope that answer your question
Is there really no way to tell Eclipse to take a look at my code and determine the needed permissions or something like this?
If you have a test suite that adequately tests your app, running the test suite will tell you the needed permissions, because your tests will crash if you do not have them.
Or is there a way to test permissions on a device. When I install my app on my local device I'm not asked for any permissions.
The permissions that you see on install are based on your <uses-permission> elements in your manifest, not some analysis of the app beyond that. Hence, this will not help you. That being said, installing your app by any means other than adb, such as downloading the app from a Web server, will pop up the permissions dialog, so you can see what prospective users will see at install time.