Support ability to add different page id for different accessibility service page in settings.
Bug: 190344664 Test: build pass Change-Id: I6cc90b27dcbb5075d13e3c59fe754309182b4d0a
This commit is contained in:
@@ -41,6 +41,7 @@ import androidx.annotation.Nullable;
|
||||
import androidx.preference.Preference;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.overlay.FeatureFactory;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -51,6 +52,19 @@ public class LaunchAccessibilityActivityPreferenceFragment extends ToggleFeature
|
||||
private static final String EMPTY_STRING = "";
|
||||
protected static final String KEY_LAUNCH_PREFERENCE = "launch_preference";
|
||||
|
||||
@Override
|
||||
public int getMetricsCategory() {
|
||||
// Retrieve from getArguments() directly because this function will be executed from
|
||||
// onAttach(), but variable mComponentName only available after onProcessArguments()
|
||||
// which comes from onCreateView().
|
||||
final ComponentName componentName = getArguments().getParcelable(
|
||||
AccessibilitySettings.EXTRA_COMPONENT_NAME);
|
||||
|
||||
return FeatureFactory.getFactory(getActivity().getApplicationContext())
|
||||
.getAccessibilityMetricsFeatureProvider()
|
||||
.getDownloadedFeatureMetricsCategory(componentName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
@@ -60,7 +74,7 @@ public class LaunchAccessibilityActivityPreferenceFragment extends ToggleFeature
|
||||
initLaunchPreference();
|
||||
removePreference(KEY_USE_SERVICE_PREFERENCE);
|
||||
return view;
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPreferenceToggled(String preferenceKey, boolean enabled) {
|
||||
@@ -70,7 +84,6 @@ public class LaunchAccessibilityActivityPreferenceFragment extends ToggleFeature
|
||||
@Override
|
||||
protected void onProcessArguments(Bundle arguments) {
|
||||
super.onProcessArguments(arguments);
|
||||
|
||||
mComponentName = arguments.getParcelable(AccessibilitySettings.EXTRA_COMPONENT_NAME);
|
||||
final ActivityInfo info = getAccessibilityShortcutInfo().getActivityInfo();
|
||||
mPackageName = info.loadLabel(getPackageManager()).toString();
|
||||
|
Reference in New Issue
Block a user