summaryrefslogtreecommitdiff
path: root/core/proto
diff options
context:
space:
mode:
authorKevin Han <kevhan@google.com>2021-01-28 14:13:10 -0800
committerKevin Han <kevhan@google.com>2021-02-03 18:17:25 -0800
commitdba83c49dd7566061d905412e4e6f71103c457af (patch)
tree187514005aed37b8d30ffaabdbb46ff5cbf4529b /core/proto
parent6669dec038ffe7a4a328687d73562bfe7600cf0d (diff)
Add persistence for app hibernation states
Persist hibernation states to disk. This CL persists the user-level and global hibernation states to disk. Bug: 175829330 Test: atest AppHibernationServiceTest Test: atest HibernationStateDiskStoreTest Change-Id: If58d648d720bed1693b9346c4d0e85074daec931
Diffstat (limited to 'core/proto')
-rw-r--r--core/proto/OWNERS1
-rw-r--r--core/proto/android/server/apphibernationservice.proto42
2 files changed, 43 insertions, 0 deletions
diff --git a/core/proto/OWNERS b/core/proto/OWNERS
index 748b4b4f5743..99fd21592411 100644
--- a/core/proto/OWNERS
+++ b/core/proto/OWNERS
@@ -16,6 +16,7 @@ ogunwale@google.com
jjaggi@google.com
roosa@google.com
per-file usagestatsservice.proto, usagestatsservice_v2.proto = mwachens@google.com
+per-file apphibernationservice.proto = file:/core/java/android/apphibernation/OWNERS
# Biometrics
kchyn@google.com
diff --git a/core/proto/android/server/apphibernationservice.proto b/core/proto/android/server/apphibernationservice.proto
new file mode 100644
index 000000000000..d341c4b2f0a8
--- /dev/null
+++ b/core/proto/android/server/apphibernationservice.proto
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+syntax = "proto2";
+package com.android.server.apphibernation;
+
+option java_multiple_files = true;
+
+// Proto for hibernation states for all packages for a user.
+message UserLevelHibernationStatesProto {
+ repeated UserLevelHibernationStateProto hibernation_state = 1;
+}
+
+// Proto for com.android.server.apphibernation.UserLevelState.
+message UserLevelHibernationStateProto {
+ optional string package_name = 1;
+ optional bool hibernated = 2;
+}
+
+// Proto for global hibernation states for all packages.
+message GlobalLevelHibernationStatesProto {
+ repeated GlobalLevelHibernationStateProto hibernation_state = 1;
+}
+
+// Proto for com.android.server.apphibernation.GlobalLevelState
+message GlobalLevelHibernationStateProto {
+ optional string package_name = 1;
+ optional bool hibernated = 2;
+} \ No newline at end of file