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

Commit 195d9143 authored by Qingxi Li's avatar Qingxi Li Committed by Android (Google) Code Review
Browse files

Merge "Add disable carrier button for eSIM"

parents 8e3b1a63 3d768742
Loading
Loading
Loading
Loading
+32 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
**
** Copyright 2017, 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.
*/
-->

<!-- This contains disable esim buttonas shared by sim_pin/sim_puk screens -->
<com.android.keyguard.KeyguardEsimArea
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/keyguard_disable_esim"
    android:visibility="gone"
    android:text="@string/disable_carrier_button_text"
    style="?android:attr/buttonBarButtonStyle"
    android:textAppearance="?android:attr/textAppearanceMedium"
    android:textSize="@dimen/kg_status_line_font_size"
    android:textColor="?android:attr/textColorSecondary"
    android:textAllCaps="@bool/kg_use_all_caps" />
+6 −0
Original line number Diff line number Diff line
@@ -42,9 +42,15 @@
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:orientation="vertical"
            android:gravity="center"
            android:layout_weight="1"
            android:layoutDirection="ltr"
            >
        <include layout="@layout/keyguard_esim_area"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_marginTop="@dimen/eca_overlap" />

        <RelativeLayout
                android:id="@+id/row0"
                android:layout_width="match_parent"
+6 −0
Original line number Diff line number Diff line
@@ -43,9 +43,15 @@
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:orientation="vertical"
            android:gravity="center"
            android:layout_weight="1"
            android:layoutDirection="ltr"
            >
        <include layout="@layout/keyguard_esim_area"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_marginTop="@dimen/eca_overlap" />

        <RelativeLayout
                android:id="@+id/row0"
                android:layout_width="match_parent"
+6 −2
Original line number Diff line number Diff line
@@ -116,6 +116,8 @@
    <!-- KeyguardPinView - accessibility support --><skip />
    <!-- Description of the Delete button in a KeyboardView. [CHAR LIMIT=NONE] -->
    <string name="keyboardview_keycode_delete">Delete</string>
    <!-- Description of the button used to disable current carrier when the device supported embedded SIM. [CHAR LIMIT=30] -->
    <string name="disable_carrier_button_text">Disable eSIM</string>
    <!-- Description of the Enter button in a KeyboardView. [CHAR LIMIT=NONE] -->
    <string name="keyboardview_keycode_enter">Enter</string>

@@ -132,9 +134,11 @@
    <!-- Instructions for using the pattern unlock screen -->
    <string name="kg_pattern_instructions">Draw your pattern</string>
    <!-- Instructions for using the SIM PIN unlock screen -->
    <string name="kg_sim_pin_instructions">Enter SIM PIN</string>
    <string name="kg_sim_pin_instructions">Enter SIM PIN.</string>
    <!-- Instructions for using the SIM PIN unlock screen when there's more than one SIM -->
    <string name="kg_sim_pin_instructions_multi">Enter SIM PIN for \"<xliff:g id="carrier" example="CARD 1">%1$s</xliff:g>\"</string>
    <string name="kg_sim_pin_instructions_multi">Enter SIM PIN for \"<xliff:g id="carrier" example="CARD 1">%1$s</xliff:g>\".</string>
    <!-- Instructions for disabling eSIM carrier to unlock the phone with embedded SIM -->
    <string name="kg_sim_lock_instructions_esim">Disable eSIM to use device without mobile service.</string>
    <!-- Instructions for using the PIN unlock screen -->
    <string name="kg_pin_instructions">Enter PIN</string>
    <!-- Instructions for using the password unlock screen -->
+61 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2017 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.keyguard;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.Button;
import android.telephony.euicc.EuiccManager;

import java.lang.ref.WeakReference;

/***
 * This button is used by the device with embedded SIM card to disable current carrier to unlock
 * the device with no cellular service.
 */
class KeyguardEsimArea extends Button implements View.OnClickListener {
    private EuiccManager mEuiccManager;

    public KeyguardEsimArea(Context context) {
        this(context, null);
    }

    public KeyguardEsimArea(Context context, AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public KeyguardEsimArea(Context context, AttributeSet attrs, int defStyleAttr) {
        this(context, attrs, defStyleAttr, android.R.style.Widget_Material_Button_Borderless);
    }

    public KeyguardEsimArea(Context context, AttributeSet attrs, int defStyleAttr,
            int defStyleRes) {
        super(context, attrs, defStyleAttr, defStyleRes);
        mEuiccManager = (EuiccManager) mContext.getSystemService(Context.EUICC_SERVICE);
        if (mEuiccManager.isEnabled()) {
            setVisibility(View.VISIBLE);
        }
        setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        // STOPSHIP(b/37353596): use EuiccManager API to disable current carrier.
    }

}
Loading