Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 42964464 authored by Chaohui Wang's avatar Chaohui Wang
Browse files

Add Context.domainVerificationManager

Bug: 236346018
Test: Manual with App Info page
Test: Settings Unit tests
Change-Id: I3558f30fe567bfb049d75a543e6b3ce5a863c77b
parent 7c44032f
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -3,6 +3,8 @@ package com.android.settingslib.spaprivileged.framework.common
import android.app.admin.DevicePolicyManager
import android.app.usage.StorageStatsManager
import android.content.Context
import android.content.pm.verify.domain.DomainVerificationManager
import android.os.UserHandle
import android.os.UserManager

/** The [UserManager] instance. */
@@ -13,3 +15,10 @@ val Context.devicePolicyManager get() = getSystemService(DevicePolicyManager::cl

/** The [StorageStatsManager] instance. */
val Context.storageStatsManager get() = getSystemService(StorageStatsManager::class.java)!!

/** The [DomainVerificationManager] instance. */
val Context.domainVerificationManager
    get() = getSystemService(DomainVerificationManager::class.java)!!

/** Gets a new [Context] for the given [UserHandle]. */
fun Context.asUser(userHandle: UserHandle): Context = createContextAsUser(userHandle, 0)