Support Samsung phone when getting device wakefulness status (#98146)
This commit is contained in:
@@ -40,6 +40,12 @@ void main() {
|
||||
expect(await device.isAsleep(), isFalse);
|
||||
});
|
||||
|
||||
test('reads Awake - samsung devices', () async {
|
||||
FakeDevice.pretendAwakeSamsung();
|
||||
expect(await device.isAwake(), isTrue);
|
||||
expect(await device.isAsleep(), isFalse);
|
||||
});
|
||||
|
||||
test('reads Asleep', () async {
|
||||
FakeDevice.pretendAsleep();
|
||||
expect(await device.isAwake(), isFalse);
|
||||
@@ -190,6 +196,12 @@ class FakeDevice extends AndroidDevice {
|
||||
''';
|
||||
}
|
||||
|
||||
static void pretendAwakeSamsung() {
|
||||
output = '''
|
||||
getWakefulnessLocked()=Awake
|
||||
''';
|
||||
}
|
||||
|
||||
static void pretendAsleep() {
|
||||
output = '''
|
||||
mWakefulness=Asleep
|
||||
|
||||
Reference in New Issue
Block a user