diff options
Diffstat (limited to 'src')
15 files changed, 86 insertions, 76 deletions
diff --git a/src/com/android/settings/ApnEditor.java b/src/com/android/settings/ApnEditor.java index 7142fb6..8299c67 100644 --- a/src/com/android/settings/ApnEditor.java +++ b/src/com/android/settings/ApnEditor.java @@ -758,7 +758,7 @@ public class ApnEditor extends InstrumentedPreferenceActivity if (pref != null) { if (pref.equals(mPassword)){ pref.setSummary(starify(sharedPreferences.getString(key, ""))); - } else if (pref.equals(mCarrierEnabled)) { + } else if (pref.equals(mCarrierEnabled) || pref.equals(mBearerMulti)) { // do nothing } else { pref.setSummary(checkNull(sharedPreferences.getString(key, ""))); diff --git a/src/com/android/settings/DevelopmentSettings.java b/src/com/android/settings/DevelopmentSettings.java index f20728a..4a4c51d 100644 --- a/src/com/android/settings/DevelopmentSettings.java +++ b/src/com/android/settings/DevelopmentSettings.java @@ -101,9 +101,6 @@ public class DevelopmentSettings extends SettingsPreferenceFragment */ public static final String PREF_SHOW = "show"; - private static final ComponentName SYSUI_TUNER = new ComponentName("com.android.systemui", - "com.android.systemui.tuner.TunerActivity"); - private static final String ENABLE_ADB = "enable_adb"; private static final String CLEAR_ADB_KEYS = "clear_adb_keys"; private static final String ENABLE_TERMINAL = "enable_terminal"; @@ -270,8 +267,6 @@ public class DevelopmentSettings extends SettingsPreferenceFragment private Dialog mAdbKeysDialog; private boolean mUnavailable; - private SwitchPreference mTunerUiPref; - @Override protected int getMetricsCategory() { return MetricsLogger.DEVELOPMENT; @@ -407,8 +402,6 @@ public class DevelopmentSettings extends SettingsPreferenceFragment mAllPrefs.add(mShowAllANRs); mResetSwitchPrefs.add(mShowAllANRs); - mTunerUiPref = findAndInitSwitchPref(TUNER_UI_KEY); - Preference hdcpChecking = findPreference(HDCP_CHECKING_KEY); if (hdcpChecking != null) { mAllPrefs.add(hdcpChecking); @@ -608,7 +601,6 @@ public class DevelopmentSettings extends SettingsPreferenceFragment updateMobileDataAlwaysOnOptions(); updateSimulateColorSpace(); updateUSBAudioOptions(); - updateTweakUi(); } private void resetDangerousOptions() { @@ -1153,21 +1145,6 @@ public class DevelopmentSettings extends SettingsPreferenceFragment } } - private void updateTweakUi() { - updateSwitchPreference(mTunerUiPref, getActivity().getPackageManager() - .getComponentEnabledSetting(SYSUI_TUNER) - == PackageManager.COMPONENT_ENABLED_STATE_ENABLED); - mTunerUiPref.setOnPreferenceChangeListener(this); - } - - private void writeTweakUi(Object newValue) { - Boolean enabled = (Boolean) newValue; - getActivity().getPackageManager().setComponentEnabledSetting(SYSUI_TUNER, - enabled ? PackageManager.COMPONENT_ENABLED_STATE_ENABLED - : PackageManager.COMPONENT_ENABLED_STATE_DISABLED, - PackageManager.DONT_KILL_APP); - } - private void updateUSBAudioOptions() { updateSwitchPreference(mUSBAudio, Settings.Secure.getInt(getContentResolver(), Settings.Secure.USB_AUDIO_AUTOMATIC_ROUTING_DISABLED, 0) != 0); @@ -1766,9 +1743,6 @@ public class DevelopmentSettings extends SettingsPreferenceFragment } else if (preference == mSimulateColorSpace) { writeSimulateColorSpace(newValue); return true; - } else if (preference == mTunerUiPref) { - writeTweakUi(newValue); - return true; } return false; } diff --git a/src/com/android/settings/EncryptionInterstitial.java b/src/com/android/settings/EncryptionInterstitial.java index 73d8257..1bef99a 100644 --- a/src/com/android/settings/EncryptionInterstitial.java +++ b/src/com/android/settings/EncryptionInterstitial.java @@ -87,8 +87,12 @@ public class EncryptionInterstitial extends SettingsActivity { @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { - final int layoutId = R.layout.encryption_interstitial; - View view = inflater.inflate(layoutId, container, false); + return inflater.inflate(R.layout.encryption_interstitial, container, false); + } + + @Override + public void onViewCreated(View view, Bundle savedInstanceState) { + super.onViewCreated(view, savedInstanceState); mRequirePasswordToDecryptButton = (RadioButton) view.findViewById(R.id.encrypt_require_password); mDontRequirePasswordToDecryptButton = @@ -135,7 +139,6 @@ public class EncryptionInterstitial extends SettingsActivity { setRequirePasswordState(getActivity().getIntent().getBooleanExtra( EXTRA_REQUIRE_PASSWORD, true)); - return view; } @Override diff --git a/src/com/android/settings/SecuritySettings.java b/src/com/android/settings/SecuritySettings.java index bf091f6..6e679b6 100644 --- a/src/com/android/settings/SecuritySettings.java +++ b/src/com/android/settings/SecuritySettings.java @@ -791,6 +791,16 @@ public class SecuritySettings extends SettingsPreferenceFragment result.add(data); } + // Fingerprint + FingerprintManager fpm = + (FingerprintManager) context.getSystemService(Context.FINGERPRINT_SERVICE); + if (fpm.isHardwareDetected()) { + data = new SearchIndexableRaw(context); + data.title = res.getString(R.string.security_settings_fingerprint_preference_title); + data.screenTitle = screenTitle; + result.add(data); + } + // Credential storage final UserManager um = (UserManager) context.getSystemService(Context.USER_SERVICE); diff --git a/src/com/android/settings/SetupEncryptionInterstitial.java b/src/com/android/settings/SetupEncryptionInterstitial.java index 4605ca1..27d7e0c 100644 --- a/src/com/android/settings/SetupEncryptionInterstitial.java +++ b/src/com/android/settings/SetupEncryptionInterstitial.java @@ -72,22 +72,24 @@ public class SetupEncryptionInterstitial extends EncryptionInterstitial { @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { - final SetupWizardLayout layout = new SetupWizardLayout(inflater.getContext()); - layout.setIllustration(R.drawable.setup_illustration_lock_screen, - R.drawable.setup_illustration_horizontal_tile); - layout.setBackgroundTile(R.drawable.setup_illustration_tile); - layout.setHeaderText(R.string.encryption_interstitial_header); + return inflater.inflate(R.layout.setup_encryption_interstitial, container, false); + } + + @Override + public void onViewCreated(View view, Bundle savedInstanceState) { + super.onViewCreated(view, savedInstanceState); + + final SetupWizardLayout layout = + (SetupWizardLayout) view.findViewById(R.id.setup_wizard_layout); - View content = super.onCreateView(inflater, layout, savedInstanceState); - layout.addView(content); - layout.getNavigationBar().setNavigationBarListener(this); + final NavigationBar navigationBar = layout.getNavigationBar(); + navigationBar.setNavigationBarListener(this); Activity activity = getActivity(); if (activity != null) { activity.setTitle(R.string.encryption_interstitial_header); SetupWizardUtils.setImmersiveMode(activity); } - return layout; } @Override diff --git a/src/com/android/settings/WirelessSettings.java b/src/com/android/settings/WirelessSettings.java index 32d50bf..8cc98cc 100644 --- a/src/com/android/settings/WirelessSettings.java +++ b/src/com/android/settings/WirelessSettings.java @@ -237,11 +237,7 @@ public class WirelessSettings extends SettingsPreferenceFragment implements Inde mAirplaneModeEnabler = new AirplaneModeEnabler(activity, mAirplaneModePreference); mNfcEnabler = new NfcEnabler(activity, nfc, androidBeam); - if (ImsManager.isWfcEnabledByPlatform(activity)) { - mButtonWfc = (PreferenceScreen) findPreference(KEY_WFC_SETTINGS); - } else { - removePreference(KEY_WFC_SETTINGS); - } + mButtonWfc = (PreferenceScreen) findPreference(KEY_WFC_SETTINGS); // Remove NSD checkbox by default getPreferenceScreen().removePreference(nsd); @@ -373,10 +369,15 @@ public class WirelessSettings extends SettingsPreferenceFragment implements Inde mNsdEnabler.resume(); } + // update WFC setting final Context context = getActivity(); if (ImsManager.isWfcEnabledByPlatform(context)) { + getPreferenceScreen().addPreference(mButtonWfc); + mButtonWfc.setSummary(WifiCallingSettings.getWfcModeSummary( context, ImsManager.getWfcMode(context))); + } else { + removePreference(KEY_WFC_SETTINGS); } } diff --git a/src/com/android/settings/applications/AppStateWriteSettingsBridge.java b/src/com/android/settings/applications/AppStateWriteSettingsBridge.java index 4ab737f..e43b5f5 100644 --- a/src/com/android/settings/applications/AppStateWriteSettingsBridge.java +++ b/src/com/android/settings/applications/AppStateWriteSettingsBridge.java @@ -60,15 +60,12 @@ public class AppStateWriteSettingsBridge extends AppStateAppOpsBridge { return super.getNumPackagesAllowedByAppOps(); } - public static class WriteSettingsState { - PermissionState mPermissionState; - + public static class WriteSettingsState extends AppStateAppOpsBridge.PermissionState { public WriteSettingsState(PermissionState permissionState) { - mPermissionState = permissionState; - } - - public boolean canWrite() { - return mPermissionState.isPermissible(); + super(permissionState.packageName, permissionState.userHandle); + this.packageInfo = permissionState.packageInfo; + this.appOpMode = permissionState.appOpMode; + this.permissionDeclared = permissionState.permissionDeclared; } } diff --git a/src/com/android/settings/applications/ManageApplications.java b/src/com/android/settings/applications/ManageApplications.java index 3820123..ce2dbe0 100644 --- a/src/com/android/settings/applications/ManageApplications.java +++ b/src/com/android/settings/applications/ManageApplications.java @@ -152,8 +152,10 @@ public class ManageApplications extends InstrumentedFragment // This is the actual mapping to filters from FILTER_ constants above, the order must // be kept in sync. public static final AppFilter[] FILTERS = new AppFilter[] { - AppStatePowerBridge.FILTER_POWER_WHITELISTED, // High power whitelist, on - ApplicationsState.FILTER_PERSONAL, // All apps label, but personal filter + new CompoundFilter(AppStatePowerBridge.FILTER_POWER_WHITELISTED, + ApplicationsState.FILTER_ALL_ENABLED), // High power whitelist, on + new CompoundFilter(ApplicationsState.FILTER_PERSONAL, + ApplicationsState.FILTER_ALL_ENABLED), // All apps label, but personal filter ApplicationsState.FILTER_EVERYTHING, // All apps ApplicationsState.FILTER_ALL_ENABLED, // Enabled ApplicationsState.FILTER_DISABLED, // Disabled @@ -617,6 +619,9 @@ public class ManageApplications extends InstrumentedFragment } public void setHasDisabled(boolean hasDisabledApps) { + if (mListType == LIST_TYPE_HIGH_POWER) { + return; + } mFilterAdapter.setFilterEnabled(FILTER_APPS_ENABLED, hasDisabledApps); mFilterAdapter.setFilterEnabled(FILTER_APPS_DISABLED, hasDisabledApps); } diff --git a/src/com/android/settings/applications/WriteSettingsDetails.java b/src/com/android/settings/applications/WriteSettingsDetails.java index eeee90c..30533c6 100644 --- a/src/com/android/settings/applications/WriteSettingsDetails.java +++ b/src/com/android/settings/applications/WriteSettingsDetails.java @@ -23,7 +23,6 @@ import android.content.Context; import android.content.Intent; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; -import android.content.pm.ResolveInfo; import android.os.Bundle; import android.os.UserHandle; import android.preference.Preference; @@ -36,6 +35,7 @@ import android.util.Log; import com.android.internal.logging.MetricsLogger; import com.android.settings.InstrumentedFragment; import com.android.settings.R; +import com.android.settings.applications.AppStateAppOpsBridge.PermissionState; import com.android.settings.applications.AppStateWriteSettingsBridge.WriteSettingsState; import com.android.settingslib.applications.ApplicationsState; import com.android.settingslib.applications.ApplicationsState.AppEntry; @@ -98,7 +98,7 @@ public class WriteSettingsDetails extends AppInfoWithHeader implements OnPrefere try { getActivity().startActivityAsUser(mSettingsIntent, new UserHandle(mUserId)); } catch (ActivityNotFoundException e) { - Log.w(TAG, "Unable to launch write system settings " + mSettingsIntent, e); + Log.w(LOG_TAG, "Unable to launch write system settings " + mSettingsIntent, e); } } return true; @@ -109,8 +109,9 @@ public class WriteSettingsDetails extends AppInfoWithHeader implements OnPrefere @Override public boolean onPreferenceChange(Preference preference, Object newValue) { if (preference == mSwitchPref) { - if (mWriteSettingsState != null && (Boolean) newValue != mWriteSettingsState.canWrite()) { - setCanWriteSettings(!mWriteSettingsState.canWrite()); + if (mWriteSettingsState != null && (Boolean) newValue != mWriteSettingsState + .isPermissible()) { + setCanWriteSettings(!mWriteSettingsState.isPermissible()); refreshUi(); } return true; @@ -122,7 +123,6 @@ public class WriteSettingsDetails extends AppInfoWithHeader implements OnPrefere mAppOpsManager.setMode(AppOpsManager.OP_WRITE_SETTINGS, mPackageInfo.applicationInfo.uid, mPackageName, newState ? AppOpsManager.MODE_ALLOWED : AppOpsManager.MODE_ERRORED); - canWriteSettings(mPackageName); } private boolean canWriteSettings(String pkgName) { @@ -140,17 +140,10 @@ public class WriteSettingsDetails extends AppInfoWithHeader implements OnPrefere mWriteSettingsState = mAppBridge.getWriteSettingsInfo(mPackageName, mPackageInfo.applicationInfo.uid); - boolean canWrite = mWriteSettingsState.canWrite(); + boolean canWrite = mWriteSettingsState.isPermissible(); mSwitchPref.setChecked(canWrite); mWriteSettingsPrefs.setEnabled(canWrite); - - ResolveInfo resolveInfo = mPm.resolveActivityAsUser(mSettingsIntent, - PackageManager.GET_META_DATA, mUserId); - if (resolveInfo == null) { - if (findPreference(KEY_APP_OPS_SETTINGS_PREFS) != null) { - getPreferenceScreen().removePreference(mWriteSettingsPrefs); - } - } + getPreferenceScreen().removePreference(mWriteSettingsPrefs); return true; } @@ -166,9 +159,20 @@ public class WriteSettingsDetails extends AppInfoWithHeader implements OnPrefere } public static CharSequence getSummary(Context context, AppEntry entry) { + if (entry.extraInfo != null) { + return getSummary(context, new WriteSettingsState((PermissionState)entry + .extraInfo)); + } + + // fallback if entry.extrainfo is null - although this should not happen return getSummary(context, entry.info.packageName); } + public static CharSequence getSummary(Context context, WriteSettingsState writeSettingsState) { + return context.getString(writeSettingsState.isPermissible() ? R.string.write_settings_on : + R.string.write_settings_off); + } + public static CharSequence getSummary(Context context, String pkg) { // first check if pkg is a system pkg boolean isSystem = false; @@ -180,8 +184,8 @@ public class WriteSettingsDetails extends AppInfoWithHeader implements OnPrefere } } catch (PackageManager.NameNotFoundException e) { // pkg doesn't even exist? - Log.w(TAG, "Package " + pkg + " not found", e); - return context.getString(R.string.system_alert_window_off); + Log.w(LOG_TAG, "Package " + pkg + " not found", e); + return context.getString(R.string.write_settings_off); } AppOpsManager appOpsManager = (AppOpsManager) context.getSystemService(Context @@ -189,7 +193,7 @@ public class WriteSettingsDetails extends AppInfoWithHeader implements OnPrefere List<AppOpsManager.PackageOps> packageOps = appOpsManager.getPackagesForOps( APP_OPS_OP_CODE); if (packageOps == null) { - return context.getString(R.string.system_alert_window_off); + return context.getString(R.string.write_settings_off); } int uid = isSystem ? 0 : -1; @@ -201,7 +205,7 @@ public class WriteSettingsDetails extends AppInfoWithHeader implements OnPrefere } if (uid == -1) { - return context.getString(R.string.system_alert_window_off); + return context.getString(R.string.write_settings_off); } int mode = appOpsManager.noteOpNoThrow(AppOpsManager.OP_WRITE_SETTINGS, uid, pkg); diff --git a/src/com/android/settings/deviceinfo/PublicVolumeSettings.java b/src/com/android/settings/deviceinfo/PublicVolumeSettings.java index 4c77d21..c9b4beb 100644 --- a/src/com/android/settings/deviceinfo/PublicVolumeSettings.java +++ b/src/com/android/settings/deviceinfo/PublicVolumeSettings.java @@ -16,6 +16,7 @@ package com.android.settings.deviceinfo; +import android.app.ActivityManager; import android.content.Context; import android.content.Intent; import android.net.Uri; @@ -81,7 +82,8 @@ public class PublicVolumeSettings extends SettingsPreferenceFragment { final Context context = getActivity(); - mIsPermittedToAdopt = UserManager.get(context).isAdminUser(); + mIsPermittedToAdopt = UserManager.get(context).isAdminUser() + && !ActivityManager.isUserAMonkey(); mStorageManager = context.getSystemService(StorageManager.class); diff --git a/src/com/android/settings/deviceinfo/StorageWizardInit.java b/src/com/android/settings/deviceinfo/StorageWizardInit.java index 284e67d..c3c2430 100644 --- a/src/com/android/settings/deviceinfo/StorageWizardInit.java +++ b/src/com/android/settings/deviceinfo/StorageWizardInit.java @@ -16,6 +16,7 @@ package com.android.settings.deviceinfo; +import android.app.ActivityManager; import android.content.Intent; import android.os.Bundle; import android.os.UserManager; @@ -42,7 +43,8 @@ public class StorageWizardInit extends StorageWizardBase { } setContentView(R.layout.storage_wizard_init); - mIsPermittedToAdopt = UserManager.get(this).isAdminUser(); + mIsPermittedToAdopt = UserManager.get(this).isAdminUser() + && !ActivityManager.isUserAMonkey(); setIllustrationInternal(true); setHeaderText(R.string.storage_wizard_init_title, mDisk.getDescription()); diff --git a/src/com/android/settings/fingerprint/FingerprintEnrollEnrolling.java b/src/com/android/settings/fingerprint/FingerprintEnrollEnrolling.java index b8ac040..5d4edbd 100644 --- a/src/com/android/settings/fingerprint/FingerprintEnrollEnrolling.java +++ b/src/com/android/settings/fingerprint/FingerprintEnrollEnrolling.java @@ -214,9 +214,9 @@ public class FingerprintEnrollEnrolling extends FingerprintEnrollBase private void launchFinish(byte[] token) { Intent intent = getFinishIntent(); + intent.addFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT); intent.putExtra(ChooseLockSettingsHelper.EXTRA_KEY_CHALLENGE_TOKEN, token); startActivity(intent); - setResult(RESULT_FINISHED); finish(); } diff --git a/src/com/android/settings/fingerprint/FingerprintEnrollFindSensor.java b/src/com/android/settings/fingerprint/FingerprintEnrollFindSensor.java index 552ed71..1d9d1c5 100644 --- a/src/com/android/settings/fingerprint/FingerprintEnrollFindSensor.java +++ b/src/com/android/settings/fingerprint/FingerprintEnrollFindSensor.java @@ -16,6 +16,7 @@ package com.android.settings.fingerprint; +import android.content.Context; import android.content.Intent; import android.hardware.fingerprint.FingerprintManager; import android.os.Bundle; @@ -75,6 +76,14 @@ public class FingerprintEnrollFindSensor extends FingerprintEnrollBase { if (resultCode == RESULT_FINISHED) { setResult(RESULT_FINISHED); finish(); + } else { + FingerprintManager fpm = getSystemService(FingerprintManager.class); + int enrolled = fpm.getEnrolledFingerprints().size(); + int max = getResources().getInteger( + com.android.internal.R.integer.config_fingerprintMaxTemplatesPerUser); + if (enrolled >= max) { + finish(); + } } } else { super.onActivityResult(requestCode, resultCode, data); diff --git a/src/com/android/settings/fingerprint/FingerprintEnrollFinish.java b/src/com/android/settings/fingerprint/FingerprintEnrollFinish.java index 7e4d656..7ce340d 100644 --- a/src/com/android/settings/fingerprint/FingerprintEnrollFinish.java +++ b/src/com/android/settings/fingerprint/FingerprintEnrollFinish.java @@ -55,6 +55,7 @@ public class FingerprintEnrollFinish extends FingerprintEnrollBase { @Override protected void onNextButtonClick() { + setResult(RESULT_FINISHED); finish(); } diff --git a/src/com/android/settings/fingerprint/FingerprintSettings.java b/src/com/android/settings/fingerprint/FingerprintSettings.java index 89c6e1b..f065bff 100644 --- a/src/com/android/settings/fingerprint/FingerprintSettings.java +++ b/src/com/android/settings/fingerprint/FingerprintSettings.java @@ -104,7 +104,7 @@ public class FingerprintSettings extends SubSettings { } public static class FingerprintSettingsFragment extends SettingsPreferenceFragment - implements OnPreferenceChangeListener, Indexable { + implements OnPreferenceChangeListener { private static final int MAX_RETRY_ATTEMPTS = 20; private static final int RESET_HIGHLIGHT_DELAY_MS = 500; |