Do you 100% have to use Chrome or Firefox?
It is easier to do what you are saying by developing a kiosk app with a custom WebView that only shows the webpage you want to show. I could be wrong on this, but I believe WebViews on Android are technically Chrome (or something like it) on the back end, but either way, using one I doubt you would need to worry about updates. However, that is not what you asked... so I will describe a solution using Chrome or Firefox. My solution also means you need to have access to the devices you are loading your software on though, not a commercial app, because you need ADB.
It is completely possible to setup a Kiosk app in Android to only allow Chrome or Firefox to be used, and this is easily done if you set the application you load onto the device (to do whatever task you need) as the device owner. This is easy to do via ADB using a Command Prompt or Android Studio Terminal.
Just FYI...I am not positive setting up a 'true' Kiosk App is possible without device owner privileges, you cannot actually lock an app to the screen without it. In the case I describe, you get a true Kiosk implementation using a device owner, not a nifty work around that mimics that functionality like most of the apps you see in the market, however, I would also bet that those apps have some type of device admin privileges, which are less powerful than device owner, but still powerful.
The 'real' way I describe would be done via ADB (or the command line) with a similar snippet to the following command (I used this in a recent enterprise application that seems pretty similar to what you are describing):
adb shell dpm set-device-owner
com.viatechsystems.guestservices/android.app.admin.DeviceAdminReceiver
- You would replace "com.viatechsystems.guestservices" with your Kiosk application's package name. You will get a confirmation message on the console once the device owner is set via ADB, but realize that this command could fail if a Device Owner is already set via some other method. To fix that issue, reset your device and try the command again and you should be good to go.
As far as locking your app (or in your case Chrome or Firefox, just find out what the package name is first) into Kiosk Mode after device owner has been set, you need to run this snippet, or something like it, in your application's main activity:
DevicePolicyManager DPM =
(DevicePolicyManager)getSystemService(Context.DEVICE_POLICY_SERVICE);
ComponentName ownerName = new
ComponentName(WHATEVER_CLASS_YOU_USE_TO_DISABLE_APPS.this
DeviceAdminReceiver.class);
//this.getPackageName() GETS CURRENT PACKAGE
String[] packages = {
//THIS IS CURRENT APP
this.getPackageName()
//YOU NEED TO USE CHROME OR FIREFOX PACKAGE
//NAME HERE INSTEAD FOR WHAT YOU WANT
};
DPM.setLockTaskPackages(ownerName, packages);
startLockTask(); //LOCKS PACKAGES IN KIOSK MODE
Now that should do what you needed, however in my recent app's case I needed to also ensure that if a user somehow got out of the Kiosk mode (which is technically possible on reboot, even with a Boot Listener implemented), they would only be able to open the application I wanted, and nothing else.
To do this you need to hide/disable applications with the device owner privileges you achieved earlier when you set your custom application to lock down Chrome, or Firefox, or whatever you want into Kiosk mode.
I can tell you how to find all of the package names on the device you load your app on, but I'm guessing you can figure that out... hint if you have issues, you use Android's Package Manager.
In this instance the package/app we want to hide is "com.example.HideThisPackage", simply replace it with whatever package name you want to hide/disable as the device owner.
//THIS VARIABLE AGAIN
DevicePolicyManager DPM =
(DevicePolicyManager)getSystemService(Context.DEVICE_POLICY_SERVICE);
//THIS VARIABLE AGAIN
ComponentName ownerName = new
ComponentName(WHATEVER_CLASS_YOU_USE_TO_DISABLE_APPS.this
DeviceAdminReceiver.class);
//USED TO HIDE INSTALLED APPS AFTER DEVICE OWNER ENABLED
DPM.setApplicationHidden(ownerName, com.example.HideThisPackage, true);
Then you should be good to go, let me know if you need any additional pointers but I used code almost exactly like this to do what it seems like you are describing a few months ago.