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

Commit bd8030e8 authored by Xin Li's avatar Xin Li
Browse files

DO NOT MERGE - Merge build QP1A.190711.019 into stage-aosp-master

Bug: 139893257
Change-Id: I54b340294458df6016b7893838e1b0f6e61daf11
parents f92905cf 19ffddb8
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -10666,13 +10666,11 @@
    <string-array name="game_driver_all_apps_preference_values">
        <item>@string/game_driver_app_preference_default</item>
        <item>@string/game_driver_app_preference_game_driver</item>
        <item>@string/game_driver_app_preference_prerelease_driver</item>
    </string-array>
    <!-- All the values for Game Driver app preference [CHAR LIMIT=50] -->
    <string-array name="game_driver_app_preference_values">
        <item>@string/game_driver_app_preference_default</item>
        <item>@string/game_driver_app_preference_game_driver</item>
        <item>@string/game_driver_app_preference_prerelease_driver</item>
        <item>@string/game_driver_app_preference_system</item>
    </string-array>
+1 −2
Original line number Diff line number Diff line
@@ -182,8 +182,7 @@ public class MasterClear extends InstrumentedFragment implements OnGlobalLayoutL
    void showFinalConfirmation() {
        final Bundle args = new Bundle();
        args.putBoolean(ERASE_EXTERNAL_EXTRA, mExternalStorage.isChecked());
        args.putBoolean(ERASE_ESIMS_EXTRA,
            mEsimStorageContainer.getVisibility() == View.VISIBLE && mEsimStorage.isChecked());
        args.putBoolean(ERASE_ESIMS_EXTRA, mEsimStorage.isChecked());
        new SubSettingLauncher(getContext())
                .setDestination(MasterClearConfirm.class.getName())
                .setArguments(args)
+20 −5
Original line number Diff line number Diff line
@@ -119,7 +119,8 @@ public class RegulatoryInfoDisplayActivity extends Activity implements
        }
    }

    private int getResourceId() {
    @VisibleForTesting
    int getResourceId() {
        // Use regulatory_info by default.
        int resId = getResources().getIdentifier(
                REGULATORY_INFO_RESOURCE, "drawable", getPackageName());
@@ -134,6 +135,18 @@ public class RegulatoryInfoDisplayActivity extends Activity implements
                resId = id;
            }
        }

        // When hardware coo property exists, use regulatory_info_<sku>_<coo> resource if valid.
        final String coo = getCoo();
        if (!TextUtils.isEmpty(coo) && !TextUtils.isEmpty(sku)) {
            final String regulatory_info_coo_res =
                    REGULATORY_INFO_RESOURCE + "_" + sku.toLowerCase() + "_" + coo.toLowerCase();
            final int id = getResources().getIdentifier(
                    regulatory_info_coo_res, "drawable", getPackageName());
            if (id != 0) {
                resId = id;
            }
        }
        return resId;
    }

@@ -142,13 +155,15 @@ public class RegulatoryInfoDisplayActivity extends Activity implements
        finish();   // close the activity
    }

    @VisibleForTesting
    public static String getSku() {
    private String getCoo() {
        return SystemProperties.get("ro.boot.hardware.coo", "");
    }

    private String getSku() {
        return SystemProperties.get("ro.boot.hardware.sku", "");
    }

    @VisibleForTesting
    public static String getRegulatoryInfoImageFileName() {
    private String getRegulatoryInfoImageFileName() {
        final String sku = getSku();
        if (TextUtils.isEmpty(sku)) {
            return DEFAULT_REGULATORY_INFO_FILEPATH;
+20 −9
Original line number Diff line number Diff line
@@ -20,10 +20,13 @@ import android.content.Context;
import android.os.storage.StorageManager;
import android.text.format.Formatter;

import androidx.preference.Preference;

import com.android.settings.R;
import com.android.settings.core.BasePreferenceController;
import com.android.settingslib.deviceinfo.PrivateStorageInfo;
import com.android.settingslib.deviceinfo.StorageManagerVolumeProvider;
import com.android.settingslib.utils.ThreadUtils;

import java.text.NumberFormat;

@@ -44,14 +47,22 @@ public class TopLevelStoragePreferenceController extends BasePreferenceControlle
    }

    @Override
    public CharSequence getSummary() {
        // TODO: Register listener.
    protected void refreshSummary(Preference preference) {
        if (preference == null) {
            return;
        }

        ThreadUtils.postOnBackgroundThread(() -> {
            final NumberFormat percentageFormat = NumberFormat.getPercentInstance();
            final PrivateStorageInfo info = PrivateStorageInfo.getPrivateStorageInfo(
                    mStorageManagerVolumeProvider);
        double privateUsedBytes = info.totalBytes - info.freeBytes;
        return mContext.getString(R.string.storage_summary,
            final double privateUsedBytes = info.totalBytes - info.freeBytes;

            ThreadUtils.postOnMainThread(() -> {
                preference.setSummary(mContext.getString(R.string.storage_summary,
                        percentageFormat.format(privateUsedBytes / info.totalBytes),
                Formatter.formatFileSize(mContext, info.freeBytes));
                        Formatter.formatFileSize(mContext, info.freeBytes)));
            });
        });
    }
}
+8 −0
Original line number Diff line number Diff line
@@ -58,11 +58,13 @@ public class BiometricFragment extends InstrumentedFragment {
    private Bundle mBundle;
    private BiometricPrompt mBiometricPrompt;
    private CancellationSignal mCancellationSignal;
    private boolean mAuthenticating;

    private AuthenticationCallback mAuthenticationCallback =
            new AuthenticationCallback() {
        @Override
        public void onAuthenticationError(int error, @NonNull CharSequence message) {
            mAuthenticating = false;
            mClientExecutor.execute(() -> {
                mClientCallback.onAuthenticationError(error, message);
            });
@@ -71,6 +73,7 @@ public class BiometricFragment extends InstrumentedFragment {

        @Override
        public void onAuthenticationSucceeded(AuthenticationResult result) {
            mAuthenticating = false;
            mClientExecutor.execute(() -> {
                mClientCallback.onAuthenticationSucceeded(result);
            });
@@ -134,6 +137,10 @@ public class BiometricFragment extends InstrumentedFragment {
        }
    }

    boolean isAuthenticating() {
        return mAuthenticating;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
@@ -180,6 +187,7 @@ public class BiometricFragment extends InstrumentedFragment {
        mCancellationSignal = new CancellationSignal();

        // TODO: CC doesn't use crypto for now
        mAuthenticating = true;
        mBiometricPrompt.authenticateUser(mCancellationSignal, mClientExecutor,
                mAuthenticationCallback, mUserId, mCancelCallback);
    }
Loading