Update List of apps on device string,

remove "XX apps" string.

Bug: 32692748
Test: m RunSettingsRoboTests
Change-Id: I64f833497b5362f95cfc56a1057d97d9539ff029
This commit is contained in:
Denis Kuznetsov
2017-03-22 15:41:38 +01:00
parent 6edba87daa
commit 0c88ff4ed9
14 changed files with 51 additions and 235 deletions

View File

@@ -14,8 +14,6 @@
package com.android.settings.enterprise;
import android.content.Context;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.support.v7.preference.Preference;
import com.android.settings.R;
@@ -42,8 +40,7 @@ public class EnterpriseInstalledPackagesPreferenceController
@Override
public void updateState(Preference preference) {
mFeatureProvider.calculateNumberOfInstalledApps(
PackageManager.INSTALL_REASON_POLICY, true /* async */,
mFeatureProvider.calculateNumberOfPolicyInstalledApps(true /* async */,
(num) -> {
if (num == 0) {
preference.setVisible(false);
@@ -69,8 +66,8 @@ public class EnterpriseInstalledPackagesPreferenceController
// changes to the pref's visibility made in updateState() would not be seen by the indexer.
// We block and return synchronously whether there are enterprise-installed apps or not.
final Boolean[] haveEnterpriseInstalledPackages = { null };
mFeatureProvider.calculateNumberOfInstalledApps(PackageManager.INSTALL_REASON_POLICY,
false /* async */, (num) -> haveEnterpriseInstalledPackages[0] = num > 0);
mFeatureProvider.calculateNumberOfPolicyInstalledApps(false /* async */,
(num) -> haveEnterpriseInstalledPackages[0] = num > 0);
return haveEnterpriseInstalledPackages[0];
}