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

Commit 2877e184 authored by Jean-Baptiste Queru's avatar Jean-Baptiste Queru
Browse files

merge from donut

parents 5f16c148 ed47f1e4
Loading
Loading
Loading
Loading
+14 −2
Original line number Diff line number Diff line
@@ -1737,7 +1737,7 @@ found in the list of installed applications.</string>
    <!-- Description for wifi connectivity -->
    <string name="battery_desc_wifi">Battery used by Wi-Fi</string>
    <!-- Suggestion for wifi connectivity power drain -->
    <string name="battery_sugg_wifi">Turn off WiFi when not using it or where it is not available</string>
    <string name="battery_sugg_wifi">Turn off Wi-Fi when not using it or where it is not available</string>

    <!-- Description for bluetooth power consumption detail -->
    <string name="battery_desc_bluetooth">Battery used by bluetooth</string>
@@ -1829,7 +1829,7 @@ found in the list of installed applications.</string>
    <string name="vpn_yes_button">Yes</string>
    <string name="vpn_no_button">No</string>
    <string name="vpn_back_button">Back</string>
    <string name="vpn_mistake_button">No, it's a mistake</string>
    <string name="vpn_mistake_button">No</string>

    <string name="vpn_menu_done">Save</string>
    <string name="vpn_menu_cancel">Cancel</string>
@@ -1848,7 +1848,10 @@ found in the list of installed applications.</string>
    <string name="vpn_confirm_edit_profile_cancellation">Are you sure you want to discard the changes made to this profile?</string>
    <string name="vpn_confirm_reconnect">Unable to connect to the network. Do you want to try again?</string>
    <string name="vpn_unknown_server_dialog_msg">Server name cannot be resolved. Do you want to check your server name setting?</string>
    <string name="vpn_challenge_error_dialog_msg">Challenge error. Do you want to check your secret setting?</string>
    <string name="vpn_secret_not_set_dialog_msg">One or more secrets are missing in this VPN configuration. Do you want to check your secret setting?</string>
    <string name="vpn_auth_error_dialog_msg">The username or password you entered is incorrect. Do you want to try again?</string>
    <string name="vpn_remote_hung_up_error_dialog_msg">Server hung up. The username or password you entered could be incorrect. Do you want to try again?</string>

    <!-- VPN type selection activity title -->
    <string name="vpn_type_title">Add VPN</string>
@@ -1894,6 +1897,8 @@ found in the list of installed applications.</string>
    <!-- Complete term -->
    <string name="vpn_l2tp_secret">L2TP secret</string>
    <string name="vpn_a_l2tp_secret">an L2TP secret</string>
    <string name="vpn_pptp_encryption_title">encryption</string>
    <string name="vpn_pptp_encryption">PPTP encryption</string>

    <!-- Preference title -->
    <string name="vpn_ipsec_presharedkey_title">Set IPSec pre-shared key</string>
@@ -1935,6 +1940,10 @@ found in the list of installed applications.</string>
    <string name="vpn_settings_title">VPN settings</string>
    <!-- Summary of preference to enter the VPN settings activity -->
    <string name="vpn_settings_summary">Set up &amp; manage Virtual Private Networks (VPNs)</string>
    <!-- A secret edit field's grayed out value when it has not been modified -->
    <string name="vpn_secret_unchanged">(unchanged)</string>
    <!-- A secret edit field's grayed out value when it has not been set -->
    <string name="vpn_secret_not_set">(not set)</string>

    <!-- Title of preference group for credential storage settings -->
    <string name="cstor_settings_category">Credential storage</string>
@@ -1991,6 +2000,9 @@ found in the list of installed applications.</string>
    <string name="cstor_name_empty_error">Please enter a name.</string>
    <string name="cstor_name_char_error">Please enter a name that contains only letters and numbers.</string>
    <string name="cstor_storage_error">Unable to save the certificate. Click OK to retry.</string>
    <string name="cstor_unable_to_save_cert">Unable to save the certificate. The credential storage is not enabled or properly initialized.</string>
    <string name="cstor_cert_not_saved">The certificate is not saved.</string>
    <string name="cstor_is_reset">The credential storage is erased.</string>

    <!-- toast message -->
    <string name="cstor_is_enabled">Credential storage is enabled.</string>
