Implement work-profile infra in BasePreferenceController
- Add settings:forWork in xml - Set mIsForWork based on xml attribute - Delete WorkProfilePreferenceController and move its function to BasePreferenceController Fixes: 123376083 Test: Add work profile, go to Settings->System->Language&input, UI should show work profile related items Change-Id: Id2dcbb0e158c117cdfd363466a275f4e133c345e
This commit is contained in:
@@ -16,34 +16,28 @@
|
||||
|
||||
package com.android.settings.inputmethod;
|
||||
|
||||
import android.app.settings.SettingsEnums;
|
||||
import android.content.Context;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.core.WorkProfilePreferenceController;
|
||||
import com.android.settings.core.BasePreferenceController;
|
||||
|
||||
/**
|
||||
* Preference controller for "Spell checker for work".
|
||||
*
|
||||
* @see SpellCheckerPreferenceController
|
||||
*/
|
||||
public final class SpellCheckerForWorkPreferenceController extends WorkProfilePreferenceController {
|
||||
public final class SpellCheckerForWorkPreferenceController extends BasePreferenceController {
|
||||
|
||||
public SpellCheckerForWorkPreferenceController(Context context, String preferenceKey) {
|
||||
super(context, preferenceKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getSourceMetricsCategory() {
|
||||
return SettingsEnums.SETTINGS_LANGUAGE_CATEGORY;
|
||||
}
|
||||
|
||||
@AvailabilityStatus
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
if (!mContext.getResources().getBoolean(R.bool.config_show_spellcheckers_settings)) {
|
||||
return UNSUPPORTED_ON_DEVICE;
|
||||
}
|
||||
return super.getAvailabilityStatus();
|
||||
return AVAILABLE;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user