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

Commit b3f596aa authored by Helen Qin's avatar Helen Qin
Browse files

Setup logging utils for the updatable UI configs.

Test: make
Bug: 327514622
Change-Id: Ia2f0b83507ed13d06f51289d7910927d4c161942
parent 459ed769
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -568,7 +568,10 @@ public class MetricUtilities {
                    /* clicked_entries */ browsedClickedEntries,
                    /* clicked_entries */ browsedClickedEntries,
                    /* provider_of_clicked_entry */ browsedProviderUid,
                    /* provider_of_clicked_entry */ browsedProviderUid,
                    /* api_status */ apiStatus,
                    /* api_status */ apiStatus,
                    /* primary_indicated */ finalPhaseMetric.isPrimary()
                    /* primary_indicated */ finalPhaseMetric.isPrimary(),
                    /* oem_credential_manager_ui_uid */ finalPhaseMetric.getOemUiUid(),
                    /* fallback_credential_manager_ui_uid */ finalPhaseMetric.getFallbackUiUid(),
                    /* oem_ui_usage_status */ finalPhaseMetric.getOemUiUsageStatus()
            );
            );
        } catch (Exception e) {
        } catch (Exception e) {
            Slog.w(TAG, "Unexpected error during final no uid metric logging: " + e);
            Slog.w(TAG, "Unexpected error during final no uid metric logging: " + e);
+28 −0
Original line number Original line Diff line number Diff line
@@ -67,6 +67,10 @@ public class ChosenProviderFinalPhaseMetric {


    // Other General Information, such as final api status, provider status, entry info, etc...
    // Other General Information, such as final api status, provider status, entry info, etc...


    private int mOemUiUid = -1;
    private int mFallbackUiUid = -1;
    private OemUiUsageStatus mOemUiUsageStatus = OemUiUsageStatus.UNKNOWN;

    private int mChosenProviderStatus = -1;
    private int mChosenProviderStatus = -1;
    // Indicates if an exception was thrown by this provider, false by default
    // Indicates if an exception was thrown by this provider, false by default
    private boolean mHasException = false;
    private boolean mHasException = false;
@@ -302,4 +306,28 @@ public class ChosenProviderFinalPhaseMetric {
    public boolean isPrimary() {
    public boolean isPrimary() {
        return mIsPrimary;
        return mIsPrimary;
    }
    }

    public void setOemUiUid(int oemUiUid) {
        mOemUiUid = oemUiUid;
    }

    public int getOemUiUid() {
        return mOemUiUid;
    }

    public void setFallbackUiUid(int fallbackUiUid) {
        mFallbackUiUid = fallbackUiUid;
    }

    public int getFallbackUiUid() {
        return mFallbackUiUid;
    }

    public void setOemUiUsageStatus(OemUiUsageStatus oemUiUsageStatus) {
        mOemUiUsageStatus = oemUiUsageStatus;
    }

    public int getOemUiUsageStatus() {
        return mOemUiUsageStatus.getLoggingInt();
    }
}
}
+42 −0
Original line number Original line Diff line number Diff line
/*
 * Copyright (C) 2024 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.server.credentials.metrics;

import static com.android.internal.util.FrameworkStatsLog.CREDENTIAL_MANAGER_FINAL_NO_UID_REPORTED__OEM_UI_USAGE_STATUS__OEM_UI_USAGE_STATUS_UNKNOWN;
import static com.android.internal.util.FrameworkStatsLog.CREDENTIAL_MANAGER_FINAL_NO_UID_REPORTED__OEM_UI_USAGE_STATUS__OEM_UI_USAGE_STATUS_SUCCESS;
import static com.android.internal.util.FrameworkStatsLog.CREDENTIAL_MANAGER_FINAL_NO_UID_REPORTED__OEM_UI_USAGE_STATUS__OEM_UI_USAGE_STATUS_NOT_SPECIFIED;
import static com.android.internal.util.FrameworkStatsLog.CREDENTIAL_MANAGER_FINAL_NO_UID_REPORTED__OEM_UI_USAGE_STATUS__OEM_UI_USAGE_STATUS_SPECIFIED_BUT_NOT_FOUND;
import static com.android.internal.util.FrameworkStatsLog.CREDENTIAL_MANAGER_FINAL_NO_UID_REPORTED__OEM_UI_USAGE_STATUS__OEM_UI_USAGE_STATUS_SPECIFIED_BUT_NOT_ENABLED;


public enum OemUiUsageStatus {
    UNKNOWN(CREDENTIAL_MANAGER_FINAL_NO_UID_REPORTED__OEM_UI_USAGE_STATUS__OEM_UI_USAGE_STATUS_UNKNOWN),
    SUCCESS(CREDENTIAL_MANAGER_FINAL_NO_UID_REPORTED__OEM_UI_USAGE_STATUS__OEM_UI_USAGE_STATUS_SUCCESS),
    FAILURE_NOT_SPECIFIED(CREDENTIAL_MANAGER_FINAL_NO_UID_REPORTED__OEM_UI_USAGE_STATUS__OEM_UI_USAGE_STATUS_NOT_SPECIFIED),
    FAILURE_SPECIFIED_BUT_NOT_FOUND(CREDENTIAL_MANAGER_FINAL_NO_UID_REPORTED__OEM_UI_USAGE_STATUS__OEM_UI_USAGE_STATUS_SPECIFIED_BUT_NOT_FOUND),
    FAILURE_SPECIFIED_BUT_NOT_ENABLED(CREDENTIAL_MANAGER_FINAL_NO_UID_REPORTED__OEM_UI_USAGE_STATUS__OEM_UI_USAGE_STATUS_SPECIFIED_BUT_NOT_ENABLED);

    private final int mLoggingInt;

    OemUiUsageStatus(int loggingInt) {
        mLoggingInt = loggingInt;
    }

    public int getLoggingInt() {
        return mLoggingInt;
    }
}