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,31 +16,25 @@
|
||||
|
||||
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;
|
||||
|
||||
public final class VirtualKeyboardForWorkPreferenceController
|
||||
extends WorkProfilePreferenceController {
|
||||
extends BasePreferenceController {
|
||||
|
||||
public VirtualKeyboardForWorkPreferenceController(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_virtual_keyboard_pref)) {
|
||||
return UNSUPPORTED_ON_DEVICE;
|
||||
}
|
||||
return super.getAvailabilityStatus();
|
||||
return AVAILABLE;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user