[Panlingual] Implement entries of Panlingual in settings UI part.
- Path 1 : System -> Language & Input -> App Languages -> per app language - path 2 : System -> Apps -> App Info -> per app language Video: https://screencast.googleplex.com/cast/NjUyNTUzMDY0MTc5MzAyNHxjNTg2MzMwYS0yOA Bug: 206854105 Test: local test pass Test: atest pass Change-Id: Ic06fa4f0c6ec68680eb828032b6e3f479b412dc4
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Copyright (C) 2021 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.settings.applications.appinfo;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.FeatureFlagUtils;
|
||||
|
||||
import com.android.settings.SettingsPreferenceFragment;
|
||||
|
||||
/**
|
||||
* A controller to update current locale information of application.
|
||||
*/
|
||||
public class AppLocalePreferenceController extends AppInfoPreferenceControllerBase {
|
||||
public AppLocalePreferenceController(Context context, String key) {
|
||||
super(context, key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
return FeatureFlagUtils
|
||||
.isEnabled(mContext, FeatureFlagUtils.SETTINGS_APP_LANGUAGE_SELECTION)
|
||||
? AVAILABLE : CONDITIONALLY_UNAVAILABLE;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class<? extends SettingsPreferenceFragment> getDetailFragmentClass() {
|
||||
return AppLocaleDetails.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CharSequence getSummary() {
|
||||
return AppLocaleDetails.getSummary(mContext, mParent.getAppEntry().info.packageName);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user