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

Commit 618455f7 authored by Irfan Sheriff's avatar Irfan Sheriff
Browse files

Redesign p2p around provision discovery

= Provision Discovery:Is an optional discovery technique for figuring out
if a peer supports the specific WPS option. For compatibility reasons,
we will now always use it during connection but at the same time support
devices that request to support connection without it

= State machine and UI redesign around the new interaction

= Specify config methods explicitly for compatibility

Bug: 5599949
Change-Id: Ib79435dda472c43cc0746f56bf79ea896b2e33a4
parent 55abad39
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@
namespace android {

static jboolean sScanModeActive = false;
static jint DBG = false;

static int doCommand(const char *cmd, char *replybuf, int replybuflen)
{
@@ -527,6 +528,7 @@ static jboolean android_net_wifi_doBooleanCommand(JNIEnv* env, jobject, jstring
    if (command.c_str() == NULL) {
        return JNI_FALSE;
    }
    if (DBG) LOGD("doBoolean: %s", command.c_str());
    return doBooleanCommand("OK", "%s", command.c_str());
}

@@ -536,6 +538,7 @@ static jint android_net_wifi_doIntCommand(JNIEnv* env, jobject, jstring javaComm
    if (command.c_str() == NULL) {
        return -1;
    }
    if (DBG) LOGD("doInt: %s", command.c_str());
    return doIntCommand("%s", command.c_str());
}

@@ -545,6 +548,7 @@ static jstring android_net_wifi_doStringCommand(JNIEnv* env, jobject, jstring ja
    if (command.c_str() == NULL) {
        return NULL;
    }
    if (DBG) LOGD("doString: %s", command.c_str());
    return doStringCommand(env, "%s", command.c_str());
}

+46 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2011 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content">

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical">

        <LinearLayout android:id="@+id/info"
            style="@style/wifi_section" />

        <LinearLayout android:id="@+id/enter_pin_section"
            style="@style/wifi_section"
            android:visibility="gone">

            <LinearLayout
                style="@style/wifi_item">
                <TextView
                    android:text="@string/wifi_p2p_enter_pin_message"
                    style="@style/wifi_item_label" />

                <EditText android:id="@+id/wifi_p2p_wps_pin"
                    android:inputType="textNoSuggestions"
                    style="@style/wifi_item_content" />
            </LinearLayout>
        </LinearLayout>
    </LinearLayout>

</ScrollView>
+9 −8
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2011 The Android Open Source Project
<!-- Copyright (C) 2010 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
@@ -15,12 +15,13 @@
-->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content">
    style="@style/wifi_item">
    <TextView
            style="@style/wifi_item_label"
            android:id="@+id/name" />

    <EditText android:id="@+id/wifi_p2p_wps_pin"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:inputType="textPassword"
    />
    <TextView
            android:id="@+id/value"
            style="@style/wifi_item_content"
            android:textStyle="bold" />
</LinearLayout>
+11 −3
Original line number Diff line number Diff line
@@ -2711,9 +2711,17 @@
    <string name="wifi_p2p_dialog_title">Wi-Fi Direct</string>
    <string name="wifi_p2p_turnon_message">Start Wi-Fi Direct operation. This will turn off Wi-Fi client/hotspot operation.</string>
    <string name="wifi_p2p_failed_message">Couldn\'t start Wi-Fi Direct</string>
    <string name="wifi_p2p_pbc_go_negotiation_request_message">Wi-Fi Direct connection setup request from <xliff:g id="p2p_device_address">%1$s</xliff:g>. Click OK to accept. </string>
    <string name="wifi_p2p_pin_go_negotiation_request_message">Wi-Fi Direct connection setup request from <xliff:g id="p2p_device_address">%1$s</xliff:g>. Enter pin to proceed. </string>
    <string name="wifi_p2p_pin_display_message">WPS pin <xliff:g id="p2p_wps_pin">%1$s</xliff:g> needs to be entered on the peer device <xliff:g id="p2p_client_address">%2$s</xliff:g> for connection setup to proceed </string>

    <string name="accept">Accept</string>
    <string name="decline">Decline</string>
    <string name="wifi_p2p_invitation_sent_title">Invitation sent</string>
    <string name="wifi_p2p_invitation_to_connect_title">Invitation to connect</string>

    <string name="wifi_p2p_from_message">From: </string>
    <string name="wifi_p2p_to_message">To: </string>
    <string name="wifi_p2p_enter_pin_message">Enter the required PIN: </string>
    <string name="wifi_p2p_show_pin_message">PIN: </string>

    <string name="wifi_p2p_enabled_notification_title">Wi-Fi Direct is on</string>
    <string name="wifi_p2p_enabled_notification_message">Touch for settings</string>

+33 −0
Original line number Diff line number Diff line
@@ -2447,4 +2447,37 @@ please see styles_device_defaults.xml.
        <item name="android:pointerIconSpotTouch">@android:drawable/pointer_spot_touch_icon</item>
        <item name="android:pointerIconSpotAnchor">@android:drawable/pointer_spot_anchor_icon</item>
    </style>

    <!-- Wifi dialog styles -->
    <!-- @hide -->
    <style name="wifi_item">
        <item name="android:layout_width">200dip</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:layout_marginTop">8dip</item>
        <item name="android:layout_marginLeft">16dip</item>
        <item name="android:layout_marginRight">16dip</item>
        <item name="android:orientation">vertical</item>
        <item name="android:gravity">left</item>
    </style>

    <!-- @hide -->
    <style name="wifi_item_label">
        <item name="android:layout_width">wrap_content</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:textSize">14sp</item>
    </style>

    <!-- @hide -->
    <style name="wifi_item_content">
        <item name="android:layout_width">match_parent</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:textSize">18sp</item>
    </style>

    <!-- @hide -->
    <style name="wifi_section">
        <item name="android:layout_width">match_parent</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:orientation">vertical</item>
    </style>
</resources>
Loading