Limit btsnoop file size (3/8)

Limit btsnoop file size by rotating between snoop files. The rotation occurrs
when a fixed number of packets have been logged and will start overwriting
the older file.

Bug: 35998031
Test: Enable snoop logs from developer options and let logs get large
Merged-In: I40d5da4c1b1c9b45908e5790d130f1c5e804c773
Change-Id: I40d5da4c1b1c9b45908e5790d130f1c5e804c773
This commit is contained in:
Ajay Panicker
2017-04-17 20:42:22 -07:00
parent d065cf049e
commit 731a26666d
5 changed files with 0 additions and 48 deletions

View File

@@ -1031,28 +1031,6 @@ public final class BluetoothAdapter {
return null;
}
/**
* enable or disable Bluetooth HCI snoop log.
*
* <p>Requires the {@link android.Manifest.permission#BLUETOOTH_ADMIN}
* permission
*
* @return true to indicate configure HCI log successfully, or false on
* immediate error
* @hide
*/
public boolean configHciSnoopLog(boolean enable) {
try {
mServiceLock.readLock().lock();
if (mService != null) return mService.configHciSnoopLog(enable);
} catch (RemoteException e) {
Log.e(TAG, "", e);
} finally {
mServiceLock.readLock().unlock();
}
return false;
}
/**
* Factory reset bluetooth settings.
*

View File

@@ -97,7 +97,6 @@ interface IBluetooth
ParcelFileDescriptor connectSocket(in BluetoothDevice device, int type, in ParcelUuid uuid, int port, int flag);
ParcelFileDescriptor createSocketChannel(int type, in String serviceName, in ParcelUuid uuid, int port, int flag);
boolean configHciSnoopLog(boolean enable);
boolean factoryReset();
boolean isMultiAdvertisementSupported();

View File

@@ -4719,13 +4719,6 @@ public final class Settings {
@TestApi
public static final String VOICE_INTERACTION_SERVICE = "voice_interaction_service";
/**
* bluetooth HCI snoop log configuration
* @hide
*/
public static final String BLUETOOTH_HCI_LOG =
"bluetooth_hci_log";
/**
* @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead
*/

View File

@@ -72,8 +72,6 @@ public class BluetoothInstrumentation extends Instrumentation {
getAddress();
} else if ("getBondedDevices".equals(command)) {
getBondedDevices();
} else if ("enableBtSnoop".equals(command)) {
enableBtSnoop();
} else {
finish(null);
}
@@ -116,12 +114,6 @@ public class BluetoothInstrumentation extends Instrumentation {
finish(mSuccessResult);
}
public void enableBtSnoop() {
Assert.assertTrue("failed to enable snoop log",
getBluetoothAdapter().configHciSnoopLog(true));
finish(mSuccessResult);
}
public void finish(Bundle result) {
if (result == null) {
result = new Bundle();

View File

@@ -1496,16 +1496,6 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
if (mGetNameAddressOnly) return;
}
try {
boolean enableHciSnoopLog = (Settings.Secure.getInt(mContentResolver,
Settings.Secure.BLUETOOTH_HCI_LOG, 0) == 1);
if (!mBluetooth.configHciSnoopLog(enableHciSnoopLog)) {
Slog.e(TAG,"IBluetooth.configHciSnoopLog return false");
}
} catch (RemoteException e) {
Slog.e(TAG,"Unable to call configHciSnoopLog", e);
}
//Register callback object
try {
mBluetooth.registerCallback(mBluetoothCallback);