mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
chore: Unused code cleanup (#1612)
* Remove unused SoftwareUpdateService code and commented out service reg in manifest * Remove unused methods that had unnecessary version checks * Regenerate baseline to remove detekt issues that are no longer present
This commit is contained in:
parent
4242afef9c
commit
2f48e8e68a
4 changed files with 1 additions and 113 deletions
|
|
@ -23,19 +23,6 @@ import android.os.Build
|
|||
* Created by kevinh on 1/14/16.
|
||||
*/
|
||||
object BuildUtils : Logging {
|
||||
|
||||
fun is64Bit(): Boolean {
|
||||
if (Build.VERSION.SDK_INT < 21)
|
||||
return false
|
||||
else
|
||||
return Build.SUPPORTED_64_BIT_ABIS.size > 0
|
||||
}
|
||||
|
||||
fun isBuggyMoto(): Boolean {
|
||||
debug("Device type is: ${Build.DEVICE}")
|
||||
return Build.DEVICE == "osprey_u2" // Moto G
|
||||
}
|
||||
|
||||
// Are we running on the emulator?
|
||||
val isEmulator
|
||||
get() = Build.FINGERPRINT.startsWith("generic") ||
|
||||
|
|
|
|||
|
|
@ -1,77 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2025 Meshtastic LLC
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.geeksville.mesh.service
|
||||
|
||||
import android.bluetooth.BluetoothGattCharacteristic
|
||||
|
||||
/**
|
||||
* Some misformatted ESP32s have problems
|
||||
*/
|
||||
class DeviceRejectedException : BLEException("Device rejected filesize")
|
||||
|
||||
/**
|
||||
* Move this somewhere as a generic network byte order function
|
||||
*/
|
||||
fun toNetworkByteArray(value: Int, formatType: Int): ByteArray {
|
||||
|
||||
val len = when (formatType) {
|
||||
BluetoothGattCharacteristic.FORMAT_UINT8 -> 1
|
||||
BluetoothGattCharacteristic.FORMAT_UINT32 -> 4
|
||||
else -> TODO()
|
||||
}
|
||||
|
||||
val mValue = ByteArray(len)
|
||||
|
||||
when (formatType) {
|
||||
/* BluetoothGattCharacteristic.FORMAT_SINT8 -> {
|
||||
value = intToSignedBits(value, 8)
|
||||
mValue.get(offset) = (value and 0xFF).toByte()
|
||||
}
|
||||
BluetoothGattCharacteristic.FORMAT_UINT8 -> mValue.get(offset) =
|
||||
(value and 0xFF).toByte()
|
||||
BluetoothGattCharacteristic.FORMAT_SINT16 -> {
|
||||
value = intToSignedBits(value, 16)
|
||||
mValue.get(offset++) = (value and 0xFF).toByte()
|
||||
mValue.get(offset) = (value shr 8 and 0xFF).toByte()
|
||||
}
|
||||
BluetoothGattCharacteristic.FORMAT_UINT16 -> {
|
||||
mValue.get(offset++) = (value and 0xFF).toByte()
|
||||
mValue.get(offset) = (value shr 8 and 0xFF).toByte()
|
||||
}
|
||||
BluetoothGattCharacteristic.FORMAT_SINT32 -> {
|
||||
value = intToSignedBits(value, 32)
|
||||
mValue.get(offset++) = (value and 0xFF).toByte()
|
||||
mValue.get(offset++) = (value shr 8 and 0xFF).toByte()
|
||||
mValue.get(offset++) = (value shr 16 and 0xFF).toByte()
|
||||
mValue.get(offset) = (value shr 24 and 0xFF).toByte()
|
||||
} */
|
||||
BluetoothGattCharacteristic.FORMAT_UINT8 ->
|
||||
mValue[0] = (value and 0xFF).toByte()
|
||||
|
||||
BluetoothGattCharacteristic.FORMAT_UINT32 -> {
|
||||
mValue[0] = (value and 0xFF).toByte()
|
||||
mValue[1] = (value shr 8 and 0xFF).toByte()
|
||||
mValue[2] = (value shr 16 and 0xFF).toByte()
|
||||
mValue[3] = (value shr 24 and 0xFF).toByte()
|
||||
}
|
||||
else -> TODO()
|
||||
}
|
||||
return mValue
|
||||
}
|
||||
|
||||
data class UpdateFilenames(val appLoad: String?, val littlefs: String?)
|
||||
Loading…
Add table
Add a link
Reference in a new issue