diff --git a/res/layout/locale_drag_cell.xml b/res/layout/locale_drag_cell.xml index 247cfd22591..f5a280b82b9 100644 --- a/res/layout/locale_drag_cell.xml +++ b/res/layout/locale_drag_cell.xml @@ -15,21 +15,24 @@ --> + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:minHeight="?android:listPreferredItemHeight" + android:background="?android:colorBackground" + android:layout_marginTop="12dp" + android:layout_marginBottom="12dp" + android:layoutDirection="locale" + android:textDirection="locale"> + android:layout_toStartOf="@+id/dragHandle" + android:layout_alignTop="@+id/miniLabel" + android:layout_alignBottom="@+id/miniLabel" /> + android:layout_centerVertical="true"/> - - + + - + - + - + + + android:layout_centerVertical="true"/> - - - + \ No newline at end of file diff --git a/res/values/strings.xml b/res/values/strings.xml index 11eaac18f01..8d921f9c7b0 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -370,7 +370,7 @@ To select a language for each app, go to app language settings. - Learn more about languages + Learn more about app languages https://support.google.com/android?p=per_language_app_settings @@ -7611,8 +7611,8 @@ Skip lock screen - - After unlocking, go directly to last used screen + + After unlocking, go directly to last used screen. Notifications won’t show on lock screen. Swipe down from top to see them. Lock screen, Lockscreen, Skip, Bypass diff --git a/src/com/android/settings/applications/AppStoreUtil.java b/src/com/android/settings/applications/AppStoreUtil.java index b18a68fd7db..b73b14ae709 100644 --- a/src/com/android/settings/applications/AppStoreUtil.java +++ b/src/com/android/settings/applications/AppStoreUtil.java @@ -53,7 +53,8 @@ public class AppStoreUtil { // so we choose to ignore this when supplied by a non-system app. String originatingPackageName = source.getOriginatingPackageName(); String initiatingPackageName = source.getInitiatingPackageName(); - if (originatingPackageName != null && initiatingPackageName != null) { + if (originatingPackageName != null && initiatingPackageName != null + && !initiatingPackageName.equals("com.android.shell")) { ApplicationInfo ai = context.getPackageManager().getApplicationInfo( initiatingPackageName, 0); if ((ai.flags & ApplicationInfo.FLAG_SYSTEM) != 0) { diff --git a/src/com/android/settings/bluetooth/BluetoothDetailsProfilesController.java b/src/com/android/settings/bluetooth/BluetoothDetailsProfilesController.java index a86b7589191..e2045f80c27 100644 --- a/src/com/android/settings/bluetooth/BluetoothDetailsProfilesController.java +++ b/src/com/android/settings/bluetooth/BluetoothDetailsProfilesController.java @@ -20,6 +20,7 @@ import android.bluetooth.BluetoothCsipSetCoordinator; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothProfile; import android.content.Context; +import android.os.SystemProperties; import android.provider.DeviceConfig; import android.text.TextUtils; import android.util.Log; @@ -66,6 +67,9 @@ public class BluetoothDetailsProfilesController extends BluetoothDetailsControll @VisibleForTesting static final String HIGH_QUALITY_AUDIO_PREF_TAG = "A2dpProfileHighQualityAudio"; + private static final String ENABLE_DUAL_MODE_AUDIO = + "persist.bluetooth.enable_dual_mode_audio"; + private LocalBluetoothManager mManager; private LocalBluetoothProfileManager mProfileManager; private CachedBluetoothDevice mCachedDevice; @@ -118,40 +122,17 @@ public class BluetoothDetailsProfilesController extends BluetoothDetailsControll /** * Refreshes the state for an existing SwitchPreference for a profile. - * If the LeAudio profile is enabled on the LeAudio devices, then the SwitchPreferences of - * A2dp profile and Headset profile are graied out. */ private void refreshProfilePreference(SwitchPreference profilePref, LocalBluetoothProfile profile) { BluetoothDevice device = mCachedDevice.getDevice(); boolean isLeAudioEnabled = isLeAudioEnabled(); - if (profile instanceof A2dpProfile - || profile instanceof HeadsetProfile) { - if (isLeAudioEnabled) { - // If the LeAudio profile is enabled on the LeAudio devices, then the - // SwitchPreferences of A2dp profile and Headset profile are grayed out. - Log.d(TAG, "LE is enabled, gray out " + profile.toString()); - profilePref.setEnabled(false); - } else { - List deviceList = mProfileDeviceMap.get( - profile.toString()); - boolean isBusy = deviceList != null - && deviceList.stream().anyMatch(item -> item.isBusy()); - profilePref.setEnabled(!isBusy); - } - } else if (profile instanceof LeAudioProfile) { - List leAudioDeviceList = mProfileDeviceMap.get( + if (profile instanceof A2dpProfile || profile instanceof HeadsetProfile + || profile instanceof LeAudioProfile) { + List deviceList = mProfileDeviceMap.get( profile.toString()); - boolean isBusy = leAudioDeviceList != null - && leAudioDeviceList.stream().anyMatch(item -> item.isBusy()); - if (isLeAudioEnabled && !isBusy) { - LocalBluetoothProfile a2dp = mProfileManager.getA2dpProfile(); - LocalBluetoothProfile headset = mProfileManager.getHeadsetProfile(); - // If the LeAudio profile is enabled on the LeAudio devices, then the - // SwitchPreferences of A2dp profile and Headset profile are graied out. - grayOutPreferenceWhenLeAudioIsEnabled(a2dp); - grayOutPreferenceWhenLeAudioIsEnabled(headset); - } + boolean isBusy = deviceList != null + && deviceList.stream().anyMatch(item -> item.isBusy()); profilePref.setEnabled(!isBusy); } else if (profile instanceof PbapServerProfile && isLeAudioEnabled @@ -183,7 +164,7 @@ public class BluetoothDetailsProfilesController extends BluetoothDetailsControll highQualityPref.setVisible(true); highQualityPref.setTitle(a2dp.getHighQualityAudioOptionLabel(device)); highQualityPref.setChecked(a2dp.isHighQualityAudioEnabled(device)); - highQualityPref.setEnabled(!mCachedDevice.isBusy() && !isLeAudioEnabled); + highQualityPref.setEnabled(!mCachedDevice.isBusy()); } else { highQualityPref.setVisible(false); } @@ -205,16 +186,6 @@ public class BluetoothDetailsProfilesController extends BluetoothDetailsControll return false; } - private void grayOutPreferenceWhenLeAudioIsEnabled(LocalBluetoothProfile profile) { - if (profile != null) { - SwitchPreference pref = mProfilesContainer.findPreference(profile.toString()); - if (pref != null) { - Log.d(TAG, "LE is enabled, gray out " + profile.toString()); - pref.setEnabled(false); - } - } - } - /** * Helper method to enable a profile for a device. */ @@ -321,6 +292,17 @@ public class BluetoothDetailsProfilesController extends BluetoothDetailsControll if (mapPermission != BluetoothDevice.ACCESS_UNKNOWN) { result.add(mapProfile); } + + // Removes phone calls & media audio toggles for dual mode devices + boolean leAudioSupported = result.contains( + mManager.getProfileManager().getLeAudioProfile()); + boolean classicAudioSupported = result.contains( + mManager.getProfileManager().getA2dpProfile()) || result.contains( + mManager.getProfileManager().getHeadsetProfile()); + if (leAudioSupported && classicAudioSupported) { + result.remove(mManager.getProfileManager().getA2dpProfile()); + result.remove(mManager.getProfileManager().getHeadsetProfile()); + } Log.d(TAG, "getProfiles:result:" + result); return result; } @@ -340,10 +322,7 @@ public class BluetoothDetailsProfilesController extends BluetoothDetailsControll } /** - * When user disable the Le Audio profile, the system needs to do two things. - * 1) Disable the Le Audio profile, VCP and CSIP for each of the Le Audio devices. - * 2) Enable the A2dp profile and Headset profile for the associated device. The system - * can't enable the A2dp profile and Headset profile if the Le Audio profile is enabled. + * Disable the Le Audio profile, VCP, and CSIP for each of the Le Audio devices. * * @param profile the LeAudio profile */ @@ -354,8 +333,6 @@ public class BluetoothDetailsProfilesController extends BluetoothDetailsControll } LocalBluetoothProfile vcp = mProfileManager.getVolumeControlProfile(); LocalBluetoothProfile csip = mProfileManager.getCsipSetCoordinatorProfile(); - LocalBluetoothProfile a2dp = mProfileManager.getA2dpProfile(); - LocalBluetoothProfile headset = mProfileManager.getHeadsetProfile(); for (CachedBluetoothDevice leAudioDevice : mProfileDeviceMap.get(profile.toString())) { Log.d(TAG, @@ -369,15 +346,15 @@ public class BluetoothDetailsProfilesController extends BluetoothDetailsControll } } - enableProfileAfterUserDisablesLeAudio(a2dp); - enableProfileAfterUserDisablesLeAudio(headset); + if (!SystemProperties.getBoolean(ENABLE_DUAL_MODE_AUDIO, false)) { + Log.i(TAG, "Enabling classic audio profiles because dual mode is disabled"); + enableProfileAfterUserDisablesLeAudio(mProfileManager.getA2dpProfile()); + enableProfileAfterUserDisablesLeAudio(mProfileManager.getHeadsetProfile()); + } } /** - * When user enable the Le Audio profile, the system needs to do two things. - * 1) Disable the A2dp profile and Headset profile for the associated device. The system - * can't enable the Le Audio if the A2dp profile and Headset profile are enabled. - * 2) Enable the Le Audio profile, VCP and CSIP for each of the Le Audio devices. + * Enable the Le Audio profile, VCP, and CSIP for each of the Le Audio devices. * * @param profile the LeAudio profile */ @@ -386,14 +363,15 @@ public class BluetoothDetailsProfilesController extends BluetoothDetailsControll Log.e(TAG, "There is no the LE profile or no device in mProfileDeviceMap. Do nothing."); return; } - LocalBluetoothProfile a2dp = mProfileManager.getA2dpProfile(); - LocalBluetoothProfile headset = mProfileManager.getHeadsetProfile(); + + if (!SystemProperties.getBoolean(ENABLE_DUAL_MODE_AUDIO, false)) { + Log.i(TAG, "Disabling classic audio profiles because dual mode is disabled"); + disableProfileBeforeUserEnablesLeAudio(mProfileManager.getA2dpProfile()); + disableProfileBeforeUserEnablesLeAudio(mProfileManager.getHeadsetProfile()); + } + LocalBluetoothProfile vcp = mProfileManager.getVolumeControlProfile(); LocalBluetoothProfile csip = mProfileManager.getCsipSetCoordinatorProfile(); - - disableProfileBeforeUserEnablesLeAudio(a2dp); - disableProfileBeforeUserEnablesLeAudio(headset); - for (CachedBluetoothDevice leAudioDevice : mProfileDeviceMap.get(profile.toString())) { Log.d(TAG, "User enable LE device: " + leAudioDevice.getDevice().getAnonymizedAddress()); diff --git a/src/com/android/settings/localepicker/LocaleDragAndDropAdapter.java b/src/com/android/settings/localepicker/LocaleDragAndDropAdapter.java index bece4140153..958001eeea9 100644 --- a/src/com/android/settings/localepicker/LocaleDragAndDropAdapter.java +++ b/src/com/android/settings/localepicker/LocaleDragAndDropAdapter.java @@ -165,7 +165,7 @@ class LocaleDragAndDropAdapter dragCell.setLabelAndDescription(label, description); dragCell.setLocalized(feedItem.isTranslated()); - dragCell.setCurrentDefault(feedItem.getLocale().equals(Locale.getDefault())); + dragCell.setCurrentDefault(feedItem.getLocale().equals(LocalePicker.getLocales().get(0))); dragCell.setMiniLabel(mNumberFormatter.format(i + 1)); dragCell.setShowCheckbox(mRemoveMode); dragCell.setShowMiniLabel(!mRemoveMode); diff --git a/src/com/android/settings/location/LocationServicesForWork.java b/src/com/android/settings/location/LocationServicesForWork.java index 29285ad6401..f61918e8b55 100644 --- a/src/com/android/settings/location/LocationServicesForWork.java +++ b/src/com/android/settings/location/LocationServicesForWork.java @@ -21,13 +21,13 @@ import android.content.Context; import com.android.settings.R; import com.android.settings.dashboard.DashboardFragment; -import com.android.settings.search.BaseSearchIndexProvider; -import com.android.settingslib.search.SearchIndexable; /** * A page that configures the Location Services settings for work profile. + * + * Note that this page should not provide indexes because it is only used in the two tabs + * {@link ProfileSelectFragment} scenario and should not be launched independently. */ -@SearchIndexable(forTarget = SearchIndexable.ALL & ~SearchIndexable.ARC) public class LocationServicesForWork extends DashboardFragment { private static final String TAG = "LocationServicesForWork"; @@ -51,10 +51,4 @@ public class LocationServicesForWork extends DashboardFragment { super.onAttach(context); use(LocationInjectedServicesForWorkPreferenceController.class).init(this); } - - /** - * For Search. - */ - public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER = - new BaseSearchIndexProvider(R.xml.location_services_workprofile); } diff --git a/src/com/android/settings/network/telephony/MobileNetworkSettings.java b/src/com/android/settings/network/telephony/MobileNetworkSettings.java index 0f2d02bfabf..ce8305308c0 100644 --- a/src/com/android/settings/network/telephony/MobileNetworkSettings.java +++ b/src/com/android/settings/network/telephony/MobileNetworkSettings.java @@ -489,7 +489,7 @@ public class MobileNetworkSettings extends AbstractMobileNetworkSettings impleme Iterator iterator = mSubscriptionInfoMap.keySet().iterator(); while (iterator.hasNext()) { - if (iterator.next() == mSubId) { + if (iterator.next() == mSubId && getActivity() != null) { finishFragment(); return; }