* If a pakcage dosen't have any UI or SVC application inside the package
DA is failed to create application reset. Need a defence code for it.
* This patch is for Platform Dynamic Analzyer that lists whole apps on the
target.
Change-Id: Ifdcfb2b0c7088ea67b65c91842cdbdeded8a81dc
// TODO: ensure main app is the first app in package
public AppInfo getMainApp() {
+
+ if(appInfos.size() == 0){
+ System.err.println("The empty package. ID: "+ id.toString());
+ return null;
+ }
+
return appInfos.get(0);
}
for (Map.Entry<String, PackageInfo> entry : pkgInfos.entrySet()) {
PackageInfo pkg = entry.getValue();
AppInfo mainapp = pkg.getMainApp();
- if (!ApplistManager.isInBlackList(mainapp)) {
+ if (mainapp != null && !ApplistManager.isInBlackList(mainapp)) {
String label = mainapp.getLabel();
if (label.isEmpty()) {
label = mainapp.getExecFileName();