summaryrefslogtreecommitdiff
path: root/PermissionController/src/com/android/permissioncontroller/permission/model
diff options
context:
space:
mode:
authorRichard MacGregor <rmacgregor@google.com>2022-12-06 11:00:43 -0800
committerRichard MacGregor <rmacgregor@google.com>2022-12-14 12:10:50 -0800
commiteb9878bf5cd830edead959556fcc66ce94d64d57 (patch)
treee85589f0fb7ad2d407c173b6789e48e4092d2b74 /PermissionController/src/com/android/permissioncontroller/permission/model
parente08832c5a30e7742b425efbc5c9514097c7ddb53 (diff)
downloadPermission-eb9878bf5cd830edead959556fcc66ce94d64d57.tar.gz
Add installsource live data and hook up store link
Bug: 260144598 Test: atest PermissionRationalePermissionGrantDialogTest Test: atest PermissionRationaleTest Change-Id: Ie5de608ece58507b49873386f38a8f385d70b643
Diffstat (limited to 'PermissionController/src/com/android/permissioncontroller/permission/model')
-rw-r--r--PermissionController/src/com/android/permissioncontroller/permission/model/livedatatypes/LightInstallSourceInfo.kt30
-rw-r--r--PermissionController/src/com/android/permissioncontroller/permission/model/livedatatypes/SafetyLabelInfo.kt34
2 files changed, 64 insertions, 0 deletions
diff --git a/PermissionController/src/com/android/permissioncontroller/permission/model/livedatatypes/LightInstallSourceInfo.kt b/PermissionController/src/com/android/permissioncontroller/permission/model/livedatatypes/LightInstallSourceInfo.kt
new file mode 100644
index 000000000..68fdf8739
--- /dev/null
+++ b/PermissionController/src/com/android/permissioncontroller/permission/model/livedatatypes/LightInstallSourceInfo.kt
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2022 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.
+ */
+
+package com.android.permissioncontroller.permission.model.livedatatypes
+
+/**
+ * A lighter version of the system's InstallSourceInfo class, containing select information about
+ * the install source.
+ *
+ * @param installingPackageName The package name of the install source (usually the app store)
+ */
+class LightInstallSourceInfo(val installingPackageName: String?) {
+
+ companion object {
+ val UNKNOWN_INSTALL_SOURCE = LightInstallSourceInfo(null)
+ }
+}
diff --git a/PermissionController/src/com/android/permissioncontroller/permission/model/livedatatypes/SafetyLabelInfo.kt b/PermissionController/src/com/android/permissioncontroller/permission/model/livedatatypes/SafetyLabelInfo.kt
new file mode 100644
index 000000000..2c26ad0d4
--- /dev/null
+++ b/PermissionController/src/com/android/permissioncontroller/permission/model/livedatatypes/SafetyLabelInfo.kt
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2022 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.
+ */
+
+package com.android.permissioncontroller.permission.model.livedatatypes
+
+import com.android.permission.safetylabel.SafetyLabel
+
+/**
+ * A wrapping class for [SafetyLabel] class that includes the install source package name
+ *
+ * @param safetyLabel The resulting [SafetyLabel], or null if none found
+ * @param installSourcePackageName The package name of the install source for the APK and safety
+ * label(usually the app store)
+ */
+class SafetyLabelInfo(val safetyLabel: SafetyLabel?, val installSourcePackageName: String?) {
+
+ companion object {
+ /** Default definition of unavailable or no safety label found */
+ val UNAVAILABLE = SafetyLabelInfo(null, null)
+ }
+}