Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
1. add vibration permission to AndroidManifest.xml file
2. add Vibration function for "arriving bus" and "Destination alerts"
  • Loading branch information
xque2 committed Mar 9, 2024
1 parent 30f4794 commit c1f3211
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion onebusaway-android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
android:label="@string/trip_service_perm_label"
android:description="@string/trip_service_perm_description"
android:protectionLevel="normal"/>

<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -584,12 +584,17 @@ private void createNotificationChannels() {
"Bus arrival notifications",
NotificationManager.IMPORTANCE_DEFAULT);
channel2.setDescription("Notifications to remind the user of an arriving bus.");
channel2.setVibrationPattern(new long[]{0, 500, 100, 500});
channel2.enableVibration(true);

NotificationChannel channel3 = new NotificationChannel(
CHANNEL_DESTINATION_ALERT_ID,
"Destination alerts",
NotificationManager.IMPORTANCE_LOW);
channel2.setDescription("All notifications relating to Destination alerts");
channel3.setDescription("All notifications relating to Destination alerts");
channel3.setVibrationPattern(new long[]{0, 250, 100, 250});
channel3.enableVibration(true);


NotificationManager manager = getSystemService(NotificationManager.class);
manager.createNotificationChannel(channel1);
Expand Down

0 comments on commit c1f3211

Please sign in to comment.