Disable managed profile version of shortcut picker.
Don't show managed profile version of shortcut picker as it lunaches same activities as personal one. Test: manual - check badged shortcut isn't present in launcher. Bug: 38333213 Change-Id: Iade6595255524a8dbf223a70a6c8312087258c23
This commit is contained in:
@@ -35,7 +35,7 @@ import static android.content.pm.PackageManager.GET_RESOLVED_FILTER;
|
|||||||
import static android.content.pm.PackageManager.MATCH_DISABLED_COMPONENTS;
|
import static android.content.pm.PackageManager.MATCH_DISABLED_COMPONENTS;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Listens to {@link Intent.ACTION_BOOT_COMPLETED} and {@link Intent.ACTION_PRE_BOOT_COMPLETED}
|
* Listens to {@link Intent.ACTION_PRE_BOOT_COMPLETED} and {@link Intent.ACTION_USER_INITIALIZED}
|
||||||
* performs setup steps for a managed profile (disables the launcher icon of the Settings app,
|
* performs setup steps for a managed profile (disables the launcher icon of the Settings app,
|
||||||
* adds cross-profile intent filters for the appropriate Settings activities), and disables the
|
* adds cross-profile intent filters for the appropriate Settings activities), and disables the
|
||||||
* webview setting for non-admin users.
|
* webview setting for non-admin users.
|
||||||
@@ -89,11 +89,13 @@ public class SettingsInitialize extends BroadcastReceiver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Disable launcher icon
|
// Disable launcher icon
|
||||||
// Note: This needs to happen after forwarding intents, otherwise the main Settings
|
|
||||||
// intent gets lost
|
|
||||||
ComponentName settingsComponentName = new ComponentName(context, Settings.class);
|
ComponentName settingsComponentName = new ComponentName(context, Settings.class);
|
||||||
pm.setComponentEnabledSetting(settingsComponentName,
|
pm.setComponentEnabledSetting(settingsComponentName,
|
||||||
PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);
|
PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);
|
||||||
|
// Disable shortcut picker.
|
||||||
|
ComponentName shortcutComponentName = new ComponentName(context, CreateShortcut.class);
|
||||||
|
pm.setComponentEnabledSetting(shortcutComponentName,
|
||||||
|
PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Disable WebView Setting if the current user is not an admin
|
// Disable WebView Setting if the current user is not an admin
|
||||||
|
Reference in New Issue
Block a user