mirror of
https://github.com/home-assistant/android
synced 2024-10-01 13:53:53 +00:00
Quick fix minor warnings from Android Studio (#4406)
- 'getter for isSpeakerphoneOn: Boolean' is deprecated. Deprecated in Java - Unnecessary safe call on a non-null receiver of type Intent - The corresponding parameter in the supertype 'BaseWidgetConfigureActivity' is named 'savedInstanceState'. This may cause problems when calling this function with named arguments.
This commit is contained in:
parent
f6cd119e8e
commit
62673fc7a3
|
@ -194,8 +194,8 @@ class ButtonWidgetConfigureActivity : BaseWidgetConfigureActivity() {
|
|||
return "${service.domain}.${service.service}"
|
||||
}
|
||||
|
||||
public override fun onCreate(icicle: Bundle?) {
|
||||
super.onCreate(icicle)
|
||||
public override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
// Set the result to CANCELED. This will cause the widget host to cancel
|
||||
// out of the widget placement if the user presses the back button.
|
||||
|
|
|
@ -54,8 +54,8 @@ class CameraWidgetConfigureActivity : BaseWidgetConfigureActivity() {
|
|||
|
||||
private var entityAdapter: SingleItemArrayAdapter<Entity<Any>>? = null
|
||||
|
||||
public override fun onCreate(icicle: Bundle?) {
|
||||
super.onCreate(icicle)
|
||||
public override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
// Set the result to CANCELED. This will cause the widget host to cancel
|
||||
// out of the widget placement if the user presses the back button.
|
||||
|
|
|
@ -425,7 +425,7 @@ class EntityWidgetConfigureActivity : BaseWidgetConfigureActivity() {
|
|||
|
||||
override fun onNewIntent(intent: Intent) {
|
||||
super.onNewIntent(intent)
|
||||
if (intent?.extras != null && intent.hasExtra(PIN_WIDGET_CALLBACK)) {
|
||||
if (intent.extras != null && intent.hasExtra(PIN_WIDGET_CALLBACK)) {
|
||||
appWidgetId = intent.extras!!.getInt(
|
||||
AppWidgetManager.EXTRA_APPWIDGET_ID,
|
||||
AppWidgetManager.INVALID_APPWIDGET_ID
|
||||
|
|
|
@ -58,8 +58,8 @@ class MediaPlayerControlsWidgetConfigureActivity : BaseWidgetConfigureActivity()
|
|||
|
||||
private var entityAdapter: SingleItemArrayAdapter<Entity<Any>>? = null
|
||||
|
||||
public override fun onCreate(icicle: Bundle?) {
|
||||
super.onCreate(icicle)
|
||||
public override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
// Set the result to CANCELED. This will cause the widget host to cancel
|
||||
// out of the widget placement if the user presses the back button.
|
||||
|
|
|
@ -54,8 +54,8 @@ class TemplateWidgetConfigureActivity : BaseWidgetConfigureActivity() {
|
|||
|
||||
private var requestLauncherSetup = false
|
||||
|
||||
public override fun onCreate(icicle: Bundle?) {
|
||||
super.onCreate(icicle)
|
||||
public override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
// Set the result to CANCELED. This will cause the widget host to cancel
|
||||
// out of the widget placement if the user presses the back button.
|
||||
|
|
|
@ -330,6 +330,8 @@ class AudioSensorManager : SensorManager {
|
|||
return
|
||||
}
|
||||
|
||||
// Use deprecated function as we can't perfectly map communication device to speakerphone
|
||||
@Suppress("DEPRECATION")
|
||||
val isSpeakerOn = audioManager.isSpeakerphoneOn
|
||||
|
||||
val icon = if (isSpeakerOn) "mdi:volume-high" else "mdi:volume-off"
|
||||
|
|
Loading…
Reference in a new issue