Check if the Activity is finishing before showDialog()

Check if the Activity is going through its finishing phase before
displaying the Dialog, because Showing dialog once the activity
is no longer in context will cause BadTokenException.

Change-Id: I58940e694f61cd79536abe2df60a0b745a7b806f
Fix NullPointerException at RunningState

getServiceInfo returns null if you have a service defined in the
manifest as: <service android:name=".Xxx" android:exported="false" />
or and in an <application> with no label or icon.
Dont crash the Settings application because of that.

Change-Id: I6f9f69c130e610b7e4ab66426177b7bade1e1515
Allow multiuser use of keystore

Since keystore has been refactored to let muliple users use it
simultaneously, we can remove all the restrictions put into place to
prevent it.

Bug: 7249554
Change-Id: I5aa069ca439cea68e87e141c497be8cd86b0ba9d
Merge "Allow multiuser use of keystore"
Merge "Check if the Activity is finishing before showDialog()"
Merge "Fix NullPointerException at RunningState"
Merge branch 'master' into HEAD