Loading src/com/android/permissioncontroller/permission/data/ForegroundPermNamesLiveData.kt +1 −1 Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ object ForegroundPermNamesLiveData : SmartUpdateMediatorLiveData<Map<String, Lis // Since the value will be static, initialize the value upon creating the LiveData. init { updateIfActive() onUpdate() } override fun onUpdate() { Loading src/com/android/permissioncontroller/permission/data/SmartAsyncMediatorLiveData.kt +1 −1 Original line number Diff line number Diff line Loading @@ -46,7 +46,7 @@ abstract class SmartAsyncMediatorLiveData<T> : SmartUpdateMediatorLiveData<T>() return } GlobalScope.launch(Dispatchers.Default) { GlobalScope.launch(Dispatchers.IO) { currentJob = coroutineContext[Job] loadDataAndPostValue(currentJob!!) } Loading src/com/android/permissioncontroller/permission/data/SmartUpdateMediatorLiveData.kt +0 −1 Original line number Diff line number Diff line Loading @@ -109,7 +109,6 @@ abstract class SmartUpdateMediatorLiveData<T> : MediatorLiveData<T>(), if (DEBUG_UPDATES) { Log.i(LOG_TAG, "updateIfActive ${javaClass.simpleName} ${shortStackTrace()}") } ensureMainThread() onUpdate() } Loading src/com/android/permissioncontroller/permission/data/UserPackageInfosLiveData.kt +2 −3 Original line number Diff line number Diff line Loading @@ -58,9 +58,8 @@ class UserPackageInfosLiveData private constructor( if (job.isCancelled) { return } var packageInfos = app.applicationContext.packageManager .getInstalledPackagesAsUser(GET_PERMISSIONS or MATCH_ALL, user.identifier) val packageInfos = app.applicationContext.packageManager .getInstalledPackagesAsUser(GET_PERMISSIONS or MATCH_ALL, user.identifier) postValue(packageInfos.map { packageInfo -> LightPackageInfo(packageInfo) }) } Loading src/com/android/permissioncontroller/permission/model/livedatatypes/LightAppPermGroup.kt +27 −11 Original line number Diff line number Diff line Loading @@ -41,6 +41,17 @@ data class LightAppPermGroup( ) { constructor(pI: LightPackageInfo, pGI: LightPermGroupInfo, perms: Map<String, LightPermission>): this(pI, pGI, perms, false, null) /** * The package name of this group */ val packageName = packageInfo.packageName /** * The permission group name of this group */ val permGroupName = permGroupInfo.name /** * The current userHandle of this AppPermGroup. */ Loading Loading @@ -124,32 +135,37 @@ data class LightAppPermGroup( private val specialLocationGrant: Boolean? ) { /** * Whether any of this App Permission Group's foreground permissions are fixed by policy * Whether any of this App Permission SubGroup's permissions are granted */ val isPolicyFixed = permissions.any { it.value.isPolicyFixed } val isGranted = specialLocationGrant ?: permissions.any { it.value.isGrantedIncludingAppOp } /** * Whether this App Permission Group's permissions are fixed by the system * Whether any of this App Permission SubGroup's permissions are granted by default */ val isSystemFixed = permissions.any { it.value.isSystemFixed } val isGrantedByDefault = permissions.any { it.value.isGrantedByDefault } /** * Whether this App Permission Group's permissions are fixed by the user * Whether any of this App Permission Subgroup's foreground permissions are fixed by policy */ val isUserFixed = permissions.any { it.value.isUserFixed } val isPolicyFixed = permissions.any { it.value.isPolicyFixed } /** * Whether any of this App Permission SubGroup's permissions are granted * Whether any of this App Permission Subgroup's permissions are fixed by the system */ val isGranted = specialLocationGrant ?: permissions.any { it.value.isGrantedIncludingAppOp } val isSystemFixed = permissions.any { it.value.isSystemFixed } /** * Whether any of this App Permission SubGroup's permissions are granted by default * Whether any of this App Permission Subgroup's permissions are fixed by the user */ val isGrantedByDefault = permissions.any { it.value.isGrantedByDefault } val isUserFixed = permissions.any { it.value.isUserFixed } /** * Whether any of this App Permission Subgroup's permissions are set by the user */ val isUserSet = permissions.any { it.value.isUserSet } /** * Whether any of this App Permission SubGroup's permissions are granted by their role * Whether any of this App Permission Subgroup's permissions are set by the role of this app */ val isGrantedByRole = permissions.any { it.value.isGrantedByRole } } Loading Loading
src/com/android/permissioncontroller/permission/data/ForegroundPermNamesLiveData.kt +1 −1 Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ object ForegroundPermNamesLiveData : SmartUpdateMediatorLiveData<Map<String, Lis // Since the value will be static, initialize the value upon creating the LiveData. init { updateIfActive() onUpdate() } override fun onUpdate() { Loading
src/com/android/permissioncontroller/permission/data/SmartAsyncMediatorLiveData.kt +1 −1 Original line number Diff line number Diff line Loading @@ -46,7 +46,7 @@ abstract class SmartAsyncMediatorLiveData<T> : SmartUpdateMediatorLiveData<T>() return } GlobalScope.launch(Dispatchers.Default) { GlobalScope.launch(Dispatchers.IO) { currentJob = coroutineContext[Job] loadDataAndPostValue(currentJob!!) } Loading
src/com/android/permissioncontroller/permission/data/SmartUpdateMediatorLiveData.kt +0 −1 Original line number Diff line number Diff line Loading @@ -109,7 +109,6 @@ abstract class SmartUpdateMediatorLiveData<T> : MediatorLiveData<T>(), if (DEBUG_UPDATES) { Log.i(LOG_TAG, "updateIfActive ${javaClass.simpleName} ${shortStackTrace()}") } ensureMainThread() onUpdate() } Loading
src/com/android/permissioncontroller/permission/data/UserPackageInfosLiveData.kt +2 −3 Original line number Diff line number Diff line Loading @@ -58,9 +58,8 @@ class UserPackageInfosLiveData private constructor( if (job.isCancelled) { return } var packageInfos = app.applicationContext.packageManager .getInstalledPackagesAsUser(GET_PERMISSIONS or MATCH_ALL, user.identifier) val packageInfos = app.applicationContext.packageManager .getInstalledPackagesAsUser(GET_PERMISSIONS or MATCH_ALL, user.identifier) postValue(packageInfos.map { packageInfo -> LightPackageInfo(packageInfo) }) } Loading
src/com/android/permissioncontroller/permission/model/livedatatypes/LightAppPermGroup.kt +27 −11 Original line number Diff line number Diff line Loading @@ -41,6 +41,17 @@ data class LightAppPermGroup( ) { constructor(pI: LightPackageInfo, pGI: LightPermGroupInfo, perms: Map<String, LightPermission>): this(pI, pGI, perms, false, null) /** * The package name of this group */ val packageName = packageInfo.packageName /** * The permission group name of this group */ val permGroupName = permGroupInfo.name /** * The current userHandle of this AppPermGroup. */ Loading Loading @@ -124,32 +135,37 @@ data class LightAppPermGroup( private val specialLocationGrant: Boolean? ) { /** * Whether any of this App Permission Group's foreground permissions are fixed by policy * Whether any of this App Permission SubGroup's permissions are granted */ val isPolicyFixed = permissions.any { it.value.isPolicyFixed } val isGranted = specialLocationGrant ?: permissions.any { it.value.isGrantedIncludingAppOp } /** * Whether this App Permission Group's permissions are fixed by the system * Whether any of this App Permission SubGroup's permissions are granted by default */ val isSystemFixed = permissions.any { it.value.isSystemFixed } val isGrantedByDefault = permissions.any { it.value.isGrantedByDefault } /** * Whether this App Permission Group's permissions are fixed by the user * Whether any of this App Permission Subgroup's foreground permissions are fixed by policy */ val isUserFixed = permissions.any { it.value.isUserFixed } val isPolicyFixed = permissions.any { it.value.isPolicyFixed } /** * Whether any of this App Permission SubGroup's permissions are granted * Whether any of this App Permission Subgroup's permissions are fixed by the system */ val isGranted = specialLocationGrant ?: permissions.any { it.value.isGrantedIncludingAppOp } val isSystemFixed = permissions.any { it.value.isSystemFixed } /** * Whether any of this App Permission SubGroup's permissions are granted by default * Whether any of this App Permission Subgroup's permissions are fixed by the user */ val isGrantedByDefault = permissions.any { it.value.isGrantedByDefault } val isUserFixed = permissions.any { it.value.isUserFixed } /** * Whether any of this App Permission Subgroup's permissions are set by the user */ val isUserSet = permissions.any { it.value.isUserSet } /** * Whether any of this App Permission SubGroup's permissions are granted by their role * Whether any of this App Permission Subgroup's permissions are set by the role of this app */ val isGrantedByRole = permissions.any { it.value.isGrantedByRole } } Loading