OSDN Git Service

Correctly handle a case when there are no preloaded apps
authorFyodor Kupolov <fkupolov@google.com>
Wed, 3 Aug 2016 20:50:37 +0000 (13:50 -0700)
committerFyodor Kupolov <fkupolov@google.com>
Wed, 3 Aug 2016 20:50:37 +0000 (13:50 -0700)
Bug: 30415696
Change-Id: Ia1cff342ff7000da3fba580083116441f478491e

services/retaildemo/java/com/android/server/retaildemo/PreloadAppsInstaller.java

index 7a3b461..daaa4f5 100644 (file)
@@ -67,10 +67,11 @@ class PreloadAppsInstaller {
 
     void installApps(int userId) {
         File[] files = preloadsAppsDirectory.listFiles();
+        AppInstallCounter counter = new AppInstallCounter(mContext, userId);
         if (ArrayUtils.isEmpty(files)) {
+            counter.setExpectedAppsCount(0);
             return;
         }
-        AppInstallCounter counter = new AppInstallCounter(mContext, userId);
         int expectedCount = 0;
         for (File file : files) {
             String apkName = file.getName();