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

Commit 5e073697 authored by Oli Thompson's avatar Oli Thompson Committed by Android (Google) Code Review
Browse files

Merge "Update User/trusted credentials for expressive" into main

parents ae3067d1 4d7d3acd
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
<!-- 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.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="24dp"
    android:height="24dp"
    android:viewportWidth="960"
    android:viewportHeight="960"
    android:tint="?attr/colorControlNormal">
    <path
        android:fillColor="@android:color/white"
        android:pathData="M160,880Q127,880 103.5,856.5Q80,833 80,800L80,360Q80,327 103.5,303.5Q127,280 160,280L360,280L360,160Q360,127 383.5,103.5Q407,80 440,80L520,80Q553,80 576.5,103.5Q600,127 600,160L600,280L800,280Q833,280 856.5,303.5Q880,327 880,360L880,800Q880,833 856.5,856.5Q833,880 800,880L160,880ZM160,800L800,800Q800,800 800,800Q800,800 800,800L800,360Q800,360 800,360Q800,360 800,360L600,360L600,360Q600,393 576.5,416.5Q553,440 520,440L440,440Q407,440 383.5,416.5Q360,393 360,360L360,360L160,360Q160,360 160,360Q160,360 160,360L160,800Q160,800 160,800Q160,800 160,800ZM240,720L480,720L480,702Q480,685 470.5,670.5Q461,656 444,648Q424,639 403.5,634.5Q383,630 360,630Q337,630 316.5,634.5Q296,639 276,648Q259,656 249.5,670.5Q240,685 240,702L240,720ZM560,660L720,660L720,600L560,600L560,660ZM360,600Q385,600 402.5,582.5Q420,565 420,540Q420,515 402.5,497.5Q385,480 360,480Q335,480 317.5,497.5Q300,515 300,540Q300,565 317.5,582.5Q335,600 360,600ZM560,540L720,540L720,480L560,480L560,540ZM440,360L520,360L520,160L440,160L440,360ZM480,580Q480,580 480,580Q480,580 480,580L480,580Q480,580 480,580Q480,580 480,580L480,580L480,580Q480,580 480,580Q480,580 480,580L480,580Q480,580 480,580Q480,580 480,580L480,580L480,580Q480,580 480,580Q480,580 480,580L480,580Q480,580 480,580Q480,580 480,580Z"/>
</vector>
 No newline at end of file
+11 −1
Original line number Diff line number Diff line
@@ -48,6 +48,17 @@
            android:textAlignment="viewStart"/>
    </LinearLayout>

    <!-- Switch is gone since either expressive or non expressive switch will show -->
    <com.google.android.material.materialswitch.MaterialSwitch
        android:id="@+id/trusted_credential_status_expressive"
        style="@style/SettingslibSwitchStyle.Expressive"
        android:theme="@style/Theme.Material3.DynamicColors.DayNight"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:visibility="gone"
        android:padding="8dp"
        android:layout_weight="0" />

    <!-- Switch is invisible and not gone so that the height is consistent between tabs -->
    <Switch
        android:id="@+id/trusted_credential_status"
@@ -56,5 +67,4 @@
        android:visibility="invisible"
        android:padding="8dp"
        android:layout_weight="0" />

</LinearLayout>
+1 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@
    android:gravity="center_vertical"
    android:background="?android:attr/selectableItemBackground"
    android:paddingTop="15dip"
    android:paddingStart="20dip"
    android:paddingBottom="15dip">

    <ImageView
+22 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- 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.
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">

    <com.android.settingslib.widget.ZeroStatePreference
        android:key="zero_state"
        app:isPreferenceVisible="false" />
</PreferenceScreen>
 No newline at end of file
+17 −1
Original line number Diff line number Diff line
@@ -60,6 +60,7 @@ import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.ProgressBar;
import android.widget.Switch;
import android.widget.TextView;

import androidx.annotation.NonNull;
@@ -69,6 +70,9 @@ import com.android.internal.app.UnlaunchableAppActivity;
import com.android.internal.widget.LockPatternUtils;
import com.android.settings.TrustedCredentialsSettings.Tab;
import com.android.settingslib.core.lifecycle.ObservableFragment;
import com.android.settingslib.widget.SettingsThemeHelper;

import com.google.android.material.materialswitch.MaterialSwitch;

import java.security.cert.CertificateEncodingException;
import java.security.cert.X509Certificate;
@@ -467,7 +471,19 @@ public class TrustedCredentialsFragment extends ObservableFragment
                        convertView.findViewById(R.id.trusted_credential_subject_primary);
                holder.mSubjectSecondaryView =
                        convertView.findViewById(R.id.trusted_credential_subject_secondary);
                holder.mSwitch = convertView.findViewById(R.id.trusted_credential_status);

                MaterialSwitch expressiveSwitch = convertView.requireViewById(
                        R.id.trusted_credential_status_expressive);
                Switch nonExpressiveSwitch = convertView.requireViewById(
                        R.id.trusted_credential_status);
                if (SettingsThemeHelper.isExpressiveTheme(requireContext())) {
                    holder.mSwitch = expressiveSwitch;
                    nonExpressiveSwitch.setVisibility(View.GONE);
                    expressiveSwitch.setVisibility(View.INVISIBLE);
                } else {
                    holder.mSwitch = nonExpressiveSwitch;
                    expressiveSwitch.setVisibility(View.GONE);
                }
                holder.mSwitch.setOnClickListener(view -> {
                    removeOrInstallCert((CertHolder) view.getTag());
                });
Loading