package org.deviceconnect.android.deviceplugin.alljoyn.profile;

import android.content.Intent;
import android.os.Bundle;

import org.deviceconnect.android.deviceplugin.alljoyn.AllJoynDeviceApplication;
import org.deviceconnect.android.deviceplugin.alljoyn.AllJoynServiceEntity;
import org.deviceconnect.android.profile.DConnectProfileProvider;
import org.deviceconnect.android.profile.ServiceDiscoveryProfile;
import org.deviceconnect.message.DConnectMessage;
import org.deviceconnect.profile.ServiceDiscoveryProfileConstants;

import java.util.LinkedList;
import java.util.List;

/**
 * System Discovery profile for AllJoyn.
 *
 * @author NTT DOCOMO, INC.
 */
public class AllJoynServiceDiscoveryProfile extends ServiceDiscoveryProfile {

    public AllJoynServiceDiscoveryProfile(DConnectProfileProvider provider) {
        super(provider);
    }

    @Override
    protected boolean onGetServices(final Intent request, final Intent response) {
        AllJoynDeviceApplication app =
                (AllJoynDeviceApplication) getContext().getApplicationContext();

        app.performDiscovery();
        List<Bundle> services = new LinkedList<>();
        for (AllJoynServiceEntity serviceEntity : app.getDiscoveredAlljoynServices().values()) {
            Bundle service = new Bundle();
            ServiceDiscoveryProfile.setId(service, serviceEntity.appId);
            ServiceDiscoveryProfile.setName(service, serviceEntity.serviceName);
            ServiceDiscoveryProfile.setScopes(service, getProfileProvider());
            ServiceDiscoveryProfile.setOnline(service, true);
            // TODO: AllJoynリモートオブジェクトのトランスポート情報を取得できるか調査。
            //ServiceDiscoveryProfile.setType(service, NetworkType.WIFI);
            services.add(service);
        }
        setServices(response, services);
        setResult(response, DConnectMessage.RESULT_OK);
        return true;
    }

}

@@ -457,75 +457,8 @@
 age;
-%0Aimport org.deviceconnect.profile.ServiceDiscoveryProfileConstants;
 %0A%0Aim
@@ -1172,24 +1172,137 @@
 values()) %7B%0A
+            if (serviceEntity.serviceName.indexOf(%22LuminaireC%22) != -1) %7B%0A                continue;%0A            %7D%0A
             
@@ -1642,69 +1642,8 @@
     
-// TODO: AllJoyn%E3%83%AA%E3%83%A2%E3%83%BC%E3%83%88%E3%82%AA%E3%83%96%E3%82%B8%E3%82%A7%E3%82%AF%E3%83%88%E3%81%AE%E3%83%88%E3%83%A9%E3%83%B3%E3%82%B9%E3%83%9D%E3%83%BC%E3%83%88%E6%83%85%E5%A0%B1%E3%82%92%E5%8F%96%E5%BE%97%E3%81%A7%E3%81%8D%E3%82%8B%E3%81%8B%E8%AA%BF%E6%9F%BB%E3%80%82%0A            //
 Serv

Add the type attribute.