Merge "Remove unecessary logs" into main
diff --git a/src/com/android/settings/bluetooth/OWNERS b/src/com/android/settings/bluetooth/OWNERS
index 0a3dec9..4edd1e4 100644
--- a/src/com/android/settings/bluetooth/OWNERS
+++ b/src/com/android/settings/bluetooth/OWNERS
@@ -1,8 +1,4 @@
# Default reviewers for this and subdirectories.
-hughchen@google.com
-timhypeng@google.com
-siyuanh@google.com
-robertluo@google.com
yiyishen@google.com
yqian@google.com
chelseahao@google.com
diff --git a/src/com/android/settings/connecteddevice/OWNERS b/src/com/android/settings/connecteddevice/OWNERS
index 5215a8f..4edd1e4 100644
--- a/src/com/android/settings/connecteddevice/OWNERS
+++ b/src/com/android/settings/connecteddevice/OWNERS
@@ -1,7 +1,4 @@
# Default reviewers for this and subdirectories.
-hughchen@google.com
-timhypeng@google.com
-robertluo@google.com
yiyishen@google.com
yqian@google.com
chelseahao@google.com
diff --git a/src/com/android/settings/datausage/DataSaverSummary.kt b/src/com/android/settings/datausage/DataSaverSummary.kt
index cdd46f2..e118bd6 100644
--- a/src/com/android/settings/datausage/DataSaverSummary.kt
+++ b/src/com/android/settings/datausage/DataSaverSummary.kt
@@ -19,6 +19,7 @@
import android.content.Context
import android.os.Bundle
import android.telephony.SubscriptionManager
+import android.view.View
import com.android.settings.R
import com.android.settings.SettingsActivity
import com.android.settings.dashboard.DashboardFragment
@@ -45,8 +46,8 @@
dataSaverBackend = DataSaverBackend(requireContext())
}
- override fun onActivityCreated(savedInstanceState: Bundle?) {
- super.onActivityCreated(savedInstanceState)
+ override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
+ super.onViewCreated(view, savedInstanceState)
switchBar = (activity as SettingsActivity).switchBar.apply {
setTitle(getString(R.string.data_saver_switch_title))
show()
diff --git a/src/com/android/settings/development/BluetoothMaxConnectedAudioDevicesPreferenceController.java b/src/com/android/settings/development/BluetoothMaxConnectedAudioDevicesPreferenceController.java
index a1467c8..467a8ca 100644
--- a/src/com/android/settings/development/BluetoothMaxConnectedAudioDevicesPreferenceController.java
+++ b/src/com/android/settings/development/BluetoothMaxConnectedAudioDevicesPreferenceController.java
@@ -45,9 +45,10 @@
super(context);
final BluetoothManager bluetoothManager = context.getSystemService(BluetoothManager.class);
-
- mDefaultMaxConnectedAudioDevices =
- bluetoothManager.getAdapter().getMaxConnectedAudioDevices();
+ if(bluetoothManager != null && bluetoothManager.getAdapter() != null) {
+ mDefaultMaxConnectedAudioDevices =
+ bluetoothManager.getAdapter().getMaxConnectedAudioDevices();
+ }
}
@Override
diff --git a/src/com/android/settings/development/OWNERS b/src/com/android/settings/development/OWNERS
index cc573ea..081c44f 100644
--- a/src/com/android/settings/development/OWNERS
+++ b/src/com/android/settings/development/OWNERS
@@ -12,3 +12,7 @@
# DesktopModePreferenceController
per-file DesktopModePreferenceController.java=file:platform/frameworks/base:/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/OWNERS
+
+# ADB
+per-file Adb*=set noparent
+per-file Adb*=file:platform/packages/modules/adb:/OWNERS
diff --git a/src/com/android/settings/sim/smartForwarding/SmartForwardingFragment.java b/src/com/android/settings/sim/smartForwarding/SmartForwardingFragment.java
index a95eb38..f847147 100644
--- a/src/com/android/settings/sim/smartForwarding/SmartForwardingFragment.java
+++ b/src/com/android/settings/sim/smartForwarding/SmartForwardingFragment.java
@@ -48,8 +48,7 @@
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
setPreferencesFromResource(R.xml.smart_forwarding_switch, rootKey);
- String title = getResources().getString(R.string.smart_forwarding_title);
- getActivity().getActionBar().setTitle(title);
+ getActivity().setTitle(R.string.smart_forwarding_title);
TwoStatePreference smartForwardingSwitch = findPreference(KEY_SMART_FORWARDING_SWITCH);
if (turnOffSwitch) {
diff --git a/src/com/android/settings/wifi/WifiConfigInfo.java b/src/com/android/settings/wifi/WifiConfigInfo.java
index 0de3063..16a4446 100644
--- a/src/com/android/settings/wifi/WifiConfigInfo.java
+++ b/src/com/android/settings/wifi/WifiConfigInfo.java
@@ -37,6 +37,7 @@
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
+ WifiUtils.setupEdgeToEdge(this);
mWifiManager = (WifiManager) getSystemService(WIFI_SERVICE);
setContentView(R.layout.wifi_config_info);
diff --git a/src/com/android/settings/wifi/WifiStatusTest.java b/src/com/android/settings/wifi/WifiStatusTest.java
index b4f3ab6..b9b1d70 100644
--- a/src/com/android/settings/wifi/WifiStatusTest.java
+++ b/src/com/android/settings/wifi/WifiStatusTest.java
@@ -115,6 +115,7 @@
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
+ WifiUtils.setupEdgeToEdge(this);
mWifiManager = (WifiManager) getSystemService(WIFI_SERVICE);
diff --git a/src/com/android/settings/wifi/WifiUtils.java b/src/com/android/settings/wifi/WifiUtils.java
index 68d8beb..e307bcf 100644
--- a/src/com/android/settings/wifi/WifiUtils.java
+++ b/src/com/android/settings/wifi/WifiUtils.java
@@ -16,6 +16,8 @@
package com.android.settings.wifi;
+import android.app.ActionBar;
+import android.app.Activity;
import android.app.admin.DevicePolicyManager;
import android.content.ComponentName;
import android.content.ContentResolver;
@@ -32,8 +34,13 @@
import android.provider.Settings;
import android.text.TextUtils;
import android.util.Log;
+import android.util.TypedValue;
+import androidx.annotation.NonNull;
import androidx.annotation.VisibleForTesting;
+import androidx.core.graphics.Insets;
+import androidx.core.view.ViewCompat;
+import androidx.core.view.WindowInsetsCompat;
import com.android.settings.R;
import com.android.settings.Utils;
@@ -308,4 +315,34 @@
public static void setCanShowWifiHotspotCached(Boolean cached) {
sCanShowWifiHotspotCached = cached;
}
+
+ /**
+ * Enable new edge to edge feature.
+ *
+ * @param activity the Activity need to setup the edge to edge feature.
+ */
+ public static void setupEdgeToEdge(@NonNull Activity activity) {
+ final ActionBar actionBar = activity.getActionBar();
+ if (actionBar == null) {
+ return;
+ }
+
+ final TypedValue typedValue = new TypedValue();
+ if (activity.getTheme().resolveAttribute(
+ com.android.internal.R.attr.actionBarSize, typedValue, true)) {
+ ViewCompat.setOnApplyWindowInsetsListener(activity.findViewById(android.R.id.content),
+ (v, windowInsets) -> {
+ Insets insets = windowInsets.getInsets(
+ WindowInsetsCompat.Type.systemBars() |
+ WindowInsetsCompat.Type.ime());
+
+ // Apply the insets paddings to the view.
+ v.setPadding(insets.left, insets.top, insets.right, insets.bottom);
+
+ // Return CONSUMED if you don't want the window insets to keep being
+ // passed down to descendant views.
+ return WindowInsetsCompat.CONSUMED;
+ });
+ }
+ }
}
diff --git a/src/com/android/settings/wifi/dpp/OWNERS b/src/com/android/settings/wifi/dpp/OWNERS
new file mode 100644
index 0000000..b61221e
--- /dev/null
+++ b/src/com/android/settings/wifi/dpp/OWNERS
@@ -0,0 +1,2 @@
+per-file AdbQrCode.java=set noparent
+per-file AdbQrCode.java=file:platform/packages/modules/adb:/OWNERS
diff --git a/tests/robotests/src/com/android/settings/testutils/shadow/ShadowCrossProfileApps.java b/tests/robotests/src/com/android/settings/testutils/shadow/ShadowCrossProfileApps.java
index 64a5f11..c52fe2f 100644
--- a/tests/robotests/src/com/android/settings/testutils/shadow/ShadowCrossProfileApps.java
+++ b/tests/robotests/src/com/android/settings/testutils/shadow/ShadowCrossProfileApps.java
@@ -19,9 +19,8 @@
import android.Manifest;
import android.content.Context;
import android.content.pm.CrossProfileApps;
-import android.content.pm.ICrossProfileApps;
-import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
+import android.content.pm.PackageInfo;
import androidx.annotation.NonNull;
@@ -35,15 +34,7 @@
@Implements(CrossProfileApps.class)
public class ShadowCrossProfileApps extends org.robolectric.shadows.ShadowCrossProfileApps {
private static final Set<String> configurableInteractAcrossProfilePackages = new HashSet<>();
- private Context mContext;
- private PackageManager mPackageManager;
- @Implementation
- protected void __constructor__(Context context, ICrossProfileApps service) {
- super.__constructor__(context, service);
- this.mContext = context;
- this.mPackageManager = context.getPackageManager();
- }
public void addCrossProfilePackage(String packageName) {
configurableInteractAcrossProfilePackages.add(packageName);
}
@@ -57,7 +48,9 @@
protected boolean canUserAttemptToConfigureInteractAcrossProfiles(@NonNull String packageName) {
PackageInfo packageInfo;
try {
- packageInfo = mPackageManager.getPackageInfo(packageName, /* flags= */ 0);
+ packageInfo = getContext().getPackageManager().getPackageInfo(
+ packageName,
+ /* flags= */ 0);
} catch (PackageManager.NameNotFoundException e) {
return false;
}
diff --git a/tests/unit/src/com/android/settings/wifi/dpp/OWNERS b/tests/unit/src/com/android/settings/wifi/dpp/OWNERS
new file mode 100644
index 0000000..84ec8a1
--- /dev/null
+++ b/tests/unit/src/com/android/settings/wifi/dpp/OWNERS
@@ -0,0 +1,2 @@
+per-file AdbQrCodeTest.java=set noparent
+per-file AdbQrCodeTest.java=file:platform/packages/modules/adb:/OWNERS