1、这个App要有系统权限

android:sharedUserId="android.uid.system"

2、两种方法

方法一:禁用包名

PackageManager p = getPackageManager();
p.setApplicationEnabledSetting("com.android.camera2", PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);

方法二:禁用组件

PackageManager p = getPackageManager();
ComponentName comp = new ComponentName("com.ebt.app", "com.ebt.app.AppStart"); p.setComponentEnabledSetting(comp, PackageManager.COMPONENT_ENABLED_STATE_DISABLED_USER, PackageManager.DONT_KILL_APP);