Merge pull request #83 from Electric1447/master

Miscellaneous changes
This commit is contained in:
Itai Levin
2020-06-08 19:50:16 +03:00
committed by GitHub
6 changed files with 11 additions and 9 deletions
@@ -80,7 +80,7 @@ public class PodsService extends Service {
* <p> * <p>
* After decoding a beacon, the status is written to leftStatus, rightStatus, caseStatus, chargeL, chargeR, chargeCase so that the NotificationThread can use the information * After decoding a beacon, the status is written to leftStatus, rightStatus, caseStatus, chargeL, chargeR, chargeCase so that the NotificationThread can use the information
*/ */
private static final ArrayList<ScanResult> recentBeacons = new ArrayList<>(); private static ArrayList<ScanResult> recentBeacons = new ArrayList<>();
private static final long RECENT_BEACONS_MAX_T_NS = 10000000000L; //10s private static final long RECENT_BEACONS_MAX_T_NS = 10000000000L; //10s
private void startAirPodsScanner () { private void startAirPodsScanner () {
@@ -294,7 +294,7 @@ public class PodsService extends Service {
} }
} }
private final NotificationManager mNotifyManager; private NotificationManager mNotifyManager;
@SuppressWarnings("WeakerAccess") @SuppressWarnings("WeakerAccess")
public NotificationThread () { public NotificationThread () {
@@ -2,6 +2,7 @@ package com.dosse.airpods;
import android.content.ComponentName; import android.content.ComponentName;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.net.Uri; import android.net.Uri;
@@ -35,19 +36,20 @@ public class SettingsFragment extends PreferenceFragmentCompat {
AlertDialog.Builder builder = new AlertDialog.Builder(requireContext()); AlertDialog.Builder builder = new AlertDialog.Builder(requireContext());
builder.setTitle(R.string.hide_dialog); builder.setTitle(R.string.hide_dialog);
builder.setMessage(R.string.hide_dialog_desc); builder.setMessage(R.string.hide_dialog_desc);
builder.setPositiveButton(R.string.hide_dialog_button, (dialogInterface, i) -> { builder.setPositiveButton(R.string.hide_dialog_button, (dialog, which) -> {
PackageManager p = requireContext().getPackageManager(); PackageManager p = requireContext().getPackageManager();
p.setComponentEnabledSetting(new ComponentName(context, MainActivity.class), PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP); p.setComponentEnabledSetting(new ComponentName(context, MainActivity.class), PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);
Toast.makeText(context, getString(R.string.hideClicked), Toast.LENGTH_LONG).show(); Toast.makeText(context, getString(R.string.hideClicked), Toast.LENGTH_LONG).show();
try { try {
context.openFileOutput("hidden", Context.MODE_PRIVATE).close(); context.openFileOutput("hidden", Context.MODE_PRIVATE).close();
} catch (Throwable ignored) { } } catch (Throwable ignored) {
}
enableDisableOptions(); enableDisableOptions();
requireActivity().finish(); requireActivity().finish();
}); });
builder.setNegativeButton(android.R.string.cancel, (dialogInterface, i) -> { }); builder.setNegativeButton(android.R.string.cancel, (dialog, which) -> dialog.dismiss());
builder.show(); builder.show();
return true; return true;
}); });
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<color name="bgColorPrimary" >@android:color/transparent</color> <color name="bgColorPrimary" >@android:color/transparent</color>
</resources> </resources>
@@ -7,5 +7,5 @@
<color name="textColorPrimary" >@android:color/primary_text_dark</color> <color name="textColorPrimary" >@android:color/primary_text_dark</color>
<color name="bgColorPrimary" >#000</color> <color name="bgColorPrimary" >#000</color>
<color name="dgrey">@android:color/darker_gray</color> <color name="dgrey" >@android:color/darker_gray</color>
</resources> </resources>
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<color name="bgColorPrimary" >@android:color/transparent</color> <color name="bgColorPrimary" >@android:color/transparent</color>
</resources> </resources>
+1 -1
View File
@@ -7,5 +7,5 @@
<color name="textColorPrimary" >@android:color/primary_text_light</color> <color name="textColorPrimary" >@android:color/primary_text_light</color>
<color name="bgColorPrimary" >#FFF</color> <color name="bgColorPrimary" >#FFF</color>
<color name="dgrey">#737373</color> <color name="dgrey" >#737373</color>
</resources> </resources>