Merge changes from topic "install_constraints"

* changes:
  Implement AppStateHelper#hasActiveNetwork
  Improve the logic of checking device idle