Better handling of detecting apps Change-Id: I15644c8d28f394aeac021af856d0d755d7a986c6 Fixes: 29609311