/* * Copyright (C) 2022 E FOUNDATION * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package foundation.e.advancedprivacy.features.internetprivacy import foundation.e.advancedprivacy.domain.entities.ApplicationDescription import foundation.e.advancedprivacy.domain.entities.FeatureState data class InternetPrivacyState( val mode: FeatureState = FeatureState.OFF, val availableApps: List = emptyList(), val bypassTorApps: Collection = emptyList(), val selectedLocation: String = "", val availableLocationIds: List = emptyList(), val forceRedraw: Boolean = false, ) { fun getApps(): List> { return availableApps.map { it to (it.packageName !in bypassTorApps) } } val selectedLocationPosition get() = availableLocationIds.indexOf(selectedLocation) }