/*
 * Copyright (C) 2025 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.
 */

syntax = "proto2";
package android.telephony.cellbroadcast;

option java_outer_classname = "CellbroadcastProtoEnums";
option java_multiple_files = true;


enum TranslationErrorType {
    // Translation success or no error
    TRANSLATION_ERROR_UNKNOWN = 0;
    TRANSLATION_ERROR_NONE = 1;

    // Errors occurring within CellBroadcastTranslateManager ---
    // Network error, timeout, or other general exceptions
    TRANSLATION_ERROR_NETWORK_EXCEPTION = 2;
    // Received HTTP error response from API server (e.g., 4xx, 5xx)
    TRANSLATION_ERROR_HTTP_ERROR = 3;
    // Failed to parse API server response JSON
    TRANSLATION_ERROR_PARSING_FAILED = 4;
    // Failed to retrieve app signing info: Package not found
    TRANSLATION_ERROR_PACKAGE_NOT_FOUND = 5;
    // Failed to retrieve app signing info: SigningInfo is null
    TRANSLATION_ERROR_SIGNING_INFO_NULL = 6;
    // Failed to generate SHA-1 hash: Encryption algorithm not found
    TRANSLATION_ERROR_NO_SUCH_ALGORITHM = 7;

    // Possible situations during translation processing within CellBroadcastAlertDialog ---
    // Previous translation task was canceled by a new translation request
    TRANSLATION_ERROR_CANCELLED = 8;
    // Translation result arrived, but not used because the message to be displayed has changed
    TRANSLATION_ERROR_STALE_RESULT = 9;
    // Translation result arrived, but the activity is finishing or has already been destroyed
    TRANSLATION_ERROR_ACTIVITY_DESTROYED = 10;
}
