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

Commit 6e19c653 authored by Becca Hughes's avatar Becca Hughes Committed by Android (Google) Code Review
Browse files

Merge "Add try/catch to handle invalid settings activity" into main

parents 68bc311b 09fa333f
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import static androidx.lifecycle.Lifecycle.Event.ON_CREATE;

import android.app.Activity;
import android.app.Dialog;
import android.content.ActivityNotFoundException;
import android.content.ComponentName;
import android.content.ContentResolver;
import android.content.Context;
@@ -656,7 +657,11 @@ public class CredentialManagerPreferenceController extends BasePreferenceControl
                                CombinedProviderInfo.createSettingsActivityIntent(
                                        mContext, packageName, settingsActivity, getUser());
                        if (settingsIntent != null) {
                            try {
                                mContext.startActivity(settingsIntent);
                            } catch (ActivityNotFoundException e) {
                                Log.e(TAG, "Failed to open settings activity", e);
                            }
                        }
                    }
                });
+7 −1
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.settings.applications.credentials;

import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.credentials.CredentialManager;
@@ -26,6 +27,7 @@ import android.provider.Settings;
import android.service.autofill.AutofillService;
import android.service.autofill.AutofillServiceInfo;
import android.view.autofill.AutofillManager;
import android.util.Slog;

import androidx.annotation.Nullable;
import androidx.annotation.NonNull;
@@ -132,7 +134,11 @@ public class DefaultCombinedPreferenceController extends DefaultAppPreferenceCon
                    new PrimaryProviderPreference.Delegate() {
                        public void onOpenButtonClicked() {
                            if (settingsActivityIntent != null) {
                                try {
                                    startActivity(settingsActivityIntent);
                                } catch (ActivityNotFoundException e) {
                                    Slog.e(TAG, "Failed to open settings activity", e);
                                }
                            }
                        }