Tell installd when boot completes.

installd can then clear the ".booting" marker from the dalvik-cache
(owned by root). This marker is used to detect boot loops.

bug: 18280671

(cherry picked from commit 76a748e62f354c799342044f724e1f4b80121837)

Change-Id: I2364c05837ac04d428b5a34ab1802964a11d2df4
Allow ringer mode change to leave priority notification mode

AudioManager.RINGER_MODE_SILENT was re-mapped from to
Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS, but this change:

Change: 806dbae9e12f3875cf0def3da2f3c3c2b768a844
Link: https://github.com/android/platform_frameworks_base/commit/806dbae9e12f3875cf0def3da2f3c3c2b768a844

This made it impossible to turn off zen mode by setting the
ringer mode to either AudioManager.RINGER_MODE_VIBRATE or
AudioManager.RINGER_MODE_NORMAL, as described in documentation:

https://developer.android.com/about/versions/android-5.0-changes.html

Issue: https://code.google.com/p/android-developer-preview/issues/detail?id=1780

This change restores that functionality.

PatchSet 2:
Simplify this to only check if zen mode is not already off

Signed-off-by: Bryan Emmanuel <piusvelte@gmail.com>
Fix memory leak where we close the descriptor instead of the file.

(cherry pick of 5cb769d99952ef9fb4f576abba70423fe157342b.)

bug: 17541634
Change-Id: I9968f9df249e4cba24383239ce6130dd16fcd532