Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
nisrulz committed Mar 21, 2021
1 parent 64facc8 commit 86a42a1
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -366,17 +366,6 @@ public void onSuccess(final String adIdentifier, final boolean adDonotTrack) {
deviceDataMap.put("Battery voltage",
easyBatteryMod.getBatteryVoltage() + " mV");

@BatteryHealth final int batteryHealth = easyBatteryMod.getBatteryHealth();
switch (batteryHealth) {
case BatteryHealth.GOOD:
deviceDataMap.put("Battery health", "Good");
break;
case BatteryHealth.HAVING_ISSUES:
default:
deviceDataMap.put("Battery health", "Having issues");
break;
}

@ChargingVia final int isChargingVia = easyBatteryMod.getChargingSource();
switch (isChargingVia) {
case ChargingVia.AC:
Expand All @@ -394,6 +383,17 @@ public void onSuccess(final String adIdentifier, final boolean adDonotTrack) {
break;
}

@BatteryHealth final int batteryHealth = easyBatteryMod.getBatteryHealth();
switch (batteryHealth) {
case BatteryHealth.GOOD:
deviceDataMap.put("Battery health", "Good");
break;
case BatteryHealth.HAVING_ISSUES:
default:
deviceDataMap.put("Battery health", "Having issues");
break;
}

//Bluetooth Mod
final EasyBluetoothMod easyBluetoothMod = new EasyBluetoothMod(this);
deviceDataMap.put("BT MAC Address", easyBluetoothMod.getBluetoothMAC());
Expand Down
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ allprojects {
google()
mavenCentral()

// Required by Lint (com.android.tools.lint:lint-gradle:27.1.3)
jcenter() {
content {
// This is an AGP issue. Its been fixed in Canary version. Ideally it would be backported
Expand Down
11 changes: 0 additions & 11 deletions configs/common.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,6 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

lintOptions {
textOutput "stdout"
textReport true
checkAllWarnings true
warningsAsErrors true
showAll true
explainIssues true
abortOnError false
lintConfig file("$projectDir/lint.xml")
}
}

dependencies {
Expand Down
2 changes: 1 addition & 1 deletion easydeviceinfo-ads/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ ext.setupModuleNamesForPublishing(ModuleName.ads, ModuleDesc.ads)
dependencies {
implementation Dependencies.adIdentifier

// Including the sub-module as Jcenter dependency
// Including the sub-module as remote maven dependency
// api "com.github.nisrulz:easydeviceinfo-common:$Versions.libraryName"

// Including the sub-module as module dependency
Expand Down
2 changes: 1 addition & 1 deletion easydeviceinfo-base/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ext.setupModuleNamesForPublishing(ModuleName.base, ModuleDesc.base)
dependencies {
implementation Dependencies.annotation

// Including the sub-module as Jcenter dependency
// Including the sub-module as remote maven dependency
// api "com.github.nisrulz:easydeviceinfo-common:$Versions.libraryName"

// Including the sub-module as module dependency
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,18 +117,22 @@ public final int getBatteryVoltage() {
@ChargingVia
public final int getChargingSource() {
final Intent batteryStatus = this.getBatteryStatusIntent();
int result = ChargingVia.UNKNOWN_SOURCE;
final int chargePlug = batteryStatus.getIntExtra(BatteryManager.EXTRA_PLUGGED, 0);

switch (chargePlug) {
case BatteryManager.BATTERY_PLUGGED_AC:
return ChargingVia.AC;
result = ChargingVia.AC;
break;
case BatteryManager.BATTERY_PLUGGED_USB:
return ChargingVia.USB;
result = ChargingVia.USB;
break;
case BatteryManager.BATTERY_PLUGGED_WIRELESS:
return ChargingVia.WIRELESS;
default:
return ChargingVia.UNKNOWN_SOURCE;
result = ChargingVia.WIRELESS;
break;
}

return result;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion easydeviceinfo-ktx/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ext.setupModuleNamesForPublishing(ModuleName.ktx, ModuleDesc.ktx)
dependencies {
implementation Dependencies.kotlinStdLib

// Including the sub-module as Jcenter dependency
// Including the sub-module as remote maven dependency
// api "com.github.nisrulz:easydeviceinfo-common:$Versions.libraryName"

// Including the sub-module as module dependency
Expand Down
2 changes: 1 addition & 1 deletion easydeviceinfo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ ext.setupModuleNamesForPublishing(ModuleName.main, ModuleDesc.main)
dependencies {
implementation Dependencies.annotation

// Including the sub-module as Jcenter dependency
// Including the sub-module as remote maven dependency
// api "com.github.nisrulz:easydeviceinfo-ads:$Versions.libraryName"
// api "com.github.nisrulz:easydeviceinfo-base:$Versions.libraryName"

Expand Down

0 comments on commit 86a42a1

Please sign in to comment.