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

Commit 5bb55449 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes I057989ea,Ic2b318e4,I266d4a03

* changes:
  Fix some deprecation warnings in WM Shell.
  Clean up SysUI Kotlin warnings
  Clean up some deprecation warnings in SettingsLib
parents 7d0df510 64dcb6e4
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -85,7 +85,7 @@ class BubbleOverflow(
        bitmapSize = positioner.bubbleBitmapSize
        iconBitmapSize = (bitmapSize * 0.46f).toInt()
        val bubbleSize = positioner.bubbleSize
        overflowBtn?.setLayoutParams(FrameLayout.LayoutParams(bubbleSize, bubbleSize))
        overflowBtn?.layoutParams = FrameLayout.LayoutParams(bubbleSize, bubbleSize)
        expandedView?.updateDimensions()
    }

@@ -95,7 +95,7 @@ class BubbleOverflow(
        // Set overflow button accent color, dot color
        val typedValue = TypedValue()
        context.theme.resolveAttribute(android.R.attr.colorAccent, typedValue, true)
        val colorAccent = res.getColor(typedValue.resourceId)
        val colorAccent = res.getColor(typedValue.resourceId, null)
        overflowBtn?.drawable?.setTint(colorAccent)
        dotColor = colorAccent

@@ -105,7 +105,7 @@ class BubbleOverflow(
        val nightMode = (res.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK
            == Configuration.UI_MODE_NIGHT_YES)
        val bg = ColorDrawable(res.getColor(
            if (nightMode) R.color.bubbles_dark else R.color.bubbles_light))
            if (nightMode) R.color.bubbles_dark else R.color.bubbles_light, null))

        val fg = InsetDrawable(overflowBtn?.drawable,
            bitmapSize - iconBitmapSize /* inset */)
@@ -115,7 +115,7 @@ class BubbleOverflow(
        // Update dot path
        dotPath = PathParser.createPathFromPathData(
            res.getString(com.android.internal.R.string.config_icon_mask))
        val scale = iconFactory.normalizer.getScale(getIconView()!!.getDrawable(),
        val scale = iconFactory.normalizer.getScale(iconView!!.drawable,
            null /* outBounds */, null /* path */, null /* outMaskShape */)
        val radius = BadgedImageView.DEFAULT_PATH_SIZE / 2f
        val matrix = Matrix()
@@ -176,10 +176,10 @@ class BubbleOverflow(
            overflowBtn = inflater.inflate(R.layout.bubble_overflow_button,
                    null /* root */, false /* attachToRoot */) as BadgedImageView
            overflowBtn?.initialize(positioner)
            overflowBtn?.setContentDescription(context.resources.getString(
                    R.string.bubble_overflow_button_content_description))
            overflowBtn?.contentDescription = context.resources.getString(
                    R.string.bubble_overflow_button_content_description)
            val bubbleSize = positioner.bubbleSize
            overflowBtn?.setLayoutParams(FrameLayout.LayoutParams(bubbleSize, bubbleSize))
            overflowBtn?.layoutParams = FrameLayout.LayoutParams(bubbleSize, bubbleSize)
            updateBtnTheme()
        }
        return overflowBtn
@@ -190,10 +190,10 @@ class BubbleOverflow(
    }

    override fun getTaskId(): Int {
        return if (expandedView != null) expandedView!!.getTaskId() else INVALID_TASK_ID
        return if (expandedView != null) expandedView!!.taskId else INVALID_TASK_ID
    }

    companion object {
        @JvmField val KEY = "Overflow"
        const val KEY = "Overflow"
    }
}
 No newline at end of file
+2 −1
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package com.android.wm.shell.bubbles

import android.graphics.PointF
import android.os.Handler
import android.os.Looper
import android.view.MotionEvent
import android.view.VelocityTracker
import android.view.View
@@ -90,7 +91,7 @@ abstract class RelativeTouchListener : View.OnTouchListener {
    private var touchSlop: Int = -1
    private var movedEnough = false

    private val handler = Handler()
    private val handler = Handler(Looper.myLooper()!!)
    private var performedLongClick = false

    @Suppress("UNCHECKED_CAST")
+2 −2
Original line number Diff line number Diff line
@@ -460,9 +460,9 @@ abstract class MagnetizedObject<T : Any>(

    /** Plays the given vibration effect if haptics are enabled. */
    @SuppressLint("MissingPermission")
    private fun vibrateIfEnabled(effect: Int) {
    private fun vibrateIfEnabled(effectId: Int) {
        if (hapticsEnabled && systemHapticsEnabled) {
            vibrator.vibrate(effect.toLong())
            vibrator.vibrate(VibrationEffect.createPredefined(effectId))
        }
    }

+2 −2
Original line number Diff line number Diff line
@@ -74,6 +74,7 @@ public class NekoControlsService : ControlsProviderService(), PrefState.PrefsLis
    private val controls = HashMap<String, Control>()
    private val publishers = ArrayList<UglyPublisher>()
    private val rng = Random()
    private val metricsLogger = MetricsLogger()

    private var lastToyIcon: Icon? = null

@@ -184,7 +185,6 @@ public class NekoControlsService : ControlsProviderService(), PrefState.PrefsLis
        return getPendingIntent()
    }


    override fun performControlAction(
        controlId: String,
        action: ControlAction,
@@ -196,7 +196,7 @@ public class NekoControlsService : ControlsProviderService(), PrefState.PrefsLis
                controls[CONTROL_ID_FOOD] = makeFoodBowlControl(true)
                Log.v(TAG, "Bowl refilled. (Registering job.)")
                NekoService.registerJob(this, FOOD_SPAWN_CAT_DELAY_MINS)
                MetricsLogger.histogram(this, "egg_neko_offered_food", 11)
                metricsLogger.histogram("egg_neko_offered_food", 11)
                prefs.foodState = 11
            }
            CONTROL_ID_TOY -> {
+1 −0
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ class ToolbarView : FrameLayout {
    ) : super(context, attrs, defStyle) {
    }

    @Suppress("DEPRECATION")
    override fun onApplyWindowInsets(insets: WindowInsets?): WindowInsets {
        var lp = layoutParams as FrameLayout.LayoutParams?
        if (lp != null && insets != null) {
Loading