rename InstalledAppProvider method after what it returns: last update
This commit is contained in:
parent
736341b34e
commit
7ca4ee6539
@ -32,7 +32,7 @@ public class InstalledAppProvider extends FDroidProvider {
|
||||
* @return The keys are the package names, and their corresponding values are
|
||||
* the {@link PackageInfo#lastUpdateTime last update time} in milliseconds.
|
||||
*/
|
||||
public static Map<String, Long> all(Context context) {
|
||||
public static Map<String, Long> lastUpdateTimes(Context context) {
|
||||
|
||||
Map<String, Long> cachedInfo = new HashMap<>();
|
||||
|
||||
|
@ -176,7 +176,7 @@ public class InstalledAppProviderService extends JobIntentService {
|
||||
*/
|
||||
public static void compareToPackageManager(Context context) {
|
||||
Utils.debugLog(TAG, "Comparing package manager to our installed app cache.");
|
||||
Map<String, Long> cachedInfo = InstalledAppProvider.Helper.all(context);
|
||||
Map<String, Long> cachedInfo = InstalledAppProvider.Helper.lastUpdateTimes(context);
|
||||
|
||||
List<PackageInfo> packageInfoList = context.getPackageManager()
|
||||
.getInstalledPackages(PackageManager.GET_SIGNATURES);
|
||||
|
@ -35,7 +35,7 @@ public class InstalledAppProviderTest extends FDroidProviderTest {
|
||||
|
||||
@Test
|
||||
public void insertSingleApp() {
|
||||
Map<String, Long> foundBefore = InstalledAppProvider.Helper.all(RuntimeEnvironment.application);
|
||||
Map<String, Long> foundBefore = InstalledAppProvider.Helper.lastUpdateTimes(RuntimeEnvironment.application);
|
||||
assertEquals(foundBefore.size(), 0);
|
||||
|
||||
ContentValues values = new ContentValues();
|
||||
@ -49,7 +49,7 @@ public class InstalledAppProviderTest extends FDroidProviderTest {
|
||||
values.put(Cols.SIGNATURE, "000111222333444555666777888999aaabbbcccdddeeefff");
|
||||
contentResolver.insert(InstalledAppProvider.getContentUri(), values);
|
||||
|
||||
Map<String, Long> foundAfter = InstalledAppProvider.Helper.all(RuntimeEnvironment.application);
|
||||
Map<String, Long> foundAfter = InstalledAppProvider.Helper.lastUpdateTimes(RuntimeEnvironment.application);
|
||||
assertEquals(1, foundAfter.size());
|
||||
assertEquals(100000000L, foundAfter.get("org.example.test-app").longValue());
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user