(Re/un)schedule the update service when preferences are changed
This commit is contained in:
parent
9c193f237d
commit
cb11bcf6dd
@ -437,6 +437,8 @@ public class DB {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Log.d("FDroid", "AppUpdate: " + updateApps.size()
|
||||||
|
+ " apps on completion.");
|
||||||
updateApps = null;
|
updateApps = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,6 +131,7 @@ public class FDroid extends TabActivity implements OnItemClickListener {
|
|||||||
|
|
||||||
private static final int REQUEST_APPDETAILS = 0;
|
private static final int REQUEST_APPDETAILS = 0;
|
||||||
private static final int REQUEST_MANAGEREPOS = 1;
|
private static final int REQUEST_MANAGEREPOS = 1;
|
||||||
|
private static final int REQUEST_PREFS = 2;
|
||||||
|
|
||||||
private static final int UPDATE_REPO = Menu.FIRST;
|
private static final int UPDATE_REPO = Menu.FIRST;
|
||||||
private static final int MANAGE_REPO = Menu.FIRST + 1;
|
private static final int MANAGE_REPO = Menu.FIRST + 1;
|
||||||
@ -232,7 +233,7 @@ public class FDroid extends TabActivity implements OnItemClickListener {
|
|||||||
|
|
||||||
case PREFERENCES:
|
case PREFERENCES:
|
||||||
Intent prefs = new Intent(getBaseContext(), Preferences.class);
|
Intent prefs = new Intent(getBaseContext(), Preferences.class);
|
||||||
startActivity(prefs);
|
startActivityForResult(prefs,REQUEST_PREFS);
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case ABOUT:
|
case ABOUT:
|
||||||
@ -294,6 +295,12 @@ public class FDroid extends TabActivity implements OnItemClickListener {
|
|||||||
alert.show();
|
alert.show();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case REQUEST_PREFS:
|
||||||
|
// The automatic update settings may have changed, so reschedule (or unschedule) the
|
||||||
|
// service accordingly. It's cheap, so no need to check if the particular setting has
|
||||||
|
// actually been changed.
|
||||||
|
UpdateService.schedule(getBaseContext());
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user