mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-05 02:39:23 +02:00
Book.save() is not public now
This commit is contained in:
parent
8a78a11bd8
commit
bb451e9467
10 changed files with 38 additions and 25 deletions
|
@ -149,6 +149,17 @@ public class BookCollectionShadow implements IBookCollection, ServiceConnection
|
|||
}
|
||||
}
|
||||
|
||||
public synchronized boolean saveBook(Book book, boolean force) {
|
||||
if (myInterface == null) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
return myInterface.saveBook(SerializerUtil.serialize(book), force);
|
||||
} catch (RemoteException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public synchronized void removeBook(Book book, boolean deleteFromDisk) {
|
||||
if (myInterface != null) {
|
||||
try {
|
||||
|
|
|
@ -15,6 +15,7 @@ interface LibraryInterface {
|
|||
String getBookById(in long id);
|
||||
String getRecentBook(in int index);
|
||||
|
||||
boolean saveBook(in String book, in boolean force);
|
||||
void removeBook(in String book, in boolean deleteFromDisk);
|
||||
void addBookToRecentList(in String book);
|
||||
void setBookFavorite(in String book, in boolean favorite);
|
||||
|
|
|
@ -151,6 +151,10 @@ public class LibraryService extends Service {
|
|||
return SerializerUtil.serialize(myCollection.getBookById(id));
|
||||
}
|
||||
|
||||
public boolean saveBook(String book, boolean force) {
|
||||
return myCollection.saveBook(SerializerUtil.deserializeBook(book), force);
|
||||
}
|
||||
|
||||
public void removeBook(String book, boolean deleteFromDisk) {
|
||||
myCollection.removeBook(SerializerUtil.deserializeBook(book), deleteFromDisk);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue