From 568d9336babe36c13cc657a45ede76d4d06e3985 Mon Sep 17 00:00:00 2001 From: Ajay Panicker Date: Wed, 29 Jul 2015 11:39:16 -0700 Subject: [PATCH] Implement Bluetooth settings factory reset (5/5) Implemented the factory reset function to be used to reset all bluetooth settings on device to factory default Bug: 16161518 Change-Id: Ie5404a4547fcf747a0bb51d515e0c97628416f4b --- src/com/android/settings/ResetNetworkConfirm.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/com/android/settings/ResetNetworkConfirm.java b/src/com/android/settings/ResetNetworkConfirm.java index 7762b899530..db4b9a5ff4e 100644 --- a/src/com/android/settings/ResetNetworkConfirm.java +++ b/src/com/android/settings/ResetNetworkConfirm.java @@ -18,6 +18,7 @@ package com.android.settings; import android.app.Fragment; import android.content.Context; +import android.bluetooth.BluetoothManager; import android.net.ConnectivityManager; import android.net.NetworkPolicyManager; import android.net.wifi.WifiManager; @@ -93,6 +94,12 @@ public class ResetNetworkConfirm extends InstrumentedFragment { policyManager.factoryReset(subscriberId); } + BluetoothManager btManager = (BluetoothManager) + context.getSystemService(Context.BLUETOOTH_SERVICE); + if (btManager != null) { + btManager.getAdapter().factoryReset(); + } + Toast.makeText(context, R.string.reset_network_complete_toast, Toast.LENGTH_SHORT) .show(); }