Removed duplicate code that had broken 'run-as'

Change-Id: Id3e5ecccdebb4a7c881c6af3e1f465e0168cc940
(cherry picked from commit d851160c373a97a2e89a48132b0a7e7890391639)