Add autofill service setting in managed profile

Previously, there was no way to change the autofill service of the
personal and managed profile independently. After 'uncloning' the
setting in ag/4666330, we now introduce a separate UI control
for each profile.

BUG: 38033559
Test: Tested manually by setting up a work profile and verifying that
the setting can be changed independently. Also verified that the
additional UI does not show without a managed profile.

Change-Id: I1c42fc4335bc319ca7f6fd1b7b10c781343ca248
This commit is contained in:
Zimuzo
2018-08-01 17:44:56 +01:00
parent 64771b5382
commit fcf3f58618
10 changed files with 390 additions and 40 deletions

View File

@@ -16,6 +16,7 @@ package com.android.settings.applications.autofill;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.UserHandle;
import android.view.autofill.AutofillManager;
import com.android.settings.applications.defaultapps.DefaultAutofillPicker;
@@ -36,7 +37,8 @@ public class AutofillPickerTrampolineActivity extends Activity {
// First check if the current user's service already belongs to the app...
final Intent intent = getIntent();
final String packageName = intent.getData().getSchemeSpecificPart();
final String currentService = DefaultAutofillPicker.getDefaultKey(this);
final String currentService = DefaultAutofillPicker.getDefaultKey(
this, UserHandle.myUserId());
if (currentService != null && currentService.startsWith(packageName)) {
// ...and succeed right away if it does.
setResult(RESULT_OK);