How to disable, or hide system settings programmatically? - android

I do not want the user to open device settings, so I need to disable device settings.
I found way to open settings
startActivityForResult(new Intent(android.provider.Settings.ACTION_SETTINGS), 0);
But I am looking for a way to disable it, how can I do that?

You can not disable system packages unless you make a custom rom. Besides that it is a huge security risk to allow developers to disable settings so the user can not stop the app.

You may create custom launcher with kiosk mode to achieve your target. Note that this approach requires some actions from your users.
Related links
https://developer.android.com/work/cosu.html
http://pvolan.blogspot.ru/2017/01/android-50-kiosk-mode-aka-super.html

Related

Default Device assistance app Android

Sadly, now we can no more map our apps to Long press home button Event. But, There is a settings page where it is possible to change the default device assistance app:
Default Device Assistance app on Samsung
Is it anyway possible to change the default device assistance app programmatically or even launch the settings page (via intent) to make the user change the setting?
Is it anyway possible to change the default device assistance app programmatically
Fortunately, no, for blindingly obvious privacy and security reasons.
even launch the settings page (via intent) to make the user change the setting?
Ideally, there would be an action in Settings for this, but I do not see one that looks like it is specific to the assistant.

Prompting User to Enable GPS

Correct me if I am wrong:
1) You cannot programatically turn GPS On/Off on all versions of Android. Maybe some previous versions, and some hacks, but not on all devices. It simply is not allowed.
This leaves only two options:
1) Use new Google Play Services to prompt user to change these settings.
One issue with this is what if you just want to allow user to turn on GPS,
but not WIFI? The resolver will give them options to turn on both. How
can you just turn on one but not the other?
2) Send user to the settings application by firing off an Intent.
Now with 1) User must have current google play services installed.
If not they can be prompted to install it via standard GPS dialog.
Ok, now for 2) Sending user to settings application. I have the following problem:
When I fire off this intent, they not only get to change the Location/GPS Settings but they can also hit the little back button within Settings app, and adjust all settings. Is there any way to prevent this? Anyway to bring up the Location/GPS Settings without the inner back button? Thanks.
You cannot programatically turn GPS On/Off on all versions of Android. Maybe some previous versions, and some hacks, but not on all devices. It simply is not allowed.
Correct, for obvious privacy reasons.
When I fire off this intent, they not only get to change the GPS Settings but they can also hit the little back button within Settings app, and adjust all settings. Is there any way to prevent this?
No.

Disable the possibility to hide notifications in Android Lollipop

Since Android Lollipop, the user can hide notifications of an application from Android settings.
I'm writing a parental control application and I'm searching for a way to disable this functionality.
Indeed, I want notifications to be always displayed, even if the child doesn't want to see them.
I saw that on tablets (not on phones) we can create a specific profile to block access to the settings app, but I don't want to lock the settings app, and the trick needs to work on phones too.
I also looked in manifest file to see if an option was there to explicitly enable/disable this but I found nothing.
Please note that my app does have admin privileges.
After hours of head scratching and hundred of coffees, nothing came to me from Android developer website or any other website, I'm desparated.
So finally, is there a way to disable the possibility to hide notifications in Android Lollipop?
Disabling the ability to hide unwanted notification would be undoing what that feature is. As far as I know there is no way to do that.
EDIT:
However - there is an broadcast send after each settings change (WiFi turn on / off etc.). Some settings blocking apps are using this to revert changes made before entering password - maybe there is an intent that does the same for hiding notification.

How to set system app is not disabled?

How can I set a system app (my custom system app) to be NOT DISABLED?
Just like the Launcher or Settings that the "Disable" button is not enabled. So the user can't disable my system app.
Below is the Launcher's effect:
It's not possible for a third party application (like yours) to define itself as not being possible to disable- It's important that the user be able to disable any application on their system. If you find a way, that will be considered a security flaw, and it'll likely be disabled in the next release of Android :)
Launcher and Settings are special cases in terms of not being possible to disable, since disabling those would make it difficult/impossible for the user to maintain their own device (or to undo their decision, since they wouldn't be able to launch the settings Activity and re-enable it).

How can I programmatically disable 'settings' option in android?

How can I disable settings option in android, I dont want user to get into it. I have launched home intent when settings process is running but its not seems to be good. Any other way to do it ?
The most you can do is take advantage of Device Administration, introduced in 2.2, to enforce settings policies. Details here

Categories

Resources