Updated Astrid task killer warning, and make task killer search every startup.

pull/14/head
Tim Su 16 years ago
parent 0a015c9813
commit dbf749e781

@ -376,7 +376,7 @@ It looks like you are using a task killer application! Please add Astrid to
the exclusion list for your task killer. Otherwise, if Astrid gets killed, the exclusion list for your task killer. Otherwise, if Astrid gets killed,
it will not let you know when your tasks are due.\n it will not let you know when your tasks are due.\n
\n \n
(note: No Astrid\'s were harmed in making this message.) In other words: don\'t kill Astrid!
</string> </string>
<!-- Locale Plugin --> <!-- Locale Plugin -->

@ -62,8 +62,6 @@ public class StartupReceiver extends BroadcastReceiver {
} }
} }
showTaskKillerHelp(context);
Preferences.setCurrentVersion(context, finalVersion); Preferences.setCurrentVersion(context, finalVersion);
} }
@ -84,6 +82,9 @@ public class StartupReceiver extends BroadcastReceiver {
Intent intent = new Intent(context, UpdateService.class); Intent intent = new Intent(context, UpdateService.class);
context.startService(intent); context.startService(intent);
// check for task killers
showTaskKillerHelp(context);
hasStartedUp = true; hasStartedUp = true;
} }
@ -92,19 +93,31 @@ public class StartupReceiver extends BroadcastReceiver {
return; return;
// search for task killers. if they exist, show the help! // search for task killers. if they exist, show the help!
PackageManager pm = context.getPackageManager(); new Thread(new Runnable() {
List<PackageInfo> apps = pm.getInstalledPackages(PackageManager.GET_PERMISSIONS); @Override
for(PackageInfo app : apps) { public void run() {
for(String permission : app.requestedPermissions) { PackageManager pm = context.getPackageManager();
if(Manifest.permission.RESTART_PACKAGES.equals(permission)) { List<PackageInfo> apps = pm
DialogUtilities.okDialog(context, context.getString(R.string.task_killer_help), new OnClickListener() { .getInstalledPackages(PackageManager.GET_PERMISSIONS);
@Override for (PackageInfo app : apps) {
public void onClick(DialogInterface arg0, int arg1) { for (String permission : app.requestedPermissions) {
Preferences.setShouldShowTaskKillerHelp(context, true); if (Manifest.permission.RESTART_PACKAGES
.equals(permission)) {
DialogUtilities.okDialog(context, context
.getString(R.string.task_killer_help),
new OnClickListener() {
@Override
public void onClick(
DialogInterface arg0, int arg1) {
Preferences
.setShouldShowTaskKillerHelp(
context, true);
}
});
} }
}); }
} }
} }
} }).start();
} }
} }

Loading…
Cancel
Save