Сравнить коммиты
| Автор | SHA1 | Дата | |
|---|---|---|---|
|
|
c45c8ea797 | ||
|
|
ed0aa53aa3 | ||
|
|
f88891be2b |
@@ -9,8 +9,8 @@ android {
|
||||
buildConfigField "boolean", "HIDDEN_APP", "false"
|
||||
minSdkVersion 14
|
||||
targetSdkVersion 26
|
||||
versionCode 41
|
||||
versionName '5.4'
|
||||
versionCode 42
|
||||
versionName '5.5'
|
||||
}
|
||||
|
||||
lintOptions {
|
||||
|
||||
@@ -8,6 +8,16 @@
|
||||
android:label="@string/hidden_app_name"
|
||||
tools:replace="android:label">
|
||||
|
||||
<activity
|
||||
android:name=".MainActivity">
|
||||
<intent-filter android:label="@string/app_name">
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
<data android:scheme="https" android:host="www.traccar.org" android:pathPrefix="/hidden" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<receiver android:name="org.traccar.client.DialLaunchReceiver" >
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.NEW_OUTGOING_CALL" />
|
||||
|
||||
@@ -89,9 +89,12 @@ public abstract class PositionProvider {
|
||||
|
||||
public static double getBatteryLevel(Context context) {
|
||||
Intent batteryIntent = context.registerReceiver(null, new IntentFilter(Intent.ACTION_BATTERY_CHANGED));
|
||||
int level = batteryIntent.getIntExtra(BatteryManager.EXTRA_LEVEL, 0);
|
||||
int scale = batteryIntent.getIntExtra(BatteryManager.EXTRA_SCALE, 1);
|
||||
return (level * 100.0) / scale;
|
||||
if (batteryIntent != null) {
|
||||
int level = batteryIntent.getIntExtra(BatteryManager.EXTRA_LEVEL, 0);
|
||||
int scale = batteryIntent.getIntExtra(BatteryManager.EXTRA_SCALE, 1);
|
||||
return (level * 100.0) / scale;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user