修复 ui线程下ui.xxx.on等函数不存在的问题

修复 非ui线程下ui.xxx.on等函数报错的问题
新增 注册ui.xxx支持增加成员
修复 多线程环境没有调用Context.exit()可能造成的内存泄漏
This commit is contained in:
hyb1996
2018-10-16 15:16:11 +08:00
parent d2e0899c8b
commit 4dcb19e4fe
25 changed files with 405 additions and 161 deletions

View File

@@ -446,7 +446,9 @@ public class UiGlobalSelector {
for (ListFilter filter : mFilters) {
str.append(filter.toString()).append(".");
}
str.deleteCharAt(str.length() - 1);
if(str.length() > 0){
str.deleteCharAt(str.length() - 1);
}
return str.toString();
}
}

View File

@@ -42,7 +42,7 @@ public class UiObjectCollection {
}
public UiObject[] toArray(){
return mNodes.toArray(new UiObject[mNodes.size()]);
return mNodes.toArray(new UiObject[0]);
}
public boolean performAction(int action) {

View File

@@ -60,7 +60,7 @@ public class AccessibilityInfoProvider implements AccessibilityDelegate {
return;
try {
ComponentName componentName = new ComponentName(latestPackageStr, latestClassStr);
mLatestActivity = mPackageManager.getActivityInfo(componentName, 0).name;
mLatestActivity = mPackageManager.getActivityInfo(componentName, PackageManager.MATCH_DEFAULT_ONLY).name;
} catch (PackageManager.NameNotFoundException ignored) {
return;
}