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

Commit 4eaf95f1 authored by Beth Thibodeau's avatar Beth Thibodeau
Browse files

Remove unused logging methods and strings

Bug: 382680767
Flag: EXEMPT refactor - unused code
Test: build
Change-Id: I48104f1a5a3f78bbe7e05c7eb474a6dd6f55dcea
parent 6daa83b7
Loading
Loading
Loading
Loading
+0 −11
Original line number Diff line number Diff line
@@ -3228,17 +3228,6 @@
    <!-- Description for button in media controls. Used when media is connecting to a remote device (via something like chromecast). Pressing button does nothing [CHAR_LIMIT=NONE] -->
    <string name="controls_media_button_connecting">Connecting</string>

    <!-- Title for Smartspace recommendation card within media controls. The "Play" means the action to play a media [CHAR_LIMIT=10] -->
    <string name="controls_media_smartspace_rec_title">Play</string>
    <!-- Description for Smartspace recommendation card within media controls [CHAR_LIMIT=NONE] -->
    <string name="controls_media_smartspace_rec_description">Open <xliff:g id="app_label" example="Spotify">%1$s</xliff:g></string>
    <!-- Description for Smartspace recommendation's media item, including information for the media's title, the artist, and source app [CHAR LIMIT=NONE]-->
    <string name="controls_media_smartspace_rec_item_description">Play <xliff:g id="song_name" example="Daily mix">%1$s</xliff:g> by <xliff:g id="artist_name" example="Various artists">%2$s</xliff:g> from <xliff:g id="app_label" example="Spotify">%3$s</xliff:g></string>
    <!-- Description for Smartspace recommendation's media item which doesn't have artist info, including information for the media's title and the source app [CHAR LIMIT=NONE]-->
    <string name="controls_media_smartspace_rec_item_no_artist_description">Play <xliff:g id="song_name" example="Daily mix">%1$s</xliff:g> from <xliff:g id="app_label" example="Spotify">%2$s</xliff:g></string>
    <!-- Header title for Smartspace recommendation card within media controls. [CHAR_LIMIT=30] -->
    <string name="controls_media_smartspace_rec_header">For You</string>

    <!--- ****** Media tap-to-transfer ****** -->
    <!-- Text for a button to undo the media transfer. [CHAR LIMIT=20] -->
    <string name="media_transfer_undo">Undo</string>
+6 −17
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@ constructor(@MediaTimeoutListenerLog private val buffer: LogBuffer) {
                str2 = newKey
                bool1 = hadListener
            },
            { "migrate from $str1 to $str2, had listener? $bool1" }
            { "migrate from $str1 to $str2, had listener? $bool1" },
        )

    fun logUpdateListener(key: String, wasPlaying: Boolean) =
@@ -53,7 +53,7 @@ constructor(@MediaTimeoutListenerLog private val buffer: LogBuffer) {
                str1 = key
                bool1 = wasPlaying
            },
            { "updating $str1, was playing? $bool1" }
            { "updating $str1, was playing? $bool1" },
        )

    fun logDelayedUpdate(key: String) =
@@ -61,7 +61,7 @@ constructor(@MediaTimeoutListenerLog private val buffer: LogBuffer) {
            TAG,
            LogLevel.DEBUG,
            { str1 = key },
            { "deliver delayed playback state for $str1" }
            { "deliver delayed playback state for $str1" },
        )

    fun logSessionDestroyed(key: String) =
@@ -75,7 +75,7 @@ constructor(@MediaTimeoutListenerLog private val buffer: LogBuffer) {
                str1 = key
                str2 = state?.toString()
            },
            { "state update: key=$str1 state=$str2" }
            { "state update: key=$str1 state=$str2" },
        )

    fun logStateCallback(key: String) =
@@ -90,7 +90,7 @@ constructor(@MediaTimeoutListenerLog private val buffer: LogBuffer) {
                bool1 = playing
                bool2 = resumption
            },
            { "schedule timeout $str1, playing=$bool1 resumption=$bool2" }
            { "schedule timeout $str1, playing=$bool1 resumption=$bool2" },
        )

    fun logCancelIgnored(key: String) =
@@ -107,17 +107,6 @@ constructor(@MediaTimeoutListenerLog private val buffer: LogBuffer) {
                str1 = key
                str2 = reason
            },
            { "timeout cancelled for $str1, reason: $str2" }
        )

    fun logRecommendationTimeoutScheduled(key: String, timeout: Long) =
        buffer.log(
            TAG,
            LogLevel.VERBOSE,
            {
                str1 = key
                long1 = timeout
            },
            { "recommendation timeout scheduled for $str1 in $long1 ms" }
            { "timeout cancelled for $str1, reason: $str2" },
        )
}
+0 −44
Original line number Diff line number Diff line
@@ -52,32 +52,6 @@ class MediaLogger @Inject constructor(@MediaLog private val buffer: LogBuffer) {
        )
    }

    fun logRecommendationLoaded(key: String, isActive: Boolean, reason: String) {
        buffer.log(
            TAG,
            LogLevel.DEBUG,
            {
                str1 = key
                bool1 = isActive
                str2 = reason
            },
            { "add recommendation $str1, active $bool1, reason: $str2" },
        )
    }

    fun logRecommendationRemoved(key: String, immediately: Boolean, reason: String) {
        buffer.log(
            TAG,
            LogLevel.DEBUG,
            {
                str1 = key
                bool1 = immediately
                str2 = reason
            },
            { "removing recommendation $str1, immediate=$bool1, reason: $str2" },
        )
    }

    fun logMediaCardAdded(instanceId: InstanceId) {
        buffer.log(
            TAG,
@@ -96,24 +70,6 @@ class MediaLogger @Inject constructor(@MediaLog private val buffer: LogBuffer) {
        )
    }

    fun logMediaRecommendationCardAdded(key: String) {
        buffer.log(
            TAG,
            LogLevel.DEBUG,
            { str1 = key },
            { "adding recommendation card $str1 to carousel" },
        )
    }

    fun logMediaRecommendationCardRemoved(key: String) {
        buffer.log(
            TAG,
            LogLevel.DEBUG,
            { str1 = key },
            { "removing recommendation card $str1 from carousel" },
        )
    }

    fun logDuplicateMediaNotification(key: String) {
        buffer.log(
            TAG,
+0 −2
Original line number Diff line number Diff line
@@ -795,8 +795,6 @@ public class MediaControlPanel {
                });
    }

    // We may want to look into unifying this with bindRecommendationContentDescription if/when we
    // do a refactor of this class.
    private void bindPlayerContentDescription(MediaData data) {
        if (mMediaViewHolder == null) {
            return;
+0 −3
Original line number Diff line number Diff line
@@ -34,9 +34,6 @@ import com.android.systemui.res.R
/**
 * A view holder for the guts menu of a media player. The guts are shown when the user long-presses
 * on the media player.
 *
 * Both [MediaViewHolder] and [RecommendationViewHolder] use the same guts menu layout, so this
 * class helps share logic between the two.
 */
class GutsViewHolder(itemView: View) {
    val gutsText: TextView = itemView.requireViewById(R.id.remove_text)
Loading