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

Commit fca74cdc authored by Joy Babafemi's avatar Joy Babafemi Committed by Android (Google) Code Review
Browse files

Merge "Fix NPE when second resource target is not available" into main

parents eef273d1 66ffd5a2
Loading
Loading
Loading
Loading
+3 −10
Original line number Diff line number Diff line
@@ -16,20 +16,13 @@
  -->

<!-- Edit button -->
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/edit_button_layout"
    android:layout_width="52dp"
    android:layout_height="wrap_content"
    android:gravity="center"
    android:layout_gravity="end">

    <ImageView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/edit_button"
    android:layout_width="24dp"
    android:layout_height="24dp"
    android:gravity="center_vertical"
    android:background="?android:attr/selectableItemBackground"
    android:layout_gravity="center"
    android:src="@drawable/ic_edit_24dp"
    android:contentDescription="@string/edit" />
 No newline at end of file
</LinearLayout>
 No newline at end of file
+2 −5
Original line number Diff line number Diff line
@@ -30,12 +30,13 @@ import androidx.preference.PreferenceViewHolder;
import com.android.internal.annotations.VisibleForTesting;
import com.android.settings.R;
import com.android.settingslib.PrimarySwitchPreference;
import com.android.settingslib.RestrictedPreference;

/**
 * This preference is shown at the top of the "passwords & accounts" screen and allows the user to
 * pick their primary credential manager provider.
 */
public class PrimaryProviderPreference extends PrimarySwitchPreference {
public class PrimaryProviderPreference extends RestrictedPreference {

    public static boolean shouldUseNewSettingsUi() {
        return Flags.isCredmanSettingsExpressiveDesign();
@@ -44,7 +45,6 @@ public class PrimaryProviderPreference extends PrimarySwitchPreference {
    private @Nullable Button mChangeButton = null;
    private @Nullable Button mOpenButton = null;
    private @Nullable View mButtonFrameView = null;
    private @Nullable View mEditView = null;
    private @Nullable Delegate mDelegate = null;
    private boolean mButtonsCompactMode = false;
    private boolean mOpenButtonVisible = false;
@@ -103,10 +103,7 @@ public class PrimaryProviderPreference extends PrimarySwitchPreference {
                    }
                });

        // Set up the edit icon to handle opening the change provider scenario.
        mEditView = holder.findViewById(R.id.edit_button);
        View mWidgetFrame = holder.findViewById(android.R.id.widget_frame);
        mEditView.setVisibility(View.VISIBLE);
        mWidgetFrame.setOnClickListener(
                new View.OnClickListener() {
                    public void onClick(@NonNull View v) {