-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
122 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.kunzisoft.scratchecklib"> | ||
package="com.kunzisoft.autosms"> | ||
|
||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> | ||
<application android:allowBackup="true" android:label="@string/app_name" | ||
android:supportsRtl="true"> | ||
|
||
</application> | ||
|
||
</manifest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
auto-sms/src/main/java/com/kunzisoft/autosms/receiver/BootReceiver.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.kunzisoft.autosms.receiver; | ||
|
||
import android.content.BroadcastReceiver; | ||
import android.content.Context; | ||
import android.content.Intent; | ||
import android.text.TextUtils; | ||
import android.util.Log; | ||
|
||
import com.kunzisoft.autosms.Scheduler; | ||
import com.kunzisoft.autosms.database.AutoSmsDbHelper; | ||
import com.kunzisoft.autosms.model.AutoSms; | ||
|
||
|
||
import java.util.Iterator; | ||
import java.util.List; | ||
|
||
public class BootReceiver extends BroadcastReceiver { | ||
|
||
@Override | ||
public void onReceive(Context context, Intent intent) { | ||
Log.i(getClass().getName(), "Rescheduling all the sms"); | ||
String action = intent.getAction(); | ||
if (TextUtils.isEmpty(action) || !action.equals(Intent.ACTION_BOOT_COMPLETED)) { | ||
return; | ||
} | ||
List<AutoSms> pendingSms = AutoSmsDbHelper.getDbHelper(context).getListAutoSmsByStatus(AutoSms.Status.PENDING); | ||
Iterator<AutoSms> i = pendingSms.iterator(); | ||
|
||
// TODO preference notifications | ||
|
||
Scheduler scheduler = new Scheduler(context); | ||
while (i.hasNext()) { | ||
scheduler.schedule(i.next(), true); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
auto-sms/src/main/java/com/kunzisoft/autosms/service/UnscheduleService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.kunzisoft.autosms.service; | ||
|
||
import android.content.Context; | ||
import android.content.Intent; | ||
import android.util.Log; | ||
|
||
import com.kunzisoft.autosms.Scheduler; | ||
import com.kunzisoft.autosms.database.AutoSmsDbHelper; | ||
|
||
public class UnscheduleService extends SmsIntentService { | ||
|
||
public UnscheduleService() { | ||
super("UnscheduleService"); | ||
} | ||
|
||
@Override | ||
protected void onHandleIntent(Intent intent) { | ||
super.onHandleIntent(intent); | ||
if (timestampCreated == 0) { | ||
return; | ||
} | ||
Log.i(getClass().getName(), "Removing sms " + timestampCreated); | ||
unschedule(getApplicationContext(), timestampCreated); | ||
} | ||
|
||
static private void unschedule(Context context, long timestampCreated) { | ||
new Scheduler(context).unschedule(timestampCreated); | ||
AutoSmsDbHelper.getDbHelper(context).deleteById(timestampCreated); | ||
Log.i(UnscheduleService.class.getName(), "Deleting notification with id " + timestampCreated); | ||
//new NotificationManagerWrapper(context).cancel(id); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
<resources> | ||
<string name="app_name" translatable="false">Auto-SMS-Libraries</string> | ||
|
||
<string name="pref_auto_sms_reminders_key" translatable="false">auto_sms_reminders</string> | ||
<string name="pref_auto_sms_reminders_default" translatable="false">false</string> | ||
</resources> |