Skip to content

Commit a210bf1

Browse files
committed
3.138
1 parent 2fcaea0 commit a210bf1

8 files changed

Lines changed: 36 additions & 4 deletions

File tree

CHANGELOG.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
3.138
2+
* 修复 gRPC 依赖的问题
3+
* 获取系统最后一个 toast
4+
5+
16
3.135
27
* 修复远程桌面加载中的问题
38
* 彻底修复协议中的竞争条件问题

README.en.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1458,6 +1458,12 @@ d.dump_window_hierarchy().getvalue()
14581458
d.wait_for_idle(5*1000)
14591459
```
14601460

1461+
> get last toast
1462+
1463+
```python
1464+
d.get_last_toast()
1465+
```
1466+
14611467
## Advanced UI Operations
14621468

14631469
> Selector

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1467,6 +1467,12 @@ d.dump_window_hierarchy().getvalue()
14671467
d.wait_for_idle(5*1000)
14681468
```
14691469

1470+
> 获取最近的 toast
1471+
1472+
```python
1473+
d.get_last_toast()
1474+
```
1475+
14701476
## 进阶UI操作
14711477

14721478
> Selector

lamda/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
#
33
# Distributed under MIT license.
44
# See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
5-
__version__ = "3.135"
5+
__version__ = "3.138"

lamda/client.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,12 @@ def get_watcher_enabled(self, name):
693693
获取此 watcher 是否启用
694694
"""
695695
return self.watchers.get(name, {}).get("enable")
696+
def get_last_toast(self):
697+
"""
698+
获取系统中最后一个 toast 消息
699+
"""
700+
r = self.stub.getLastToast(protos.Empty())
701+
return r
696702
def remove_watcher(self, name):
697703
"""
698704
移除一个 watcher
@@ -1758,6 +1764,8 @@ def dump_window_hierarchy(self):
17581764
return self.stub("UiAutomator").dump_window_hierarchy()
17591765
def wait_for_idle(self, timeout):
17601766
return self.stub("UiAutomator").wait_for_idle(timeout)
1767+
def get_last_toast(self):
1768+
return self.stub("UiAutomator").get_last_toast()
17611769
# watcher
17621770
def remove_all_watchers(self):
17631771
return self.stub("UiAutomator").remove_all_watchers()

lamda/rpc/services.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ service UiAutomator {
148148
rpc selectorLongClick(SelectorClickRequest) returns (Boolean) {}
149149

150150
rpc selectorExists(SelectorOnlyRequest) returns (Boolean) {}
151+
rpc getLastToast(google.protobuf.Empty) returns (ToastInfo) {}
151152

152153
rpc selectorObjInfo(SelectorOnlyRequest) returns (ObjInfo) {}
153154
rpc selectorObjInfoOfAllInstances(SelectorOnlyRequest) returns (ObjInfoList) {}

lamda/rpc/uiautomator.proto

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,12 @@ message ObjInfo {
369369
Bound visibleBounds = 17;
370370
}
371371

372+
message ToastInfo {
373+
uint64 timestamp = 1;
374+
string package = 2;
375+
string message = 3;
376+
}
377+
372378
message ObjInfoList {
373379
repeated ObjInfo objects = 1;
374380
}

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
],
2121
},
2222
install_requires= [
23-
"grpcio-tools>=1.35.0,<=1.50.0",
24-
"grpc-interceptor>=0.13.0,<0.14.2",
25-
"grpcio>=1.35.0,<=1.50.0",
23+
"grpcio-tools>=1.35.0,<1.49.0",
24+
"grpc-interceptor>=0.13.0,<0.15.0",
25+
"grpcio>=1.35.0,<1.49.0",
2626
"asn1crypto>=1.0.0,<2",
2727
],
2828
classifiers = [

0 commit comments

Comments
 (0)