title: PackageManager's DONT_KILL_APP flag is not working on Android Lollipop 5.0
body: <p>Application has two activities: one is a Dialog, other is a fullscreen activity which implements several classes. Dialog activity has MAIN/LAUNCHER category.</p>
  
  <p>Pressing Dialog button is starting fullscreen activity and then disable Dialog activity component to hide the Icon.</p>
  
  <p>Disabling is done by the usual code:</p>
  
  <pre><code>private static final ComponentName COMPONENT_NAME = 
          new ComponentName("com.xxxx.xxxxx", "com.xxxx.xxxxx.DialogActivity");
  ....
  ....
  try {
      PackageManager localPackageManager = getPackageManager();
      localPackageManager.setComponentEnabledSetting(COMPONENT_NAME, 
              PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);
  } catch (Exception e) {}
  </code></pre>
  
  <p>It worked fine till I've updated to Lollipop.
  Now my fullscreen activity beeing killed even if user interacts with it.
  LogCat shows that <code>PACKAGE_CHANGED</code> intent is fired and then boom, app is closed.</p>
  
  <p>I've tested it on two Nexuses (KitKat and Lollipop) and OnePlus (Cyanogen 11 and 12.0). Result is always the same - Lollipop kills the app.</p>
  
  <p>Is there any other way to disable component? Is there a way to cheat memory optimization (I guess it's the troublemaker), so application won't be killed?</p>