rename InstalledAppProvider method after what it returns: last update

This commit is contained in:
Hans-Christoph Steiner 2019-05-27 15:28:41 +02:00
parent 736341b34e
commit 7ca4ee6539
3 changed files with 4 additions and 4 deletions

View File

@ -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<>();

View File

@ -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);

View File

@ -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());