+2 −1
Original line number Diff line number Diff line
@@ -76,12 +76,13 @@
        </PreferenceScreen>
        
        <!-- Contributors -->
        <!-- 
        <PreferenceScreen
                android:key="contributors"
                android:title="@string/contributors_title">
            <intent android:action="android.settings.TEAM" />
        </PreferenceScreen>
        
        -->
        <!-- System Tutorial - launches activity -->
        <PreferenceScreen android:key="system_tutorial"
                android:title="@string/system_tutorial_list_item_title" 
+35 −41
Original line number Diff line number Diff line
@@ -355,7 +355,7 @@ public class ManageApplications extends ListActivity implements
                    Log.w(TAG, "Couldnt find application info for:"+pkgName);
                    break;
                }
                mObserver.invokeGetSizeInfo(info);
                mObserver.invokeGetSizeInfo(pkgName);
                break;
            case ADD_PKG_DONE:
                if(localLOGV) Log.i(TAG, "Message ADD_PKG_DONE");
@@ -367,7 +367,12 @@ public class ManageApplications extends ListActivity implements
                if (status) {
                    size = data.getLong(ATTR_PKG_STATS);
                    formattedSize = data.getString(ATTR_PKG_SIZE_STR);
                    int idx = mAppInfoAdapter.getIndex(pkgName);
                    if (idx == -1) {
                        mAppInfoAdapter.addToList(pkgName, size, formattedSize);
                    } else {
                        mAppInfoAdapter.updatePackage(pkgName, size, formattedSize);
                    }
                }
                break;
            case REFRESH_LABELS:
