Upgrade compileSdk to v36#735
Conversation
| try { | ||
| val info: PackageInfo = Application.app.packageManager.getPackageInfo(Application.app.packageName, 0) | ||
| versionName = info.versionName | ||
| versionName = info.versionName.toString() |
There was a problem hiding this comment.
Are these other changes necessary for compilesdk 36?
There was a problem hiding this comment.
When just changing to target v36, throws the error:
Assignment type mismatch: actual type is 'kotlin.String?', but 'kotlin.String' was expected.
There was a problem hiding this comment.
Would you prefer to use the non-null assertion operator !! here ?
| } | ||
|
|
||
| override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences, key: String) { | ||
| override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences, key: String?) { |
There was a problem hiding this comment.
When only changing the SDK version, throws an error without String?:
Class 'Preferences' is not abstract and does not implement abstract member 'onSharedPreferenceChanged'
| override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences, key: String) { | ||
| override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences, key: String?) { | ||
| // A null key is passed when SharedPreferences are cleared, so we exit. | ||
| if (key == null) { |
There was a problem hiding this comment.
Added to handle the case when sharedPreferences is cleared and is null
| if (SatelliteUtils.isRotationVectorSensorSupported(context)) { | ||
| // Use the modern rotation vector sensors | ||
| val vectorSensor: Sensor = | ||
| val vectorSensor: Sensor? = |
There was a problem hiding this comment.
Throws the following error with v36:
Initializer type mismatch: expected 'android.hardware.Sensor', actual 'android.hardware.Sensor?'.
There was a problem hiding this comment.
This is also aligned with the way we get the legacy sensor on line 145
There was a problem hiding this comment.
Would you like to add a non-null test and log here, like:
if (vectorSensor != null) {
sensorManager.registerListener(
callback,
vectorSensor,
ROT_VECTOR_SENSOR_DELAY_MICROS
)
} else {
Log.e(TAG, "Device doesn't support sensor TYPE_ROTATION_VECTOR")
}
| ) | ||
| } else { | ||
| // No sensors to observe | ||
| } else { |
There was a problem hiding this comment.
Indentation fix, no functional change here
Please make sure these boxes are checked before submitting your pull request - thanks!
AndroidStyle.xmlstyle template to your code in Android Studio.This PR upgrades the version of the SDK used for compiling to the latest version, and includes minor fixes to build cleanly.