Merge "Support click metrics logs in several pages" into rvc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
afaf654a77
@@ -20,6 +20,7 @@ import android.accounts.Account;
|
||||
import android.app.settings.SettingsEnums;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import androidx.preference.Preference;
|
||||
import androidx.preference.PreferenceScreen;
|
||||
@@ -63,23 +64,29 @@ public class BrandedAccountPreferenceController extends BasePreferenceController
|
||||
}
|
||||
|
||||
accountPreference.setSummary(mAccounts[0].name);
|
||||
accountPreference.setOnPreferenceClickListener(preference -> {
|
||||
final Bundle args = new Bundle();
|
||||
args.putParcelable(AccountDetailDashboardFragment.KEY_ACCOUNT,
|
||||
mAccounts[0]);
|
||||
args.putParcelable(AccountDetailDashboardFragment.KEY_USER_HANDLE,
|
||||
android.os.Process.myUserHandle());
|
||||
args.putString(AccountDetailDashboardFragment.KEY_ACCOUNT_TYPE,
|
||||
mAccountFeatureProvider.getAccountType());
|
||||
}
|
||||
|
||||
new SubSettingLauncher(mContext)
|
||||
.setDestination(AccountDetailDashboardFragment.class.getName())
|
||||
.setTitleRes(R.string.account_sync_title)
|
||||
.setArguments(args)
|
||||
.setSourceMetricsCategory(SettingsEnums.DEVICEINFO)
|
||||
.launch();
|
||||
return true;
|
||||
});
|
||||
@Override
|
||||
public boolean handlePreferenceTreeClick(Preference preference) {
|
||||
if (!TextUtils.equals(preference.getKey(), getPreferenceKey())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final Bundle args = new Bundle();
|
||||
args.putParcelable(AccountDetailDashboardFragment.KEY_ACCOUNT,
|
||||
mAccounts[0]);
|
||||
args.putParcelable(AccountDetailDashboardFragment.KEY_USER_HANDLE,
|
||||
android.os.Process.myUserHandle());
|
||||
args.putString(AccountDetailDashboardFragment.KEY_ACCOUNT_TYPE,
|
||||
mAccountFeatureProvider.getAccountType());
|
||||
|
||||
new SubSettingLauncher(mContext)
|
||||
.setDestination(AccountDetailDashboardFragment.class.getName())
|
||||
.setTitleRes(R.string.account_sync_title)
|
||||
.setArguments(args)
|
||||
.setSourceMetricsCategory(SettingsEnums.DEVICEINFO)
|
||||
.launch();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -23,7 +23,6 @@ import android.content.Intent;
|
||||
import android.content.pm.UserInfo;
|
||||
import android.os.Bundle;
|
||||
import android.os.UserManager;
|
||||
import android.provider.SearchIndexableResource;
|
||||
import android.view.View;
|
||||
|
||||
import com.android.settings.R;
|
||||
@@ -50,7 +49,6 @@ import com.android.settingslib.search.SearchIndexable;
|
||||
import com.android.settingslib.widget.LayoutPreference;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@SearchIndexable
|
||||
|
Reference in New Issue
Block a user