32 lines
834 B
Java
32 lines
834 B
Java
package com.ubtrobot.jimu.exception;
|
|
|
|
import android.content.Context;
|
|
import com.ubtrobot.jimu.robotapi.R$string;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public class BatteryException extends RobotActiveException {
|
|
public static final int CODE_VOLTAGE_HIGH = 1;
|
|
public static final int CODE_VOLTAGE_LOW = 0;
|
|
private int power;
|
|
|
|
public BatteryException(int i, int i2, String str) {
|
|
super(i, str);
|
|
this.power = i2;
|
|
}
|
|
|
|
public String getErrorMessage(Context context) {
|
|
int i = this.power;
|
|
if (i == 0) {
|
|
return context.getResources().getString(R$string.batter_low);
|
|
}
|
|
if (i == 1) {
|
|
return context.getResources().getString(R$string.batter_high);
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public int getPowerCode() {
|
|
return this.power;
|
|
}
|
|
}
|