You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.6 KiB
46 lines
1.6 KiB
8 years ago
|
/*
|
||
|
* Copyright (C) 2017 The LineageOS 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.
|
||
|
*/
|
||
|
|
||
7 years ago
|
package org.lineageos.settings.device;
|
||
8 years ago
|
|
||
|
import android.content.res.Resources;
|
||
|
import android.os.Bundle;
|
||
|
import android.support.v14.preference.PreferenceFragment;
|
||
|
|
||
7 years ago
|
import org.lineageos.settings.device.R;
|
||
8 years ago
|
|
||
7 years ago
|
import org.lineageos.internal.util.FileUtils;
|
||
8 years ago
|
|
||
|
public class AdvancedDisplayFragment extends PreferenceFragment {
|
||
|
private mDNIeScenario mmDNIeScenario;
|
||
|
private mDNIeNegative mmDNIeNegative;
|
||
|
|
||
|
@Override
|
||
|
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
|
||
|
addPreferencesFromResource(R.xml.screen_preferences);
|
||
|
Resources res = getResources();
|
||
|
|
||
|
/* mDNIe */
|
||
|
mmDNIeScenario = (mDNIeScenario) findPreference(Constants.KEY_MDNIE_SCENARIO);
|
||
|
mmDNIeScenario.setEnabled(
|
||
|
FileUtils.isFileWritable(res.getString(R.string.mdnie_scenario_sysfs_file)));
|
||
|
|
||
|
mmDNIeNegative = (mDNIeNegative) findPreference(Constants.KEY_MDNIE_NEGATIVE);
|
||
|
mmDNIeNegative.setEnabled(
|
||
|
FileUtils.isFileWritable(res.getString(R.string.mdnie_negative_sysfs_file)));
|
||
|
}
|
||
|
}
|