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

Commit 1f424c35 authored by Hyundo Moon's avatar Hyundo Moon Committed by Gerrit Code Review
Browse files

Merge "Bluetooth: Add edge-to-edge enforcement" into main

parents 9a286aed 26320ba6
Loading
Loading
Loading
Loading
+20 −2
Original line number Diff line number Diff line
@@ -54,6 +54,10 @@ import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;

import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

import com.android.bluetooth.BluetoothMethodProxy;
import com.android.bluetooth.BluetoothStatsLog;
import com.android.bluetooth.R;
@@ -88,8 +92,22 @@ public class BluetoothOppTransferHistory extends Activity
    public void onCreate(Bundle icicle) {
        super.onCreate(icicle);

        if (Flags.oppSetInsetsForEdgeToEdge()) {
            ViewCompat.setOnApplyWindowInsetsListener(
                    findViewById(android.R.id.content),
                    (v, windowInsets) -> {
                        Insets insets =
                                windowInsets.getInsets(
                                        WindowInsetsCompat.Type.systemBars()
                                                | WindowInsetsCompat.Type.ime()
                                                | WindowInsetsCompat.Type.displayCutout());
                        v.setPadding(insets.left, insets.top, insets.right, insets.bottom);
                        return WindowInsetsCompat.CONSUMED;
                    });
        } else {
            // TODO(b/309578419): Make this activity handle insets properly and then remove this.
            getTheme().applyStyle(R.style.OptOutEdgeToEdgeEnforcement, /* force */ false);
        }

        setContentView(R.layout.bluetooth_transfers_page);
        mListView = (ListView) findViewById(R.id.list);