Skip to content

Commit

Permalink
remove some debug messages
Browse files Browse the repository at this point in the history
  • Loading branch information
rhaeus committed Aug 28, 2021
1 parent 3e0012f commit 4f9148c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion wear/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<!-- A workaround used to be able to set the permissions we need. Is later disabled. -->
<service android:name=".DummyNotificationListener"
android:enabled="true"
android:exported="false"
android:exported="true"
android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE">
<intent-filter>
<action android:name="android.service.notification.NotificationListenerService" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public void onMessageReceived (MessageEvent messageEvent) {
}

if (messageEvent.getPath().equalsIgnoreCase(DND_SYNC_MESSAGE_PATH)) {
Toast.makeText(getApplicationContext(), "DNDSync performs the action!", Toast.LENGTH_SHORT).show();
// Toast.makeText(getApplicationContext(), "DNDSync performs the action!", Toast.LENGTH_SHORT).show();

byte[] data = messageEvent.getData();
// data[0] contains if dnd or bedtime mode
Expand Down
17 changes: 9 additions & 8 deletions wear/src/main/java/de/rhaeus/dndsync/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,14 @@ protected void onCreate(Bundle savedInstanceState) {
public void onClick(View v) {
// Check if the notification policy access has been granted for the app.
NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
int fil = mNotificationManager.getCurrentInterruptionFilter();
Toast.makeText(getApplicationContext(), "DND permission filter: " + fil, Toast.LENGTH_SHORT).show();
// if (mNotificationManager.isNotificationPolicyAccessGranted()) {
// Toast.makeText(getApplicationContext(), "DND permission ok!", Toast.LENGTH_SHORT).show();
// } else {
// Toast.makeText(getApplicationContext(), "DND permission missing!", Toast.LENGTH_SHORT).show();
// }
// int fil = mNotificationManager.getCurrentInterruptionFilter();
// Toast.makeText(getApplicationContext(), "DND permission filter: " + fil, Toast.LENGTH_SHORT).show();
// mNotificationManager.setInterruptionFilter(NotificationManager.INTERRUPTION_FILTER_PRIORITY);
if (mNotificationManager.isNotificationPolicyAccessGranted()) {
Toast.makeText(getApplicationContext(), "DND permission ok!", Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(getApplicationContext(), "DND permission missing!", Toast.LENGTH_SHORT).show();
}

}
});
Expand All @@ -45,7 +46,7 @@ public void onClick(View v) {
public void onClick(View v) {
serv = DNDSyncAccessService.getSharedInstance();
if (serv == null) {
Toast.makeText(getApplicationContext(), "Accessibility service not connected!", Toast.LENGTH_SHORT).show();
Toast.makeText(getApplicationContext(), "Accessibility service NOT connected!", Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(getApplicationContext(), "Accessibility service connected!", Toast.LENGTH_SHORT).show();
}
Expand Down

0 comments on commit 4f9148c

Please sign in to comment.