Settings: Expose clipboard auto clear setting [2/2]
[someone5678] * Adapt to current project * Use Settings instead of DeviceConfig as GMS don't likes it * Add switch for clipboard auto clear * Import resources from CalyxOS and crDroid Android and adapt it * Update summary setting logic Ref:72db57c96648e00e2b8133c49aa70cbc81eea9ccIssue: calyxos#2208 Change-Id: Ie101177aba90ea085d83c0cb641ffed447cceecd Signed-off-by: someone5678 <59456192+someone5678@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Copyright (C) 2024 TheParasiteProject
|
||||
*
|
||||
* 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.custom.privacy;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.android.internal.logging.nano.MetricsProto;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.SettingsPreferenceFragment;
|
||||
import com.android.settings.search.BaseSearchIndexProvider;
|
||||
import com.android.settingslib.search.SearchIndexable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@SearchIndexable
|
||||
public class ClipboardAutoClearFragment extends SettingsPreferenceFragment {
|
||||
|
||||
public static final String TAG = "ClipboardAutoClearFragment";
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
addPreferencesFromResource(R.xml.clipboard_auto_clear_settings);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetricsCategory() {
|
||||
return MetricsProto.MetricsEvent.EVOLVER;
|
||||
}
|
||||
|
||||
/**
|
||||
* For search
|
||||
*/
|
||||
public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
|
||||
new BaseSearchIndexProvider(R.xml.clipboard_auto_clear_settings) {
|
||||
|
||||
@Override
|
||||
public List<String> getNonIndexableKeys(Context context) {
|
||||
List<String> keys = super.getNonIndexableKeys(context);
|
||||
|
||||
return keys;
|
||||
}
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user