修复 任务管理崩溃的Bug
修复 id有关选择器报错的Bug 修复 engines.myEngine()报错的Bug
This commit is contained in:
@@ -105,7 +105,7 @@ open class UiObject(info: Any?, private val allocator: AccessibilityNodeInfoAllo
|
||||
return drawingOrder
|
||||
}
|
||||
|
||||
open fun id(): String {
|
||||
open fun id(): String? {
|
||||
return viewIdResourceName
|
||||
}
|
||||
|
||||
@@ -145,21 +145,21 @@ open class UiObject(info: Any?, private val allocator: AccessibilityNodeInfoAllo
|
||||
}
|
||||
|
||||
override fun performAction(action: Int, bundle: Bundle): Boolean {
|
||||
try {
|
||||
return super.performAction(action, bundle)
|
||||
return try {
|
||||
super.performAction(action, bundle)
|
||||
} catch (e: IllegalStateException) {
|
||||
// FIXME: 2017/5/5
|
||||
return false
|
||||
false
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun performAction(action: Int): Boolean {
|
||||
try {
|
||||
return super.performAction(action)
|
||||
return try {
|
||||
super.performAction(action)
|
||||
} catch (e: IllegalStateException) {
|
||||
// FIXME: 2017/5/5
|
||||
return false
|
||||
false
|
||||
}
|
||||
|
||||
|
||||
@@ -374,7 +374,8 @@ open class UiObject(info: Any?, private val allocator: AccessibilityNodeInfoAllo
|
||||
}
|
||||
|
||||
override fun findAccessibilityNodeInfosByViewId(viewId: String): List<AccessibilityNodeInfoCompat> {
|
||||
return allocator?.findAccessibilityNodeInfosByViewId(this, viewId) ?: super.findAccessibilityNodeInfosByViewId(viewId)
|
||||
return allocator?.findAccessibilityNodeInfosByViewId(this, viewId)
|
||||
?: super.findAccessibilityNodeInfosByViewId(viewId)
|
||||
}
|
||||
|
||||
fun findByViewId(viewId: String): List<UiObject> {
|
||||
|
||||
@@ -34,7 +34,7 @@ class AccessibilityInfoProvider(private val context: Context) : AccessibilityDel
|
||||
var latestActivity = ""
|
||||
private set
|
||||
|
||||
var useUsageStats: Boolean = true
|
||||
var useUsageStats: Boolean = false
|
||||
|
||||
override val eventTypes: Set<Int>?
|
||||
get() = AccessibilityDelegate.ALL_EVENT_TYPES
|
||||
@@ -59,7 +59,7 @@ class AccessibilityInfoProvider(private val context: Context) : AccessibilityDel
|
||||
val current = System.currentTimeMillis()
|
||||
val usageStats = usageStatsManager.queryUsageStats(UsageStatsManager.INTERVAL_BEST, current - 60 * 60 * 1000, current)
|
||||
return if (usageStats.isEmpty()) {
|
||||
""
|
||||
mLatestPackage
|
||||
} else {
|
||||
usageStats.sortBy {
|
||||
it.lastTimeStamp
|
||||
|
||||
Reference in New Issue
Block a user