Fix enterprise settings bug

This fixes a bug where the picker
is not using the correct user id
and also ensures that the settings
activity uses the correct user when
launched.

Test: flash & test w/ work profile
Bug 322071206

Change-Id: I846593ff9ae320d9bb774e3e79ed9ef41f101ff5
This commit is contained in:
Becca Hughes
2024-01-29 22:40:34 +00:00
parent ee85a6e0e9
commit 401ebcb53d
9 changed files with 206 additions and 85 deletions

View File

@@ -20,7 +20,6 @@ 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;
@@ -653,16 +652,8 @@ public class CredentialManagerPreferenceController extends BasePreferenceControl
@Override
public void onLeftSideClicked() {
Intent settingsIntent =
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);
}
}
CombinedProviderInfo.launchSettingsActivityIntent(
mContext, packageName, settingsActivity, getUser());
}
});