Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 182b7660 authored by Jimmy Chen's avatar Jimmy Chen Committed by Android (Google) Code Review
Browse files

Merge "p2p: support find a specific channel"

parents c91de482 05e63641
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -93,4 +93,6 @@ interface ISupplicantP2pIface {
  String startWpsPinDisplay(in String groupIfName, in byte[] bssid);
  void startWpsPinKeypad(in String groupIfName, in String pin);
  void stopFind();
  void findOnSocialChannels(in int timeoutInSec);
  void findOnSpecificFrequency(in int freqInHz, in int timeoutInSec);
}
+33 −1
Original line number Diff line number Diff line
@@ -237,7 +237,7 @@ interface ISupplicantP2pIface {
     * Initiate a P2P service discovery with an optional timeout.
     *
     * @param timeoutInSec Max time to be spent is performing discovery.
     *        Set to 0 to indefinely continue discovery until an explicit
     *        Set to 0 to indefinitely continue discovery until an explicit
     *        |stopFind| is sent.
     * @throws ServiceSpecificException with one of the following values:
     *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
@@ -778,4 +778,36 @@ interface ISupplicantP2pIface {
     *         |SupplicantStatusCode.FAILURE_IFACE_DISABLED|
     */
    void stopFind();

    /**
     * Initiate a P2P device discovery only on social channels.
     *
     * Full P2P discovery is performed through |ISupplicantP2pIface.find| method.
     *
     * @param timeoutInSec The maximum amount of time that should be spent in performing device
     *         discovery.
     *        Set to 0 to indefinitely continue discovery until an explicit
     *        |stopFind| is sent.
     * @throws ServiceSpecificException with one of the following values:
     *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
     *         |SupplicantStatusCode.FAILURE_IFACE_INVALID|
     *         |SupplicantStatusCode.FAILURE_IFACE_DISABLED|
     */
    void findOnSocialChannels(in int timeoutInSec);

    /**
     * Initiate a P2P device discovery on a specific frequency.
     *
     * Full P2P discovery is performed through |ISupplicantP2pIface.find| method.
     *
     * @param freqInHz the frequency to be scanned.
     * @param timeoutInSec Max time to be spent is performing discovery.
     *        Set to 0 to indefinitely continue discovery until an explicit
     *        |stopFind| is sent.
     * @throws ServiceSpecificException with one of the following values:
     *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
     *         |SupplicantStatusCode.FAILURE_IFACE_INVALID|
     *         |SupplicantStatusCode.FAILURE_IFACE_DISABLED|
     */
    void findOnSpecificFrequency(in int freqInHz, in int timeoutInSec);
}
+14 −0
Original line number Diff line number Diff line
@@ -480,6 +480,20 @@ TEST_P(SupplicantP2pIfaceAidlTest, Find) {
    EXPECT_TRUE(p2p_iface_->find(kTestFindTimeout).isOk());
}

/*
 * FindSocialChannelsOnly
 */
TEST_P(SupplicantP2pIfaceAidlTest, FindSocialChannelsOnly) {
    EXPECT_TRUE(p2p_iface_->findOnSocialChannels(kTestFindTimeout).isOk());
}

/*
 * FindSpecificFrequency
 */
TEST_P(SupplicantP2pIfaceAidlTest, FindSpecificFrequency) {
    EXPECT_TRUE(p2p_iface_->findOnSpecificFrequency(2412, kTestFindTimeout).isOk());
}

/*
 * StopFind
 */