System Settings app force closes when in ProKiosk mode
Environment
- Knox SDK
- ProKiosk mode
- Samsung Wi-Fi only tablets
Overview
On some Samsung Wi-Fi only tablets in ProKiosk mode, you may encounter an issue where you can access the Connection > WLAN item on the device, but the System Settings app force closes if you invoke the relevant Knox SDK API.
Resolution
The Samsung Knox team released a new binary for several Wi-Fi only tablets to resolve this issue. If your device model is listed here, please use one of the workarounds below as it may not receive this update.
- SM-P200
- SM-P583
- SM-T580
- SM-T710
- SM-T810
- SM-T550
- SM-T330
- SM-T560
- SM-P350
- SM-T350
- SM-T820
- SM-T290
- SM-T295C
Cause
Check if you enabled the Connections item in the Settings app:
try {
CustomDeviceManager cdm = CustomDeviceManager.getInstance();
ProKioskManager pkm = cdm.getProKioskManager();
pkm.setProKioskState(true, "defaultPassCode");
pkm.setSettingsEnabledItems(true, CustomDeviceManager.PRO_KIOSK_SETTINGS_WIFI);
} catch(SecurityException e) {
Log.w(TAG, "SecurityException:" + e);
}
Navigating to the System Settings application, then to Settings > Connections invokes checkForKnoxCustomProKioskEnabledItems()
and removes any items that do not belong to ProKiosk mode, including Tethering and Hotspot. If your device is a Wi-Fi only model, Tethering and Hotspot are already removed, causing the open System Settings application to force close.
For more information, refer to the Knox API documentation:
Workaround
There are two solutions to resolve the force close:
Apply for Wi-Fi permission in AndroidManifest.xml
Declare the following permission in your AndroidManifest.xml file:
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
Then, use the code snippet below to enable the Wi-Fi Picker Dialog and display the SSID of the WLAN network:
Intent i = new Intent();
i.setClassName("com.android.settings", "com.samsung.android.settings.wifi.WifiPickerDialog");
startActivity(i);
Develop a Wi-Fi app according to Android native APIs
Instead of the Knox SDK, you may choose to use the Android native APIs to programmatically control your device’s Wi-Fi settings.
For the Android NDK API reference, see the Android Developers documentation.
Back to KBAsOn this page
Is this page helpful?