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

Commit e365fc8c authored by Jacky Wang's avatar Jacky Wang
Browse files

[Catalyst] Make Catalyst libraries compiled with public APIs

Bug: 422032603
Flag: EXEMPT refactor
Test: atest
Change-Id: Ic3a1cfb71bf2746e2bd8a887ac4dea1b961563a1
parent 76979804
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ import android.util.Log
import java.util.concurrent.ConcurrentHashMap

/** Base class of the Settings provider data stores. */
abstract class SettingsStore(protected val contentResolver: ContentResolver) :
sealed class SettingsStore(protected val contentResolver: ContentResolver) :
    AbstractKeyedDataObservable<String>(), KeyValueStore {

    private val defaultValues = ConcurrentHashMap<String, Any>()
+2 −0
Original line number Diff line number Diff line
@@ -17,6 +17,8 @@ android_library {
        "androidx.fragment_fragment",
        "androidx.preference_preference",
    ],
    sdk_version: "system_current",
    min_sdk_version: "21",
    kotlincflags: ["-Xjvm-default=all"],
}

+3 −0
Original line number Diff line number Diff line
@@ -13,6 +13,8 @@ android_library {
        "guava",
        "kotlinx-coroutines-android",
    ],
    sdk_version: "system_current",
    min_sdk_version: "21",
    kotlincflags: ["-Xjvm-default=all"],
}

@@ -26,4 +28,5 @@ android_library {
        "flag-junit",
        "kotlinx-coroutines-android",
    ],
    test_only: true,
}
+2 −2
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ import android.content.Context
import android.content.pm.PackageManager

/** [ApiPermissionChecker] that checks if calling app has given app-op permission. */
class AppOpApiPermissionChecker<T>(private val op: Int, private val permission: String) :
class AppOpApiPermissionChecker<T>(private val op: String, private val permission: String) :
    ApiPermissionChecker<T> {

    @Suppress("DEPRECATION")
@@ -35,7 +35,7 @@ class AppOpApiPermissionChecker<T>(private val op: Int, private val permission:
        val appOpsManager =
            application.getSystemService(Context.APP_OPS_SERVICE) as? AppOpsManager ?: return false
        val pkg = application.packageManager.getNameForUid(callingUid) ?: return false
        return when (appOpsManager.noteOp(op, callingUid, pkg)) {
        return when (appOpsManager.noteOp(op, callingUid, pkg, null, null)) {
            AppOpsManager.MODE_ALLOWED -> true
            AppOpsManager.MODE_DEFAULT ->
                application.checkPermission(permission, callingPid, callingUid) ==
+1 −0
Original line number Diff line number Diff line
@@ -30,4 +30,5 @@ android_library {
        "mockito-kotlin2",
        "truth",
    ],
    test_only: true,
}
Loading