Merge changes I928a6735,I10d2fab2

* changes:
  Move package change handling to handler.
  Write policy file on background thread