Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔥 Single-line changes to remove notification checks in the background checker #238

Merged
merged 4 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import java.util.List;
import java.util.Objects;

import edu.berkeley.eecs.emission.cordova.tracker.ExplicitIntent;
import edu.berkeley.eecs.emission.cordova.unifiedlogger.Log;

/**
Expand Down Expand Up @@ -111,8 +112,7 @@ protected void onHandleIntent(Intent intent) {
}

private void broadcastLoc(Location loc) {
Intent answerIntent = new Intent(INTENT_NAME);
answerIntent.setPackage(this.getPackageName());
Intent answerIntent = new ExplicitIntent(this, INTENT_NAME);
answerIntent.putExtra(INTENT_RESULT_KEY, loc);
Log.i(this, TAG, "broadcasting intent "+answerIntent);
LocalBroadcastManager.getInstance(this).sendBroadcast(answerIntent);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ public static void checkAppState(final Context ctxt) {
SensorControlChecks.checkLocationPermissions(ctxt),
SensorControlChecks.checkIgnoreBatteryOptimizations(ctxt),
SensorControlChecks.checkMotionActivityPermissions(ctxt),
SensorControlChecks.checkNotificationsEnabled(ctxt),
};
boolean allOtherChecksPass = true;
for (boolean check: allOtherChecks) {
Expand Down
3 changes: 1 addition & 2 deletions src/ios/Verification/SensorControlBackgroundChecker.m
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ +(void)checkAppState
@([TripDiarySensorControlChecks checkLocationSettings]),
@([TripDiarySensorControlChecks checkLocationPermissions]),
@([TripDiarySensorControlChecks checkMotionActivitySettings]),
@([TripDiarySensorControlChecks checkMotionActivityPermissions]),
@([TripDiarySensorControlChecks checkNotificationsEnabled])
@([TripDiarySensorControlChecks checkMotionActivityPermissions])
];
BOOL allChecksPass = TRUE;
for (NSNumber* check in allChecks) {
Expand Down