"Protected Apps" Setting on Huawei Phones, and How to Handle It

Protected Apps setting on Huawei phones, and how to handle it

if("huawei".equalsIgnoreCase(android.os.Build.MANUFACTURER) && !sp.getBoolean("protected",false)) {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(R.string.huawei_headline).setMessage(R.string.huawei_text)
.setPositiveButton(R.string.go_to_protected, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
Intent intent = new Intent();
intent.setComponent(new ComponentName("com.huawei.systemmanager", "com.huawei.systemmanager.optimize.process.ProtectActivity"));
startActivity(intent);
sp.edit().putBoolean("protected",true).commit();
}
}).create().show();
}

“Protected Apps” setting on Android phones

Because related interfaces are not exposed, currently you cannot get to know whether the app got protected or not.

Huawei: The app needs to be running in the background

To prevent malicious applications from running in the background and associated startup, your phone's memory and power consumption increase sharply. By default, the EMUI does not allow related apps to be kept alive or started in the background. However, you can manually keep the apps alive on the mobile phone so that the apps can be started or automatically started in the background. The apps take effect after restart.

If the application needs to be allowed in the background due to application scenarios, it is recommended that a message be displayed when the application is started for the first time after installation, instructing you to manually keep the application alive.

To do this, choose Phone Manager > App Startup Management > Disable Automatic Management > Allow Auto Startup or Allow Background Activities.

  1. The EMUI allows users to switch from the app to the app startup management page, but does not provide an interface for querying whether an app is kept alive in the background.

  2. It is recommended that you display a prompt rather than jump.

  3. When the app is started for the first time, a message is displayed, instructing you to manually keep the app alive in the background.


  1. If the user does not enable the background keepalive function, the application cannot run in the background for a long time. You are advised to use FAQs to notify users in the app.

Add application to protected apps in huawei (check autorun)

There isn't a setting in the manifest, and Huawei has enabled Whatsapp because it's a popular app.

This my help you too: "Protected Apps" setting on Huawei phones, and how to handle it

Regards

Max



Related Topics



Leave a reply



Submit