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

Commit 430fa41d authored by Ibrahim Yilmaz's avatar Ibrahim Yilmaz Committed by Android (Google) Code Review
Browse files

Merge "Add Reason to addRemoteInput Logs" into main

parents 317f4d08 59852c07
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -71,7 +71,8 @@ public class RemoteInputController {
     * @param entry the entry for which a remote input is now active.
     * @param token a token identifying the view that is managing the remote input
     */
    public void addRemoteInput(NotificationEntry entry, Object token) {
    public void addRemoteInput(NotificationEntry entry, Object token,
            @CompileTimeConstant String reason) {
        Objects.requireNonNull(entry);
        Objects.requireNonNull(token);
        boolean isActive = isRemoteInputActive(entry);
@@ -79,7 +80,9 @@ public class RemoteInputController {
                entry /* contains */, null /* remove */, token /* removeToken */);
        mLogger.logAddRemoteInput(entry.getKey()/* entryKey */,
                isActive /* isRemoteInputAlreadyActive */,
                found /* isRemoteInputFound */);
                found /* isRemoteInputFound */,
                reason /* reason */,
                entry.getNotificationStyle()/* notificationStyle */);
        if (!found) {
            mOpen.add(new Pair<>(new WeakReference<>(entry), token));
        }
+9 −2
Original line number Diff line number Diff line
@@ -32,17 +32,24 @@ constructor(@NotificationRemoteInputLog private val logBuffer: LogBuffer) {
    fun logAddRemoteInput(
        entryKey: String,
        isRemoteInputAlreadyActive: Boolean,
        isRemoteInputFound: Boolean
        isRemoteInputFound: Boolean,
        reason: String,
        notificationStyle: String
    ) =
        logBuffer.log(
            TAG,
            DEBUG,
            {
                str1 = entryKey
                str2 = reason
                str3 = notificationStyle
                bool1 = isRemoteInputAlreadyActive
                bool2 = isRemoteInputFound
            },
            { "addRemoteInput entry: $str1, isAlreadyActive: $bool1, isFound:$bool2" }
            {
                "addRemoteInput reason:$str2 entry: $str1, style:$str3" +
                    ", isAlreadyActive: $bool1, isFound:$bool2"
            }
        )

    /** logs removeRemoteInput invocation of [RemoteInputController] */
+1 −1
Original line number Diff line number Diff line
@@ -657,7 +657,7 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene
        mEditText.setText(mEntry.remoteInputText);
        mEditText.setSelection(mEditText.length());
        mEditText.requestFocus();
        mController.addRemoteInput(mEntry, mToken);
        mController.addRemoteInput(mEntry, mToken, "RemoteInputView#focus");
        setAttachment(mEntry.remoteInputAttachment);

        updateSendButton();