@@ -1162,19 +1167,6 @@ public class ManageApplications extends ListActivity implements
            }
        }

        public boolean updateAppLabel(String pkgName, CharSequence label) {
            if ((pkgName == null) || (label == null)) {
                return false;
            }
            AppInfo aInfo = mCache.getEntry(pkgName);
            if (aInfo != null) {
                aInfo.refreshLabel(label);
                notifyDataSetChanged();
                return true;
            }
            return false;
        }

        private boolean shouldBeInList(int filterOption, ApplicationInfo info) {
            // Match filter here
            if (filterOption == FILTER_APPS_RUNNING) {
@@ -1246,6 +1238,24 @@ public class ManageApplications extends ListActivity implements
            }
        }

        public void updatePackage(String pkgName,
                long size, String formattedSize) {
            ApplicationInfo info = null;
            try {
                info = mPm.getApplicationInfo(pkgName,
                        PackageManager.GET_UNINSTALLED_PACKAGES);
            } catch (NameNotFoundException e) {
                return;
            }
            AppInfo aInfo = mCache.getEntry(pkgName);
            if (aInfo != null) {
                aInfo.refreshLabel(info.loadLabel(mPm));
                aInfo.refreshIcon(info.loadIcon(mPm));
                aInfo.setSize(size, formattedSize);
                notifyDataSetChanged();
            }
        }

        private void removePkgBase(String pkgName) {
            int imax = mAppList.size();
            for (int i = 0; i < imax; i++) {
@@ -1300,7 +1310,7 @@ public class ManageApplications extends ListActivity implements
            for (int i = 0; i < pkgs.length; i++) {
                AppInfo entry = mCache.getEntry(pkgs[i]);
                if (entry == null) {
                    Log.w(TAG, "Entry for package:"+ pkgs[i] +"doesn't exist in map");
                    if (localLOGV) Log.w(TAG, "Entry for package:"+ pkgs[i] +"doesn't exist in map");
                    continue;
                }
                if (entry.setSize(sizes[i], formatted[i])) {
@@ -1311,21 +1321,6 @@ public class ManageApplications extends ListActivity implements
                notifyDataSetChanged();
            }
        }
        
        public void updateAppSize(String pkgName, long size, String formattedSize) {
            if(pkgName == null) {
                return;
            }
            AppInfo entry = mCache.getEntry(pkgName);
            if (entry == null) {
                Log.w(TAG, "Entry for package:"+pkgName+"doesnt exist in map");
                return;
            }
            // Copy the index into the newly updated entry
            if (entry.setSize(size, formattedSize)) {
                notifyDataSetChanged();
            }
        }
    }
    
    /*
@@ -1371,7 +1366,7 @@ public class ManageApplications extends ListActivity implements
     * and the AppInfo object corresponding to the package name are set on the message
     */
    class PkgSizeObserver extends IPackageStatsObserver.Stub {
        private ApplicationInfo mAppInfo;
        String pkgName;
        public void onGetStatsCompleted(PackageStats pStats, boolean pSucceeded) {
            if(DEBUG_PKG_DELAY) {
                try {
@@ -1379,12 +1374,11 @@ public class ManageApplications extends ListActivity implements
                } catch (InterruptedException e) {
                }
            }
            AppInfo appInfo = null;
            Bundle data = new Bundle();
            data.putString(ATTR_PKG_NAME, mAppInfo.packageName);
            data.putString(ATTR_PKG_NAME, pkgName);
            data.putBoolean(ATTR_GET_SIZE_STATUS, pSucceeded);
            if(pSucceeded && pStats != null) {
                if (localLOGV) Log.i(TAG, "onGetStatsCompleted::"+pStats.packageName+", ("+
                if (localLOGV) Log.i(TAG, "onGetStatsCompleted::"+pkgName+", ("+
                        pStats.cacheSize+","+
                        pStats.codeSize+", "+pStats.dataSize);
                long total = getTotalSize(pStats);
@@ -1400,14 +1394,14 @@ public class ManageApplications extends ListActivity implements
            mHandler.sendMessage(msg);
        }

        public void invokeGetSizeInfo(ApplicationInfo pAppInfo) {
            if(pAppInfo == null || pAppInfo.packageName == null) {
        public void invokeGetSizeInfo(String packageName) {
            if (packageName == null) {
                return;
            }
            pkgName = packageName;
            if(localLOGV) Log.i(TAG, "Invoking getPackageSizeInfo for package:"+
                    pAppInfo.packageName);
            mAppInfo = pAppInfo;
            mPm.getPackageSizeInfo(pAppInfo.packageName, this);
                    packageName);
            mPm.getPackageSizeInfo(packageName, this);
        }
    }
    
+81 −36
Original line number Diff line number Diff line
@@ -42,6 +42,7 @@ import android.security.Keystore;
import android.text.Html;
import android.text.TextUtils;
import android.text.method.LinkMovementMethod;
import android.util.Log;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
@@ -464,15 +465,26 @@ public class SecuritySettings extends PreferenceActivity implements

            if (ACTION_ADD_CREDENTIAL.equals(action)) {
                mCstorAddCredentialHelper = new CstorAddCredentialHelper(intent);
                showDialog(CSTOR_NAME_CREDENTIAL_DIALOG);
                showCstorDialog(CSTOR_NAME_CREDENTIAL_DIALOG);
            } else if (ACTION_UNLOCK_CREDENTIAL_STORAGE.equals(action)) {
                mSpecialIntent = intent;
                showDialog(mCstorHelper.isCstorInitialized()
                showCstorDialog(mCstorHelper.isCstorInitialized()
                        ? CSTOR_UNLOCK_DIALOG
                        : CSTOR_INIT_DIALOG);
            }
        }

        private void showCstorDialog(int dialogId) {
            mDialogId = dialogId;
            showDialog(dialogId);

            if (dialogId == CSTOR_NAME_CREDENTIAL_DIALOG) {
                // set mView back as mView may be replaced by CSTOR_INIT_DIALOG
                // or CSTOR_UNLOCK_DIALOG
                mView = mCstorAddCredentialHelper.mView;
            }
        }

        private boolean isCstorUnlocked() {
            return (mKeystore.getState() == Keystore.UNLOCKED);
        }
@@ -514,16 +526,54 @@ public class SecuritySettings extends PreferenceActivity implements
            mKeystore.reset();
            enablePreferences(false);
            mAccessCheckBox.setChecked(false);
            Toast.makeText(SecuritySettings.this, R.string.cstor_is_reset,
                    Toast.LENGTH_LONG).show();
        }

        private boolean addCredential() {
            if (mCstorAddCredentialHelper.saveToStorage() != 0) {
                // set mView back as mView may be replaced by CSTOR_INIT_DIALOG
                // or CSTOR_UNLOCK_DIALOG
                mView = mCstorAddCredentialHelper.mView;
                if (mCstorAddCredentialHelper.isPkcs12Keystore()) {
                    showError(R.string.cstor_password_error);
                } else {
                    showError(R.string.cstor_storage_error);
                }
                Log.d("CSTOR", "failed to add credential");
                return false;
            }
            Log.d("CSTOR", "credential is added: "
                    + mCstorAddCredentialHelper.getName());
            String formatString =
                    getString(R.string.cstor_is_added);
            String message = String.format(formatString,
                    mCstorAddCredentialHelper.getName());
            Toast.makeText(SecuritySettings.this, message,
                    Toast.LENGTH_LONG).show();
            return true;
        }

        public void onCancel(DialogInterface dialog) {
            if (mCstorAddCredentialHelper != null) {
                // release the object here so that it doesn't get triggerred in
                // onDismiss()
            if (mCstorAddCredentialHelper == null) return;

            switch (mDialogId) {
                case CSTOR_INIT_DIALOG:
                case CSTOR_UNLOCK_DIALOG:
                    Toast.makeText(SecuritySettings.this,
                            R.string.cstor_unable_to_save_cert,
                            Toast.LENGTH_LONG).show();
                    break;

                case CSTOR_NAME_CREDENTIAL_DIALOG:
                    Toast.makeText(SecuritySettings.this,
                            R.string.cstor_cert_not_saved,
                            Toast.LENGTH_LONG).show();
                    break;
            }
            mCstorAddCredentialHelper = null;
            finish();
        }
        }

        public void onClick(DialogInterface dialog, int which) {
            if (which == DialogInterface.BUTTON_NEGATIVE) {
@@ -554,31 +604,34 @@ public class SecuritySettings extends PreferenceActivity implements
        public void onDismiss(DialogInterface dialog) {
            if (!mConfirm) {
                mConfirm = true;
                showDialog(mDialogId);
                showCstorDialog(mDialogId);
            } else {
                removeDialog(mDialogId);

                if (mDialogId == CSTOR_UNLOCK_DIALOG) {
                    mAccessCheckBox.setChecked(isCstorUnlocked());
                }

                if (mCstorAddCredentialHelper != null) {
                    if (!isCstorInitialized()) {
                        showDialog(CSTOR_INIT_DIALOG);
                        showCstorDialog(CSTOR_INIT_DIALOG);
                    } else if (!isCstorUnlocked()) {
                        showDialog(CSTOR_UNLOCK_DIALOG);
                        showCstorDialog(CSTOR_UNLOCK_DIALOG);
                    } else {
                        String formatString =
                                getString(R.string.cstor_is_added);
                        String message = String.format(formatString,
                                mCstorAddCredentialHelper.getName());
                        Toast.makeText(SecuritySettings.this, message,
                                Toast.LENGTH_SHORT).show();
                        if (addCredential()) {
                            // succeeded
                            finish();
                        } else {
                            // failed
                            if (mDialogId != CSTOR_NAME_CREDENTIAL_DIALOG) {
                                removeDialog(mDialogId);
                            }
                            showCstorDialog(CSTOR_NAME_CREDENTIAL_DIALOG);
                        }
                    }
                    return;
                } else if (mSpecialIntent != null) {
                    finish();
                }
                removeDialog(mDialogId);
            }
        }

@@ -625,15 +678,6 @@ public class SecuritySettings extends PreferenceActivity implements
                mCstorAddCredentialHelper.setPassword(password);
            }

            if (mCstorAddCredentialHelper.saveToStorage() < 0) {
                if (mCstorAddCredentialHelper.isPkcs12Keystore()) {
                    showError(R.string.cstor_password_error);
                } else {
                    showError(R.string.cstor_storage_error);
                }
                return false;
            }

            return true;
        }

@@ -760,7 +804,7 @@ public class SecuritySettings extends PreferenceActivity implements
                        public boolean onPreferenceChange(
                                Preference pref, Object value) {
                            if (((Boolean) value)) {
                                showDialog(isCstorInitialized()
                                showCstorDialog(isCstorInitialized()
                                        ? CSTOR_UNLOCK_DIALOG
                                        : CSTOR_INIT_DIALOG);
                            } else {
@@ -781,7 +825,7 @@ public class SecuritySettings extends PreferenceActivity implements
            pref.setOnPreferenceClickListener(
                    new Preference.OnPreferenceClickListener() {
                        public boolean onPreferenceClick(Preference pref) {
                            showDialog(isCstorInitialized()
                            showCstorDialog(isCstorInitialized()
                                    ? CSTOR_CHANGE_PASSWORD_DIALOG
                                    : CSTOR_INIT_DIALOG);
                            return true;
@@ -797,7 +841,7 @@ public class SecuritySettings extends PreferenceActivity implements
            pref.setOnPreferenceClickListener(
                    new Preference.OnPreferenceClickListener() {
                        public boolean onPreferenceClick(Preference pref) {
                            showDialog(CSTOR_RESET_DIALOG);
                            showCstorDialog(CSTOR_RESET_DIALOG);
                            return true;
                        }
                    });
@@ -807,7 +851,6 @@ public class SecuritySettings extends PreferenceActivity implements
        }

        private Dialog createUnlockDialog() {
            mDialogId = CSTOR_UNLOCK_DIALOG;
            mView = View.inflate(SecuritySettings.this,
                    R.layout.cstor_unlock_dialog_view, null);
            hideError();
@@ -830,7 +873,6 @@ public class SecuritySettings extends PreferenceActivity implements
        }

        private Dialog createSetPasswordDialog(int id) {
            mDialogId = id;
            mView = View.inflate(SecuritySettings.this,
                    R.layout.cstor_set_password_dialog_view, null);
            hideError();
@@ -870,7 +912,6 @@ public class SecuritySettings extends PreferenceActivity implements
        }

        private Dialog createResetDialog() {
            mDialogId = CSTOR_RESET_DIALOG;
            return new AlertDialog.Builder(SecuritySettings.this)
                    .setTitle(android.R.string.dialog_alert_title)
                    .setIcon(android.R.drawable.ic_dialog_alert)
@@ -881,9 +922,12 @@ public class SecuritySettings extends PreferenceActivity implements
        }

        private Dialog createNameCredentialDialog() {
            mDialogId = CSTOR_NAME_CREDENTIAL_DIALOG;
            mView = View.inflate(SecuritySettings.this,
                    R.layout.cstor_name_credential_dialog_view, null);
            if (mCstorAddCredentialHelper != null) {
                mCstorAddCredentialHelper.mView = mView;
            }

            hideError();
            if (!mCstorAddCredentialHelper.isPkcs12Keystore()) {
                hide(R.id.cstor_credential_password_container);
@@ -915,6 +959,7 @@ public class SecuritySettings extends PreferenceActivity implements
        private String mDescription;
        private String mName;
        private String mPassword;
        private View mView;

        CstorAddCredentialHelper(Intent intent) {
            parse(intent);
@@ -958,7 +1003,7 @@ public class SecuritySettings extends PreferenceActivity implements
                    byte[] blob = mItemList.get(i);
                    int ret = ks.put(mNamespaceList.get(i), mName,
                            new String(blob));
                    if (ret < 0) return ret;
                    if (ret != 0) return ret;
                }
            }
            return 0;
+7 −7
Original line number Diff line number Diff line
@@ -59,7 +59,7 @@ public class TextToSpeechSettings extends PreferenceActivity implements
    private static final String LOCALE_DELIMITER = "-";

    private static final String FALLBACK_TTS_DEFAULT_SYNTH =
            TextToSpeech.Engine.FALLBACK_TTS_DEFAULT_SYNTH;
            TextToSpeech.Engine.DEFAULT_SYNTH;

    private Preference         mPlayExample = null;
    private Preference         mInstallData = null;
@@ -141,7 +141,7 @@ public class TextToSpeechSettings extends PreferenceActivity implements
            intVal = Settings.Secure.getInt(resolver, TTS_USE_DEFAULTS);
        } catch (SettingNotFoundException e) {
            // "use default" setting not found, initialize it
            intVal = TextToSpeech.Engine.FALLBACK_TTS_USE_DEFAULTS;
            intVal = TextToSpeech.Engine.USE_DEFAULTS;
            Settings.Secure.putInt(resolver, TTS_USE_DEFAULTS, intVal);
        }
        mUseDefaultPref.setChecked(intVal == 1);
@@ -162,7 +162,7 @@ public class TextToSpeechSettings extends PreferenceActivity implements
            intVal = Settings.Secure.getInt(resolver, TTS_DEFAULT_RATE);
        } catch (SettingNotFoundException e) {
            // default rate setting not found, initialize it
            intVal = TextToSpeech.Engine.FALLBACK_TTS_DEFAULT_RATE;
            intVal = TextToSpeech.Engine.DEFAULT_RATE;
            Settings.Secure.putInt(resolver, TTS_DEFAULT_RATE, intVal);
        }
        mDefaultRatePref.setValue(String.valueOf(intVal));
@@ -223,7 +223,7 @@ public class TextToSpeechSettings extends PreferenceActivity implements
    private void checkVoiceData() {
        PackageManager pm = getPackageManager();
        Intent intent = new Intent();
        intent.setAction("android.intent.action.CHECK_TTS_DATA");
        intent.setAction(TextToSpeech.Engine.ACTION_CHECK_TTS_DATA);
        List<ResolveInfo> resolveInfos = pm.queryIntentActivities(intent, 0);
        // query only the package that matches that of the default engine
        for (int i = 0; i < resolveInfos.size(); i++) {
@@ -243,7 +243,7 @@ public class TextToSpeechSettings extends PreferenceActivity implements
    private void installVoiceData() {
        PackageManager pm = getPackageManager();
        Intent intent = new Intent();
        intent.setAction("android.intent.action.INSTALL_TTS_DATA");
        intent.setAction(TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA);
        List<ResolveInfo> resolveInfos = pm.queryIntentActivities(intent, 0);
        // query only the package that matches that of the default engine
        for (int i = 0; i < resolveInfos.size(); i++) {
@@ -260,7 +260,7 @@ public class TextToSpeechSettings extends PreferenceActivity implements
     * Called when the TTS engine is initialized.
     */
    public void onInit(int status) {
        if (status == TextToSpeech.TTS_SUCCESS) {
        if (status == TextToSpeech.SUCCESS) {
            Log.v(TAG, "TTS engine for settings screen initialized.");
            mEnableDemo = true;
        } else {
@@ -337,7 +337,7 @@ public class TextToSpeechSettings extends PreferenceActivity implements
            // Play example
            if (mTts != null) {
                mTts.speak(getResources().getString(R.string.tts_demo),
                        TextToSpeech.TTS_QUEUE_FLUSH, null);
                        TextToSpeech.QUEUE_FLUSH, null);
            }
            return true;
        }
Loading