1/* 2 * Copyright (C) 2017 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17syntax = "proto2"; 18package android.os; 19 20option java_multiple_files = true; 21 22import "frameworks/base/core/proto/android/os/worksource.proto"; 23import "frameworks/base/libs/incident/proto/android/privacy.proto"; 24 25message PowerManagerProto { 26 /* User activity events in PowerManager.java. */ 27 enum UserActivityEvent { 28 // Unspecified event type. 29 USER_ACTIVITY_EVENT_OTHER = 0; 30 // Button or key pressed or released. 31 USER_ACTIVITY_EVENT_BUTTON = 1; 32 // Touch down, move or up. 33 USER_ACTIVITY_EVENT_TOUCH = 2; 34 // Accessibility taking action on behalf of user. 35 USER_ACTIVITY_EVENT_ACCESSIBILITY = 3; 36 } 37 38 // WakeLock class in android.os.PowerManager, it is the one used by sdk 39 message WakeLock { 40 option (.android.msg_privacy).dest = DEST_AUTOMATIC; 41 42 optional string tag = 1; 43 optional string package_name = 2; 44 optional bool held = 3; 45 optional int32 internal_count = 4; 46 optional WorkSourceProto work_source = 5; 47 } 48} 49 50message PowerManagerInternalProto { 51 // Enum values gotten from PowerManagerInternal.java 52 enum Wakefulness { 53 // The device is asleep. It can only be awoken by a call to wakeUp(). 54 // The screen should be off or in the process of being turned off by the 55 // display controller. The device typically passes through the dozing 56 // state first. 57 WAKEFULNESS_ASLEEP = 0; 58 // The device is fully awake. It can be put to sleep by a call to 59 // goToSleep(). When the user activity timeout expires, the device may 60 // start dreaming or go to sleep. 61 WAKEFULNESS_AWAKE = 1; 62 // The device is dreaming. It can be awoken by a call to wakeUp(), which 63 // ends the dream. The device goes to sleep when goToSleep() is called, 64 // when the dream ends, or when unplugged. User activity may brighten 65 // the screen but does not end the dream. 66 WAKEFULNESS_DREAMING = 2; 67 // The device is dozing. It is almost asleep but is allowing a special 68 // low-power "doze" dream to run which keeps the display on but lets the 69 // application processor suspend. It can be awoken by a call to wakeUp() 70 // which ends the dream. The device fully goes to sleep if the dream 71 // cannot be started or ends on its own. 72 WAKEFULNESS_DOZING = 3; 73 } 74} 75