Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3720fab9 authored by Mohammed Althaf T's avatar Mohammed Althaf T 😊
Browse files

Merge branch '1534-q-license_value' into 'v1-q'

Revert "Settings: Move position of preference"

See merge request !179
parents 7b8115a7 24b5251b
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -218,9 +218,6 @@
    <string name="fast_charging_title">Fast charging</string>
    <string name="fast_charging_summary">Disable to reduce the heat produced by the device while charging or to extend the lifespan of the battery</string>

    <!-- /e/ license ID -->
    <string name="e_license_id_title">/e/ OS license ID</string>

    <!-- /e/ Sentry -->
    <string name="sentry_userid_title">Sentry User ID</string>

+0 −10
Original line number Diff line number Diff line
@@ -169,16 +169,6 @@
        android:summary="@string/summary_placeholder"
        android:selectable="false"/>

    <!-- /e/ OS License ID -->
    <Preference
        android:key="e_license_id"
        android:order="49"
        android:title="@string/e_license_id_title"
        android:summary="@string/summary_placeholder"
        android:selectable="false"
        settings:enableCopying="true"
        settings:controller="com.android.settings.deviceinfo.firmwareversion.LicenseIDDetailPreferenceController"/>

    <!-- Manual -->
    <Preference
        android:key="manual"
+0 −69
Original line number Diff line number Diff line
/*
 * Copyright (C) 2023 MURENA SAS
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */

package com.android.settings.deviceinfo.firmwareversion;

import android.content.Context;
import android.os.UserHandle;
import android.provider.Settings;

import androidx.preference.Preference;

import com.android.settings.R;
import com.android.settings.core.BasePreferenceController;
import com.android.settings.slices.Sliceable;


public class LicenseIDDetailPreferenceController extends BasePreferenceController {

    private static final String TAG = "LicenseIDDetailPreferenceController";

    public LicenseIDDetailPreferenceController(Context context, String key) {
        super(context, key);
    }

    @Override
    public int getAvailabilityStatus() {
        return AVAILABLE;
    }

    @Override
    public boolean useDynamicSliceSummary() {
        return true;
    }

    @Override
    public boolean isSliceable() {
        return true;
    }

    @Override
    public CharSequence getSummary() {
        String eLicenseID = Settings.Secure.getStringForUser(
                mContext.getContentResolver(), Settings.Secure.E_LICENSE_ID,
                UserHandle.USER_CURRENT);
        if (eLicenseID == null) {
            return mContext.getString(R.string.unknown);
        }
        return eLicenseID;
    }

    @Override
    public void copy() {
        Sliceable.setCopyContent(mContext, getSummary(),
                mContext.getText(R.string.sentry_userid_title));
    }
}