Put the Android security check in its own function

Bug: 9469682
Change-Id: I60253008333edd7c8f2efe63f31059dc22adda63
3 files changed