Only throw SecurityException for OverlayManager callers targeting R

To maintain existing API behavior, if a legacy permission failure or
actor enforcement failure occurs for an app not targeting R,
coerce it into an IllegalStateException, which existed in the source
prior to R.

For apps targeting R, throw exceptions as they are.

Bug: 147340954

Test: atest com.android.server.om

Change-Id: Ib27ddf1db89782458c315cae2cc98a78efd9fe86
6 files changed