• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#  Copyright (C) 2024 The Android Open Source Project
2#
3#  Licensed under the Apache License, Version 2.0 (the "License");
4#  you may not use this file except in compliance with the License.
5#  You may obtain a copy of the License at
6#
7#       http://www.apache.org/licenses/LICENSE-2.0
8#
9#  Unless required by applicable law or agreed to in writing, software
10#  distributed under the License is distributed on an "AS IS" BASIS,
11#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12#  See the License for the specific language governing permissions and
13#  limitations under the License.
14
15from mobly.controllers import android_device
16
17
18def set_screen_on_and_unlock(ad: android_device.AndroidDevice):
19    """Sets the screen to stay on and unlocks the device.
20
21    Args:
22        ad: AndroidDevice instance.
23    """
24    ad.adb.shell("svc power stayon true")
25    ad.adb.shell("input keyevent KEYCODE_WAKEUP")
26    ad.adb.shell("wm dismiss-keyguard")
27
28
29def enable_wifi_verbose_logging(ad: android_device.AndroidDevice):
30    """Sets the Wi-Fi verbose logging developer option to Enable."""
31    ad.adb.shell('cmd wifi set-verbose-logging enabled')
32