For example, the following code performs an alias change succesfully in APIs 21 to 28 without exiting app:
getPackageManager().setComponentEnabledSetting(