mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-12-27 11:05:49 +01:00
Fossil HR: improved DeviceApplicationsList handling
This commit is contained in:
parent
8d1a1c07b7
commit
73ce323288
@ -89,6 +89,7 @@ import nodomain.freeyourgadget.gadgetbridge.externalevents.NotificationListener;
|
|||||||
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
|
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceApp;
|
import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceApp;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.model.CallSpec;
|
import nodomain.freeyourgadget.gadgetbridge.model.CallSpec;
|
||||||
|
import nodomain.freeyourgadget.gadgetbridge.model.GenericItem;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.model.MusicSpec;
|
import nodomain.freeyourgadget.gadgetbridge.model.MusicSpec;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.model.MusicStateSpec;
|
import nodomain.freeyourgadget.gadgetbridge.model.MusicStateSpec;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.model.NotificationSpec;
|
import nodomain.freeyourgadget.gadgetbridge.model.NotificationSpec;
|
||||||
@ -210,7 +211,19 @@ public class FossilHRWatchAdapter extends FossilWatchAdapter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void listApplications() {
|
public void listApplications() {
|
||||||
queueWrite(new ApplicationsListRequest(this));
|
queueWrite(new ApplicationsListRequest(this){
|
||||||
|
@Override
|
||||||
|
public void handleApplicationsList(List<ApplicationInformation> installedApplications) {
|
||||||
|
((FossilHRWatchAdapter) getAdapter()).setInstalledApplications(installedApplications);
|
||||||
|
GBDevice device = getAdapter().getDeviceSupport().getDevice();
|
||||||
|
JSONArray array = new JSONArray();
|
||||||
|
for(ApplicationInformation info : installedApplications){
|
||||||
|
array.put(info.getAppName());
|
||||||
|
}
|
||||||
|
device.addDeviceInfo(new GenericItem("INSTALLED_APPS", array.toString()));
|
||||||
|
device.sendDeviceUpdateIntent(getAdapter().getContext());
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initializeAfterAuthentication(boolean authenticated) {
|
private void initializeAfterAuthentication(boolean authenticated) {
|
||||||
|
@ -9,6 +9,7 @@ import java.nio.ByteBuffer;
|
|||||||
import java.nio.ByteOrder;
|
import java.nio.ByteOrder;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
|
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.model.GenericItem;
|
import nodomain.freeyourgadget.gadgetbridge.model.GenericItem;
|
||||||
@ -49,15 +50,13 @@ public class ApplicationsListRequest extends FileLookupAndGetRequest{
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
Collections.sort(applicationInfos);
|
Collections.sort(applicationInfos);
|
||||||
((FossilHRWatchAdapter) getAdapter()).setInstalledApplications(applicationInfos);
|
this.handleApplicationsList(applicationInfos);
|
||||||
GBDevice device = getAdapter().getDeviceSupport().getDevice();
|
|
||||||
JSONArray array = new JSONArray();
|
|
||||||
for(ApplicationInformation info : applicationInfos){
|
|
||||||
array.put(info.getAppName());
|
|
||||||
}
|
}
|
||||||
device.addDeviceInfo(new GenericItem("INSTALLED_APPS", array.toString()));
|
|
||||||
device.sendDeviceUpdateIntent(getAdapter().getContext());
|
public void handleApplicationsList(List<ApplicationInformation> installedApplications){
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void handleFileLookupError(FILE_LOOKUP_ERROR error){
|
public void handleFileLookupError(FILE_LOOKUP_ERROR error){
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user