Merge \"Enable the demo launcher package as well.\" into nyc-mr1-dev
am: b5b2c196a8
Change-Id: Ie5c2c249a046edbd9c6f2347056f121b96b12284
This commit is contained in:
@@ -38,6 +38,7 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.content.IntentSender;
|
||||
import android.content.pm.IPackageManager;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.PackageManager.NameNotFoundException;
|
||||
import android.content.pm.UserInfo;
|
||||
@@ -2919,10 +2920,15 @@ public class UserManagerService extends IUserManager.Stub {
|
||||
com.android.internal.R.string.config_demoModeLauncherComponent);
|
||||
if (!TextUtils.isEmpty(demoLauncher)) {
|
||||
ComponentName componentToEnable = ComponentName.unflattenFromString(demoLauncher);
|
||||
String demoLauncherPkg = componentToEnable.getPackageName();
|
||||
try {
|
||||
AppGlobals.getPackageManager().setComponentEnabledSetting(componentToEnable,
|
||||
final IPackageManager iPm = AppGlobals.getPackageManager();
|
||||
iPm.setComponentEnabledSetting(componentToEnable,
|
||||
PackageManager.COMPONENT_ENABLED_STATE_ENABLED, /* flags= */ 0,
|
||||
/* userId= */ userId);
|
||||
iPm.setApplicationEnabledSetting(demoLauncherPkg,
|
||||
PackageManager.COMPONENT_ENABLED_STATE_ENABLED, /* flags= */ 0,
|
||||
/* userId= */ userId, null);
|
||||
} catch (RemoteException re) {
|
||||
// Internal, shouldn't happen
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user