Port back Persist Install Support from AOKP (1/3)