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

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

Revert "Settings: add preference for license id"

This reverts commit 62bfeb1e.
parent 9b9e2440
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -206,9 +206,6 @@
    <!-- /e/ version -->
    <string name="e_version">/e/ OS version</string>

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

    <!-- /e/ legal. -->
    <string name="elicense_title">/e/ legal</string>

+0 −9
Original line number Diff line number Diff line
@@ -138,15 +138,6 @@
            android:selectable="false"
            settings:enableCopying="true"
            settings:controller="com.android.settings.deviceinfo.firmwareversion.LineageVersionDetailPreferenceController"/>

        <!-- /e/ OS License ID -->
        <Preference
            android:key="e_license_id"
            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"/>
    </PreferenceCategory>

    <PreferenceCategory
+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));
    }
}