network: fix binder object leakage in settings
Summary: When BT ON and enter into NetworkDashboardFragment, and turning BT OFF and exiting the fragment, the `BluetoothAdapter.closeProfileProxy(BluetoothProfile.PAN)` will not be called. This causes binder leakage on next time the NetworkDashboardFragment is entered, until killing Settings process. Reproduce Steps: 1. Turn BT ON 2. Open Settings process 3. Enter "Network & internet" (NetworkDashboardFragment) 4. Turn BT OFF 5. Back to previous page (do not kill Settings process) * Repeat Step 3-5 Solution: Do not set value of `mBluetoothPan` to null when `onServiceDisconnected` raised, to ensure the binder object (profile proxy) be closed in lifecycle `onDestroy()`. Bug: 243128377 Test: enter "Network & internet" page, turn off BT and leave the page Change-Id: Ieca3e5401c23d1b0ffece1bbb0db96988044262d
Loading
Please register or sign in to comment