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

Commit b15a2645 authored by Ajay Panicker's avatar Ajay Panicker Committed by Android (Google) Code Review
Browse files

Merge "Limit btsnoop file size (2/9)" into oc-dev

parents bd1e40a4 2f3ccd29
Loading
Loading
Loading
Loading
+0 −12
Original line number Diff line number Diff line
@@ -1147,17 +1147,6 @@ static int createSocketChannelNative(JNIEnv* env, jobject object, jint type,
  return socket_fd;
}

static jboolean configHciSnoopLogNative(JNIEnv* env, jobject obj,
                                        jboolean enable) {
  ALOGV("%s", __func__);

  if (!sBluetoothInterface) return JNI_FALSE;

  int ret = sBluetoothInterface->config_hci_snoop_log(enable);

  return (ret == BT_STATUS_SUCCESS) ? JNI_TRUE : JNI_FALSE;
}

static int readEnergyInfo() {
  ALOGV("%s", __func__);

@@ -1250,7 +1239,6 @@ static JNINativeMethod sMethods[] = {
    {"connectSocketNative", "([BI[BIII)I", (void*)connectSocketNative},
    {"createSocketChannelNative", "(ILjava/lang/String;[BIII)I",
     (void*)createSocketChannelNative},
    {"configHciSnoopLogNative", "(Z)Z", (void*)configHciSnoopLogNative},
    {"alarmFiredNative", "()V", (void*)alarmFiredNative},
    {"readEnergyInfo", "()I", (void*)readEnergyInfo},
    {"dumpNative", "(Ljava/io/FileDescriptor;[Ljava/lang/String;)V",
+0 −18
Original line number Diff line number Diff line
@@ -1281,18 +1281,6 @@ public class AdapterService extends Service {
            return service.sdpSearch(device,uuid);
        }

        public boolean configHciSnoopLog(boolean enable) {
            if (Binder.getCallingUid() != Process.SYSTEM_UID) {
                EventLog.writeEvent(0x534e4554 /* SNET */, "Bluetooth", Binder.getCallingUid(),
                        "configHciSnoopLog() - Not allowed for non-active user b/18643224");
                return false;
            }

            AdapterService service = getService();
            if (service == null) return false;
            return service.configHciSnoopLog(enable);
        }

        public boolean factoryReset() {
            AdapterService service = getService();
            if (service == null) return false;
@@ -1857,11 +1845,6 @@ public class AdapterService extends Service {
        return ParcelFileDescriptor.adoptFd(fd);
    }

    boolean configHciSnoopLog(boolean enable) {
        enforceCallingOrSelfPermission(BLUETOOTH_PERM, "Need BLUETOOTH permission");
        return configHciSnoopLogNative(enable);
    }

    boolean factoryReset() {
        enforceCallingOrSelfPermission(BLUETOOTH_PRIVILEGED, "Need BLUETOOTH permission");
        return factoryResetNative();
@@ -2288,7 +2271,6 @@ public class AdapterService extends Service {
    private native int createSocketChannelNative(
            int type, String serviceName, byte[] uuid, int port, int flag, int callingUid);

    /*package*/ native boolean configHciSnoopLogNative(boolean enable);
    /*package*/ native boolean factoryResetNative();

    private native void alarmFiredNative();