This project is to handle protected apps in huawei devices and to prevent your app being killed by the Samsung Smartmanager.
Inspired by:
Integrate the module into the modules
folder and define them into the tiapp.xml
file:
<modules>
<module platform="android" version="1.1.0">ti.optimizationpreferences</module>
</modules>
Show the warning and give the end-user the possiblility to add the app to protected apps
if (!OS_ANDROID) {
return;
}
var optimizationpreferences = require('ti.optimizationpreferences'),
brands = [optimizationpreferences.HUAWEI, optimizationpreferences.SAMSUNG];
// need warning checks the huawei/samsung activities exists
if (optimizationpreferences.needWarning(brands)) {
optimizationpreferences.check(brands);
}