Avoid null plugins, so we never have to special case it

Fixes: 159842083
Test: Built
Change-Id: Ic2c8fbb8cfc93c81c692d7ec22fe77bcc1fe9964
This commit is contained in:
Philip P. Moltmann
2020-07-08 17:43:41 -07:00
parent c1aba95d34
commit e1b8d8fcd1

View File

@@ -46,7 +46,7 @@ public class RecommendationServiceImpl extends RecommendationService
private static final String LOG_TAG = "PrintServiceRecService";
/** All registered plugins */
private ArrayList<RemotePrintServicePlugin> mPlugins;
private final ArrayList<RemotePrintServicePlugin> mPlugins = new ArrayList<>();
/** Lock to keep multi-cast enabled */
private WifiManager.MulticastLock mMultiCastLock;
@@ -62,8 +62,6 @@ public class RecommendationServiceImpl extends RecommendationService
mMultiCastLock.acquire();
}
mPlugins = new ArrayList<>();
try {
for (VendorConfig config : VendorConfig.getAllConfigs(this)) {
try {
@@ -138,6 +136,7 @@ public class RecommendationServiceImpl extends RecommendationService
Log.e(LOG_TAG, "Could not stop plugin", e);
}
}
mPlugins.clear();
if (mMultiCastLock != null) {
mMultiCastLock.release();