mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-16 15:36:12 -04:00
Added APIs to control device sleep
These APIs can be used to prevent device into sleep when sending supper big files. PiperOrigin-RevId: 556809236
This commit is contained in:
committed by
Copybara-Service
parent
06942caeb3
commit
fabeff0d57
@@ -38,7 +38,7 @@ class DeviceInfo : public api::DeviceInfo {
|
||||
return api::DeviceInfo::DeviceType::kLaptop;
|
||||
}
|
||||
|
||||
api::DeviceInfo::OsType GetOsType() const override{
|
||||
api::DeviceInfo::OsType GetOsType() const override {
|
||||
return api::DeviceInfo::OsType::kChromeOs;
|
||||
}
|
||||
|
||||
@@ -92,6 +92,10 @@ class DeviceInfo : public api::DeviceInfo {
|
||||
screen_locked_listeners_.erase(listener_name);
|
||||
}
|
||||
|
||||
bool PreventSleep() override { return true; }
|
||||
|
||||
bool AllowSleep() override { return true; }
|
||||
|
||||
private:
|
||||
absl::flat_hash_map<std::string,
|
||||
std::function<void(api::DeviceInfo::ScreenStatus)>>
|
||||
|
||||
Reference in New Issue
Block a user