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

Commit 7d6d3f63 authored by Colin Cross's avatar Colin Cross Committed by Xin Li
Browse files

Fix kotlin nullable errors in frameworks/base

Fix kotlin nullable errors that were exposed by setting the retention
of android.annotation.NonNull and android.annotation.Nullable to
class retention.

Bug: 294110802
Test: builds
Merged-In: I0736e8abf503c80b92e3762bed908400ffedb335
Change-Id: I0736e8abf503c80b92e3762bed908400ffedb335
parent 5565b8a6
Loading
Loading
Loading
Loading
+6 −8
Original line number Diff line number Diff line
@@ -137,15 +137,13 @@ class Quare(val width: Int, val height: Int, val depth: Int) : Parcelable {
        return 0
    }

    override fun writeToParcel(p: Parcel?, flags: Int) {
        p?.let {
    override fun writeToParcel(p: Parcel, flags: Int) {
        p.writeInt(width)
        p.writeInt(height)
        p.writeInt(depth)
        p.writeIntArray(data)
        p.writeIntArray(user)
    }
    }

    companion object CREATOR : Parcelable.Creator<Quare> {
        override fun createFromParcel(p: Parcel?): Quare {
+3 −3
Original line number Diff line number Diff line
@@ -60,8 +60,8 @@ class QuaresActivity : Activity() {

        setContentView(R.layout.activity_quares)

        grid = findViewById(R.id.grid)
        label = findViewById(R.id.label)
        grid = requireViewById(R.id.grid)
        label = requireViewById(R.id.label)

        if (savedInstanceState != null) {
            Log.v(TAG, "restoring puzzle from state")
@@ -135,7 +135,7 @@ class QuaresActivity : Activity() {
        if (q.check()) {
            val dp = resources.displayMetrics.density

            val label: Button = findViewById(R.id.label)
            val label: Button = requireViewById(R.id.label)
            label.text = resName.replace(Regex("^.*/"), "")
            val drawable = icon?.loadDrawable(this)?.also {
                it.setBounds(0, 0, (32 * dp).toInt(), (32 * dp).toInt())
+1 −1
Original line number Diff line number Diff line
@@ -325,7 +325,7 @@ open class ThemedBatteryDrawable(private val context: Context, frameColor: Int)
        return batteryLevel
    }

    override fun onBoundsChange(bounds: Rect?) {
    override fun onBoundsChange(bounds: Rect) {
        super.onBoundsChange(bounds)
        updateSize()
    }
+1 −1
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ class PeerDeviceSystemAttestationVerificationTest {
    @Before
    fun setup() {
        rule.getScenario().onActivity {
            avm = it.getSystemService(AttestationVerificationManager::class.java)
            avm = it.getSystemService(AttestationVerificationManager::class.java)!!
            activity = it
        }
        invalidAttestationByteArray = TEST_ATTESTATION_CERT_FILENAME.fromPEMFileToByteArray()
+1 −1
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ class SystemAttestationVerificationTest {
    @Before
    fun setup() {
        rule.getScenario().onActivity {
            avm = it.getSystemService(AttestationVerificationManager::class.java)
            avm = it.getSystemService(AttestationVerificationManager::class.java)!!
            activity = it
            androidKeystore = KeyStore.getInstance(ANDROID_KEYSTORE).apply { load(null) }
        }
Loading