Check dexopt needed for secondary dex while downgrading
Test: make otapreopt
Test: manual
* Remove the check in the code that allows downgrade only when
the space is low on the device.
* adb root
* Set pm.dexopt_unopt_after_inactive_days to 600
* Make sure the current time of the device is correctly set
* Install 2 non system apps - B, C
* Downgrade B to extract
* Upgrade a system apps to speed-profile - E
* Downgrade a system app to quicken - G
* adb shell cmd package bg-dexopt-job
Expected Results:
* Extract - B
* Verify - C
* There should not be any entries for apps E an G
in dalvik_cache
For secondary dex:
* compile googlequicksearchbox to everything.
* run background dexopt service for secondary dex.
* verify the compiler filter for the corresponding odex files.
(cherry picked from commit 45c8743428e0c9445430995ba395b3b5ebf82b3e)
Bug: 36598475
Merged-In: I6ad40e2c53433326f83c2589646d94ba555400b2
Change-Id: I6ad40e2c53433326f83c2589646d94ba555400b2
diff --git a/cmds/installd/dexopt.h b/cmds/installd/dexopt.h
index d171ee5..b09eea2 100644
--- a/cmds/installd/dexopt.h
+++ b/cmds/installd/dexopt.h
@@ -63,7 +63,8 @@
int dexopt(const char *apk_path, uid_t uid, const char *pkgName, const char *instruction_set,
int dexopt_needed, const char* oat_dir, int dexopt_flags, const char* compiler_filter,
- const char* volume_uuid, const char* shared_libraries, const char* se_info);
+ const char* volume_uuid, const char* shared_libraries, const char* se_info,
+ bool downgrade);
} // namespace installd
} // namespace android