mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-18 20:08:53 +01:00
fixed ~~all~~ most of the ~~things~~ errors - it compiles now
This commit is contained in:
@@ -16,4 +16,7 @@
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with QKSMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
<manifest />
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
</manifest>
|
||||
|
||||
@@ -31,7 +31,18 @@ class SubscriptionManagerCompat @Inject constructor(context: Context, private va
|
||||
|
||||
val activeSubscriptionInfoList: List<SubscriptionInfoCompat>
|
||||
get() {
|
||||
return subscriptionManager?.activeSubscriptionInfoList?.map { SubscriptionInfoCompat(it) } ?: listOf()
|
||||
return if (permissions.hasPhone()) {
|
||||
try {
|
||||
subscriptionManager?.activeSubscriptionInfoList?.map {
|
||||
SubscriptionInfoCompat(it)
|
||||
} ?: listOf()
|
||||
} catch (e: SecurityException) {
|
||||
// Handle exception if permission is not granted
|
||||
listOf()
|
||||
}
|
||||
} else {
|
||||
listOf()
|
||||
}
|
||||
}
|
||||
|
||||
init {
|
||||
|
||||
Reference in New Issue
Block a user