Menu

How to clear keyboard input history on a device using the Knox SDK

Environment 

Knox SDK

Overview

This article guides you through the steps on how to clear the input history on your device's keyboard, including saved login information. Following these steps prepares the device for a new user without requiring a factory reset or work profile removal.

How do I clear the keyboard input history on my device using the Knox SDK?

In order to clear the keyboard history for a user, invoke the Knox SDK API ApplicationPolicy.wipeApplicationData(), with com.sec.android.inputmethod passed in the parameter.

For example:

wipeApplicationData("com.sec.android.inputmethod")
NOTE - Ensure that the permission com.samsung.android.knox.permission.KNOX_APP_MGMT is declared or granted.
Although the default Samsung keyboard is passed into the API call, all keyboards' histories will be removed by this API since it removes both cache and stored application data.

Workaround

To ensure the white bar is removed while still hiding the navigation buttons, invoke SystemManager.setStatusBarMode() instead.
The following is an example of how to do this: 
CustomDeviceManager cdm = CustomDeviceManager.getInstance();
SystemManager sm = cdm.getSystemManager();
sm.setStatusBarMode(CustomDeviceManager.HIDE);
NOTE - You must have a KPE Premium license to use the CustomDeviceManagerobject.

Additional information

The ApplicationPolicy.wipeApplicationData() method does not affect autofill settings configured through Settings > Language and input > Autofill service , or any other keyboard settings.

You can disable autofill on the Samsung browser by using the public boolean setAutoFillSetting (boolean enable) API with the com.samsung.android.knox.permission.KNOX_BROWSER_SETTINGS permission.

For sample MVNO configurations, see the Knox Developer documentation.