Merge "Validate RenderScript context creation flags"
diff --git a/Android.mk b/Android.mk
index 9828ea6..58509a7 100644
--- a/Android.mk
+++ b/Android.mk
@@ -171,7 +171,6 @@
core/java/android/nfc/INfcAdapterExtras.aidl \
core/java/android/nfc/INfcTag.aidl \
core/java/android/nfc/INfcCardEmulation.aidl \
- core/java/android/nfc/INfcUnlockSettings.aidl \
core/java/android/os/IBatteryPropertiesListener.aidl \
core/java/android/os/IBatteryPropertiesRegistrar.aidl \
core/java/android/os/ICancellationSignal.aidl \
@@ -334,7 +333,7 @@
telephony/java/com/android/internal/telephony/ISms.aidl \
telephony/java/com/android/internal/telephony/IWapPushManager.aidl \
wifi/java/android/net/wifi/IWifiManager.aidl \
- wifi/java/android/net/wifi/passpoint/IPasspointManager.aidl \
+ wifi/java/android/net/wifi/passpoint/IWifiPasspointManager.aidl \
wifi/java/android/net/wifi/p2p/IWifiP2pManager.aidl \
wifi/java/android/net/wifi/IWifiScanner.aidl \
packages/services/PacProcessor/com/android/net/IProxyService.aidl \
diff --git a/api/current.txt b/api/current.txt
index 27afcda..c4f1896 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -5278,6 +5278,80 @@
}
+package android.app.wearable {
+
+ public final class WearableActionExtensions implements android.app.Notification.Action.Builder.Extender android.os.Parcelable {
+ method public android.app.Notification.Action.Builder applyTo(android.app.Notification.Action.Builder);
+ method public int describeContents();
+ method public static android.app.wearable.WearableActionExtensions from(android.app.Notification.Action);
+ method public boolean isAvailableOffline();
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final android.os.Parcelable.Creator CREATOR;
+ }
+
+ public static final class WearableActionExtensions.Builder {
+ ctor public WearableActionExtensions.Builder();
+ ctor public WearableActionExtensions.Builder(android.app.wearable.WearableActionExtensions);
+ method public android.app.wearable.WearableActionExtensions build();
+ method public android.app.wearable.WearableActionExtensions.Builder setAvailableOffline(boolean);
+ }
+
+ public final class WearableNotificationExtensions implements android.app.Notification.Builder.Extender android.os.Parcelable {
+ method public android.app.Notification.Builder applyTo(android.app.Notification.Builder);
+ method public int describeContents();
+ method public static android.app.wearable.WearableNotificationExtensions from(android.app.Notification);
+ method public android.app.Notification.Action getAction(int);
+ method public int getActionCount();
+ method public android.app.Notification.Action[] getActions();
+ method public android.graphics.Bitmap getBackground();
+ method public int getContentAction();
+ method public int getContentIcon();
+ method public int getContentIconGravity();
+ method public boolean getContentIntentAvailableOffline();
+ method public int getCustomContentHeight();
+ method public int getCustomSizePreset();
+ method public android.app.PendingIntent getDisplayIntent();
+ method public int getGravity();
+ method public boolean getHintHideIcon();
+ method public boolean getHintShowBackgroundOnly();
+ method public android.app.Notification[] getPages();
+ method public boolean getStartScrollBottom();
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final android.os.Parcelable.Creator CREATOR;
+ field public static final int SIZE_DEFAULT = 0; // 0x0
+ field public static final int SIZE_LARGE = 4; // 0x4
+ field public static final int SIZE_MEDIUM = 3; // 0x3
+ field public static final int SIZE_SMALL = 2; // 0x2
+ field public static final int SIZE_XSMALL = 1; // 0x1
+ field public static final int UNSET_ACTION_INDEX = -1; // 0xffffffff
+ }
+
+ public static final class WearableNotificationExtensions.Builder {
+ ctor public WearableNotificationExtensions.Builder();
+ ctor public WearableNotificationExtensions.Builder(android.app.wearable.WearableNotificationExtensions);
+ method public android.app.wearable.WearableNotificationExtensions.Builder addAction(android.app.Notification.Action);
+ method public android.app.wearable.WearableNotificationExtensions.Builder addActions(java.util.List<android.app.Notification.Action>);
+ method public android.app.wearable.WearableNotificationExtensions.Builder addPage(android.app.Notification);
+ method public android.app.wearable.WearableNotificationExtensions.Builder addPages(java.util.List<android.app.Notification>);
+ method public android.app.wearable.WearableNotificationExtensions build();
+ method public android.app.wearable.WearableNotificationExtensions.Builder clearActions();
+ method public android.app.wearable.WearableNotificationExtensions.Builder clearPages();
+ method public android.app.wearable.WearableNotificationExtensions.Builder setBackground(android.graphics.Bitmap);
+ method public android.app.wearable.WearableNotificationExtensions.Builder setContentAction(int);
+ method public android.app.wearable.WearableNotificationExtensions.Builder setContentIcon(int);
+ method public android.app.wearable.WearableNotificationExtensions.Builder setContentIconGravity(int);
+ method public android.app.wearable.WearableNotificationExtensions.Builder setContentIntentAvailableOffline(boolean);
+ method public android.app.wearable.WearableNotificationExtensions.Builder setCustomContentHeight(int);
+ method public android.app.wearable.WearableNotificationExtensions.Builder setCustomSizePreset(int);
+ method public android.app.wearable.WearableNotificationExtensions.Builder setDisplayIntent(android.app.PendingIntent);
+ method public android.app.wearable.WearableNotificationExtensions.Builder setGravity(int);
+ method public android.app.wearable.WearableNotificationExtensions.Builder setHintHideIcon(boolean);
+ method public android.app.wearable.WearableNotificationExtensions.Builder setHintShowBackgroundOnly(boolean);
+ method public android.app.wearable.WearableNotificationExtensions.Builder setStartScrollBottom(boolean);
+ }
+
+}
+
package android.appwidget {
public class AppWidgetHost {
@@ -6066,6 +6140,7 @@
ctor public BluetoothLeAdvertiseScanData();
field public static final int ADVERTISING_DATA = 0; // 0x0
field public static final int PARSED_SCAN_RECORD = 2; // 0x2
+ field public static final int SCAN_RESPONSE_DATA = 1; // 0x1
}
public static abstract class BluetoothLeAdvertiseScanData.AdvertiseBaseData {
@@ -6109,6 +6184,7 @@
public class BluetoothLeAdvertiser {
method public void startAdvertising(android.bluetooth.BluetoothLeAdvertiser.Settings, android.bluetooth.BluetoothLeAdvertiseScanData.AdvertisementData, android.bluetooth.BluetoothLeAdvertiser.AdvertiseCallback);
+ method public void startAdvertising(android.bluetooth.BluetoothLeAdvertiser.Settings, android.bluetooth.BluetoothLeAdvertiseScanData.AdvertisementData, android.bluetooth.BluetoothLeAdvertiseScanData.AdvertisementData, android.bluetooth.BluetoothLeAdvertiser.AdvertiseCallback);
method public void stopAdvertising(android.bluetooth.BluetoothLeAdvertiser.Settings, android.bluetooth.BluetoothLeAdvertiser.AdvertiseCallback);
}
@@ -16953,9 +17029,11 @@
}
public static final class WifiEnterpriseConfig.Eap {
+ field public static final int AKA = 5; // 0x5
field public static final int NONE = -1; // 0xffffffff
field public static final int PEAP = 0; // 0x0
field public static final int PWD = 3; // 0x3
+ field public static final int SIM = 4; // 0x4
field public static final int TLS = 1; // 0x1
field public static final int TTLS = 2; // 0x2
}
@@ -17351,108 +17429,23 @@
package android.net.wifi.passpoint {
- public abstract interface IPasspointManager implements android.os.IInterface {
- method public abstract android.os.Messenger getMessenger() throws android.os.RemoteException;
- method public abstract int getPasspointState() throws android.os.RemoteException;
- }
-
- public class PasspointCredential implements android.os.Parcelable {
- ctor public PasspointCredential();
+ public class WifiPasspointCredential implements android.os.Parcelable {
+ ctor public WifiPasspointCredential(java.lang.String, android.net.wifi.WifiEnterpriseConfig);
method public int describeContents();
+ method public java.lang.String getClientCertPath();
+ method public int getEapMethod();
+ method public java.lang.String getFqdn();
+ method public java.lang.String getImsi();
+ method public java.lang.String getRealm();
+ method public java.lang.String getUserName();
method public void writeToParcel(android.os.Parcel, int);
}
- public class PasspointInfo implements android.os.Parcelable {
- method public int describeContents();
- method public void writeToParcel(android.os.Parcel, int);
- field public static final int ANQP_CAPABILITY = 1; // 0x1
- field public static final int CELLULAR_NETWORK = 64; // 0x40
- field public static final int CONNECTION_CAPABILITY = 2048; // 0x800
- field public static final int DOMAIN_NAME = 128; // 0x80
- field public static final int HOTSPOT_CAPABILITY = 256; // 0x100
- field public static final int IP_ADDR_TYPE_AVAILABILITY = 16; // 0x10
- field public static final int NAI_REALM = 32; // 0x20
- field public static final int NETWORK_AUTH_TYPE = 4; // 0x4
- field public static final int OPERATOR_FRIENDLY_NAME = 512; // 0x200
- field public static final int OSU_PROVIDER = 4096; // 0x1000
- field public static final int PRESET_ALL = 8191; // 0x1fff
- field public static final int PRESET_CRED_MATCH = 481; // 0x1e1
- field public static final int ROAMING_CONSORTIUM = 8; // 0x8
- field public static final int VENUE_NAME = 2; // 0x2
- field public static final int WAN_METRICS = 1024; // 0x400
- field public java.lang.String bssid;
- field public java.lang.String cellularNetwork;
- field public java.lang.String connectionCapability;
- field public java.lang.String domainName;
- field public java.lang.String ipAddrTypeAvaibility;
- field public java.lang.String naiRealm;
- field public java.lang.String networkAuthType;
- field public java.lang.String operatorFriendlyName;
- field public java.util.List osuProviderList;
- field public java.lang.String roamingConsortium;
- field public java.lang.String venueName;
- field public java.lang.String wanMetrics;
- }
-
- public class PasspointManager {
- ctor public PasspointManager(android.content.Context, android.net.wifi.passpoint.IPasspointManager);
- method public boolean addCredential(android.net.wifi.passpoint.PasspointCredential);
- method public void connect(android.net.wifi.passpoint.PasspointPolicy);
- method public int getPasspointState();
- method public java.util.List<android.net.wifi.passpoint.PasspointCredential> getSavedCredentials();
- method public android.net.wifi.passpoint.PasspointManager.Channel initialize(android.content.Context, android.os.Looper, android.net.wifi.passpoint.PasspointManager.ChannelListener);
- method public boolean removeCredential(android.net.wifi.passpoint.PasspointCredential);
- method public java.util.List<android.net.wifi.passpoint.PasspointPolicy> requestCredentialMatch(java.util.List<android.net.wifi.ScanResult>);
- method public void requestOsuIcons(android.net.wifi.passpoint.PasspointManager.Channel, java.util.List<android.net.wifi.passpoint.PasspointOsuProvider>, int, android.net.wifi.passpoint.PasspointManager.ActionListener);
- method public boolean updateCredential(android.net.wifi.passpoint.PasspointCredential);
- field public static final int BUSY = 2; // 0x2
- field public static final int ERROR = 0; // 0x0
- field public static final java.lang.String PASSPOINT_CRED_CHANGED_ACTION = "android.net.wifi.passpoint.CRED_CHANGE";
- field public static final int PASSPOINT_STATE_ACCESS = 3; // 0x3
- field public static final java.lang.String PASSPOINT_STATE_CHANGED_ACTION = "android.net.wifi.passpoint.STATE_CHANGE";
- field public static final int PASSPOINT_STATE_DISABLED = 1; // 0x1
- field public static final int PASSPOINT_STATE_DISCOVERY = 2; // 0x2
- field public static final int PASSPOINT_STATE_PROVISION = 4; // 0x4
- field public static final int PASSPOINT_STATE_UNKNOWN = 0; // 0x0
- field public static final int WIFI_DISABLED = 1; // 0x1
- }
-
- public static abstract interface PasspointManager.ActionListener {
- method public abstract void onFailure(int);
- method public abstract void onSuccess();
- }
-
- public static class PasspointManager.Channel {
- }
-
- public static abstract interface PasspointManager.ChannelListener {
- method public abstract void onChannelDisconnected();
- }
-
- public class PasspointOsuProvider implements android.os.Parcelable {
- method public int describeContents();
- method public void writeToParcel(android.os.Parcel, int);
- field public static final android.os.Parcelable.Creator CREATOR;
- field public static final int OSU_METHOD_OMADM = 0; // 0x0
- field public static final int OSU_METHOD_SOAP = 1; // 0x1
- field public static final int OSU_METHOD_UNKNOWN = -1; // 0xffffffff
- field public java.lang.String friendlyName;
- field public java.lang.Object icon;
- field public java.lang.String iconFileName;
- field public int iconHeight;
- field public java.lang.String iconType;
- field public int iconWidth;
- field public int osuMethod;
- field public java.lang.String osuNai;
- field public java.lang.String osuService;
- field public java.lang.String serverUri;
- field public java.lang.String ssid;
- }
-
- public class PasspointPolicy implements android.os.Parcelable {
- ctor public PasspointPolicy();
- method public int describeContents();
- method public void writeToParcel(android.os.Parcel, int);
+ public class WifiPasspointManager {
+ method public boolean addCredential(android.net.wifi.passpoint.WifiPasspointCredential);
+ method public java.util.List<android.net.wifi.passpoint.WifiPasspointCredential> getSavedCredentials();
+ method public boolean removeCredential(android.net.wifi.passpoint.WifiPasspointCredential);
+ method public boolean updateCredential(android.net.wifi.passpoint.WifiPasspointCredential);
}
}
@@ -17574,11 +17567,6 @@
method public android.nfc.NfcAdapter getDefaultAdapter();
}
- public class NfcUnlock {
- method public static synchronized android.nfc.NfcUnlock getInstance(android.nfc.NfcAdapter);
- method public boolean getNfcUnlockEnabled();
- }
-
public final class Tag implements android.os.Parcelable {
method public int describeContents();
method public byte[] getId();
@@ -23939,7 +23927,6 @@
field public static final java.lang.String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
field public static final deprecated java.lang.String LOGGING_ID = "logging_id";
field public static final deprecated java.lang.String NETWORK_PREFERENCE = "network_preference";
- field public static final java.lang.String NFC_UNLOCK_ENABLED = "nfc_unlock_enabled";
field public static final java.lang.String PARENTAL_CONTROL_ENABLED = "parental_control_enabled";
field public static final java.lang.String PARENTAL_CONTROL_LAST_UPDATE = "parental_control_last_update";
field public static final java.lang.String PARENTAL_CONTROL_REDIRECT_URL = "parental_control_redirect_url";
diff --git a/core/java/android/app/ContextImpl.java b/core/java/android/app/ContextImpl.java
index 6324d4c..9053af2 100644
--- a/core/java/android/app/ContextImpl.java
+++ b/core/java/android/app/ContextImpl.java
@@ -81,8 +81,8 @@
import android.net.nsd.NsdManager;
import android.net.wifi.IWifiManager;
import android.net.wifi.WifiManager;
-import android.net.wifi.passpoint.IPasspointManager;
-import android.net.wifi.passpoint.PasspointManager;
+import android.net.wifi.passpoint.IWifiPasspointManager;
+import android.net.wifi.passpoint.WifiPasspointManager;
import android.net.wifi.p2p.IWifiP2pManager;
import android.net.wifi.p2p.WifiP2pManager;
import android.nfc.NfcManager;
@@ -581,8 +581,8 @@
registerService(WIFI_PASSPOINT_SERVICE, new ServiceFetcher() {
public Object createService(ContextImpl ctx) {
IBinder b = ServiceManager.getService(WIFI_PASSPOINT_SERVICE);
- IPasspointManager service = IPasspointManager.Stub.asInterface(b);
- return new PasspointManager(ctx.getOuterContext(), service);
+ IWifiPasspointManager service = IWifiPasspointManager.Stub.asInterface(b);
+ return new WifiPasspointManager(ctx.getOuterContext(), service);
}});
registerService(WIFI_P2P_SERVICE, new ServiceFetcher() {
@@ -1377,7 +1377,7 @@
ActivityManagerNative.getDefault().broadcastIntent(
mMainThread.getApplicationThread(), intent, resolvedType, rd,
initialCode, initialData, initialExtras, receiverPermission,
- AppOpsManager.OP_NONE, true, false, user.getIdentifier());
+ appOp, true, false, user.getIdentifier());
} catch (RemoteException e) {
}
}
diff --git a/core/java/android/app/wearable/WearableActionExtensions.java b/core/java/android/app/wearable/WearableActionExtensions.java
new file mode 100644
index 0000000..c296ef2
--- /dev/null
+++ b/core/java/android/app/wearable/WearableActionExtensions.java
@@ -0,0 +1,176 @@
+/*
+ * Copyright (C) 2014 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.
+ */
+
+package android.app.wearable;
+
+import android.app.Notification;
+import android.os.Parcel;
+import android.os.Parcelable;
+
+/**
+ * Wearable extensions to notification actions. To add extensions to an action,
+ * create a new {@link WearableActionExtensions} object using
+ * {@link WearableActionExtensions.Builder} and apply it to a
+ * {@link android.app.Notification.Action.Builder}.
+ *
+ * <pre class="prettyprint">
+ * Notification.Action action = new Notification.Action.Builder(
+ * R.drawable.archive_all, "Archive all", actionIntent)
+ * .apply(new WearableActionExtensions.Builder()
+ * .setAvailableOffline(false)
+ * .build())
+ * .build();
+ * </pre>
+ */
+public final class WearableActionExtensions implements Notification.Action.Builder.Extender,
+ Parcelable {
+ /** Notification action extra which contains wearable extensions */
+ private static final String EXTRA_WEARABLE_EXTENSIONS = "android.wearable.EXTENSIONS";
+
+ // Flags bitwise-ored to mFlags
+ private static final int FLAG_AVAILABLE_OFFLINE = 1 << 0;
+
+ // Default value for flags integer
+ private static final int DEFAULT_FLAGS = FLAG_AVAILABLE_OFFLINE;
+
+ private final int mFlags;
+
+ private WearableActionExtensions(int flags) {
+ mFlags = flags;
+ }
+
+ private WearableActionExtensions(Parcel in) {
+ mFlags = in.readInt();
+ }
+
+ /**
+ * Create a {@link WearableActionExtensions} by reading wearable extensions present on an
+ * existing notification action.
+ * @param action the notification action to inspect.
+ * @return a new {@link WearableActionExtensions} object.
+ */
+ public static WearableActionExtensions from(Notification.Action action) {
+ WearableActionExtensions extensions = action.getExtras().getParcelable(
+ EXTRA_WEARABLE_EXTENSIONS);
+ if (extensions != null) {
+ return extensions;
+ } else {
+ // Return a WearableActionExtensions with default values.
+ return new Builder().build();
+ }
+ }
+
+ /**
+ * Get whether this action is available when the wearable device is not connected to
+ * a companion device. The user can still trigger this action when the wearable device is
+ * offline, but a visual hint will indicate that the action may not be available.
+ * Defaults to true.
+ */
+ public boolean isAvailableOffline() {
+ return (mFlags & FLAG_AVAILABLE_OFFLINE) != 0;
+ }
+
+ @Override
+ public Notification.Action.Builder applyTo(Notification.Action.Builder builder) {
+ builder.getExtras().putParcelable(EXTRA_WEARABLE_EXTENSIONS, this);
+ return builder;
+ }
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
+ public void writeToParcel(Parcel out, int flags) {
+ out.writeInt(mFlags);
+ }
+
+ /**
+ * Builder for {@link WearableActionExtensions} objects, which adds wearable extensions to
+ * notification actions. To extend an action, create an instance of this class, call the set
+ * methods present, call {@link #build}, and finally apply the options to a
+ * {@link Notification.Action.Builder} using its
+ * {@link android.app.Notification.Action.Builder#apply} method.
+ */
+ public static final class Builder {
+ private int mFlags = DEFAULT_FLAGS;
+
+ /**
+ * Construct a builder to be used for adding wearable extensions to notification actions.
+ *
+ * <pre class="prettyprint">
+ * Notification.Action action = new Notification.Action.Builder(
+ * R.drawable.archive_all, "Archive all", actionIntent)
+ * .apply(new WearableActionExtensions.Builder()
+ * .setAvailableOffline(false)
+ * .build())
+ * .build();</pre>
+ */
+ public Builder() {
+ }
+
+ /**
+ * Create a {@link Builder} by reading wearable extensions present on an
+ * existing {@code WearableActionExtensions} object.
+ * @param other the existing extensions to inspect.
+ */
+ public Builder(WearableActionExtensions other) {
+ mFlags = other.mFlags;
+ }
+
+ /**
+ * Set whether this action is available when the wearable device is not connected to
+ * a companion device. The user can still trigger this action when the wearable device is
+ * offline, but a visual hint will indicate that the action may not be available.
+ * Defaults to true.
+ */
+ public Builder setAvailableOffline(boolean availableOffline) {
+ setFlag(FLAG_AVAILABLE_OFFLINE, availableOffline);
+ return this;
+ }
+
+ /**
+ * Build a new {@link WearableActionExtensions} object with the extensions
+ * currently present on this builder.
+ * @return the extensions object.
+ */
+ public WearableActionExtensions build() {
+ return new WearableActionExtensions(mFlags);
+ }
+
+ private void setFlag(int mask, boolean value) {
+ if (value) {
+ mFlags |= mask;
+ } else {
+ mFlags &= ~mask;
+ }
+ }
+ }
+
+ public static final Creator<WearableActionExtensions> CREATOR =
+ new Creator<WearableActionExtensions>() {
+ @Override
+ public WearableActionExtensions createFromParcel(Parcel in) {
+ return new WearableActionExtensions(in);
+ }
+
+ @Override
+ public WearableActionExtensions[] newArray(int size) {
+ return new WearableActionExtensions[size];
+ }
+ };
+}
diff --git a/core/java/android/app/wearable/WearableNotificationExtensions.java b/core/java/android/app/wearable/WearableNotificationExtensions.java
new file mode 100644
index 0000000..d433613
--- /dev/null
+++ b/core/java/android/app/wearable/WearableNotificationExtensions.java
@@ -0,0 +1,702 @@
+/*
+ * Copyright (C) 2014 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.
+ */
+
+package android.app.wearable;
+
+import android.app.Notification;
+import android.app.PendingIntent;
+import android.graphics.Bitmap;
+import android.os.Parcel;
+import android.os.Parcelable;
+import android.view.Gravity;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * Helper class that contains wearable extensions for notifications.
+ * <p class="note"> See
+ * <a href="{@docRoot}wear/notifications/creating.html">Creating Notifications
+ * for Android Wear</a> for more information on how to use this class.
+ * <p>
+ * To create a notification with wearable extensions:
+ * <ol>
+ * <li>Create a {@link Notification.Builder}, setting any desired
+ * properties.
+ * <li>Create a {@link WearableNotificationExtensions.Builder}.
+ * <li>Set wearable-specific properties using the
+ * {@code add} and {@code set} methods of {@link WearableNotificationExtensions.Builder}.
+ * <li>Call {@link WearableNotificationExtensions.Builder#build} to build the extensions
+ * object.
+ * <li>Call {@link Notification.Builder#apply} to apply the extensions to a notification.
+ * <li>Post the notification to the notification system with the
+ * {@code NotificationManager.notify(...)} methods.
+ * </ol>
+ *
+ * <pre class="prettyprint">
+ * Notification notif = new Notification.Builder(mContext)
+ * .setContentTitle("New mail from " + sender.toString())
+ * .setContentText(subject)
+ * .setSmallIcon(R.drawable.new_mail)
+ * .apply(new new WearableNotificationExtensions.Builder()
+ * .setContentIcon(R.drawable.new_mail)
+ * .build())
+ * .build();
+ * NotificationManager notificationManger =
+ * (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
+ * notificationManger.notify(0, notif);</pre>
+ *
+ * <p>Wearable extensions can be accessed on an existing notification by using the
+ * {@link WearableNotificationExtensions#from} function.
+ *
+ * <pre class="prettyprint">
+ * WearableNotificationExtensions wearableExtensions = WearableNotificationExtensions.from(
+ * notification);
+ * Notification[] pages = wearableExtensions.getPages();
+ * </pre>
+ */
+public final class WearableNotificationExtensions implements Notification.Builder.Extender,
+ Parcelable {
+ /**
+ * Sentinel value for an action index that is unset.
+ */
+ public static final int UNSET_ACTION_INDEX = -1;
+
+ /**
+ * Size value for use with {@link Builder#setCustomSizePreset} to show this notification with
+ * default sizing.
+ * <p>For custom display notifications created using {@link Builder#setDisplayIntent},
+ * the default is {@link #SIZE_LARGE}. All other notifications size automatically based
+ * on their content.
+ */
+ public static final int SIZE_DEFAULT = 0;
+
+ /**
+ * Size value for use with {@link Builder#setCustomSizePreset} to show this notification
+ * with an extra small size.
+ * <p>This value is only applicable for custom display notifications created using
+ * {@link Builder#setDisplayIntent}.
+ */
+ public static final int SIZE_XSMALL = 1;
+
+ /**
+ * Size value for use with {@link Builder#setCustomSizePreset} to show this notification
+ * with a small size.
+ * <p>This value is only applicable for custom display notifications created using
+ * {@link Builder#setDisplayIntent}.
+ */
+ public static final int SIZE_SMALL = 2;
+
+ /**
+ * Size value for use with {@link Builder#setCustomSizePreset} to show this notification
+ * with a medium size.
+ * <p>This value is only applicable for custom display notifications created using
+ * {@link Builder#setDisplayIntent}.
+ */
+ public static final int SIZE_MEDIUM = 3;
+
+ /**
+ * Size value for use with {@link Builder#setCustomSizePreset} to show this notification
+ * with a large size.
+ * <p>This value is only applicable for custom display notifications created using
+ * {@link Builder#setDisplayIntent}.
+ */
+ public static final int SIZE_LARGE = 4;
+
+ /** Notification extra which contains wearable extensions */
+ static final String EXTRA_WEARABLE_EXTENSIONS = "android.wearable.EXTENSIONS";
+
+ // Flags bitwise-ored to mFlags
+ static final int FLAG_CONTENT_INTENT_AVAILABLE_OFFLINE = 1 << 0;
+ static final int FLAG_HINT_HIDE_ICON = 1 << 1;
+ static final int FLAG_HINT_SHOW_BACKGROUND_ONLY = 1 << 2;
+ static final int FLAG_START_SCROLL_BOTTOM = 1 << 3;
+
+ // Default value for flags integer
+ static final int DEFAULT_FLAGS = FLAG_CONTENT_INTENT_AVAILABLE_OFFLINE;
+
+ private final Notification.Action[] mActions;
+ private final int mFlags;
+ private final PendingIntent mDisplayIntent;
+ private final Notification[] mPages;
+ private final Bitmap mBackground;
+ private final int mContentIcon;
+ private final int mContentIconGravity;
+ private final int mContentActionIndex;
+ private final int mCustomSizePreset;
+ private final int mCustomContentHeight;
+ private final int mGravity;
+
+ private WearableNotificationExtensions(Notification.Action[] actions, int flags,
+ PendingIntent displayIntent, Notification[] pages, Bitmap background,
+ int contentIcon, int contentIconGravity, int contentActionIndex,
+ int customSizePreset, int customContentHeight, int gravity) {
+ mActions = actions;
+ mFlags = flags;
+ mDisplayIntent = displayIntent;
+ mPages = pages;
+ mBackground = background;
+ mContentIcon = contentIcon;
+ mContentIconGravity = contentIconGravity;
+ mContentActionIndex = contentActionIndex;
+ mCustomSizePreset = customSizePreset;
+ mCustomContentHeight = customContentHeight;
+ mGravity = gravity;
+ }
+
+ private WearableNotificationExtensions(Parcel in) {
+ mActions = in.createTypedArray(Notification.Action.CREATOR);
+ mFlags = in.readInt();
+ mDisplayIntent = in.readParcelable(PendingIntent.class.getClassLoader());
+ mPages = in.createTypedArray(Notification.CREATOR);
+ mBackground = in.readParcelable(Bitmap.class.getClassLoader());
+ mContentIcon = in.readInt();
+ mContentIconGravity = in.readInt();
+ mContentActionIndex = in.readInt();
+ mCustomSizePreset = in.readInt();
+ mCustomContentHeight = in.readInt();
+ mGravity = in.readInt();
+ }
+
+ /**
+ * Create a {@link WearableNotificationExtensions} by reading wearable extensions present on an
+ * existing notification.
+ * @param notif the notification to inspect.
+ * @return a new {@link WearableNotificationExtensions} object.
+ */
+ public static WearableNotificationExtensions from(Notification notif) {
+ WearableNotificationExtensions extensions = notif.extras.getParcelable(
+ EXTRA_WEARABLE_EXTENSIONS);
+ if (extensions != null) {
+ return extensions;
+ } else {
+ // Return a WearableNotificationExtensions with default values.
+ return new Builder().build();
+ }
+ }
+
+ /**
+ * Apply wearable extensions to a notification that is being built. This is typically
+ * called by {@link Notification.Builder#apply} method of {@link Notification.Builder}.
+ */
+ @Override
+ public Notification.Builder applyTo(Notification.Builder builder) {
+ builder.getExtras().putParcelable(EXTRA_WEARABLE_EXTENSIONS, this);
+ return builder;
+ }
+
+ /**
+ * Get the number of wearable actions present on this notification.
+ *
+ * @return the number of wearable actions for this notification
+ */
+ public int getActionCount() {
+ return mActions.length;
+ }
+
+ /**
+ * Get a {@link Notification.Action} for the wearable action at {@code actionIndex}.
+ * @param actionIndex the index of the desired wearable action
+ */
+ public Notification.Action getAction(int actionIndex) {
+ return mActions[actionIndex];
+ }
+
+ /**
+ * Get the wearable actions present on this notification.
+ */
+ public Notification.Action[] getActions() {
+ return mActions;
+ }
+
+ /**
+ * Get the intent to launch inside of an activity view when displaying this
+ * notification. This {@code PendingIntent} should be for an activity.
+ */
+ public PendingIntent getDisplayIntent() {
+ return mDisplayIntent;
+ }
+
+ /**
+ * Get the array of additional pages of content for displaying this notification. The
+ * current notification forms the first page, and elements within this array form
+ * subsequent pages. This field can be used to separate a notification into multiple
+ * sections.
+ * @return the pages for this notification
+ */
+ public Notification[] getPages() {
+ return mPages;
+ }
+
+ /**
+ * Get a background image to be displayed behind the notification content.
+ * Contrary to the {@link Notification.BigPictureStyle}, this background
+ * will work with any notification style.
+ *
+ * @return the background image
+ * @see Builder#setBackground
+ */
+ public Bitmap getBackground() {
+ return mBackground;
+ }
+
+ /**
+ * Get an icon that goes with the content of this notification.
+ */
+ public int getContentIcon() {
+ return mContentIcon;
+ }
+
+ /**
+ * Get the gravity that the content icon should have within the notification display.
+ * Supported values include {@link Gravity#START} and {@link Gravity#END}. The default
+ * value is {@link android.view.Gravity#END}.
+ * @see #getContentIcon
+ */
+ public int getContentIconGravity() {
+ return mContentIconGravity;
+ }
+
+ /**
+ * Get the action index of an action from this notification to show as clickable with
+ * the content of this notification page. When the user clicks this notification page,
+ * this action will trigger. This action will no longer display separately from the
+ * notification content. The action's icon will display with optional subtext provided
+ * by the action's title.
+ *
+ * <p>If wearable specific actions are present, this index will apply to that list,
+ * otherwise it will apply to the main notification's actions list.
+ */
+ public int getContentAction() {
+ return mContentActionIndex;
+ }
+
+ /**
+ * Get the gravity that this notification should have within the available viewport space.
+ * Supported values include {@link Gravity#TOP}, {@link Gravity#CENTER_VERTICAL} and
+ * {@link android.view.Gravity#BOTTOM}. The default value is
+ * {@link android.view.Gravity#BOTTOM}.
+ */
+ public int getGravity() {
+ return mGravity;
+ }
+
+ /**
+ * Get the custom size preset for the display of this notification out of the available
+ * presets found in {@link WearableNotificationExtensions}, e.g. {@link #SIZE_LARGE}.
+ * <p>Some custom size presets are only applicable for custom display notifications created
+ * using {@link Builder#setDisplayIntent}. Check the documentation for the preset in question.
+ * See also {@link Builder#setCustomContentHeight} and {@link Builder#setCustomSizePreset}.
+ */
+ public int getCustomSizePreset() {
+ return mCustomSizePreset;
+ }
+
+ /**
+ * Get the custom height in pixels for the display of this notification's content.
+ * <p>This option is only available for custom display notifications created
+ * using {@link Builder#setDisplayIntent}. See also {@link Builder#setCustomSizePreset} and
+ * {@link Builder#setCustomContentHeight}.
+ */
+ public int getCustomContentHeight() {
+ return mCustomContentHeight;
+ }
+
+ /**
+ * Get whether the scrolling position for the contents of this notification should start
+ * at the bottom of the contents instead of the top when the contents are too long to
+ * display within the screen. Default is false (start scroll at the top).
+ */
+ public boolean getStartScrollBottom() {
+ return (mFlags & FLAG_START_SCROLL_BOTTOM) != 0;
+ }
+
+ /**
+ * Get whether the content intent is available when the wearable device is not connected
+ * to a companion device. The user can still trigger this intent when the wearable device is
+ * offline, but a visual hint will indicate that the content intent may not be available.
+ * Defaults to true.
+ */
+ public boolean getContentIntentAvailableOffline() {
+ return (mFlags & FLAG_CONTENT_INTENT_AVAILABLE_OFFLINE) != 0;
+ }
+
+ /**
+ * Get a hint that this notification's icon should not be displayed.
+ * @return {@code true} if this icon should not be displayed, false otherwise.
+ * The default value is {@code false} if this was never set.
+ */
+ public boolean getHintHideIcon() {
+ return (mFlags & FLAG_HINT_HIDE_ICON) != 0;
+ }
+
+ /**
+ * Get a visual hint that only the background image of this notification should be
+ * displayed, and other semantic content should be hidden. This hint is only applicable
+ * to sub-pages added using {@link Builder#addPage}.
+ */
+ public boolean getHintShowBackgroundOnly() {
+ return (mFlags & FLAG_HINT_SHOW_BACKGROUND_ONLY) != 0;
+ }
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
+ public void writeToParcel(Parcel out, int flags) {
+ out.writeTypedArray(mActions, flags);
+ out.writeInt(mFlags);
+ out.writeParcelable(mDisplayIntent, flags);
+ out.writeTypedArray(mPages, flags);
+ out.writeParcelable(mBackground, flags);
+ out.writeInt(mContentIcon);
+ out.writeInt(mContentIconGravity);
+ out.writeInt(mContentActionIndex);
+ out.writeInt(mCustomSizePreset);
+ out.writeInt(mCustomContentHeight);
+ out.writeInt(mGravity);
+ }
+
+ /**
+ * Builder to apply wearable notification extensions to a {@link Notification.Builder}
+ * object.
+ *
+ * <p>You can chain the "set" methods for this builder in any order,
+ * but you must call the {@link #build} method and then the {@link Notification.Builder#apply}
+ * method to apply your extensions to a notification.
+ *
+ * <pre class="prettyprint">
+ * Notification notif = new Notification.Builder(mContext)
+ * .setContentTitle("New mail from " + sender.toString())
+ * .setContentText(subject)
+ * .setSmallIcon(R.drawable.new_mail);
+ * .apply(new WearableNotificationExtensions.Builder()
+ * .setContentIcon(R.drawable.new_mail)
+ * .build())
+ * .build();
+ * NotificationManager notificationManger =
+ * (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
+ * notificationManager.notify(0, notif);</pre>
+ */
+ public static final class Builder {
+ private final List<Notification.Action> mActions =
+ new ArrayList<Notification.Action>();
+ private int mFlags = DEFAULT_FLAGS;
+ private PendingIntent mDisplayIntent;
+ private final List<Notification> mPages = new ArrayList<Notification>();
+ private Bitmap mBackground;
+ private int mContentIcon;
+ private int mContentIconGravity = Gravity.END;
+ private int mContentActionIndex = UNSET_ACTION_INDEX;
+ private int mCustomContentHeight;
+ private int mCustomSizePreset = SIZE_DEFAULT;
+ private int mGravity = Gravity.BOTTOM;
+
+ /**
+ * Construct a builder to be used for adding wearable extensions to notifications.
+ *
+ * <pre class="prettyprint">
+ * Notification notif = new Notification.Builder(mContext)
+ * .setContentTitle("New mail from " + sender.toString())
+ * .setContentText(subject)
+ * .setSmallIcon(R.drawable.new_mail);
+ * .apply(new WearableNotificationExtensions.Builder()
+ * .setContentIcon(R.drawable.new_mail)
+ * .build())
+ * .build();
+ * NotificationManager notificationManger =
+ * (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
+ * notificationManager.notify(0, notif);</pre>
+ */
+ public Builder() {
+ }
+
+ /**
+ * Create a {@link Builder} by reading wearable extensions present on an
+ * existing {@code WearableNotificationExtensions} object.
+ * @param other the existing extensions to inspect.
+ */
+ public Builder(WearableNotificationExtensions other) {
+ Collections.addAll(mActions, other.mActions);
+ mFlags = other.mFlags;
+ mDisplayIntent = other.mDisplayIntent;
+ Collections.addAll(mPages, other.mPages);
+ mBackground = other.mBackground;
+ mContentIcon = other.mContentIcon;
+ mContentIconGravity = other.mContentIconGravity;
+ mContentActionIndex = other.mContentActionIndex;
+ mCustomContentHeight = other.mCustomContentHeight;
+ mCustomSizePreset = other.mCustomSizePreset;
+ mGravity = other.mGravity;
+ }
+
+ /**
+ * Add a wearable action to this notification.
+ *
+ * <p>When wearable actions are added using this method, the set of actions that
+ * show on a wearable device splits from devices that only show actions added
+ * using {@link android.app.Notification.Builder#addAction}. This allows for customization
+ * of which actions display on different devices.
+ *
+ * @param action the action to add to this notification
+ * @return this object for method chaining
+ * @see Notification.Action
+ */
+ public Builder addAction(Notification.Action action) {
+ mActions.add(action);
+ return this;
+ }
+
+ /**
+ * Adds wearable actions to this notification.
+ *
+ * <p>When wearable actions are added using this method, the set of actions that
+ * show on a wearable device splits from devices that only show actions added
+ * using {@link android.app.Notification.Builder#addAction}. This allows for customization
+ * of which actions display on different devices.
+ *
+ * @param actions the actions to add to this notification
+ * @return this object for method chaining
+ * @see Notification.Action
+ */
+ public Builder addActions(List<Notification.Action> actions) {
+ mActions.addAll(actions);
+ return this;
+ }
+
+ /**
+ * Clear all wearable actions present on this builder.
+ * @return this object for method chaining.
+ * @see #addAction
+ */
+ public Builder clearActions() {
+ mActions.clear();
+ return this;
+ }
+
+ /**
+ * Set an intent to launch inside of an activity view when displaying
+ * this notification. This {@link android.app.PendingIntent} should be for an activity.
+ *
+ * @param intent the {@link android.app.PendingIntent} for an activity
+ * @return this object for method chaining
+ * @see WearableNotificationExtensions#getDisplayIntent
+ */
+ public Builder setDisplayIntent(PendingIntent intent) {
+ mDisplayIntent = intent;
+ return this;
+ }
+
+ /**
+ * Add an additional page of content to display with this notification. The current
+ * notification forms the first page, and pages added using this function form
+ * subsequent pages. This field can be used to separate a notification into multiple
+ * sections.
+ *
+ * @param page the notification to add as another page
+ * @return this object for method chaining
+ * @see WearableNotificationExtensions#getPages
+ */
+ public Builder addPage(Notification page) {
+ mPages.add(page);
+ return this;
+ }
+
+ /**
+ * Add additional pages of content to display with this notification. The current
+ * notification forms the first page, and pages added using this function form
+ * subsequent pages. This field can be used to separate a notification into multiple
+ * sections.
+ *
+ * @param pages a list of notifications
+ * @return this object for method chaining
+ * @see WearableNotificationExtensions#getPages
+ */
+ public Builder addPages(List<Notification> pages) {
+ mPages.addAll(pages);
+ return this;
+ }
+
+ /**
+ * Clear all additional pages present on this builder.
+ * @return this object for method chaining.
+ * @see #addPage
+ */
+ public Builder clearPages() {
+ mPages.clear();
+ return this;
+ }
+
+ /**
+ * Set a background image to be displayed behind the notification content.
+ * Contrary to the {@link Notification.BigPictureStyle}, this background
+ * will work with any notification style.
+ *
+ * @param background the background bitmap
+ * @return this object for method chaining
+ * @see WearableNotificationExtensions#getBackground
+ */
+ public Builder setBackground(Bitmap background) {
+ mBackground = background;
+ return this;
+ }
+
+ /**
+ * Set an icon that goes with the content of this notification.
+ */
+ public Builder setContentIcon(int icon) {
+ mContentIcon = icon;
+ return this;
+ }
+
+ /**
+ * Set the gravity that the content icon should have within the notification display.
+ * Supported values include {@link Gravity#START} and {@link Gravity#END}. The default
+ * value is {@link android.view.Gravity#END}.
+ * @see #setContentIcon
+ */
+ public Builder setContentIconGravity(int contentIconGravity) {
+ mContentIconGravity = contentIconGravity;
+ return this;
+ }
+
+ /**
+ * Set an action from this notification's actions to be clickable with the content of
+ * this notification page. This action will no longer display separately from the
+ * notification content. This action's icon will display with optional subtext provided
+ * by the action's title.
+ * @param actionIndex The index of the action to hoist on the current notification page.
+ * If wearable actions are present, this index will apply to that list,
+ * otherwise it will apply to the main notification's actions list.
+ */
+ public Builder setContentAction(int actionIndex) {
+ mContentActionIndex = actionIndex;
+ return this;
+ }
+
+ /**
+ * Set the gravity that this notification should have within the available viewport space.
+ * Supported values include {@link Gravity#TOP}, {@link Gravity#CENTER_VERTICAL} and
+ * {@link Gravity#BOTTOM}. The default value is {@link Gravity#BOTTOM}.
+ */
+ public Builder setGravity(int gravity) {
+ mGravity = gravity;
+ return this;
+ }
+
+ /**
+ * Set the custom size preset for the display of this notification out of the available
+ * presets found in {@link WearableNotificationExtensions}, e.g. {@link #SIZE_LARGE}.
+ * <p>Some custom size presets are only applicable for custom display notifications created
+ * using {@link Builder#setDisplayIntent}. Check the documentation for the preset in
+ * question. See also {@link Builder#setCustomContentHeight} and
+ * {@link #getCustomSizePreset}.
+ */
+ public Builder setCustomSizePreset(int sizePreset) {
+ mCustomSizePreset = sizePreset;
+ return this;
+ }
+
+ /**
+ * Set the custom height in pixels for the display of this notification's content.
+ * <p>This option is only available for custom display notifications created
+ * using {@link Builder#setDisplayIntent}. See also {@link Builder#setCustomSizePreset} and
+ * {@link #getCustomContentHeight}.
+ */
+ public Builder setCustomContentHeight(int height) {
+ mCustomContentHeight = height;
+ return this;
+ }
+
+ /**
+ * Set whether the scrolling position for the contents of this notification should start
+ * at the bottom of the contents instead of the top when the contents are too long to
+ * display within the screen. Default is false (start scroll at the top).
+ */
+ public Builder setStartScrollBottom(boolean startScrollBottom) {
+ setFlag(FLAG_START_SCROLL_BOTTOM, startScrollBottom);
+ return this;
+ }
+
+ /**
+ * Set whether the content intent is available when the wearable device is not connected
+ * to a companion device. The user can still trigger this intent when the wearable device
+ * is offline, but a visual hint will indicate that the content intent may not be available.
+ * Defaults to true.
+ */
+ public Builder setContentIntentAvailableOffline(boolean contentIntentAvailableOffline) {
+ setFlag(FLAG_CONTENT_INTENT_AVAILABLE_OFFLINE, contentIntentAvailableOffline);
+ return this;
+ }
+
+ /**
+ * Set a hint that this notification's icon should not be displayed.
+ * @param hintHideIcon {@code true} to hide the icon, {@code false} otherwise.
+ * @return this object for method chaining
+ */
+ public Builder setHintHideIcon(boolean hintHideIcon) {
+ setFlag(FLAG_HINT_HIDE_ICON, hintHideIcon);
+ return this;
+ }
+
+ /**
+ * Set a visual hint that only the background image of this notification should be
+ * displayed, and other semantic content should be hidden. This hint is only applicable
+ * to sub-pages added using {@link #addPage}.
+ */
+ public Builder setHintShowBackgroundOnly(boolean hintShowBackgroundOnly) {
+ setFlag(FLAG_HINT_SHOW_BACKGROUND_ONLY, hintShowBackgroundOnly);
+ return this;
+ }
+
+ /**
+ * Build a new {@link WearableNotificationExtensions} object with the extensions
+ * currently present on this builder.
+ * @return the extensions object.
+ */
+ public WearableNotificationExtensions build() {
+ return new WearableNotificationExtensions(
+ mActions.toArray(new Notification.Action[mActions.size()]), mFlags,
+ mDisplayIntent, mPages.toArray(new Notification[mPages.size()]),
+ mBackground, mContentIcon, mContentIconGravity, mContentActionIndex,
+ mCustomSizePreset, mCustomContentHeight, mGravity);
+ }
+
+ private void setFlag(int mask, boolean value) {
+ if (value) {
+ mFlags |= mask;
+ } else {
+ mFlags &= ~mask;
+ }
+ }
+ }
+
+ public static final Creator<WearableNotificationExtensions> CREATOR =
+ new Creator<WearableNotificationExtensions>() {
+ @Override
+ public WearableNotificationExtensions createFromParcel(Parcel in) {
+ return new WearableNotificationExtensions(in);
+ }
+
+ @Override
+ public WearableNotificationExtensions[] newArray(int size) {
+ return new WearableNotificationExtensions[size];
+ }
+ };
+}
diff --git a/core/java/android/bluetooth/BluetoothLeAdvertiseScanData.java b/core/java/android/bluetooth/BluetoothLeAdvertiseScanData.java
index d12ac6c..2fa5e49 100644
--- a/core/java/android/bluetooth/BluetoothLeAdvertiseScanData.java
+++ b/core/java/android/bluetooth/BluetoothLeAdvertiseScanData.java
@@ -53,9 +53,6 @@
* Bluetooth LE scan response data, the data will be placed in ScanRspData field of advertising
* packet.
* <p>
- * TODO: unhide when stack supports setting scan response data.
- *
- * @hide
*/
public static final int SCAN_RESPONSE_DATA = 1;
/**
diff --git a/core/java/android/bluetooth/BluetoothLeAdvertiser.java b/core/java/android/bluetooth/BluetoothLeAdvertiser.java
index 2a8aa23..30c90c4 100644
--- a/core/java/android/bluetooth/BluetoothLeAdvertiser.java
+++ b/core/java/android/bluetooth/BluetoothLeAdvertiser.java
@@ -328,6 +328,7 @@
private static final int LE_CALLBACK_TIMEOUT_MILLIS = 2000;
private final AdvertiseCallback mAdvertiseCallback;
private final AdvertisementData mAdvertisement;
+ private final AdvertisementData mScanResponse;
private final Settings mSettings;
private final IBluetoothGatt mBluetoothGatt;
@@ -338,10 +339,11 @@
private boolean isAdvertising = false;
public AdvertiseCallbackWrapper(AdvertiseCallback advertiseCallback,
- AdvertisementData advertiseData, Settings settings,
+ AdvertisementData advertiseData, AdvertisementData scanResponse, Settings settings,
IBluetoothGatt bluetoothGatt) {
mAdvertiseCallback = advertiseCallback;
mAdvertisement = advertiseData;
+ mScanResponse = scanResponse;
mSettings = settings;
mBluetoothGatt = bluetoothGatt;
mLeHandle = 0;
@@ -384,7 +386,8 @@
if (status == BluetoothGatt.GATT_SUCCESS) {
mLeHandle = clientIf;
try {
- mBluetoothGatt.startMultiAdvertising(mLeHandle, mAdvertisement, mSettings);
+ mBluetoothGatt.startMultiAdvertising(mLeHandle, mAdvertisement,
+ mScanResponse, mSettings);
} catch (RemoteException e) {
Log.e(TAG, "fail to start le advertise: " + e);
mLeHandle = -1;
@@ -540,6 +543,19 @@
*/
public void startAdvertising(Settings settings,
AdvertisementData advertiseData, final AdvertiseCallback callback) {
+ startAdvertising(settings, advertiseData, null, callback);
+ }
+
+ /**
+ * Start Bluetooth LE Advertising.
+ * @param settings {@link Settings} for Bluetooth LE advertising.
+ * @param advertiseData {@link AdvertisementData} to be advertised in advertisement packet.
+ * @param scanResponse {@link AdvertisementData} for scan response.
+ * @param callback {@link AdvertiseCallback} for advertising status.
+ */
+ public void startAdvertising(Settings settings,
+ AdvertisementData advertiseData, AdvertisementData scanResponse,
+ final AdvertiseCallback callback) {
if (callback == null) {
throw new IllegalArgumentException("callback cannot be null");
}
@@ -548,8 +564,7 @@
return;
}
AdvertiseCallbackWrapper wrapper = new AdvertiseCallbackWrapper(callback, advertiseData,
- settings,
- mBluetoothGatt);
+ scanResponse, settings, mBluetoothGatt);
UUID uuid = UUID.randomUUID();
try {
mBluetoothGatt.registerClient(new ParcelUuid(uuid), wrapper);
diff --git a/core/java/android/bluetooth/IBluetoothGatt.aidl b/core/java/android/bluetooth/IBluetoothGatt.aidl
index 091b806..ceed52b 100644
--- a/core/java/android/bluetooth/IBluetoothGatt.aidl
+++ b/core/java/android/bluetooth/IBluetoothGatt.aidl
@@ -41,7 +41,9 @@
in BluetoothLeScanner.Settings settings,
in List<BluetoothLeScanFilter> filters);
void stopScan(in int appIf, in boolean isServer);
- void startMultiAdvertising(in int appIf, in BluetoothLeAdvertiseScanData.AdvertisementData data,
+ void startMultiAdvertising(in int appIf,
+ in BluetoothLeAdvertiseScanData.AdvertisementData advertiseData,
+ in BluetoothLeAdvertiseScanData.AdvertisementData scanResponse,
in BluetoothLeAdvertiser.Settings settings);
void stopMultiAdvertising(in int appIf);
void registerClient(in ParcelUuid appId, in IBluetoothGattCallback callback);
diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java
index c11b04c..9e02e4b 100644
--- a/core/java/android/content/Context.java
+++ b/core/java/android/content/Context.java
@@ -2352,11 +2352,11 @@
/**
* Use with {@link #getSystemService} to retrieve a {@link
- * android.net.wifi.passpoint.PasspointManager} for handling management of
+ * android.net.wifi.passpoint.WifiPasspointManager} for handling management of
* Wi-Fi passpoint access.
*
* @see #getSystemService
- * @see android.net.wifi.passpoint.PasspointManager
+ * @see android.net.wifi.passpoint.WifiPasspointManager
*/
public static final String WIFI_PASSPOINT_SERVICE = "wifipasspoint";
diff --git a/core/java/android/nfc/INfcAdapter.aidl b/core/java/android/nfc/INfcAdapter.aidl
index 635a50f..9218c11 100644
--- a/core/java/android/nfc/INfcAdapter.aidl
+++ b/core/java/android/nfc/INfcAdapter.aidl
@@ -25,7 +25,6 @@
import android.nfc.INfcAdapterExtras;
import android.nfc.INfcTag;
import android.nfc.INfcCardEmulation;
-import android.nfc.INfcUnlockSettings;
import android.os.Bundle;
/**
@@ -36,7 +35,6 @@
INfcTag getNfcTagInterface();
INfcCardEmulation getNfcCardEmulationInterface();
INfcAdapterExtras getNfcAdapterExtrasInterface(in String pkg);
- INfcUnlockSettings getNfcUnlockSettingsInterface();
int getState();
boolean disable(boolean saveState);
diff --git a/core/java/android/nfc/INfcUnlockSettings.aidl b/core/java/android/nfc/INfcUnlockSettings.aidl
deleted file mode 100644
index 649eeed..0000000
--- a/core/java/android/nfc/INfcUnlockSettings.aidl
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (C) 2013 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.
- */
-
-package android.nfc;
-
-import android.nfc.Tag;
-import java.util.List;
-
-/**
- * Interface to NFC unlock functionality.
- *
- * @hide
- */
-interface INfcUnlockSettings {
-
- /**
- * Checks the validity of the tag and attempts to unlock the screen.
- *
- * @return true if the screen was successfuly unlocked.
- */
- boolean tryUnlock(int userId, in Tag tag);
-
- /**
- * Registers the given tag as an unlock tag. Subsequent calls to {@code tryUnlock}
- * with the same {@code tag} should succeed.
- *
- * @return true if the tag was successfully registered.
- */
- boolean registerTag(int userId, in Tag tag);
-
- /**
- * Deregisters the tag with the corresponding timestamp.
- * Subsequent calls to {@code tryUnlock} with the same tag should fail.
- *
- * @return true if the tag was successfully deleted.
- */
- boolean deregisterTag(int userId, long timestamp);
-
- /**
- * Used for user-visible rendering of registered tags.
- *
- * @return a list of the times in millis since epoch when the registered tags were paired.
- */
- long[] getTagRegistryTimes(int userId);
-
- /**
- * Determines the state of the NFC unlock feature.
- *
- * @return true if NFC unlock is enabled.
- */
- boolean getNfcUnlockEnabled(int userId);
-
- /**
- * Sets the state [ON | OFF] of the NFC unlock feature.
- */
- void setNfcUnlockEnabled(int userId, boolean enabled);
-}
diff --git a/core/java/android/nfc/NfcAdapter.java b/core/java/android/nfc/NfcAdapter.java
index 96a3947..dd8e41c 100644
--- a/core/java/android/nfc/NfcAdapter.java
+++ b/core/java/android/nfc/NfcAdapter.java
@@ -292,7 +292,6 @@
static INfcAdapter sService;
static INfcTag sTagService;
static INfcCardEmulation sCardEmulationService;
- static INfcUnlockSettings sNfcUnlockSettingsService;
/**
* The NfcAdapter object for each application context.
@@ -433,13 +432,6 @@
throw new UnsupportedOperationException();
}
- try {
- sNfcUnlockSettingsService = sService.getNfcUnlockSettingsInterface();
- } catch (RemoteException e) {
- Log.e(TAG, "could not retrieve NFC unlock settings service");
- sNfcUnlockSettingsService = null;
- }
-
sIsInitialized = true;
}
if (context == null) {
@@ -557,22 +549,6 @@
}
/**
- * Returns the binder interface to the NFC unlock service.
- *
- * @throws UnsupportedOperationException if the service is not available.
- * @hide
- */
- public INfcUnlockSettings getNfcUnlockSettingsService() throws UnsupportedOperationException {
- isEnabled();
-
- if (sNfcUnlockSettingsService == null) {
- throw new UnsupportedOperationException("NfcUnlockSettingsService not available");
- }
-
- return sNfcUnlockSettingsService;
- }
-
- /**
* NFC service dead - attempt best effort recovery
* @hide
*/
diff --git a/core/java/android/nfc/NfcUnlock.java b/core/java/android/nfc/NfcUnlock.java
deleted file mode 100644
index 82dcd96..0000000
--- a/core/java/android/nfc/NfcUnlock.java
+++ /dev/null
@@ -1,255 +0,0 @@
-/*
- * Copyright (C) 2013 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.
- */
-
-package android.nfc;
-
-import static com.android.internal.util.Preconditions.checkNotNull;
-
-import android.annotation.Nullable;
-import android.app.ActivityManager;
-import android.content.Context;
-import android.os.RemoteException;
-import android.os.SystemProperties;
-import android.util.Log;
-
-import java.util.HashMap;
-
-/**
- * Provides an interface to read and update NFC unlock settings.
- * <p/>
- * Allows system services (currently exclusively LockSettingsService) to
- * register NFC tags to be used to unlock the device, as well as the ability
- * to enable/disable the service entirely.
- *
- */
-public class NfcUnlock {
-
- /**
- * Action to unlock the device.
- *
- * @hide
- */
- public static final String ACTION_NFC_UNLOCK = "android.nfc.ACTION_NFC_UNLOCK";
- /**
- * Permission to unlock the device.
- *
- * @hide
- */
- public static final String NFC_UNLOCK_PERMISSION = "android.permission.NFC_UNLOCK";
-
- /**
- * Property to enable NFC Unlock
- *
- * @hide
- */
- public static final String PROPERTY = "ro.com.android.nfc.unlock";
-
- private static final String TAG = "NfcUnlock";
- private static HashMap<Context, NfcUnlock> sNfcUnlocks = new HashMap<Context, NfcUnlock>();
-
- private final Context mContext;
- private final boolean mEnabled;
- private INfcUnlockSettings sService;
-
- private NfcUnlock(Context context, INfcUnlockSettings service) {
- this.mContext = checkNotNull(context);
- this.sService = checkNotNull(service);
- this.mEnabled = getPropertyEnabled();
- }
-
- /**
- * Returns an instance of {@link NfcUnlock}.
- */
- public static synchronized NfcUnlock getInstance(NfcAdapter nfcAdapter) {
- Context context = nfcAdapter.getContext();
- if (context == null) {
- Log.e(TAG, "NfcAdapter context is null");
- throw new UnsupportedOperationException();
- }
-
- NfcUnlock manager = sNfcUnlocks.get(context);
- if (manager == null) {
- INfcUnlockSettings service = nfcAdapter.getNfcUnlockSettingsService();
- manager = new NfcUnlock(context, service);
- sNfcUnlocks.put(context, manager);
- }
-
- return manager;
- }
-
- /**
- * Registers the given {@code tag} as an unlock tag.
- *
- * @return true if the tag was successfully registered.
- * @hide
- */
- public boolean registerTag(Tag tag) {
- enforcePropertyEnabled();
-
- int currentUser = ActivityManager.getCurrentUser();
-
- try {
- return sService.registerTag(currentUser, tag);
- } catch (RemoteException e) {
- recoverService();
- if (sService == null) {
- Log.e(TAG, "Failed to recover NfcUnlockSettingsService");
- return false;
- }
-
- try {
- return sService.registerTag(currentUser, tag);
- } catch (RemoteException ee) {
- Log.e(TAG, "Failed to reach NfcUnlockSettingsService", ee);
- return false;
- }
- }
- }
-
- /**
- * Deregisters the given {@code tag} as an unlock tag.
- *
- * @return true if the tag was successfully deregistered.
- * @hide
- */
- public boolean deregisterTag(long timestamp) {
- enforcePropertyEnabled();
- int currentUser = ActivityManager.getCurrentUser();
-
- try {
- return sService.deregisterTag(currentUser, timestamp);
- } catch (RemoteException e) {
- recoverService();
- if (sService == null) {
- Log.e(TAG, "Failed to recover NfcUnlockSettingsService");
- return false;
- }
-
- try {
- return sService.deregisterTag(currentUser, timestamp);
- } catch (RemoteException ee) {
- Log.e(TAG, "Failed to reach NfcUnlockSettingsService", ee);
- return false;
- }
- }
- }
-
- /**
- * Determines the enable state of the NFC unlock feature.
- *
- * @return true if NFC unlock is enabled.
- */
- public boolean getNfcUnlockEnabled() {
- enforcePropertyEnabled();
- int currentUser = ActivityManager.getCurrentUser();
-
- try {
- return sService.getNfcUnlockEnabled(currentUser);
- } catch (RemoteException e) {
- recoverService();
- if (sService == null) {
- Log.e(TAG, "Failed to recover NfcUnlockSettingsService");
- return false;
- }
-
- try {
- return sService.getNfcUnlockEnabled(currentUser);
- } catch (RemoteException ee) {
- Log.e(TAG, "Failed to reach NfcUnlockSettingsService", ee);
- return false;
- }
- }
- }
-
- /**
- * Set the enable state of the NFC unlock feature.
- *
- * @return true if the setting was successfully persisted.
- * @hide
- */
- public boolean setNfcUnlockEnabled(boolean enabled) {
- enforcePropertyEnabled();
- int currentUser = ActivityManager.getCurrentUser();
-
- try {
- sService.setNfcUnlockEnabled(currentUser, enabled);
- return true;
- } catch (RemoteException e) {
- recoverService();
- if (sService == null) {
- Log.e(TAG, "Failed to recover NfcUnlockSettingsService");
- return false;
- }
-
- try {
- sService.setNfcUnlockEnabled(currentUser, enabled);
- return true;
- } catch (RemoteException ee) {
- Log.e(TAG, "Failed to reach NfcUnlockSettingsService", ee);
- return false;
- }
-
- }
- }
-
- /**
- * Returns a list of times (in millis since epoch) corresponding to when
- * unlock tags were registered.
- *
- * @hide
- */
- @Nullable
- public long[] getTagRegistryTimes() {
- enforcePropertyEnabled();
- int currentUser = ActivityManager.getCurrentUser();
-
- try {
- return sService.getTagRegistryTimes(currentUser);
- } catch (RemoteException e) {
- recoverService();
- if (sService == null) {
- Log.e(TAG, "Failed to recover NfcUnlockSettingsService");
- return null;
- }
-
- try {
- return sService.getTagRegistryTimes(currentUser);
- } catch (RemoteException ee) {
- Log.e(TAG, "Failed to reach NfcUnlockSettingsService", ee);
- return null;
- }
- }
- }
-
- /**
- * @hide
- */
- public static boolean getPropertyEnabled() {
- return SystemProperties.get(PROPERTY).equals("ON");
- }
-
- private void recoverService() {
- NfcAdapter adapter = NfcAdapter.getDefaultAdapter(mContext);
- sService = adapter.getNfcUnlockSettingsService();
- }
-
-
- private void enforcePropertyEnabled() {
- if (!mEnabled) {
- throw new UnsupportedOperationException("NFC Unlock property is not enabled");
- }
- }
-}
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 2d03e1d..e9ffc52 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -3477,11 +3477,6 @@
public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
/**
- * Whether the NFC unlock feature is enabled (0 = false, 1 = true)
- */
- public static final String NFC_UNLOCK_ENABLED = "nfc_unlock_enabled";
-
- /**
* Whether lock pattern will vibrate as user enters (0 = false, 1 =
* true)
*
diff --git a/core/java/android/tv/TvInputManager.java b/core/java/android/tv/TvInputManager.java
index c5f179a..dfa84f8 100644
--- a/core/java/android/tv/TvInputManager.java
+++ b/core/java/android/tv/TvInputManager.java
@@ -414,8 +414,9 @@
*
* @param surface A {@link android.view.Surface} used to render video.
* @throws IllegalStateException if the session has been already released.
+ * @hide
*/
- void setSurface(Surface surface) {
+ public void setSurface(Surface surface) {
if (mToken == null) {
throw new IllegalStateException("the session has been already released");
}
diff --git a/core/java/android/view/accessibility/AccessibilityNodeInfo.java b/core/java/android/view/accessibility/AccessibilityNodeInfo.java
index 34967df..d5f0834 100644
--- a/core/java/android/view/accessibility/AccessibilityNodeInfo.java
+++ b/core/java/android/view/accessibility/AccessibilityNodeInfo.java
@@ -995,13 +995,12 @@
public void addAction(int action) {
enforceNotSealed();
- AccessibilityAction newAction = getActionSingleton(action);
- if (newAction == null) {
- // This means it is not one of the standard actions
- throw new IllegalArgumentException("Argument is not one of the standard actions");
+ if ((action & ACTION_TYPE_MASK) != 0) {
+ throw new IllegalArgumentException("Action is not a combination of the standard " +
+ "actions: " + action);
}
- addAction(newAction);
+ addLegacyStandardActions(action);
}
/**
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index a97d5fc..7b200c4 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -833,15 +833,8 @@
<!-- Allows access to the loop radio (Android@Home mesh network) device.
@hide -->
<permission android:name="android.permission.LOOP_RADIO"
- android:permissionGroup="android.permission-group.NETWORK"
- android:protectionLevel="signature|system" />
-
- <!-- Allows for the NFC process to unlock the device
- @hide This should only be used by the Nfc apk
- -->
- <permission android:name="android.permission.NFC_UNLOCK"
- android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
- android:protectionLevel="signature" />
+ android:permissionGroup="android.permission-group.NETWORK"
+ android:protectionLevel="signature|system" />
<!-- ================================== -->
<!-- Permissions for accessing accounts -->
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 463dda2..c3efb69 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -1215,6 +1215,49 @@
-->
<bool name="config_powerDecoupleInteractiveModeFromDisplay">false</bool>
+ <!-- User activity timeout: Minimum screen off timeout in milliseconds.
+
+ Sets a lower bound for the {@link Settings.System#SCREEN_OFF_TIMEOUT} setting
+ which determines how soon the device will go to sleep when there is no
+ user activity.
+
+ This value must be greater than zero, otherwise the device will immediately
+ fall asleep again as soon as it is awoken.
+ -->
+ <integer name="config_minimumScreenOffTimeout">10000</integer>
+
+ <!-- User activity timeout: Maximum screen dim duration in milliseconds.
+
+ Sets an upper bound for how long the screen will dim before the device goes
+ to sleep when there is no user activity. The dim duration is subtracted from
+ the overall screen off timeout to determine the screen dim timeout.
+ When the screen dim timeout expires, the screen will dim, shortly thereafter
+ the device will go to sleep.
+
+ If the screen off timeout is very short, the dim duration may be reduced
+ proportionally. See config_maximumScreenDimRatio.
+
+ This value may be zero in which case the screen will not dim before the
+ device goes to sleep.
+ -->
+ <integer name="config_maximumScreenDimDuration">7000</integer>
+
+ <!-- User activity timeout: Maximum screen dim duration as a percentage of screen off timeout.
+
+ This resource is similar to config_maximumScreenDimDuration but the maximum
+ screen dim duration is defined as a ratio of the overall screen off timeout
+ instead of as an absolute value in milliseconds. This is useful for reducing
+ the dim duration when the screen off timeout is very short.
+
+ When computing the screen dim duration, the power manager uses the lesser
+ of the effective durations expressed by config_maximumScreenDimDuration and
+ config_maximumScreenDimRatio.
+
+ This value must be between 0% and 100%. If the value is zero, the screen will not
+ dim before the device goes to sleep.
+ -->
+ <fraction name="config_maximumScreenDimRatio">20%</fraction>
+
<!-- Base "touch slop" value used by ViewConfiguration as a
movement threshold where scrolling should begin. -->
<dimen name="config_viewConfigurationTouchSlop">8dp</dimen>
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index 2d60b86..a4e80bc1 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -1639,6 +1639,9 @@
<java-symbol type="string" name="enable_explore_by_touch_warning_message" />
<java-symbol type="bool" name="config_powerDecoupleAutoSuspendModeFromDisplay" />
<java-symbol type="bool" name="config_powerDecoupleInteractiveModeFromDisplay" />
+ <java-symbol type="integer" name="config_minimumScreenOffTimeout" />
+ <java-symbol type="integer" name="config_maximumScreenDimDuration" />
+ <java-symbol type="fraction" name="config_maximumScreenDimRatio" />
<java-symbol type="string" name="config_customAdbPublicKeyConfirmationComponent" />
<java-symbol type="string" name="config_defaultNetworkScorerPackageName" />
diff --git a/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/AccessPointParserHelper.java b/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/AccessPointParserHelper.java
index 2ce87eb..db125e6 100644
--- a/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/AccessPointParserHelper.java
+++ b/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/AccessPointParserHelper.java
@@ -174,12 +174,12 @@
public void endElement(String uri, String localName, String tagName) throws SAXException {
if (tagName.equalsIgnoreCase("accesspoint")) {
if (mLinkProperties != null) {
- config.ipAssignment = IpAssignment.STATIC;
- config.linkProperties = mLinkProperties;
+ config.setIpAssignment(IpAssignment.STATIC);
+ config.setLinkProperties(mLinkProperties);
} else {
- config.ipAssignment = IpAssignment.DHCP;
+ config.setIpAssignment(IpAssignment.DHCP);
}
- config.proxySettings = ProxySettings.NONE;
+ config.setProxySettings(ProxySettings.NONE);
networks.add(config);
mLinkProperties = null;
}
diff --git a/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/stress/WifiStressTest.java b/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/stress/WifiStressTest.java
index 9692ec0..08618d6 100644
--- a/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/stress/WifiStressTest.java
+++ b/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/stress/WifiStressTest.java
@@ -233,8 +233,8 @@
} else {
config.preSharedKey = '"' + mPassword + '"';
}
- config.ipAssignment = IpAssignment.DHCP;
- config.proxySettings = ProxySettings.NONE;
+ config.setIpAssignment(IpAssignment.DHCP);
+ config.setProxySettings(ProxySettings.NONE);
assertTrue("Failed to connect to Wi-Fi network: " + mSsid,
connectToWifiWithConfiguration(config));
diff --git a/docs/html/distribute/essentials/gpfe-guidelines.jd b/docs/html/distribute/essentials/gpfe-guidelines.jd
index 8b47671..799009f 100644
--- a/docs/html/distribute/essentials/gpfe-guidelines.jd
+++ b/docs/html/distribute/essentials/gpfe-guidelines.jd
@@ -115,10 +115,6 @@
<hr>
</div>
-<div class="figure">
- <img src="{@docRoot}images/gp-edu-monetize.png">
-</div>
-
<p>
In-app purchase is currently not supported with Google Play for Education, so
a student device will block any transactions. To avoid confusion, be sure to
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardHostView.java b/packages/Keyguard/src/com/android/keyguard/KeyguardHostView.java
index f85e29f..2685447 100644
--- a/packages/Keyguard/src/com/android/keyguard/KeyguardHostView.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardHostView.java
@@ -16,8 +16,6 @@
package com.android.keyguard;
-import android.nfc.NfcUnlock;
-
import com.android.internal.widget.LockPatternUtils;
import com.android.keyguard.KeyguardSecurityModel.SecurityMode;
import com.android.keyguard.KeyguardUpdateMonitor.DisplayClientState;
@@ -46,6 +44,7 @@
import android.provider.Settings;
import android.util.AttributeSet;
import android.util.Log;
+import android.util.Slog;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
@@ -264,12 +263,6 @@
}
}
}
- @Override
- public void onNfcUnlock() {
- if (NfcUnlock.getPropertyEnabled()) {
- dismiss(true);
- }
- }
};
private static final boolean isMusicPlaying(int playbackState) {
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java b/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
index d6351df..0bcd916 100644
--- a/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
@@ -37,7 +37,6 @@
import static android.os.BatteryManager.EXTRA_HEALTH;
import android.media.AudioManager;
import android.media.IRemoteControlDisplay;
-import android.nfc.NfcUnlock;
import android.os.BatteryManager;
import android.os.Bundle;
import android.os.Handler;
@@ -98,7 +97,6 @@
protected static final int MSG_REPORT_EMERGENCY_CALL_ACTION = 318;
private static final int MSG_SCREEN_TURNED_ON = 319;
private static final int MSG_SCREEN_TURNED_OFF = 320;
- private static final int MSG_NFC_UNLOCK = 321;
private static final int MSG_KEYGUARD_BOUNCER_CHANGED = 322;
private static KeyguardUpdateMonitor sInstance;
@@ -204,9 +202,6 @@
case MSG_SCREEN_TURNED_ON:
handleScreenTurnedOn();
break;
- case MSG_NFC_UNLOCK:
- handleNfcUnlock();
- break;
}
}
};
@@ -356,15 +351,6 @@
}
};
- private final BroadcastReceiver mNfcUnlockReceiver = new BroadcastReceiver() {
- @Override
- public void onReceive(Context context, Intent intent) {
- if (NfcUnlock.ACTION_NFC_UNLOCK.equals(intent.getAction())) {
- mHandler.sendEmptyMessage(MSG_NFC_UNLOCK);
- }
- }
- }
- ;
/**
* When we receive a
* {@link com.android.internal.telephony.TelephonyIntents#ACTION_SIM_STATE_CHANGED} broadcast,
@@ -549,15 +535,6 @@
}
}
- private void handleNfcUnlock() {
- for (int i = 0; i < mCallbacks.size(); i++) {
- KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get();
- if (cb != null) {
- cb.onNfcUnlock();
- }
- }
- }
-
private KeyguardUpdateMonitor(Context context) {
mContext = context;
@@ -587,11 +564,6 @@
filter.addAction(Intent.ACTION_USER_REMOVED);
context.registerReceiver(mBroadcastReceiver, filter);
- final IntentFilter nfcUnlockIntentFilter = new IntentFilter();
- nfcUnlockIntentFilter.addAction(NfcUnlock.ACTION_NFC_UNLOCK);
- context.registerReceiver(mNfcUnlockReceiver, nfcUnlockIntentFilter,
- NfcUnlock.NFC_UNLOCK_PERMISSION, null /* run on default scheduler */);
-
final IntentFilter bootCompleteFilter = new IntentFilter();
bootCompleteFilter.setPriority(IntentFilter.SYSTEM_HIGH_PRIORITY);
bootCompleteFilter.addAction(Intent.ACTION_BOOT_COMPLETED);
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitorCallback.java b/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitorCallback.java
index 91a024f..76206f7 100644
--- a/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitorCallback.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitorCallback.java
@@ -179,10 +179,4 @@
* {@link WindowManagerPolicy#OFF_BECAUSE_OF_TIMEOUT}.
*/
public void onScreenTurnedOff(int why) { }
-
- /**
- * Called when the NFC Service has found a tag that is registered for NFC unlock.
- */
- public void onNfcUnlock() { }
-
}
diff --git a/packages/SystemUI/proguard.flags b/packages/SystemUI/proguard.flags
index da37803..6d101d7 100644
--- a/packages/SystemUI/proguard.flags
+++ b/packages/SystemUI/proguard.flags
@@ -6,10 +6,6 @@
public void setGlowAlpha(float);
public void setGlowScale(float);
}
--keep class com.android.systemui.recents.views.TaskInfoView {
- public void setCircularClipRadius(float);
- public float getCircularClipRadius();
-}
-keep class com.android.systemui.statusbar.phone.PhoneStatusBar
-keep class com.android.systemui.statusbar.tv.TvStatusBar
diff --git a/services/core/java/com/android/server/VibratorService.java b/services/core/java/com/android/server/VibratorService.java
index 82c13e0..06dd3ed 100644
--- a/services/core/java/com/android/server/VibratorService.java
+++ b/services/core/java/com/android/server/VibratorService.java
@@ -47,6 +47,7 @@
import com.android.internal.app.IBatteryStats;
import java.util.ArrayList;
+import java.util.Iterator;
import java.util.LinkedList;
import java.util.ListIterator;
@@ -136,6 +137,10 @@
}
return true;
}
+
+ public boolean isSystemHapticFeedback() {
+ return (mUid == Process.SYSTEM_UID || mUid == 0) && mRepeat < 0;
+ }
}
VibratorService(Context context) {
@@ -622,20 +627,32 @@
}
}
}
- };
+ }
BroadcastReceiver mIntentReceiver = new BroadcastReceiver() {
+ @Override
public void onReceive(Context context, Intent intent) {
if (intent.getAction().equals(Intent.ACTION_SCREEN_OFF)) {
synchronized (mVibrations) {
- doCancelVibrateLocked();
-
- int size = mVibrations.size();
- for(int i = 0; i < size; i++) {
- unlinkVibration(mVibrations.get(i));
+ // When the system is entering a non-interactive state, we want
+ // to cancel vibrations in case a misbehaving app has abandoned
+ // them. However it may happen that the system is currently playing
+ // haptic feedback as part of the transition. So we don't cancel
+ // system vibrations.
+ if (mCurrentVibration != null
+ && !mCurrentVibration.isSystemHapticFeedback()) {
+ doCancelVibrateLocked();
}
- mVibrations.clear();
+ // Clear all remaining vibrations.
+ Iterator<Vibration> it = mVibrations.iterator();
+ while (it.hasNext()) {
+ Vibration vibration = it.next();
+ if (vibration != mCurrentVibration) {
+ unlinkVibration(vibration);
+ it.remove();
+ }
+ }
}
}
}
diff --git a/services/core/java/com/android/server/power/PowerManagerService.java b/services/core/java/com/android/server/power/PowerManagerService.java
index f0b7861..716ee27 100644
--- a/services/core/java/com/android/server/power/PowerManagerService.java
+++ b/services/core/java/com/android/server/power/PowerManagerService.java
@@ -148,20 +148,9 @@
private static final int USER_ACTIVITY_SCREEN_BRIGHT = 1 << 0;
private static final int USER_ACTIVITY_SCREEN_DIM = 1 << 1;
- // Default and minimum screen off timeout in milliseconds.
+ // Default timeout in milliseconds. This is only used until the settings
+ // provider populates the actual default value (R.integer.def_screen_off_timeout).
private static final int DEFAULT_SCREEN_OFF_TIMEOUT = 15 * 1000;
- private static final int MINIMUM_SCREEN_OFF_TIMEOUT = 10 * 1000;
-
- // The screen dim duration, in milliseconds.
- // This is subtracted from the end of the screen off timeout so the
- // minimum screen off timeout should be longer than this.
- private static final int SCREEN_DIM_DURATION = 7 * 1000;
-
- // The maximum screen dim time expressed as a ratio relative to the screen
- // off timeout. If the screen off timeout is very short then we want the
- // dim timeout to also be quite short so that most of the time is spent on.
- // Otherwise the user won't get much screen on time before dimming occurs.
- private static final float MAXIMUM_SCREEN_DIM_RATIO = 0.2f;
// The name of the boot animation service in init.rc.
private static final String BOOT_ANIMATION_SERVICE = "bootanim";
@@ -342,6 +331,20 @@
// True if dreams should be activated on dock.
private boolean mDreamsActivateOnDockSetting;
+ // The minimum screen off timeout, in milliseconds.
+ private int mMinimumScreenOffTimeoutConfig;
+
+ // The screen dim duration, in milliseconds.
+ // This is subtracted from the end of the screen off timeout so the
+ // minimum screen off timeout should be longer than this.
+ private int mMaximumScreenDimDurationConfig;
+
+ // The maximum screen dim time expressed as a ratio relative to the screen
+ // off timeout. If the screen off timeout is very short then we want the
+ // dim timeout to also be quite short so that most of the time is spent on.
+ // Otherwise the user won't get much screen on time before dimming occurs.
+ private float mMaximumScreenDimRatioConfig;
+
// The screen off timeout setting value in milliseconds.
private int mScreenOffTimeoutSetting;
@@ -583,6 +586,12 @@
com.android.internal.R.integer.config_dreamsBatteryLevelMinimumWhenNotPowered);
mDreamsBatteryLevelDrainCutoffConfig = resources.getInteger(
com.android.internal.R.integer.config_dreamsBatteryLevelDrainCutoff);
+ mMinimumScreenOffTimeoutConfig = resources.getInteger(
+ com.android.internal.R.integer.config_minimumScreenOffTimeout);
+ mMaximumScreenDimDurationConfig = resources.getInteger(
+ com.android.internal.R.integer.config_maximumScreenDimDuration);
+ mMaximumScreenDimRatioConfig = resources.getFraction(
+ com.android.internal.R.fraction.config_maximumScreenDimRatio, 1, 1);
}
private void updateSettingsLocked() {
@@ -1368,12 +1377,12 @@
if (mUserActivityTimeoutOverrideFromWindowManager >= 0) {
timeout = (int)Math.min(timeout, mUserActivityTimeoutOverrideFromWindowManager);
}
- return Math.max(timeout, MINIMUM_SCREEN_OFF_TIMEOUT);
+ return Math.max(timeout, mMinimumScreenOffTimeoutConfig);
}
private int getScreenDimDurationLocked(int screenOffTimeout) {
- return Math.min(SCREEN_DIM_DURATION,
- (int)(screenOffTimeout * MAXIMUM_SCREEN_DIM_RATIO));
+ return Math.min(mMaximumScreenDimDurationConfig,
+ (int)(screenOffTimeout * mMaximumScreenDimRatioConfig));
}
/**
@@ -2158,6 +2167,9 @@
pw.println(" mDreamsEnabledSetting=" + mDreamsEnabledSetting);
pw.println(" mDreamsActivateOnSleepSetting=" + mDreamsActivateOnSleepSetting);
pw.println(" mDreamsActivateOnDockSetting=" + mDreamsActivateOnDockSetting);
+ pw.println(" mMinimumScreenOffTimeoutConfig=" + mMinimumScreenOffTimeoutConfig);
+ pw.println(" mMaximumScreenDimDurationConfig=" + mMaximumScreenDimDurationConfig);
+ pw.println(" mMaximumScreenDimRatioConfig=" + mMaximumScreenDimRatioConfig);
pw.println(" mScreenOffTimeoutSetting=" + mScreenOffTimeoutSetting);
pw.println(" mMaximumScreenOffTimeoutFromDeviceAdmin="
+ mMaximumScreenOffTimeoutFromDeviceAdmin + " (enforced="
diff --git a/wifi/java/android/net/wifi/ScanResult.java b/wifi/java/android/net/wifi/ScanResult.java
index 3e3b6e3..cfd0a51 100644
--- a/wifi/java/android/net/wifi/ScanResult.java
+++ b/wifi/java/android/net/wifi/ScanResult.java
@@ -16,8 +16,8 @@
package android.net.wifi;
-import android.net.wifi.passpoint.PasspointInfo;
-import android.net.wifi.passpoint.PasspointManager;
+import android.net.wifi.passpoint.WifiPasspointInfo;
+import android.net.wifi.passpoint.WifiPasspointManager;
import android.os.Parcelable;
import android.os.Parcel;
@@ -80,10 +80,10 @@
/**
* Passpoint ANQP information. This is not fetched automatically.
- * Use {@link PasspointManager#requestAnqpInfo} to request ANQP info.
+ * Use {@link WifiPasspointManager#requestAnqpInfo} to request ANQP info.
* {@hide}
*/
- public PasspointInfo passpoint;
+ public WifiPasspointInfo passpoint;
/**
* {@hide}
@@ -132,7 +132,7 @@
distanceSdCm = source.distanceSdCm;
seen = source.seen;
if (source.passpoint != null)
- passpoint = new PasspointInfo(source.passpoint);
+ passpoint = new WifiPasspointInfo(source.passpoint);
}
}
@@ -219,7 +219,7 @@
in.readInt()
);
if (in.readInt() == 1) {
- sr.passpoint = PasspointInfo.CREATOR.createFromParcel(in);
+ sr.passpoint = WifiPasspointInfo.CREATOR.createFromParcel(in);
}
return sr;
}
diff --git a/wifi/java/android/net/wifi/WifiEnterpriseConfig.java b/wifi/java/android/net/wifi/WifiEnterpriseConfig.java
index 69be2cf..1484d49 100644
--- a/wifi/java/android/net/wifi/WifiEnterpriseConfig.java
+++ b/wifi/java/android/net/wifi/WifiEnterpriseConfig.java
@@ -224,8 +224,12 @@
public static final int TTLS = 2;
/** EAP-Password */
public static final int PWD = 3;
+ /** EAP-Subscriber Identity Module */
+ public static final int SIM = 4;
+ /** EAP-Authentication and Key Agreement */
+ public static final int AKA = 5;
/** @hide */
- public static final String[] strings = { "PEAP", "TLS", "TTLS", "PWD" };
+ public static final String[] strings = { "PEAP", "TLS", "TTLS", "PWD", "SIM", "AKA" };
/** Prevent initialization */
private Eap() {}
@@ -271,6 +275,8 @@
case Eap.PWD:
case Eap.TLS:
case Eap.TTLS:
+ case Eap.SIM:
+ case Eap.AKA:
mFields.put(EAP_KEY, Eap.strings[eapMethod]);
mFields.put(OPP_KEY_CACHING, "1");
break;
diff --git a/wifi/java/android/net/wifi/passpoint/IPasspointManager.aidl b/wifi/java/android/net/wifi/passpoint/IWifiPasspointManager.aidl
similarity index 87%
rename from wifi/java/android/net/wifi/passpoint/IPasspointManager.aidl
rename to wifi/java/android/net/wifi/passpoint/IWifiPasspointManager.aidl
index e57db64..8375d09 100644
--- a/wifi/java/android/net/wifi/passpoint/IPasspointManager.aidl
+++ b/wifi/java/android/net/wifi/passpoint/IWifiPasspointManager.aidl
@@ -19,11 +19,11 @@
import android.os.Messenger;
/**
- * Interface that allows controlling and querying Passpoint connectivity.
+ * Interface that allows controlling and querying Wifi Passpoint connectivity.
*
* {@hide}
*/
-interface IPasspointManager
+interface IWifiPasspointManager
{
Messenger getMessenger();
int getPasspointState();
diff --git a/wifi/java/android/net/wifi/passpoint/PasspointCredential.aidl b/wifi/java/android/net/wifi/passpoint/PasspointCredential.aidl
deleted file mode 100644
index 6f75cbe..0000000
--- a/wifi/java/android/net/wifi/passpoint/PasspointCredential.aidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * Copyright (c) 2014, 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.
- */
-
-package android.net.wifi.passpoint;
-
-parcelable PasspointCredential;
diff --git a/wifi/java/android/net/wifi/passpoint/PasspointCredential.java b/wifi/java/android/net/wifi/passpoint/PasspointCredential.java
deleted file mode 100644
index 4218f23..0000000
--- a/wifi/java/android/net/wifi/passpoint/PasspointCredential.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (C) 2014 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.
- */
-
-package android.net.wifi.passpoint;
-
-import android.os.Parcelable;
-import android.os.Parcel;
-
-public class PasspointCredential implements Parcelable {
-
- @Override
- public String toString() {
- // TODO
- return null;
- }
-
- /** Implement the Parcelable interface {@hide} */
- @Override
- public int describeContents() {
- return 0;
- }
-
- /** Implement the Parcelable interface {@hide} */
- @Override
- public void writeToParcel(Parcel dest, int flags) {
- // TODO
- }
-
- /** Implement the Parcelable interface {@hide} */
- public static final Creator<PasspointCredential> CREATOR =
- new Creator<PasspointCredential>() {
- @Override
- public PasspointCredential createFromParcel(Parcel in) {
- // TODO
- return null;
- }
-
- @Override
- public PasspointCredential[] newArray(int size) {
- return new PasspointCredential[size];
- }
- };
-}
diff --git a/wifi/java/android/net/wifi/passpoint/PasspointInfo.java b/wifi/java/android/net/wifi/passpoint/PasspointInfo.java
deleted file mode 100644
index d57b0aa..0000000
--- a/wifi/java/android/net/wifi/passpoint/PasspointInfo.java
+++ /dev/null
@@ -1,274 +0,0 @@
-/*
- * Copyright (C) 2014 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.
- */
-
-package android.net.wifi.passpoint;
-
-import android.os.Parcel;
-import android.os.Parcelable;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * TODO: doc
- */
-public class PasspointInfo implements Parcelable {
-
- /** TODO doc */
- public static final int ANQP_CAPABILITY = 1 << 0;
-
- /** TODO doc */
- public static final int VENUE_NAME = 1 << 1;
-
- /** TODO doc */
- public static final int NETWORK_AUTH_TYPE = 1 << 2;
-
- /** TODO doc */
- public static final int ROAMING_CONSORTIUM = 1 << 3;
-
- /** TODO doc */
- public static final int IP_ADDR_TYPE_AVAILABILITY = 1 << 4;
-
- /** TODO doc */
- public static final int NAI_REALM = 1 << 5;
-
- /** TODO doc */
- public static final int CELLULAR_NETWORK = 1 << 6;
-
- /** TODO doc */
- public static final int DOMAIN_NAME = 1 << 7;
-
- /** TODO doc */
- public static final int HOTSPOT_CAPABILITY = 1 << 8;
-
- /** TODO doc */
- public static final int OPERATOR_FRIENDLY_NAME = 1 << 9;
-
- /** TODO doc */
- public static final int WAN_METRICS = 1 << 10;
-
- /** TODO doc */
- public static final int CONNECTION_CAPABILITY = 1 << 11;
-
- /** TODO doc */
- public static final int OSU_PROVIDER = 1 << 12;
-
- /** TODO doc */
- public static final int PRESET_CRED_MATCH =
- ANQP_CAPABILITY |
- HOTSPOT_CAPABILITY |
- NAI_REALM |
- CELLULAR_NETWORK |
- DOMAIN_NAME;
-
- /** TODO doc */
- public static final int PRESET_ALL =
- ANQP_CAPABILITY |
- VENUE_NAME |
- NETWORK_AUTH_TYPE |
- ROAMING_CONSORTIUM |
- IP_ADDR_TYPE_AVAILABILITY |
- NAI_REALM |
- CELLULAR_NETWORK |
- DOMAIN_NAME |
- HOTSPOT_CAPABILITY |
- OPERATOR_FRIENDLY_NAME |
- WAN_METRICS |
- CONNECTION_CAPABILITY |
- OSU_PROVIDER;
-
-
- /** TODO doc */
- public String bssid;
-
- /** TODO doc */
- public String venueName;
-
- /** TODO doc */
- public String networkAuthType;
-
- /** TODO doc */
- public String roamingConsortium;
-
- /** TODO doc */
- public String ipAddrTypeAvaibility;
-
- /** TODO doc */
- public String naiRealm;
-
- /** TODO doc */
- public String cellularNetwork;
-
- /** TODO doc */
- public String domainName;
-
- /** TODO doc */
- public String operatorFriendlyName;
-
- /** TODO doc */
- public String wanMetrics;
-
- /** TODO doc */
- public String connectionCapability;
-
- /** TODO doc */
- public List<PasspointOsuProvider> osuProviderList;
-
-
- /** default constructor @hide */
- public PasspointInfo() {
-// osuProviderList = new ArrayList<OsuProvider>();
- }
-
- /** copy constructor @hide */
- public PasspointInfo(PasspointInfo source) {
- // TODO
- bssid = source.bssid;
- venueName = source.venueName;
- networkAuthType = source.networkAuthType;
- roamingConsortium = source.roamingConsortium;
- ipAddrTypeAvaibility = source.ipAddrTypeAvaibility;
- naiRealm = source.naiRealm;
- cellularNetwork = source.cellularNetwork;
- domainName = source.domainName;
- operatorFriendlyName = source.operatorFriendlyName;
- wanMetrics = source.wanMetrics;
- connectionCapability = source.connectionCapability;
- if (source.osuProviderList != null) {
- osuProviderList = new ArrayList<PasspointOsuProvider>();
- for (PasspointOsuProvider osu : source.osuProviderList)
- osuProviderList.add(new PasspointOsuProvider(osu));
- }
- }
-
- /**
- * Convert mask to ANQP subtypes, for supplicant command use.
- *
- * @param mask The ANQP subtypes mask.
- * @return String of ANQP subtypes, good for supplicant command use
- * @hide
- */
- public static String toAnqpSubtypes(int mask) {
- StringBuilder sb = new StringBuilder();
- if ((mask & ANQP_CAPABILITY) != 0) sb.append("257,");
- if ((mask & VENUE_NAME) != 0) sb.append("258,");
- if ((mask & NETWORK_AUTH_TYPE) != 0) sb.append("260,");
- if ((mask & ROAMING_CONSORTIUM) != 0) sb.append("261,");
- if ((mask & IP_ADDR_TYPE_AVAILABILITY) != 0) sb.append("262,");
- if ((mask & NAI_REALM) != 0) sb.append("263,");
- if ((mask & CELLULAR_NETWORK) != 0) sb.append("264,");
- if ((mask & DOMAIN_NAME) != 0) sb.append("268,");
- if ((mask & HOTSPOT_CAPABILITY) != 0) sb.append("hs20:2,");
- if ((mask & OPERATOR_FRIENDLY_NAME) != 0) sb.append("hs20:3,");
- if ((mask & WAN_METRICS) != 0) sb.append("hs20:4,");
- if ((mask & CONNECTION_CAPABILITY) != 0) sb.append("hs20:5,");
- if ((mask & OSU_PROVIDER) != 0) sb.append("hs20:8,");
- if (sb.length() > 0) sb.deleteCharAt(sb.length() - 1);
- return sb.toString();
- }
-
- @Override
- public String toString() {
- StringBuffer sb = new StringBuffer();
- sb.append("BSSID: ").append(bssid);
- if (venueName != null)
- sb.append(" venueName: ").append(venueName);
- if (networkAuthType != null)
- sb.append(" networkAuthType: ").append(networkAuthType);
- if (roamingConsortium != null)
- sb.append(" roamingConsortium: ").append(roamingConsortium);
- if (ipAddrTypeAvaibility != null)
- sb.append(" ipAddrTypeAvaibility: ").append(ipAddrTypeAvaibility);
- if (naiRealm != null)
- sb.append(" naiRealm: ").append(naiRealm);
- if (cellularNetwork != null)
- sb.append(" cellularNetwork: ").append(cellularNetwork);
- if (domainName != null)
- sb.append(" domainName: ").append(domainName);
- if (operatorFriendlyName != null)
- sb.append(" operatorFriendlyName: ").append(operatorFriendlyName);
- if (wanMetrics != null)
- sb.append(" wanMetrics: ").append(wanMetrics);
- if (connectionCapability != null)
- sb.append(" connectionCapability: ").append(connectionCapability);
- if (osuProviderList != null)
- sb.append(" osuProviderList: (size=" + osuProviderList.size() + ")");
- return sb.toString();
- }
-
- /** Implement the Parcelable interface {@hide} */
- @Override
- public void writeToParcel(Parcel out, int flags) {
- out.writeValue(bssid);
- out.writeValue(venueName);
- out.writeValue(networkAuthType);
- out.writeValue(roamingConsortium);
- out.writeValue(ipAddrTypeAvaibility);
- out.writeValue(naiRealm);
- out.writeValue(cellularNetwork);
- out.writeValue(domainName);
- out.writeValue(operatorFriendlyName);
- out.writeValue(wanMetrics);
- out.writeValue(connectionCapability);
- if (osuProviderList == null) {
- out.writeInt(0);
- } else {
- out.writeInt(osuProviderList.size());
- for (PasspointOsuProvider osu : osuProviderList)
- osu.writeToParcel(out, flags);
- }
- }
-
- /** Implement the Parcelable interface {@hide} */
- @Override
- public int describeContents() {
- return 0;
- }
-
- /** Implement the Parcelable interface {@hide} */
- public static final Parcelable.Creator<PasspointInfo> CREATOR =
- new Parcelable.Creator<PasspointInfo>() {
- @Override
- public PasspointInfo createFromParcel(Parcel in) {
- PasspointInfo p = new PasspointInfo();
- p.bssid = (String) in.readValue(String.class.getClassLoader());
- p.venueName = (String) in.readValue(String.class.getClassLoader());
- p.networkAuthType = (String) in.readValue(String.class.getClassLoader());
- p.roamingConsortium = (String) in.readValue(String.class.getClassLoader());
- p.ipAddrTypeAvaibility = (String) in.readValue(String.class.getClassLoader());
- p.naiRealm = (String) in.readValue(String.class.getClassLoader());
- p.cellularNetwork = (String) in.readValue(String.class.getClassLoader());
- p.domainName = (String) in.readValue(String.class.getClassLoader());
- p.operatorFriendlyName = (String) in.readValue(String.class.getClassLoader());
- p.wanMetrics = (String) in.readValue(String.class.getClassLoader());
- p.connectionCapability = (String) in.readValue(String.class.getClassLoader());
- int n = in.readInt();
- if (n > 0) {
- p.osuProviderList = new ArrayList<PasspointOsuProvider>();
- for (int i = 0; i < n; i++) {
- PasspointOsuProvider osu = PasspointOsuProvider.CREATOR.createFromParcel(in);
- p.osuProviderList.add(osu);
- }
- }
- return p;
- }
-
- @Override
- public PasspointInfo[] newArray(int size) {
- return new PasspointInfo[size];
- }
- };
-}
diff --git a/wifi/java/android/net/wifi/passpoint/PasspointPolicy.aidl b/wifi/java/android/net/wifi/passpoint/PasspointPolicy.aidl
deleted file mode 100644
index c2cc731..0000000
--- a/wifi/java/android/net/wifi/passpoint/PasspointPolicy.aidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * Copyright (c) 2014, 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.
- */
-
-package android.net.wifi.passpoint;
-
-parcelable PasspointPolicy;
diff --git a/wifi/java/android/net/wifi/passpoint/PasspointPolicy.java b/wifi/java/android/net/wifi/passpoint/PasspointPolicy.java
deleted file mode 100644
index 3a8806b..0000000
--- a/wifi/java/android/net/wifi/passpoint/PasspointPolicy.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (C) 2014 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.
- */
-
-package android.net.wifi.passpoint;
-
-import android.os.Parcelable;
-import android.os.Parcel;
-
-public class PasspointPolicy implements Parcelable {
-
- @Override
- public String toString() {
- // TODO
- return null;
- }
-
- /** Implement the Parcelable interface {@hide} */
- @Override
- public int describeContents() {
- return 0;
- }
-
- /** Implement the Parcelable interface {@hide} */
- @Override
- public void writeToParcel(Parcel dest, int flags) {
- // TODO
- }
-
- /** Implement the Parcelable interface {@hide} */
- public static final Creator<PasspointPolicy> CREATOR =
- new Creator<PasspointPolicy>() {
- @Override
- public PasspointPolicy createFromParcel(Parcel in) {
- return null;
- }
-
- @Override
- public PasspointPolicy[] newArray(int size) {
- return new PasspointPolicy[size];
- }
- };
-}
diff --git a/wifi/java/android/net/wifi/passpoint/PasspointOsuProvider.aidl b/wifi/java/android/net/wifi/passpoint/WifiPasspointCredential.aidl
similarity index 94%
rename from wifi/java/android/net/wifi/passpoint/PasspointOsuProvider.aidl
rename to wifi/java/android/net/wifi/passpoint/WifiPasspointCredential.aidl
index f5ecb7c..cfd3605 100644
--- a/wifi/java/android/net/wifi/passpoint/PasspointOsuProvider.aidl
+++ b/wifi/java/android/net/wifi/passpoint/WifiPasspointCredential.aidl
@@ -16,4 +16,4 @@
package android.net.wifi.passpoint;
-parcelable PasspointOsuProvider;
+parcelable WifiPasspointCredential;
diff --git a/wifi/java/android/net/wifi/passpoint/WifiPasspointCredential.java b/wifi/java/android/net/wifi/passpoint/WifiPasspointCredential.java
new file mode 100644
index 0000000..08b430f
--- /dev/null
+++ b/wifi/java/android/net/wifi/passpoint/WifiPasspointCredential.java
@@ -0,0 +1,711 @@
+/*
+ * Copyright (C) 2014 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.
+ */
+
+package android.net.wifi.passpoint;
+
+import android.net.wifi.WifiEnterpriseConfig;
+import android.os.Parcelable;
+import android.os.Parcel;
+
+import java.util.Collection;
+import java.util.Set;
+import java.util.Iterator;
+import java.util.Map;
+
+public class WifiPasspointCredential implements Parcelable {
+
+ private final static String TAG = "PasspointCredential";
+ private String mWifiSPFQDN;
+ private String mCredentialName;
+ private String mUpdateIdentifier;
+ private String mSubscriptionUpdateMethod;
+ private String mType;
+ private String mInnerMethod;
+ private String mCertType;
+ private String mCertSha256Fingerprint;
+ private String mUsername;
+ private String mPasswd;
+ private String mImsi;
+ private String mMcc;
+ private String mMnc;
+ private String mCaRootCert;
+ private String mRealm;
+ private int mPriority; //User preferred priority; The smaller, the higher
+ private boolean mUserPreferred = false;
+ private String mHomeSpFqdn;
+ private String mFriendlyName;
+ private String mOtherhomepartnerFqdn;
+ private String mClientCert;
+ private String mCreationDate;
+ private String mExpirationDate;
+
+ private String mSubscriptionDMAccUsername;
+ private String mSubscriptionDMAccPassword;
+ private String mSubscriptionUpdateInterval;
+
+ private String mPolicyUpdateURI;
+ private String mPolicyUpdateInterval;
+ private String mPolicyDMAccUsername;
+ private String mPolicyDMAccPassword;
+ private String mPolicyUpdateRestriction;
+ private String mPolicyUpdateMethod;
+
+ private Collection<WifiPasspointDmTree.PreferredRoamingPartnerList> mPreferredRoamingPartnerList;
+ private Collection<WifiPasspointDmTree.HomeOIList> mHomeOIList;
+ private Collection<WifiPasspointDmTree.MinBackhaulThresholdNetwork> mMinBackhaulThresholdNetwork;
+ private Collection<WifiPasspointDmTree.RequiredProtoPortTuple> mRequiredProtoPortTuple;
+ private Collection<WifiPasspointDmTree.SPExclusionList> mSpExclusionList;
+ private String mMaxBssLoad;
+
+ private boolean mIsMachineRemediation;
+
+ private String mAAACertURL;
+ private String mAAASha256Fingerprint;
+
+ private String mSubscriptionUpdateRestriction;
+ private String mSubscriptionUpdateURI;
+
+ private boolean mCheckAaaServerCertStatus;
+
+ /** @hide */
+ public WifiPasspointCredential() {
+
+ }
+
+ /**
+ * Constructor
+ * @param realm Realm of the passpoint credential
+ * @param config Credential information, must be either EAP-TLS or EAP-TTLS.
+ * @see WifiEnterpriseConfig
+ */
+ public WifiPasspointCredential(String realm, WifiEnterpriseConfig config) {
+ mRealm = realm;
+ switch (config.getEapMethod()) {
+ case WifiEnterpriseConfig.Eap.TLS:
+ // TODO;
+ break;
+ case WifiEnterpriseConfig.Eap.TTLS:
+ // TODO;
+ break;
+ default:
+ // ignore
+ }
+ }
+
+ /** @hide */
+ public WifiPasspointCredential(String type,
+ String caroot,
+ String clientcert,
+ WifiPasspointDmTree.SpFqdn sp,
+ WifiPasspointDmTree.CredentialInfo credinfo) {
+
+ if (credinfo == null) {
+ return;
+ }
+
+ mType = type;
+ mCaRootCert = caroot;
+ mClientCert = clientcert;
+
+ mWifiSPFQDN = sp.nodeName;
+ mUpdateIdentifier = sp.perProviderSubscription.UpdateIdentifier;
+
+ mCredentialName = credinfo.nodeName;
+ Set set = credinfo.homeSP.otherHomePartners.entrySet();
+ Iterator i = set.iterator();
+ if (i.hasNext()) {
+ Map.Entry entry3 = (Map.Entry) i.next();
+ WifiPasspointDmTree.OtherHomePartners ohp = (WifiPasspointDmTree.OtherHomePartners) entry3.getValue();
+ mOtherhomepartnerFqdn = ohp.FQDN;
+ }
+
+ set = credinfo.aAAServerTrustRoot.entrySet();
+ i = set.iterator();
+ if (i.hasNext()) {
+ Map.Entry entry3 = (Map.Entry) i.next();
+ WifiPasspointDmTree.AAAServerTrustRoot aaa = (WifiPasspointDmTree.AAAServerTrustRoot) entry3.getValue();
+ mAAACertURL = aaa.CertURL;
+ mAAASha256Fingerprint = aaa.CertSHA256Fingerprint;
+ }
+
+ mCertType = credinfo.credential.digitalCertificate.CertificateType;
+ mCertSha256Fingerprint = credinfo.credential.digitalCertificate.CertSHA256Fingerprint;
+ mUsername = credinfo.credential.usernamePassword.Username;
+ mPasswd = credinfo.credential.usernamePassword.Password;
+ mIsMachineRemediation = credinfo.credential.usernamePassword.MachineManaged;
+ mInnerMethod = credinfo.credential.usernamePassword.eAPMethod.InnerMethod;
+ mImsi = credinfo.credential.sim.IMSI;
+ mCreationDate = credinfo.credential.CreationDate;
+ mExpirationDate = credinfo.credential.ExpirationDate;
+ mRealm = credinfo.credential.Realm;
+
+ if (credinfo.credentialPriority == null) {
+ credinfo.credentialPriority = "128";
+ }
+ mPriority = Integer.parseInt(credinfo.credentialPriority);
+
+ mHomeSpFqdn = credinfo.homeSP.FQDN;
+
+ mSubscriptionUpdateInterval = credinfo.subscriptionUpdate.UpdateInterval;
+ mSubscriptionUpdateMethod = credinfo.subscriptionUpdate.UpdateMethod;
+ mSubscriptionUpdateRestriction = credinfo.subscriptionUpdate.Restriction;
+ mSubscriptionUpdateURI = credinfo.subscriptionUpdate.URI;
+ mSubscriptionDMAccUsername = credinfo.subscriptionUpdate.usernamePassword.Username;
+ mSubscriptionDMAccPassword = credinfo.subscriptionUpdate.usernamePassword.Password;
+
+ mPolicyUpdateURI = credinfo.policy.policyUpdate.URI;
+ mPolicyUpdateInterval = credinfo.policy.policyUpdate.UpdateInterval;
+ mPolicyDMAccUsername = credinfo.policy.policyUpdate.usernamePassword.Username;
+ mPolicyDMAccPassword = credinfo.policy.policyUpdate.usernamePassword.Password;
+ mPolicyUpdateRestriction = credinfo.policy.policyUpdate.Restriction;
+ mPolicyUpdateMethod = credinfo.policy.policyUpdate.UpdateMethod;
+ mPreferredRoamingPartnerList = credinfo.policy.preferredRoamingPartnerList.values();
+ mMinBackhaulThresholdNetwork = credinfo.policy.minBackhaulThreshold.values();
+ mRequiredProtoPortTuple = credinfo.policy.requiredProtoPortTuple.values();
+ mMaxBssLoad = credinfo.policy.maximumBSSLoadValue;
+ mSpExclusionList = credinfo.policy.sPExclusionList.values();
+
+ mHomeOIList = credinfo.homeSP.homeOIList.values();
+ mFriendlyName = credinfo.homeSP.FriendlyName;
+ mCheckAaaServerCertStatus = credinfo.credential.CheckAAAServerCertStatus;
+ }
+
+ /** @hide */
+ public WifiPasspointCredential(String type,
+ String caroot,
+ String clientcert,
+ String mcc,
+ String mnc,
+ WifiPasspointDmTree.SpFqdn sp,
+ WifiPasspointDmTree.CredentialInfo credinfo) {
+
+ if (credinfo == null) {
+ return;
+ }
+
+ mType = type;
+ mCaRootCert = caroot;
+ mClientCert = clientcert;
+
+ mWifiSPFQDN = sp.nodeName;
+ mUpdateIdentifier = sp.perProviderSubscription.UpdateIdentifier;
+
+ mCredentialName = credinfo.nodeName;
+ Set set = credinfo.homeSP.otherHomePartners.entrySet();
+ Iterator i = set.iterator();
+ if (i.hasNext()) {
+ Map.Entry entry3 = (Map.Entry) i.next();
+ WifiPasspointDmTree.OtherHomePartners ohp = (WifiPasspointDmTree.OtherHomePartners) entry3.getValue();
+ mOtherhomepartnerFqdn = ohp.FQDN;
+ }
+
+ set = credinfo.aAAServerTrustRoot.entrySet();
+ i = set.iterator();
+ if (i.hasNext()) {
+ Map.Entry entry3 = (Map.Entry) i.next();
+ WifiPasspointDmTree.AAAServerTrustRoot aaa = (WifiPasspointDmTree.AAAServerTrustRoot) entry3.getValue();
+ mAAACertURL = aaa.CertURL;
+ mAAASha256Fingerprint = aaa.CertSHA256Fingerprint;
+ }
+
+ mCertType = credinfo.credential.digitalCertificate.CertificateType;
+ mCertSha256Fingerprint = credinfo.credential.digitalCertificate.CertSHA256Fingerprint;
+ mUsername = credinfo.credential.usernamePassword.Username;
+ mPasswd = credinfo.credential.usernamePassword.Password;
+ mIsMachineRemediation = credinfo.credential.usernamePassword.MachineManaged;
+ mInnerMethod = credinfo.credential.usernamePassword.eAPMethod.InnerMethod;
+ mImsi = credinfo.credential.sim.IMSI;
+ mMcc = mcc;
+ mMnc = mnc;
+ mCreationDate = credinfo.credential.CreationDate;
+ mExpirationDate = credinfo.credential.ExpirationDate;
+ mRealm = credinfo.credential.Realm;
+
+ if (credinfo.credentialPriority == null) {
+ credinfo.credentialPriority = "128";
+ }
+ mPriority = Integer.parseInt(credinfo.credentialPriority);
+
+ mHomeSpFqdn = credinfo.homeSP.FQDN;
+
+ mSubscriptionUpdateMethod = credinfo.subscriptionUpdate.UpdateMethod;
+ mSubscriptionUpdateRestriction = credinfo.subscriptionUpdate.Restriction;
+ mSubscriptionUpdateURI = credinfo.subscriptionUpdate.URI;
+ mSubscriptionDMAccUsername = credinfo.subscriptionUpdate.usernamePassword.Username;
+ mSubscriptionDMAccPassword = credinfo.subscriptionUpdate.usernamePassword.Password;
+
+ mPolicyUpdateURI = credinfo.policy.policyUpdate.URI;
+ mPolicyUpdateInterval = credinfo.policy.policyUpdate.UpdateInterval;
+ mPolicyDMAccUsername = credinfo.policy.policyUpdate.usernamePassword.Username;
+ mPolicyDMAccPassword = credinfo.policy.policyUpdate.usernamePassword.Password;
+ mPolicyUpdateRestriction = credinfo.policy.policyUpdate.Restriction;
+ mPolicyUpdateMethod = credinfo.policy.policyUpdate.UpdateMethod;
+ mPreferredRoamingPartnerList = credinfo.policy.preferredRoamingPartnerList.values();
+ mMinBackhaulThresholdNetwork = credinfo.policy.minBackhaulThreshold.values();
+ mRequiredProtoPortTuple = credinfo.policy.requiredProtoPortTuple.values();
+ mMaxBssLoad = credinfo.policy.maximumBSSLoadValue;
+ mSpExclusionList = credinfo.policy.sPExclusionList.values();
+
+ mHomeOIList = credinfo.homeSP.homeOIList.values();
+ mFriendlyName = credinfo.homeSP.FriendlyName;
+ }
+
+ /** @hide */
+ public String getUpdateIdentifier() {
+ return mUpdateIdentifier;
+ }
+
+ /** @hide */
+ public String getUpdateMethod() {
+ return mSubscriptionUpdateMethod;
+ }
+
+ /** @hide */
+ public void setUpdateMethod(String method) {
+ mSubscriptionUpdateMethod = method;
+ }
+
+ /** @hide */
+ public String getWifiSPFQDN() {
+ return mWifiSPFQDN;
+ }
+
+ /** @hide */
+ public String getCredName() {
+ return mCredentialName;
+ }
+
+ /** @hide */
+ public String getEapMethodStr() {
+ return mType;
+ }
+
+ /**
+ * Get EAP method of this Passpoint credential.
+ * @return EAP method, refer to {@link WifiEnterpriseConfig.Eap} for possible return values
+ */
+ public int getEapMethod() {
+ return 0;
+ }
+
+ /** @hide */
+ public String getCertType() {
+ return mCertType;
+ }
+
+ /** @hide */
+ public String getCertSha256Fingerprint() {
+ return mCertSha256Fingerprint;
+ }
+
+ /**
+ * Get the user name of this Passpoint credential, for EAP-TTLS only.
+ * @return user name
+ */
+ public String getUserName() {
+ return mUsername;
+ }
+
+ /** @hide */
+ public String getPassword() {
+ // TODO: guarded by connectivity internal
+ return mPasswd;
+ }
+
+ /**
+ * Get the IMSI of this Passpoint credential, for EAP-SIM / EAP-AKA only.
+ * @return IMSI
+ */
+ public String getImsi() {
+ return mImsi;
+ }
+
+ /** @hide */
+ public String getMcc() {
+ return mMcc;
+ }
+
+ /** @hide */
+ public String getMnc() {
+ return mMnc;
+ }
+
+ /** @hide */
+ public String getCaRootCert() {
+ return mCaRootCert;
+ }
+
+ /**
+ * Get the client certificate path of this Passpoint credential, for EAP-TLS only.
+ * @return client certificate path
+ */
+ public String getClientCertPath() {
+ return mClientCert;
+ }
+
+ /**
+ * Get the realm of this Passpoint credential, for all EAP methods.
+ * @return Realm
+ */
+ public String getRealm() {
+ return mRealm;
+ }
+
+ /** @hide */
+ public int getPriority() {
+ if (mUserPreferred) {
+ return 0;
+ }
+
+ return mPriority;
+ }
+
+ /**
+ * Get the fully qualified domain name (FQDN) of this Passpoint credential,
+ * for all EAP methods.
+ * @return FQDN
+ */
+ public String getFqdn() {
+ return mHomeSpFqdn;
+ }
+
+ /** @hide */
+ public String getOtherhomepartners() {
+ return mOtherhomepartnerFqdn;
+ }
+
+ /** @hide */
+ public String getSubscriptionDMAccUsername() {
+ return mSubscriptionDMAccUsername;
+ }
+
+ /** @hide */
+ public String getSubscriptionDMAccPassword() {
+ return mSubscriptionDMAccPassword;
+ }
+
+ /** @hide */
+ public String getPolicyUpdateURI() {
+ return mPolicyUpdateURI;
+ }
+
+ /** @hide */
+ public String getPolicyUpdateInterval() {
+ return mPolicyUpdateInterval;
+ }
+
+ /** @hide */
+ public String getPolicyDMAccUsername() {
+ return mPolicyDMAccUsername;
+ }
+
+ /** @hide */
+ public String getPolicyDMAccPassword() {
+ return mPolicyDMAccPassword;
+ }
+
+ /** @hide */
+ public String getPolicyUpdateRestriction() {
+ return mPolicyUpdateRestriction;
+ }
+
+ /** @hide */
+ public String getPolicyUpdateMethod() {
+ return mPolicyUpdateMethod;
+ }
+
+ /** @hide */
+ public String getCreationDate() {
+ return mCreationDate;
+ }
+
+ /** @hide */
+ public String getExpirationDate() {
+ return mExpirationDate;
+ }
+
+ /** @hide */
+ public void setExpirationDate(String expirationdate) {
+ mExpirationDate = expirationdate;
+ }
+
+ /** @hide */
+ public Collection<WifiPasspointDmTree.PreferredRoamingPartnerList> getPrpList() {
+ return mPreferredRoamingPartnerList;
+ }
+
+ /** @hide */
+ public Collection<WifiPasspointDmTree.HomeOIList> getHomeOIList() {
+ return mHomeOIList;
+ }
+
+ /** @hide */
+ public Collection<WifiPasspointDmTree.MinBackhaulThresholdNetwork> getBackhaulThresholdList() {
+ return mMinBackhaulThresholdNetwork;
+ }
+
+ /** @hide */
+ public Collection<WifiPasspointDmTree.RequiredProtoPortTuple> getRequiredProtoPortList() {
+ return mRequiredProtoPortTuple;
+ }
+
+ /** @hide */
+ public Collection<WifiPasspointDmTree.SPExclusionList> getSPExclusionList() {
+ return mSpExclusionList;
+ }
+
+ /** @hide */
+ public boolean getIsMachineRemediation() {
+ return mIsMachineRemediation;
+ }
+
+ /** @hide */
+ public String getAAACertURL() {
+ return mAAACertURL;
+ }
+
+ /** @hide */
+ public String getAAASha256Fingerprint() {
+ return mAAASha256Fingerprint;
+ }
+
+ /** @hide */
+ public String getSubscriptionUpdateRestriction() {
+ return mSubscriptionUpdateRestriction;
+ }
+
+ /** @hide */
+ public String getSubscriptionUpdateURI() {
+ return mSubscriptionUpdateURI;
+ }
+
+ /** @hide */
+ public String getSubscriptionUpdateInterval() {
+ return mSubscriptionUpdateInterval;
+ }
+
+ /** @hide */
+ public String getFriendlyName() {
+ return mFriendlyName;
+ }
+
+ /** @hide */
+ public String getMaxBssLoad() {
+ return mMaxBssLoad;
+ }
+
+ /** @hide */
+ public boolean getUserPreference() {
+ return mUserPreferred;
+ }
+
+ /** @hide */
+ public boolean getCheckAaaServerCertStatus() {
+ return mCheckAaaServerCertStatus;
+ }
+
+ /** @hide */
+ public void setUserPreference(boolean value) {
+ mUserPreferred = value;
+ }
+
+ @Override
+ /** @hide */
+ public boolean equals(Object obj) {
+ boolean result = false;
+ if (obj instanceof WifiPasspointCredential) {
+ final WifiPasspointCredential other = (WifiPasspointCredential) obj;
+ if (this.mType.equals(other.mType)) {
+ if (this.mType.equals("TTLS")) {
+ result = this.mUsername.equals(other.mUsername) &&
+ this.mPasswd.equals(other.mPasswd) &&
+ this.mRealm.equals(other.mRealm) &&
+ this.mHomeSpFqdn.equals(other.mHomeSpFqdn);
+ }
+ if (this.mType.equals("TLS")) {
+ result = this.mRealm.equals(other.mRealm) &&
+ this.mHomeSpFqdn.equals(other.mHomeSpFqdn);
+ }
+ if (this.mType.equals("SIM")) {
+ result = this.mMcc.equals(other.mMcc) &&
+ this.mMnc.equals(other.mMnc) &&
+ this.mImsi.equals(other.mImsi) &&
+ this.mHomeSpFqdn.equals(other.mHomeSpFqdn);
+ }
+ }
+ }
+ return result;
+ }
+
+ @Override
+ /** @hide */
+ public String toString() {
+ StringBuffer sb = new StringBuffer();
+ String none = "<none>";
+
+ sb.append(", UpdateIdentifier: ")
+ .append(mUpdateIdentifier == null ? none : mUpdateIdentifier).
+ append(", SubscriptionUpdateMethod: ")
+ .append(mSubscriptionUpdateMethod == null ? none : mSubscriptionUpdateMethod).
+ append(", Type: ").append(mType == null ? none : mType).
+ append(", Username: ").append(mUsername == null ? none : mUsername).
+ append(", Passwd: ").append(mPasswd == null ? none : mPasswd).
+ append(", SubDMAccUsername: ")
+ .append(mSubscriptionDMAccUsername == null ? none : mSubscriptionDMAccUsername).
+ append(", SubDMAccPassword: ")
+ .append(mSubscriptionDMAccPassword == null ? none : mSubscriptionDMAccPassword).
+ append(", PolDMAccUsername: ")
+ .append(mPolicyDMAccUsername == null ? none : mPolicyDMAccUsername).
+ append(", PolDMAccPassword: ")
+ .append(mPolicyDMAccPassword == null ? none : mPolicyDMAccPassword).
+ append(", Imsi: ").append(mImsi == null ? none : mImsi).
+ append(", Mcc: ").append(mMcc == null ? none : mMcc).
+ append(", Mnc: ").append(mMnc == null ? none : mMnc).
+ append(", CaRootCert: ").append(mCaRootCert == null ? none : mCaRootCert).
+ append(", Realm: ").append(mRealm == null ? none : mRealm).
+ append(", Priority: ").append(mPriority).
+ append(", Fqdn: ").append(mHomeSpFqdn == null ? none : mHomeSpFqdn).
+ append(", Otherhomepartners: ")
+ .append(mOtherhomepartnerFqdn == null ? none : mOtherhomepartnerFqdn).
+ append(", ExpirationDate: ")
+ .append(mExpirationDate == null ? none : mExpirationDate).
+ append(", MaxBssLoad: ").append(mMaxBssLoad == null ? none : mMaxBssLoad).
+ append(", SPExclusionList: ").append(mSpExclusionList);
+
+ if (mPreferredRoamingPartnerList != null) {
+ sb.append("PreferredRoamingPartnerList:");
+ for (WifiPasspointDmTree.PreferredRoamingPartnerList prpListItem : mPreferredRoamingPartnerList) {
+ sb.append("[fqdnmatch:").append(prpListItem.FQDN_Match).
+ append(", priority:").append(prpListItem.Priority).
+ append(", country:").append(prpListItem.Country).append("]");
+ }
+ }
+
+ if (mHomeOIList != null) {
+ sb.append("HomeOIList:");
+ for (WifiPasspointDmTree.HomeOIList HomeOIListItem : mHomeOIList) {
+ sb.append("[HomeOI:").append(HomeOIListItem.HomeOI).
+ append(", HomeOIRequired:").append(HomeOIListItem.HomeOIRequired).
+ append("]");
+ }
+ }
+
+ if (mMinBackhaulThresholdNetwork != null) {
+ sb.append("BackHaulThreshold:");
+ for (WifiPasspointDmTree.MinBackhaulThresholdNetwork BhtListItem : mMinBackhaulThresholdNetwork) {
+ sb.append("[networkType:").append(BhtListItem.NetworkType).
+ append(", dlBandwidth:").append(BhtListItem.DLBandwidth).
+ append(", ulBandwidth:").append(BhtListItem.ULBandwidth).
+ append("]");
+ }
+ }
+
+ if (mRequiredProtoPortTuple != null) {
+ sb.append("WifiMORequiredProtoPortTupleList:");
+ for (WifiPasspointDmTree.RequiredProtoPortTuple RpptListItem : mRequiredProtoPortTuple) {
+ sb.append("[IPProtocol:").append(RpptListItem.IPProtocol).
+ append(", PortNumber:").append(RpptListItem.PortNumber).
+ append("]");
+ }
+ }
+
+ return sb.toString();
+ }
+
+ /** Implement the Parcelable interface {@hide} */
+ public int describeContents() {
+ return 0;
+ }
+
+ /** Implement the Parcelable interface {@hide} */
+ public void writeToParcel(Parcel dest, int flags) {
+ dest.writeString(mType);
+ dest.writeString(mUsername);
+ dest.writeString(mPasswd);
+ dest.writeString(mImsi);
+ dest.writeString(mMcc);
+ dest.writeString(mMnc);
+ dest.writeString(mCaRootCert);
+ dest.writeString(mRealm);
+ dest.writeInt(mPriority);
+ dest.writeString(mHomeSpFqdn);
+ dest.writeString(mOtherhomepartnerFqdn);
+ dest.writeString(mClientCert);
+ dest.writeString(mExpirationDate);
+ }
+
+ /** Implement the Parcelable interface {@hide} */
+ public static final Creator<WifiPasspointCredential> CREATOR =
+ new Creator<WifiPasspointCredential>() {
+ public WifiPasspointCredential createFromParcel(Parcel in) {
+ WifiPasspointCredential pc = new WifiPasspointCredential();
+ pc.mType = in.readString();
+ pc.mUsername = in.readString();
+ pc.mPasswd = in.readString();
+ pc.mImsi = in.readString();
+ pc.mMcc = in.readString();
+ pc.mMnc = in.readString();
+ pc.mCaRootCert = in.readString();
+ pc.mRealm = in.readString();
+ pc.mPriority = in.readInt();
+ pc.mHomeSpFqdn = in.readString();
+ pc.mOtherhomepartnerFqdn = in.readString();
+ pc.mClientCert = in.readString();
+ pc.mExpirationDate = in.readString();
+ return pc;
+ }
+
+ public WifiPasspointCredential[] newArray(int size) {
+ return new WifiPasspointCredential[size];
+ }
+ };
+
+ /** @hide */
+ public int compareTo(WifiPasspointCredential another) {
+
+ //The smaller the higher
+ if (mPriority < another.mPriority) {
+ return -1;
+ } else if (mPriority == another.mPriority) {
+ return this.mType.compareTo(another.mType);
+ } else {
+ return 1;
+ }
+ }
+
+ @Override
+ /** @hide */
+ public int hashCode() {
+ int hash = 208;
+ if (mType != null) {
+ hash += mType.hashCode();
+ }
+ if (mRealm != null) {
+ hash += mRealm.hashCode();
+ }
+ if (mHomeSpFqdn != null) {
+ hash += mHomeSpFqdn.hashCode();
+ }
+ if (mUsername != null) {
+ hash += mUsername.hashCode();
+ }
+ if (mPasswd != null) {
+ hash += mPasswd.hashCode();
+ }
+
+ return hash;
+ }
+}
diff --git a/wifi/java/android/net/wifi/passpoint/PasspointInfo.aidl b/wifi/java/android/net/wifi/passpoint/WifiPasspointDmTree.aidl
similarity index 95%
copy from wifi/java/android/net/wifi/passpoint/PasspointInfo.aidl
copy to wifi/java/android/net/wifi/passpoint/WifiPasspointDmTree.aidl
index cc11045..6a88b2e 100644
--- a/wifi/java/android/net/wifi/passpoint/PasspointInfo.aidl
+++ b/wifi/java/android/net/wifi/passpoint/WifiPasspointDmTree.aidl
@@ -16,4 +16,4 @@
package android.net.wifi.passpoint;
-parcelable PasspointInfo;
+parcelable WifiPasspointDmTree;
diff --git a/wifi/java/android/net/wifi/passpoint/WifiPasspointDmTree.java b/wifi/java/android/net/wifi/passpoint/WifiPasspointDmTree.java
new file mode 100644
index 0000000..9ff1973
--- /dev/null
+++ b/wifi/java/android/net/wifi/passpoint/WifiPasspointDmTree.java
@@ -0,0 +1,1379 @@
+/*
+ * Copyright (C) 2014 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.
+ */
+
+package android.net.wifi.passpoint;
+
+import android.os.Parcelable;
+import android.os.Parcel;
+import android.util.Log;
+
+import java.util.HashMap;
+
+/**
+ * Required Mobile Device Management Tree Structure
+ *
+ * +----------+
+ * | ./(Root) |
+ * +----+-----+
+ * |
+ * +---------+ | +---------+ +---------+
+ * | DevInfo |-----------+---------| Wi-Fi |---|SP FQDN* |
+ * +---------+ | +---------+ +---------+
+ * +---------+ |
+ * |DevDetail|-----------+
+ * +---------+
+ *
+ * For example,
+ * ./Wi-Fi/wi-fi.org/PerproviderSubscription/Cred01/Policy/PreferredRoamingPartnerList/Roa01/FQDN_Math
+ *
+ * This class contains all nodes start from Wi-Fi
+ * @hide
+ **/
+public class WifiPasspointDmTree implements Parcelable {
+ private final static String TAG = "WifiTree";
+ public int PpsMoId;//plugfest used only
+ public HashMap<String, SpFqdn> spFqdn = new HashMap<String, SpFqdn>();//Maps.newHashMap();
+
+ public SpFqdn createSpFqdn(String name) {
+ SpFqdn obj = new SpFqdn(name);
+ spFqdn.put(name, obj);
+ return obj;
+ }
+
+ public static class SpFqdn implements Parcelable {
+ public String nodeName;
+ public PerProviderSubscription perProviderSubscription = new PerProviderSubscription();
+
+ public SpFqdn(String name) {
+ nodeName = name;
+ }
+
+ public SpFqdn() {
+ }
+
+ public SpFqdn(Parcel in) {
+ readFromParcel(in);
+ }
+
+ public int describeContents() {
+ return 0;
+ }
+
+ public void writeToParcel(Parcel out, int flags) {
+ out.writeString(nodeName);
+ out.writeParcelable(perProviderSubscription, flags);
+ }
+
+ public void readFromParcel(Parcel in) {
+ if (in == null) {
+ //log here
+ } else {
+ nodeName = in.readString();
+ perProviderSubscription = in.readParcelable(PerProviderSubscription.class
+ .getClassLoader());
+ }
+ }
+
+ public static final Parcelable.Creator<SpFqdn> CREATOR = new Parcelable.Creator<SpFqdn>() {
+ public SpFqdn createFromParcel(Parcel in) {
+ return new SpFqdn(in);
+ }
+
+ public SpFqdn[] newArray(int size) {
+ return new SpFqdn[size];
+ }
+ };
+ }
+
+ /**
+ * PerProviderSubscription
+ **/
+ public static class PerProviderSubscription implements Parcelable {
+ /**
+ * PerProviderSubscription/UpdateIdentifier
+ **/
+ public String UpdateIdentifier;
+ public HashMap<String, CredentialInfo> credentialInfo = new HashMap<String, CredentialInfo>();
+
+ public CredentialInfo createCredentialInfo(String name) {
+ CredentialInfo obj = new CredentialInfo(name);
+ credentialInfo.put(name, obj);
+ return obj;
+ }
+
+ public PerProviderSubscription() {
+ }
+
+ public PerProviderSubscription(Parcel in) {
+ readFromParcel(in);
+ }
+
+ public int describeContents() {
+ return 0;
+ }
+
+ public void writeToParcel(Parcel out, int flags) {
+ out.writeString(UpdateIdentifier);
+ out.writeMap(credentialInfo);
+ }
+
+ public void readFromParcel(Parcel in) {
+ if (in == null) {
+ //log here
+ } else {
+ UpdateIdentifier = in.readString();
+ in.readMap(credentialInfo, CredentialInfo.class.getClassLoader());
+ }
+ }
+
+ public static final Parcelable.Creator<PerProviderSubscription> CREATOR = new Parcelable.Creator<PerProviderSubscription>() {
+ public PerProviderSubscription createFromParcel(Parcel in) {
+ return new PerProviderSubscription(in);
+ }
+
+ public PerProviderSubscription[] newArray(int size) {
+ return new PerProviderSubscription[size];
+ }
+ };
+
+ }
+
+ /**
+ * PerProviderSubscription/<X+>
+ * This interior node contains the Home SP information, subscription policy, management and credential information.
+ **/
+ public static class CredentialInfo implements Parcelable {
+ public String nodeName;
+ public Policy policy = new Policy();
+ public String credentialPriority;
+ public HashMap<String, AAAServerTrustRoot> aAAServerTrustRoot = new HashMap<String, AAAServerTrustRoot>();
+ public SubscriptionUpdate subscriptionUpdate = new SubscriptionUpdate();
+ public HomeSP homeSP = new HomeSP();
+ public SubscriptionParameters subscriptionParameters = new SubscriptionParameters();
+ public Credential credential = new Credential();
+ public Extension extension = new Extension();
+
+ public CredentialInfo(String nn) {
+ nodeName = nn;
+ }
+
+ public AAAServerTrustRoot createAAAServerTrustRoot(String name, String url, String fp) {
+ AAAServerTrustRoot obj = new AAAServerTrustRoot(name, url, fp);
+ aAAServerTrustRoot.put(name, obj);
+ return obj;
+ }
+
+ public CredentialInfo() {
+ }
+
+ public CredentialInfo(Parcel in) {
+ readFromParcel(in);
+ }
+
+ public int describeContents() {
+ return 0;
+ }
+
+ public void writeToParcel(Parcel out, int flags) {
+ out.writeString(nodeName);
+ out.writeParcelable(policy, flags);
+ out.writeString(credentialPriority);
+ out.writeMap(aAAServerTrustRoot);
+ out.writeParcelable(subscriptionUpdate, flags);
+ out.writeParcelable(homeSP, flags);
+ out.writeParcelable(subscriptionParameters, flags);
+ out.writeParcelable(credential, flags);
+ //out.writeParcelable(extension, flags);
+ }
+
+ public void readFromParcel(Parcel in) {
+ if (in == null) {
+ //log here
+ } else {
+ nodeName = in.readString();
+ policy = in.readParcelable(Policy.class.getClassLoader());
+ credentialPriority = in.readString();
+ in.readMap(aAAServerTrustRoot, AAAServerTrustRoot.class.getClassLoader());
+ subscriptionUpdate = in.readParcelable(SubscriptionUpdate.class.getClassLoader());
+ homeSP = in.readParcelable(HomeSP.class.getClassLoader());
+ subscriptionParameters = in.readParcelable(SubscriptionParameters.class
+ .getClassLoader());
+ credential = in.readParcelable(Credential.class.getClassLoader());
+ //extension = in.readParcelable(Extension.class.getClassLoader());
+ }
+ }
+
+ public static final Parcelable.Creator<CredentialInfo> CREATOR = new Parcelable.Creator<CredentialInfo>() {
+ public CredentialInfo createFromParcel(Parcel in) {
+ return new CredentialInfo(in);
+ }
+
+ public CredentialInfo[] newArray(int size) {
+ return new CredentialInfo[size];
+ }
+ };
+
+ }
+
+ /**
+ * PerProviderSubscription/<X+>/Policy
+ **/
+ public static class Policy implements Parcelable {
+ public HashMap<String, PreferredRoamingPartnerList> preferredRoamingPartnerList = new HashMap<String, PreferredRoamingPartnerList>();
+ public HashMap<String, MinBackhaulThresholdNetwork> minBackhaulThreshold = new HashMap<String, MinBackhaulThresholdNetwork>();
+ public PolicyUpdate policyUpdate = new PolicyUpdate();
+ public HashMap<String, SPExclusionList> sPExclusionList = new HashMap<String, SPExclusionList>();
+ public HashMap<String, RequiredProtoPortTuple> requiredProtoPortTuple = new HashMap<String, RequiredProtoPortTuple>();
+ public String maximumBSSLoadValue;
+
+ public PreferredRoamingPartnerList createPreferredRoamingPartnerList(String name,
+ String fqdn, String priority, String country) {
+ PreferredRoamingPartnerList obj = new PreferredRoamingPartnerList(name, fqdn, priority,
+ country);
+ preferredRoamingPartnerList.put(name, obj);
+ return obj;
+ }
+
+ public MinBackhaulThresholdNetwork createMinBackhaulThreshold(String name, String type,
+ String dl, String ul) {
+ MinBackhaulThresholdNetwork obj = new MinBackhaulThresholdNetwork(name, type, dl, ul);
+ minBackhaulThreshold.put(name, obj);
+ return obj;
+ }
+
+ public SPExclusionList createSPExclusionList(String name, String ssid) {
+ SPExclusionList obj = new SPExclusionList(name, ssid);
+ sPExclusionList.put(name, obj);
+ return obj;
+ }
+
+ public RequiredProtoPortTuple createRequiredProtoPortTuple(String name, String proto,
+ String port) {
+ RequiredProtoPortTuple obj = new RequiredProtoPortTuple(name, proto, port);
+ requiredProtoPortTuple.put(name, obj);
+ return obj;
+ }
+
+ public Policy() {
+ }
+
+ public Policy(Parcel in) {
+ readFromParcel(in);
+ }
+
+ public int describeContents() {
+ return 0;
+ }
+
+ public void writeToParcel(Parcel out, int flags) {
+ out.writeMap(preferredRoamingPartnerList);
+ out.writeMap(minBackhaulThreshold);
+ out.writeParcelable(policyUpdate, flags);
+ out.writeMap(sPExclusionList);
+ out.writeMap(requiredProtoPortTuple);
+ out.writeString(maximumBSSLoadValue);
+ }
+
+ public void readFromParcel(Parcel in) {
+ if (in == null) {
+ //log here
+ } else {
+ in.readMap(preferredRoamingPartnerList,
+ PreferredRoamingPartnerList.class.getClassLoader());
+ in.readMap(minBackhaulThreshold, MinBackhaulThresholdNetwork.class.getClassLoader());
+ policyUpdate = in.readParcelable(PolicyUpdate.class.getClassLoader());
+ in.readMap(sPExclusionList, SPExclusionList.class.getClassLoader());
+ in.readMap(requiredProtoPortTuple, RequiredProtoPortTuple.class.getClassLoader());
+ maximumBSSLoadValue = in.readString();
+
+ }
+ }
+
+ public static final Parcelable.Creator<Policy> CREATOR = new Parcelable.Creator<Policy>() {
+ public Policy createFromParcel(Parcel in) {
+ return new Policy(in);
+ }
+
+ public Policy[] newArray(int size) {
+ return new Policy[size];
+ }
+ };
+
+ }
+
+ /**
+ * PerProviderSubscription/<X+>/Policy/PreferredRoamingPartnerList/<X+>
+ **/
+ public static class PreferredRoamingPartnerList implements Parcelable {
+ public String nodeName;
+ public String FQDN_Match; //maximum 255 + ",includeSubdomains", equals 273
+ public String Priority;
+ public String Country; // maximum 600 octets
+
+ public PreferredRoamingPartnerList(String nn, String f, String p, String c) {
+ nodeName = nn;
+ FQDN_Match = f;
+ Priority = p;
+ Country = c;
+ }
+
+ public PreferredRoamingPartnerList() {
+ }
+
+ public PreferredRoamingPartnerList(Parcel in) {
+ readFromParcel(in);
+ }
+
+ public int describeContents() {
+ return 0;
+ }
+
+ public void writeToParcel(Parcel out, int flags) {
+ out.writeString(nodeName);
+ out.writeString(FQDN_Match);
+ out.writeString(Priority);
+ out.writeString(Country);
+ }
+
+ public void readFromParcel(Parcel in) {
+ if (in == null) {
+ //log here
+ } else {
+ nodeName = in.readString();
+ FQDN_Match = in.readString();
+ Priority = in.readString();
+ Country = in.readString();
+ }
+ }
+
+ public static final Parcelable.Creator<PreferredRoamingPartnerList> CREATOR = new Parcelable.Creator<PreferredRoamingPartnerList>() {
+ public PreferredRoamingPartnerList createFromParcel(Parcel in) {
+ return new PreferredRoamingPartnerList(in);
+ }
+
+ public PreferredRoamingPartnerList[] newArray(int size) {
+ return new PreferredRoamingPartnerList[size];
+ }
+ };
+ }
+
+ /**
+ * PerProviderSubscription/<X+>/Policy/MinBackhaulThreshold
+ **/
+ public static class MinBackhaulThresholdNetwork implements Parcelable {
+ public String nodeName;
+ public String NetworkType;
+ public String DLBandwidth;
+ public String ULBandwidth;
+
+ public MinBackhaulThresholdNetwork(String nn, String nt, String d, String u) {
+ nodeName = nn;
+ NetworkType = nt;
+ DLBandwidth = d;
+ ULBandwidth = u;
+ }
+
+ public MinBackhaulThresholdNetwork() {
+ }
+
+ public MinBackhaulThresholdNetwork(Parcel in) {
+ readFromParcel(in);
+ }
+
+ public int describeContents() {
+ return 0;
+ }
+
+ public void writeToParcel(Parcel out, int flags) {
+ out.writeString(nodeName);
+ out.writeString(NetworkType);
+ out.writeString(DLBandwidth);
+ out.writeString(ULBandwidth);
+ }
+
+ public void readFromParcel(Parcel in) {
+ if (in == null) {
+ //log here
+ } else {
+ nodeName = in.readString();
+ NetworkType = in.readString();
+ DLBandwidth = in.readString();
+ ULBandwidth = in.readString();
+ }
+ }
+
+ public static final Parcelable.Creator<MinBackhaulThresholdNetwork> CREATOR = new Parcelable.Creator<MinBackhaulThresholdNetwork>() {
+ public MinBackhaulThresholdNetwork createFromParcel(Parcel in) {
+ return new MinBackhaulThresholdNetwork(in);
+ }
+
+ public MinBackhaulThresholdNetwork[] newArray(int size) {
+ return new MinBackhaulThresholdNetwork[size];
+ }
+ };
+
+ }
+
+ /**
+ * PerProviderSubscription/<X+>/Policy/PolicyUpdate
+ **/
+ public static class PolicyUpdate implements Parcelable {
+ public String UpdateInterval;
+ public String UpdateMethod;
+ public String Restriction;
+ public String URI;
+ public UsernamePassword usernamePassword = new UsernamePassword();
+ public String Other;
+ public TrustRoot trustRoot = new TrustRoot();
+
+ public PolicyUpdate() {
+ }
+
+ public PolicyUpdate(Parcel in) {
+ readFromParcel(in);
+ }
+
+ public int describeContents() {
+ return 0;
+ }
+
+ public void writeToParcel(Parcel out, int flags) {
+ out.writeString(UpdateInterval);
+ out.writeString(UpdateMethod);
+ out.writeString(Restriction);
+ out.writeString(URI);
+ out.writeParcelable(usernamePassword, flags);
+ out.writeString(Other);
+ out.writeParcelable(trustRoot, flags);
+
+ }
+
+ public void readFromParcel(Parcel in) {
+ if (in == null) {
+ //log here
+ } else {
+ UpdateInterval = in.readString();
+ UpdateMethod = in.readString();
+ Restriction = in.readString();
+ URI = in.readString();
+ usernamePassword = in.readParcelable(UsernamePassword.class.getClassLoader());
+ Other = in.readString();
+ trustRoot = in.readParcelable(TrustRoot.class.getClassLoader());
+ }
+ }
+
+ public static final Parcelable.Creator<PolicyUpdate> CREATOR = new Parcelable.Creator<PolicyUpdate>() {
+ public PolicyUpdate createFromParcel(Parcel in) {
+ return new PolicyUpdate(in);
+ }
+
+ public PolicyUpdate[] newArray(int size) {
+ return new PolicyUpdate[size];
+ }
+ };
+ }
+
+ /**
+ * PerProviderSubscription/<X+>/Policy/SPExclusionList
+ **/
+ public static class SPExclusionList implements Parcelable {
+ public String nodeName;
+ public String SSID;
+
+ public SPExclusionList(String nn, String s) {
+ nodeName = nn;
+ SSID = s;
+ }
+
+ public SPExclusionList() {
+ }
+
+ public SPExclusionList(Parcel in) {
+ readFromParcel(in);
+ }
+
+ public int describeContents() {
+ return 0;
+ }
+
+ public void writeToParcel(Parcel out, int flags) {
+ out.writeString(nodeName);
+ out.writeString(SSID);
+ }
+
+ public void readFromParcel(Parcel in) {
+ if (in == null) {
+ //log here
+ } else {
+ nodeName = in.readString();
+ SSID = in.readString();
+ }
+ }
+
+ public static final Parcelable.Creator<SPExclusionList> CREATOR = new Parcelable.Creator<SPExclusionList>() {
+ public SPExclusionList createFromParcel(Parcel in) {
+ return new SPExclusionList(in);
+ }
+
+ public SPExclusionList[] newArray(int size) {
+ return new SPExclusionList[size];
+ }
+ };
+ }
+
+ /**
+ * PerProviderSubscription/<X+>/Policy/RequiredProtoPortTuple
+ **/
+ public static class RequiredProtoPortTuple implements Parcelable {
+ public String nodeName;
+ public String IPProtocol;
+ public String PortNumber;
+
+ public RequiredProtoPortTuple() {
+ }
+
+ public RequiredProtoPortTuple(String nn, String protocol, String port) {
+ nodeName = nn;
+ IPProtocol = protocol;
+ PortNumber = port;
+ }
+
+ public RequiredProtoPortTuple(Parcel in) {
+ readFromParcel(in);
+ }
+
+ public int describeContents() {
+ return 0;
+ }
+
+ public void writeToParcel(Parcel out, int flags) {
+ out.writeString(nodeName);
+ out.writeString(IPProtocol);
+ out.writeString(PortNumber);
+ }
+
+ public void readFromParcel(Parcel in) {
+ if (in == null) {
+ //log here
+ } else {
+ nodeName = in.readString();
+ IPProtocol = in.readString();
+ PortNumber = in.readString();
+ }
+ }
+
+ public static final Parcelable.Creator<RequiredProtoPortTuple> CREATOR = new Parcelable.Creator<RequiredProtoPortTuple>() {
+ public RequiredProtoPortTuple createFromParcel(Parcel in) {
+ return new RequiredProtoPortTuple(in);
+ }
+
+ public RequiredProtoPortTuple[] newArray(int size) {
+ return new RequiredProtoPortTuple[size];
+ }
+ };
+ }
+
+ /**
+ * PerProviderSubscription/<X+>/AAAServerTrustRoot
+ **/
+ public static class AAAServerTrustRoot implements Parcelable {
+ public String nodeName;
+ public String CertURL;
+ public String CertSHA256Fingerprint;
+
+ public AAAServerTrustRoot(String nn, String url, String fp) {
+ nodeName = nn;
+ CertURL = url;
+ CertSHA256Fingerprint = fp;
+ }
+
+ public AAAServerTrustRoot() {
+ }
+
+ public AAAServerTrustRoot(Parcel in) {
+ readFromParcel(in);
+ }
+
+ public int describeContents() {
+ return 0;
+ }
+
+ public void writeToParcel(Parcel out, int flags) {
+ out.writeString(nodeName);
+ out.writeString(CertURL);
+ out.writeString(CertSHA256Fingerprint);
+ }
+
+ public void readFromParcel(Parcel in) {
+ if (in == null) {
+ //log here
+ } else {
+ nodeName = in.readString();
+ CertURL = in.readString();
+ CertSHA256Fingerprint = in.readString();
+ }
+ }
+
+ public static final Parcelable.Creator<AAAServerTrustRoot> CREATOR = new Parcelable.Creator<AAAServerTrustRoot>() {
+ public AAAServerTrustRoot createFromParcel(Parcel in) {
+ return new AAAServerTrustRoot(in);
+ }
+
+ public AAAServerTrustRoot[] newArray(int size) {
+ return new AAAServerTrustRoot[size];
+ }
+ };
+ }
+
+ /**
+ * PerProviderSubscription/<X+>/SubscriptionUpdate
+ **/
+ public static class SubscriptionUpdate implements Parcelable {
+ public String UpdateInterval;
+ public String UpdateMethod;
+ public String Restriction;
+ public String URI;
+ public UsernamePassword usernamePassword = new UsernamePassword();
+ public String Other;
+ public TrustRoot trustRoot = new TrustRoot();
+
+ public SubscriptionUpdate() {
+ }
+
+ public SubscriptionUpdate(Parcel in) {
+ readFromParcel(in);
+ }
+
+ public int describeContents() {
+ return 0;
+ }
+
+ public void writeToParcel(Parcel out, int flags) {
+ out.writeString(UpdateInterval);
+ out.writeString(UpdateMethod);
+ out.writeString(Restriction);
+ out.writeString(URI);
+ out.writeParcelable(usernamePassword, flags);
+ out.writeString(Other);
+ out.writeParcelable(trustRoot, flags);
+ }
+
+ public void readFromParcel(Parcel in) {
+ if (in == null) {
+ //log here
+ } else {
+ UpdateInterval = in.readString();
+ UpdateMethod = in.readString();
+ Restriction = in.readString();
+ URI = in.readString();
+ usernamePassword = in.readParcelable(UsernamePassword.class.getClassLoader());
+ Other = in.readString();
+ trustRoot = in.readParcelable(TrustRoot.class.getClassLoader());
+ }
+ }
+
+ public static final Parcelable.Creator<SubscriptionUpdate> CREATOR = new Parcelable.Creator<SubscriptionUpdate>() {
+ public SubscriptionUpdate createFromParcel(Parcel in) {
+ return new SubscriptionUpdate(in);
+ }
+
+ public SubscriptionUpdate[] newArray(int size) {
+ return new SubscriptionUpdate[size];
+ }
+ };
+
+ }
+
+ /**
+ * PerProviderSubscription/<X+>/Policy/PolicyUpdate/TrustRoot
+ * PerProviderSubscription/<X+>/SubscriptionUpdate/TrustRoot
+ * PerProviderSubscription/<X+>/AAAServerTrustRoot/<X+>
+ **/
+ public static class TrustRoot implements Parcelable {
+ public String CertURL;
+ public String CertSHA256Fingerprint;
+
+ public TrustRoot() {
+ }
+
+ public TrustRoot(Parcel in) {
+ readFromParcel(in);
+ }
+
+ public int describeContents() {
+ return 0;
+ }
+
+ public void writeToParcel(Parcel out, int flags) {
+ out.writeString(CertURL);
+ out.writeString(CertSHA256Fingerprint);
+ }
+
+ public void readFromParcel(Parcel in) {
+ if (in == null) {
+ //log here
+ } else {
+ CertURL = in.readString();
+ CertSHA256Fingerprint = in.readString();
+ }
+ }
+
+ public static final Parcelable.Creator<TrustRoot> CREATOR = new Parcelable.Creator<TrustRoot>() {
+ public TrustRoot createFromParcel(Parcel in) {
+ return new TrustRoot(in);
+ }
+
+ public TrustRoot[] newArray(int size) {
+ return new TrustRoot[size];
+ }
+ };
+ }
+
+ /**
+ * PerProviderSubscription/<X+>/Policy/PolicyUpdate/UsernamePassword
+ * PerProviderSubscription/<X+>/SubscriptionUpdate/UsernamePassword
+ * PerProviderSubscription/<X+>/Credential/UsernamePassword
+ **/
+ public static class UsernamePassword implements Parcelable {
+ public String Username;
+ public String Password;
+ //following are Credential node used only
+ public boolean MachineManaged;
+ public String SoftTokenApp;
+ public String AbleToShare;
+ public EAPMethod eAPMethod = new EAPMethod();
+
+ public UsernamePassword() {
+ }
+
+ public UsernamePassword(Parcel in) {
+ readFromParcel(in);
+ }
+
+ public int describeContents() {
+ return 0;
+ }
+
+ public void writeToParcel(Parcel out, int flags) {
+ out.writeString(Username);
+ out.writeString(Password);
+ out.writeInt(MachineManaged ? 1 : 0);
+ out.writeString(SoftTokenApp);
+ out.writeString(AbleToShare);
+ out.writeParcelable(eAPMethod, flags);
+ }
+
+ public void readFromParcel(Parcel in) {
+ if (in == null) {
+ //log here
+ } else {
+ Username = in.readString();
+ Password = in.readString();
+ MachineManaged = (in.readInt() == 1) ? true : false;
+ SoftTokenApp = in.readString();
+ AbleToShare = in.readString();
+ eAPMethod = in.readParcelable(EAPMethod.class.getClassLoader());
+ }
+ }
+
+ public static final Parcelable.Creator<UsernamePassword> CREATOR = new Parcelable.Creator<UsernamePassword>() {
+ public UsernamePassword createFromParcel(Parcel in) {
+ return new UsernamePassword(in);
+ }
+
+ public UsernamePassword[] newArray(int size) {
+ return new UsernamePassword[size];
+ }
+ };
+
+ }
+
+ /**
+ * PerProviderSubscription/<X+>/Credential/UsernamePassword/EAPMethod
+ **/
+ public static class EAPMethod implements Parcelable {
+ public String EAPType;
+ public String VendorId;
+ public String VendorType;
+ public String InnerEAPType;
+ public String InnerVendorId;
+ public String InnerVendorType;
+ public String InnerMethod;
+
+ public EAPMethod() {
+ }
+
+ public EAPMethod(Parcel in) {
+ readFromParcel(in);
+ }
+
+ public int describeContents() {
+ return 0;
+ }
+
+ public void writeToParcel(Parcel out, int flags) {
+ out.writeString(EAPType);
+ out.writeString(VendorId);
+ out.writeString(VendorType);
+ out.writeString(InnerEAPType);
+ out.writeString(InnerVendorId);
+ out.writeString(InnerVendorType);
+ out.writeString(InnerMethod);
+ }
+
+ public void readFromParcel(Parcel in) {
+ if (in == null) {
+ //log here
+ } else {
+ EAPType = in.readString();
+ VendorId = in.readString();
+ VendorType = in.readString();
+ InnerEAPType = in.readString();
+ InnerVendorId = in.readString();
+ InnerVendorType = in.readString();
+ InnerMethod = in.readString();
+ }
+ }
+
+ public static final Parcelable.Creator<EAPMethod> CREATOR = new Parcelable.Creator<EAPMethod>() {
+ public EAPMethod createFromParcel(Parcel in) {
+ return new EAPMethod(in);
+ }
+
+ public EAPMethod[] newArray(int size) {
+ return new EAPMethod[size];
+ }
+ };
+ }
+
+ /**
+ * PerProviderSubscription/<X+>/HomeSP
+ **/
+ public static class HomeSP implements Parcelable {
+ public HashMap<String, NetworkID> networkID = new HashMap<String, NetworkID>();
+ public String FriendlyName;
+ public String IconURL;
+ public String FQDN;
+ public HashMap<String, HomeOIList> homeOIList = new HashMap<String, HomeOIList>();
+ public HashMap<String, OtherHomePartners> otherHomePartners = new HashMap<String, OtherHomePartners>();
+ public String RoamingConsortiumOI;
+
+ public NetworkID createNetworkID(String name, String ssid, String hessid) {
+ NetworkID obj = new NetworkID(name, ssid, hessid);
+ networkID.put(name, obj);
+ return obj;
+ }
+
+ public HomeOIList createHomeOIList(String name, String homeoi, boolean required) {
+ HomeOIList obj = new HomeOIList(name, homeoi, required);
+ homeOIList.put(name, obj);
+ return obj;
+ }
+
+ public OtherHomePartners createOtherHomePartners(String name, String fqdn) {
+ OtherHomePartners obj = new OtherHomePartners(name, fqdn);
+ otherHomePartners.put(name, obj);
+ return obj;
+ }
+
+ public HomeSP() {
+ }
+
+ public HomeSP(Parcel in) {
+ readFromParcel(in);
+ }
+
+ public int describeContents() {
+ return 0;
+ }
+
+ public void writeToParcel(Parcel out, int flags) {
+ out.writeMap(networkID);
+ out.writeString(FriendlyName);
+ out.writeString(IconURL);
+ out.writeString(FQDN);
+ out.writeMap(homeOIList);
+ out.writeMap(otherHomePartners);
+ out.writeString(RoamingConsortiumOI);
+ }
+
+ public void readFromParcel(Parcel in) {
+ if (in == null) {
+ //log here
+ } else {
+ in.readMap(networkID, NetworkID.class.getClassLoader());
+ FriendlyName = in.readString();
+ IconURL = in.readString();
+ FQDN = in.readString();
+ in.readMap(homeOIList, HomeOIList.class.getClassLoader());
+ in.readMap(otherHomePartners, OtherHomePartners.class.getClassLoader());
+ RoamingConsortiumOI = in.readString();
+ }
+ }
+
+ public static final Parcelable.Creator<HomeSP> CREATOR = new Parcelable.Creator<HomeSP>() {
+ public HomeSP createFromParcel(Parcel in) {
+ return new HomeSP(in);
+ }
+
+ public HomeSP[] newArray(int size) {
+ return new HomeSP[size];
+ }
+ };
+
+ }
+
+ /**
+ * PerProviderSubscription/<X+>/HomeSP/NetworkID
+ **/
+ public static class NetworkID implements Parcelable {
+ public String nodeName;
+ public String SSID;
+ public String HESSID;
+
+ public NetworkID(String nn, String s, String h) {
+ nodeName = nn;
+ SSID = s;
+ HESSID = h;
+ }
+
+ public NetworkID() {
+ }
+
+ public NetworkID(Parcel in) {
+ readFromParcel(in);
+ }
+
+ public int describeContents() {
+ return 0;
+ }
+
+ public void writeToParcel(Parcel out, int flags) {
+ out.writeString(nodeName);
+ out.writeString(SSID);
+ out.writeString(HESSID);
+ }
+
+ public void readFromParcel(Parcel in) {
+ if (in == null) {
+ //log here
+ } else {
+ nodeName = in.readString();
+ SSID = in.readString();
+ HESSID = in.readString();
+ }
+ }
+
+ public static final Parcelable.Creator<NetworkID> CREATOR = new Parcelable.Creator<NetworkID>() {
+ public NetworkID createFromParcel(Parcel in) {
+ return new NetworkID(in);
+ }
+
+ public NetworkID[] newArray(int size) {
+ return new NetworkID[size];
+ }
+ };
+
+ }
+
+ /**
+ * PerProviderSubscription/<X+>/HomeSP/HomeOIList
+ **/
+ public static class HomeOIList implements Parcelable {
+ public String nodeName;
+ public String HomeOI;
+ public boolean HomeOIRequired;
+
+ public HomeOIList(String nn, String h, boolean r) {
+ nodeName = nn;
+ HomeOI = h;
+ HomeOIRequired = r;
+ }
+
+ public HomeOIList() {
+ }
+
+ public HomeOIList(Parcel in) {
+ readFromParcel(in);
+ }
+
+ public int describeContents() {
+ return 0;
+ }
+
+ public void writeToParcel(Parcel out, int flags) {
+ out.writeString(nodeName);
+ out.writeString(HomeOI);
+ out.writeInt(HomeOIRequired ? 1 : 0);
+ }
+
+ public void readFromParcel(Parcel in) {
+ if (in == null) {
+ //log here
+ } else {
+ nodeName = in.readString();
+ HomeOI = in.readString();
+ HomeOIRequired = (in.readInt() == 1) ? true : false;
+ }
+ }
+
+ public static final Parcelable.Creator<HomeOIList> CREATOR = new Parcelable.Creator<HomeOIList>() {
+ public HomeOIList createFromParcel(Parcel in) {
+ return new HomeOIList(in);
+ }
+
+ public HomeOIList[] newArray(int size) {
+ return new HomeOIList[size];
+ }
+ };
+
+ }
+
+ /**
+ * PerProviderSubscription/<X+>/HomeSP/OtherHomePartners
+ **/
+ public static class OtherHomePartners implements Parcelable {
+ public String nodeName;
+ public String FQDN;
+
+ public OtherHomePartners(String nn, String f) {
+ nodeName = nn;
+ FQDN = f;
+ }
+
+ public OtherHomePartners() {
+ }
+
+ public OtherHomePartners(Parcel in) {
+ readFromParcel(in);
+ }
+
+ public int describeContents() {
+ return 0;
+ }
+
+ public void writeToParcel(Parcel out, int flags) {
+ out.writeString(nodeName);
+ out.writeString(FQDN);
+ }
+
+ public void readFromParcel(Parcel in) {
+ if (in == null) {
+ //log here
+ } else {
+ nodeName = in.readString();
+ FQDN = in.readString();
+ }
+ }
+
+ public static final Parcelable.Creator<OtherHomePartners> CREATOR = new Parcelable.Creator<OtherHomePartners>() {
+ public OtherHomePartners createFromParcel(Parcel in) {
+ return new OtherHomePartners(in);
+ }
+
+ public OtherHomePartners[] newArray(int size) {
+ return new OtherHomePartners[size];
+ }
+ };
+
+ }
+
+ /**
+ * PerProviderSubscription/<X+>/SubscriptionParameters
+ **/
+ public static class SubscriptionParameters implements Parcelable {
+ public String CreationDate;
+ public String ExpirationDate;
+ public String TypeOfSubscription;
+ public UsageLimits usageLimits = new UsageLimits();
+
+ public SubscriptionParameters() {
+ }
+
+ public SubscriptionParameters(Parcel in) {
+ readFromParcel(in);
+ }
+
+ public int describeContents() {
+ return 0;
+ }
+
+ public void writeToParcel(Parcel out, int flags) {
+ out.writeString(CreationDate);
+ out.writeString(ExpirationDate);
+ out.writeString(TypeOfSubscription);
+ out.writeParcelable(usageLimits, flags);
+ }
+
+ public void readFromParcel(Parcel in) {
+ if (in == null) {
+ //log here
+ } else {
+ CreationDate = in.readString();
+ ExpirationDate = in.readString();
+ TypeOfSubscription = in.readString();
+ usageLimits = in.readParcelable(UsageLimits.class.getClassLoader());
+ }
+ }
+
+ public static final Parcelable.Creator<SubscriptionParameters> CREATOR = new Parcelable.Creator<SubscriptionParameters>() {
+ public SubscriptionParameters createFromParcel(Parcel in) {
+ return new SubscriptionParameters(in);
+ }
+
+ public SubscriptionParameters[] newArray(int size) {
+ return new SubscriptionParameters[size];
+ }
+ };
+
+ }
+
+ /**
+ * PerProviderSubscription/<X+>/SubscriptionParameters/UsageLimits
+ **/
+ public static class UsageLimits implements Parcelable {
+ public String DataLimit;
+ public String StartDate;
+ public String TimeLimit;
+ public String UsageTimePeriod;
+
+ public UsageLimits() {
+ }
+
+ public UsageLimits(Parcel in) {
+ readFromParcel(in);
+ }
+
+ public int describeContents() {
+ return 0;
+ }
+
+ public void writeToParcel(Parcel out, int flags) {
+ out.writeString(DataLimit);
+ out.writeString(StartDate);
+ out.writeString(TimeLimit);
+ out.writeString(UsageTimePeriod);
+ }
+
+ public void readFromParcel(Parcel in) {
+ if (in == null) {
+ //log here
+ } else {
+ DataLimit = in.readString();
+ StartDate = in.readString();
+ TimeLimit = in.readString();
+ UsageTimePeriod = in.readString();
+ }
+ }
+
+ public static final Parcelable.Creator<UsageLimits> CREATOR = new Parcelable.Creator<UsageLimits>() {
+ public UsageLimits createFromParcel(Parcel in) {
+ return new UsageLimits(in);
+ }
+
+ public UsageLimits[] newArray(int size) {
+ return new UsageLimits[size];
+ }
+ };
+ }
+
+ /**
+ * PerProviderSubscription/<X+>/Credential
+ **/
+ public static class Credential implements Parcelable {
+ public String CreationDate;
+ public String ExpirationDate;
+ public UsernamePassword usernamePassword = new UsernamePassword();
+ public DigitalCertificate digitalCertificate = new DigitalCertificate();
+ public String Realm;
+ public boolean CheckAAAServerCertStatus;
+ public SIM sim = new SIM();
+
+ public Credential() {
+ }
+
+ public Credential(Parcel in) {
+ readFromParcel(in);
+ }
+
+ public int describeContents() {
+ return 0;
+ }
+
+ public void writeToParcel(Parcel out, int flags) {
+ out.writeString(CreationDate);
+ out.writeString(ExpirationDate);
+ out.writeParcelable(usernamePassword, flags);
+ out.writeParcelable(digitalCertificate, flags);
+ out.writeString(Realm);
+ out.writeInt(CheckAAAServerCertStatus ? 1 : 0);
+ out.writeParcelable(sim, flags);
+ }
+
+ public void readFromParcel(Parcel in) {
+ if (in == null) {
+ //log here
+ } else {
+ CreationDate = in.readString();
+ ExpirationDate = in.readString();
+ usernamePassword = in.readParcelable(UsernamePassword.class.getClassLoader());
+ digitalCertificate = in.readParcelable(DigitalCertificate.class.getClassLoader());
+ Realm = in.readString();
+ CheckAAAServerCertStatus = (in.readInt() == 1) ? true : false;
+ sim = in.readParcelable(SIM.class.getClassLoader());
+ }
+ }
+
+ public static final Parcelable.Creator<Credential> CREATOR = new Parcelable.Creator<Credential>() {
+ public Credential createFromParcel(Parcel in) {
+ return new Credential(in);
+ }
+
+ public Credential[] newArray(int size) {
+ return new Credential[size];
+ }
+ };
+ }
+
+ /**
+ * PerProviderSubscription/<X+>/Credential/DigitalCertificate
+ **/
+ public static class DigitalCertificate implements Parcelable {
+ public String CertificateType;
+ public String CertSHA256Fingerprint;
+
+ public DigitalCertificate() {
+ }
+
+ public DigitalCertificate(Parcel in) {
+ readFromParcel(in);
+ }
+
+ public int describeContents() {
+ return 0;
+ }
+
+ public void writeToParcel(Parcel out, int flags) {
+ out.writeString(CertificateType);
+ out.writeString(CertSHA256Fingerprint);
+ }
+
+ public void readFromParcel(Parcel in) {
+ if (in == null) {
+ //log here
+ } else {
+ CertificateType = in.readString();
+ CertSHA256Fingerprint = in.readString();
+ }
+ }
+
+ public static final Parcelable.Creator<DigitalCertificate> CREATOR = new Parcelable.Creator<DigitalCertificate>() {
+ public DigitalCertificate createFromParcel(Parcel in) {
+ return new DigitalCertificate(in);
+ }
+
+ public DigitalCertificate[] newArray(int size) {
+ return new DigitalCertificate[size];
+ }
+ };
+
+ }
+
+ /**
+ * PerProviderSubscription/<X+>/Credential/SIM
+ **/
+ public static class SIM implements Parcelable {
+ public String IMSI;
+ public String EAPType;
+
+ public SIM() {
+ }
+
+ public SIM(Parcel in) {
+ readFromParcel(in);
+ }
+
+ public int describeContents() {
+ return 0;
+ }
+
+ public void writeToParcel(Parcel out, int flags) {
+ out.writeString(IMSI);
+ out.writeString(EAPType);
+ }
+
+ public void readFromParcel(Parcel in) {
+ if (in == null) {
+ //log here
+ } else {
+ IMSI = in.readString();
+ EAPType = in.readString();
+ }
+ }
+
+ public static final Parcelable.Creator<SIM> CREATOR = new Parcelable.Creator<SIM>() {
+ public SIM createFromParcel(Parcel in) {
+ return new SIM(in);
+ }
+
+ public SIM[] newArray(int size) {
+ return new SIM[size];
+ }
+ };
+
+ }
+
+ /**
+ * PerProviderSubscription/<X+>/Extension
+ **/
+ public static class Extension {
+ public String empty;
+ }
+
+ public WifiPasspointDmTree() {
+ }
+
+ public WifiPasspointDmTree(Parcel in) {
+ readFromParcel(in);
+ }
+
+ public int describeContents() {
+ return 0;
+ }
+
+ public void writeToParcel(Parcel out, int flags) {
+ out.writeMap(spFqdn);
+ }
+
+ public void readFromParcel(Parcel in) {
+ if (in == null) {
+ //log here
+ } else {
+ in.readMap(spFqdn, SpFqdn.class.getClassLoader());
+ }
+ }
+
+ public static final Parcelable.Creator<WifiPasspointDmTree> CREATOR = new Parcelable.Creator<WifiPasspointDmTree>() {
+ public WifiPasspointDmTree createFromParcel(Parcel in) {
+ return new WifiPasspointDmTree(in);
+ }
+
+ public WifiPasspointDmTree[] newArray(int size) {
+ return new WifiPasspointDmTree[size];
+ }
+ };
+
+}
diff --git a/wifi/java/android/net/wifi/passpoint/PasspointInfo.aidl b/wifi/java/android/net/wifi/passpoint/WifiPasspointInfo.aidl
similarity index 95%
copy from wifi/java/android/net/wifi/passpoint/PasspointInfo.aidl
copy to wifi/java/android/net/wifi/passpoint/WifiPasspointInfo.aidl
index cc11045..27f23bc 100644
--- a/wifi/java/android/net/wifi/passpoint/PasspointInfo.aidl
+++ b/wifi/java/android/net/wifi/passpoint/WifiPasspointInfo.aidl
@@ -16,4 +16,4 @@
package android.net.wifi.passpoint;
-parcelable PasspointInfo;
+parcelable WifiPasspointInfo;
diff --git a/wifi/java/android/net/wifi/passpoint/WifiPasspointInfo.java b/wifi/java/android/net/wifi/passpoint/WifiPasspointInfo.java
new file mode 100644
index 0000000..99bea2f
--- /dev/null
+++ b/wifi/java/android/net/wifi/passpoint/WifiPasspointInfo.java
@@ -0,0 +1,285 @@
+/*
+ * Copyright (C) 2014 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.
+ */
+
+package android.net.wifi.passpoint;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/** @hide */
+public class WifiPasspointInfo implements Parcelable {
+
+ /** TODO doc */
+ public static final int ANQP_CAPABILITY = 1 << 0;
+
+ /** TODO doc */
+ public static final int VENUE_NAME = 1 << 1;
+
+ /** TODO doc */
+ public static final int NETWORK_AUTH_TYPE = 1 << 2;
+
+ /** TODO doc */
+ public static final int ROAMING_CONSORTIUM = 1 << 3;
+
+ /** TODO doc */
+ public static final int IP_ADDR_TYPE_AVAILABILITY = 1 << 4;
+
+ /** TODO doc */
+ public static final int NAI_REALM = 1 << 5;
+
+ /** TODO doc */
+ public static final int CELLULAR_NETWORK = 1 << 6;
+
+ /** TODO doc */
+ public static final int DOMAIN_NAME = 1 << 7;
+
+ /** TODO doc */
+ public static final int HOTSPOT_CAPABILITY = 1 << 8;
+
+ /** TODO doc */
+ public static final int OPERATOR_FRIENDLY_NAME = 1 << 9;
+
+ /** TODO doc */
+ public static final int WAN_METRICS = 1 << 10;
+
+ /** TODO doc */
+ public static final int CONNECTION_CAPABILITY = 1 << 11;
+
+ /** TODO doc */
+ public static final int OSU_PROVIDER = 1 << 12;
+
+ /** TODO doc */
+ public static final int PRESET_CRED_MATCH =
+ ANQP_CAPABILITY |
+ HOTSPOT_CAPABILITY |
+ NAI_REALM |
+ CELLULAR_NETWORK |
+ DOMAIN_NAME;
+
+ /** TODO doc */
+ public static final int PRESET_ALL =
+ ANQP_CAPABILITY |
+ VENUE_NAME |
+ NETWORK_AUTH_TYPE |
+ ROAMING_CONSORTIUM |
+ IP_ADDR_TYPE_AVAILABILITY |
+ NAI_REALM |
+ CELLULAR_NETWORK |
+ DOMAIN_NAME |
+ HOTSPOT_CAPABILITY |
+ OPERATOR_FRIENDLY_NAME |
+ WAN_METRICS |
+ CONNECTION_CAPABILITY |
+ OSU_PROVIDER;
+
+ /** TODO doc */
+ public String bssid;
+
+ /** TODO doc */
+ public String venueName;
+
+ /** TODO doc */
+ public String networkAuthType;
+
+ /** TODO doc */
+ public String roamingConsortium;
+
+ /** TODO doc */
+ public String ipAddrTypeAvaibility;
+
+ /** TODO doc */
+ public String naiRealm;
+
+ /** TODO doc */
+ public String cellularNetwork;
+
+ /** TODO doc */
+ public String domainName;
+
+ /** TODO doc */
+ public String operatorFriendlyName;
+
+ /** TODO doc */
+ public String wanMetrics;
+
+ /** TODO doc */
+ public String connectionCapability;
+
+ /** TODO doc */
+ public List<WifiPasspointOsuProvider> osuProviderList;
+
+ /** default constructor @hide */
+ public WifiPasspointInfo() {
+ // osuProviderList = new ArrayList<OsuProvider>();
+ }
+
+ /** copy constructor @hide */
+ public WifiPasspointInfo(WifiPasspointInfo source) {
+ // TODO
+ bssid = source.bssid;
+ venueName = source.venueName;
+ networkAuthType = source.networkAuthType;
+ roamingConsortium = source.roamingConsortium;
+ ipAddrTypeAvaibility = source.ipAddrTypeAvaibility;
+ naiRealm = source.naiRealm;
+ cellularNetwork = source.cellularNetwork;
+ domainName = source.domainName;
+ operatorFriendlyName = source.operatorFriendlyName;
+ wanMetrics = source.wanMetrics;
+ connectionCapability = source.connectionCapability;
+ if (source.osuProviderList != null) {
+ osuProviderList = new ArrayList<WifiPasspointOsuProvider>();
+ for (WifiPasspointOsuProvider osu : source.osuProviderList)
+ osuProviderList.add(new WifiPasspointOsuProvider(osu));
+ }
+ }
+
+ /**
+ * Convert mask to ANQP subtypes, for supplicant command use.
+ *
+ * @param mask The ANQP subtypes mask.
+ * @return String of ANQP subtypes, good for supplicant command use
+ * @hide
+ */
+ public static String toAnqpSubtypes(int mask) {
+ StringBuilder sb = new StringBuilder();
+ if ((mask & ANQP_CAPABILITY) != 0)
+ sb.append("257,");
+ if ((mask & VENUE_NAME) != 0)
+ sb.append("258,");
+ if ((mask & NETWORK_AUTH_TYPE) != 0)
+ sb.append("260,");
+ if ((mask & ROAMING_CONSORTIUM) != 0)
+ sb.append("261,");
+ if ((mask & IP_ADDR_TYPE_AVAILABILITY) != 0)
+ sb.append("262,");
+ if ((mask & NAI_REALM) != 0)
+ sb.append("263,");
+ if ((mask & CELLULAR_NETWORK) != 0)
+ sb.append("264,");
+ if ((mask & DOMAIN_NAME) != 0)
+ sb.append("268,");
+ if ((mask & HOTSPOT_CAPABILITY) != 0)
+ sb.append("hs20:2,");
+ if ((mask & OPERATOR_FRIENDLY_NAME) != 0)
+ sb.append("hs20:3,");
+ if ((mask & WAN_METRICS) != 0)
+ sb.append("hs20:4,");
+ if ((mask & CONNECTION_CAPABILITY) != 0)
+ sb.append("hs20:5,");
+ if ((mask & OSU_PROVIDER) != 0)
+ sb.append("hs20:8,");
+ if (sb.length() > 0)
+ sb.deleteCharAt(sb.length() - 1);
+ return sb.toString();
+ }
+
+ @Override
+ public String toString() {
+ StringBuffer sb = new StringBuffer();
+ sb.append("BSSID: ").append(bssid);
+ if (venueName != null)
+ sb.append(" venueName: ").append(venueName);
+ if (networkAuthType != null)
+ sb.append(" networkAuthType: ").append(networkAuthType);
+ if (roamingConsortium != null)
+ sb.append(" roamingConsortium: ").append(roamingConsortium);
+ if (ipAddrTypeAvaibility != null)
+ sb.append(" ipAddrTypeAvaibility: ").append(ipAddrTypeAvaibility);
+ if (naiRealm != null)
+ sb.append(" naiRealm: ").append(naiRealm);
+ if (cellularNetwork != null)
+ sb.append(" cellularNetwork: ").append(cellularNetwork);
+ if (domainName != null)
+ sb.append(" domainName: ").append(domainName);
+ if (operatorFriendlyName != null)
+ sb.append(" operatorFriendlyName: ").append(operatorFriendlyName);
+ if (wanMetrics != null)
+ sb.append(" wanMetrics: ").append(wanMetrics);
+ if (connectionCapability != null)
+ sb.append(" connectionCapability: ").append(connectionCapability);
+ if (osuProviderList != null)
+ sb.append(" osuProviderList: (size=" + osuProviderList.size() + ")");
+ return sb.toString();
+ }
+
+ /** Implement the Parcelable interface {@hide} */
+ @Override
+ public void writeToParcel(Parcel out, int flags) {
+ out.writeValue(bssid);
+ out.writeValue(venueName);
+ out.writeValue(networkAuthType);
+ out.writeValue(roamingConsortium);
+ out.writeValue(ipAddrTypeAvaibility);
+ out.writeValue(naiRealm);
+ out.writeValue(cellularNetwork);
+ out.writeValue(domainName);
+ out.writeValue(operatorFriendlyName);
+ out.writeValue(wanMetrics);
+ out.writeValue(connectionCapability);
+ if (osuProviderList == null) {
+ out.writeInt(0);
+ } else {
+ out.writeInt(osuProviderList.size());
+ for (WifiPasspointOsuProvider osu : osuProviderList)
+ osu.writeToParcel(out, flags);
+ }
+ }
+
+ /** Implement the Parcelable interface {@hide} */
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ /** Implement the Parcelable interface {@hide} */
+ public static final Parcelable.Creator<WifiPasspointInfo> CREATOR =
+ new Parcelable.Creator<WifiPasspointInfo>() {
+ @Override
+ public WifiPasspointInfo createFromParcel(Parcel in) {
+ WifiPasspointInfo p = new WifiPasspointInfo();
+ p.bssid = (String) in.readValue(String.class.getClassLoader());
+ p.venueName = (String) in.readValue(String.class.getClassLoader());
+ p.networkAuthType = (String) in.readValue(String.class.getClassLoader());
+ p.roamingConsortium = (String) in.readValue(String.class.getClassLoader());
+ p.ipAddrTypeAvaibility = (String) in.readValue(String.class.getClassLoader());
+ p.naiRealm = (String) in.readValue(String.class.getClassLoader());
+ p.cellularNetwork = (String) in.readValue(String.class.getClassLoader());
+ p.domainName = (String) in.readValue(String.class.getClassLoader());
+ p.operatorFriendlyName = (String) in.readValue(String.class.getClassLoader());
+ p.wanMetrics = (String) in.readValue(String.class.getClassLoader());
+ p.connectionCapability = (String) in.readValue(String.class.getClassLoader());
+ int n = in.readInt();
+ if (n > 0) {
+ p.osuProviderList = new ArrayList<WifiPasspointOsuProvider>();
+ for (int i = 0; i < n; i++) {
+ WifiPasspointOsuProvider osu = WifiPasspointOsuProvider.CREATOR
+ .createFromParcel(in);
+ p.osuProviderList.add(osu);
+ }
+ }
+ return p;
+ }
+
+ @Override
+ public WifiPasspointInfo[] newArray(int size) {
+ return new WifiPasspointInfo[size];
+ }
+ };
+}
diff --git a/wifi/java/android/net/wifi/passpoint/PasspointManager.java b/wifi/java/android/net/wifi/passpoint/WifiPasspointManager.java
similarity index 75%
rename from wifi/java/android/net/wifi/passpoint/PasspointManager.java
rename to wifi/java/android/net/wifi/passpoint/WifiPasspointManager.java
index 234a44c..ee4dc5a 100644
--- a/wifi/java/android/net/wifi/passpoint/PasspointManager.java
+++ b/wifi/java/android/net/wifi/passpoint/WifiPasspointManager.java
@@ -34,9 +34,9 @@
import java.util.List;
/**
- * TODO: doc
+ * Provides APIs for managing Wifi Passpoint credentials.
*/
-public class PasspointManager {
+public class WifiPasspointManager {
private static final String TAG = "PasspointManager";
@@ -44,37 +44,58 @@
/* Passpoint states values */
- /** Passpoint is in an known state. This should only occur in boot time */
- public static final int PASSPOINT_STATE_UNKNOWN = 0;
+ /** Passpoint is in an known state. This should only occur in boot time @hide */
+ public static final int PASSPOINT_STATE_UNKNOWN = 0;
- /** Passpoint is disabled. This occurs when wifi is disabled. */
- public static final int PASSPOINT_STATE_DISABLED = 1;
+ /** Passpoint is disabled. This occurs when wifi is disabled. @hide */
+ public static final int PASSPOINT_STATE_DISABLED = 1;
- /** Passpoint is enabled and in discovery state. */
- public static final int PASSPOINT_STATE_DISCOVERY = 2;
+ /** Passpoint is enabled and in discovery state. @hide */
+ public static final int PASSPOINT_STATE_DISCOVERY = 2;
- /** Passpoint is enabled and in access state. */
- public static final int PASSPOINT_STATE_ACCESS = 3;
+ /** Passpoint is enabled and in access state. @hide */
+ public static final int PASSPOINT_STATE_ACCESS = 3;
- /** Passpoint is enabled and in provisioning state. */
- public static final int PASSPOINT_STATE_PROVISION = 4;
+ /** Passpoint is enabled and in provisioning state. @hide */
+ public static final int PASSPOINT_STATE_PROVISION = 4;
/* Passpoint callback error codes */
- /** Indicates that the operation failed due to an internal error */
- public static final int ERROR = 0;
+ /** Indicates that the operation failed due to an internal error @hide */
+ public static final int ERROR = 0;
- /** Indicates that the operation failed because wifi is disabled */
- public static final int WIFI_DISABLED = 1;
+ /** Indicates that the operation failed because wifi is disabled @hide */
+ public static final int WIFI_DISABLED = 1;
- /** Indicates that the operation failed because the framework is busy */
- public static final int BUSY = 2;
+ /** Indicates that the operation failed because the framework is busy @hide */
+ public static final int BUSY = 2;
+
+ /**
+ * protocol supported for Passpoint
+ * @hide
+ */
+ public static final String PROTOCOL_DM = "OMA-DM-ClientInitiated";
+
+ /**
+ * protocol supported for Passpoint
+ * @hide
+ */
+ public static final String PROTOCOL_SOAP = "SPP-ClientInitiated";
/* Passpoint broadcasts */
/**
+ * Broadcast intent action indicating that Passpoint online sign up is
+ * avaiable.
+ * @hide
+ */
+ public static final String PASSPOINT_OSU_AVAILABLE =
+ "android.net.wifi.passpoint.OSU_AVAILABLE";
+
+ /**
* Broadcast intent action indicating that the state of Passpoint
* connectivity has changed
+ * @hide
*/
public static final String PASSPOINT_STATE_CHANGED_ACTION =
"android.net.wifi.passpoint.STATE_CHANGE";
@@ -82,6 +103,7 @@
/**
* Broadcast intent action indicating that the saved Passpoint credential
* list has changed
+ * @hide
*/
public static final String PASSPOINT_CRED_CHANGED_ACTION =
"android.net.wifi.passpoint.CRED_CHANGE";
@@ -101,9 +123,9 @@
public static final String PASSPOINT_USER_REM_REQ_ACTION =
"android.net.wifi.passpoint.USER_REM_REQ";
-
/**
* Interface for callback invocation when framework channel is lost
+ * @hide
*/
public interface ChannelListener {
/**
@@ -115,6 +137,7 @@
/**
* Interface for callback invocation on an application action
+ * @hide
*/
public interface ActionListener {
/** The operation succeeded */
@@ -163,6 +186,7 @@
* A channel that connects the application to the wifi passpoint framework.
* Most passpoint operations require a Channel as an argument.
* An instance of Channel is obtained by doing a call on {@link #initialize}
+ * @hide
*/
public static class Channel {
private final static int INVALID_LISTENER_KEY = 0;
@@ -193,7 +217,8 @@
}
private int putListener(Object listener, int count) {
- if (listener == null || count <= 0) return INVALID_LISTENER_KEY;
+ if (listener == null || count <= 0)
+ return INVALID_LISTENER_KEY;
int key;
synchronized (mListenerMapLock) {
do {
@@ -207,13 +232,15 @@
private Object getListener(int key, boolean force) {
Log.d(TAG, "getListener() key=" + key + " force=" + force);
- if (key == INVALID_LISTENER_KEY) return null;
+ if (key == INVALID_LISTENER_KEY)
+ return null;
synchronized (mListenerMapLock) {
if (!force) {
int count = mListenerMapCount.get(key);
Log.d(TAG, "count=" + count);
mListenerMapCount.put(key, --count);
- if (count > 0) return null;
+ if (count > 0)
+ return null;
}
Log.d(TAG, "remove key");
mListenerMapCount.remove(key);
@@ -223,12 +250,14 @@
private void anqpRequestStart(ScanResult sr) {
Log.d(TAG, "anqpRequestStart sr.bssid=" + sr.BSSID);
- synchronized(mAnqpRequestLock) { mAnqpRequest.add(sr); }
+ synchronized (mAnqpRequestLock) {
+ mAnqpRequest.add(sr);
+ }
}
- private void anqpRequestFinish(PasspointInfo result) {
+ private void anqpRequestFinish(WifiPasspointInfo result) {
Log.d(TAG, "anqpRequestFinish pi.bssid=" + result.bssid);
- synchronized(mAnqpRequestLock) {
+ synchronized (mAnqpRequestLock) {
for (ScanResult sr : mAnqpRequest)
if (sr.BSSID.equals(result.bssid)) {
Log.d(TAG, "find hit " + result.bssid);
@@ -242,7 +271,7 @@
private void anqpRequestFinish(ScanResult sr) {
Log.d(TAG, "anqpRequestFinish sr.bssid=" + sr.BSSID);
- synchronized(mAnqpRequestLock) {
+ synchronized (mAnqpRequestLock) {
for (ScanResult sr1 : mAnqpRequest)
if (sr1.BSSID.equals(sr.BSSID)) {
mAnqpRequest.remove(sr1);
@@ -268,7 +297,7 @@
break;
case REQUEST_ANQP_INFO_SUCCEEDED:
- PasspointInfo result = (PasspointInfo) message.obj;
+ WifiPasspointInfo result = (WifiPasspointInfo) message.obj;
anqpRequestFinish(result);
if (listener != null) {
((ActionListener) listener).onSuccess();
@@ -277,7 +306,8 @@
case REQUEST_ANQP_INFO_FAILED:
anqpRequestFinish((ScanResult) message.obj);
- if (listener == null) getListener(message.arg2, true);
+ if (listener == null)
+ getListener(message.arg2, true);
if (listener != null) {
((ActionListener) listener).onFailure(message.arg1);
}
@@ -292,38 +322,36 @@
}
-
private static final int BASE = Protocol.BASE_WIFI_PASSPOINT_MANAGER;
/** @hide */
- public static final int REQUEST_ANQP_INFO = BASE + 1;
+ public static final int REQUEST_ANQP_INFO = BASE + 1;
/** @hide */
- public static final int REQUEST_ANQP_INFO_FAILED = BASE + 2;
+ public static final int REQUEST_ANQP_INFO_FAILED = BASE + 2;
/** @hide */
- public static final int REQUEST_ANQP_INFO_SUCCEEDED = BASE + 3;
+ public static final int REQUEST_ANQP_INFO_SUCCEEDED = BASE + 3;
/** @hide */
- public static final int REQUEST_OSU_INFO = BASE + 4;
+ public static final int REQUEST_OSU_INFO = BASE + 4;
/** @hide */
- public static final int REQUEST_OSU_INFO_FAILED = BASE + 5;
+ public static final int REQUEST_OSU_INFO_FAILED = BASE + 5;
/** @hide */
- public static final int REQUEST_OSU_INFO_SUCCEEDED = BASE + 6;
-
+ public static final int REQUEST_OSU_INFO_SUCCEEDED = BASE + 6;
private Context mContext;
- IPasspointManager mService;
-
+ IWifiPasspointManager mService;
/**
* TODO: doc
* @param context
* @param service
+ * @hide
*/
- public PasspointManager(Context context, IPasspointManager service) {
+ public WifiPasspointManager(Context context, IWifiPasspointManager service) {
mContext = context;
mService = service;
}
@@ -338,10 +366,13 @@
* null.
* @return Channel instance that is necessary for performing any further
* passpoint operations
+ *
+ * @hide
*/
public Channel initialize(Context srcContext, Looper srcLooper, ChannelListener listener) {
Messenger messenger = getMessenger();
- if (messenger == null) return null;
+ if (messenger == null)
+ return null;
Channel c = new Channel(srcContext, srcLooper, listener);
if (c.mAsyncChannel.connectSync(srcContext, c.mHandler, messenger)
@@ -366,49 +397,33 @@
}
}
- /**
- * Get Passpoint state.
- *
- * @return One of {@link #PASSPOINT_STATE_DISABLED},
- * {@link #PASSPOINT_STATE_DISCOVERY},
- * {@link #PASSPOINT_STATE_ACCESS},
- * {@link #PASSPOINT_STATE_PROVISION},
- * {@link #PASSPOINT_STATE_UNKNOWN}
- */
+ /** @hide */
public int getPasspointState() {
- try{
+ try {
return mService.getPasspointState();
- }
- catch (RemoteException e) {
+ } catch (RemoteException e) {
return PASSPOINT_STATE_UNKNOWN;
}
}
- /**
- * TODO: doc
- *
- * @param c
- * @param requested
- * @param mask
- * @param listener
- *
- * @hide
- */
+ /** @hide */
public void requestAnqpInfo(Channel c, List<ScanResult> requested, int mask,
ActionListener listener) {
Log.d(TAG, "requestAnqpInfo start");
Log.d(TAG, "requested.size=" + requested.size());
checkChannel(c);
List<ScanResult> list = new ArrayList<ScanResult>();
- for (ScanResult sr : requested) if (sr.capabilities.contains("[HS20]")) {
- list.add(sr);
- c.anqpRequestStart(sr);
- Log.d(TAG, "adding " + sr.BSSID);
- }
+ for (ScanResult sr : requested)
+ if (sr.capabilities.contains("[HS20]")) {
+ list.add(sr);
+ c.anqpRequestStart(sr);
+ Log.d(TAG, "adding " + sr.BSSID);
+ }
int count = list.size();
Log.d(TAG, "after filter, count=" + count);
if (count == 0) {
- if (DBG) Log.d(TAG, "ANQP info request contains no HS20 APs, skipped");
+ if (DBG)
+ Log.d(TAG, "ANQP info request contains no HS20 APs, skipped");
listener.onSuccess();
return;
}
@@ -418,25 +433,13 @@
Log.d(TAG, "requestAnqpInfo end");
}
- /**
- * TODO: doc
- *
- * @param c
- * @param requested
- * @param resolution
- * @param listener
- */
- public void requestOsuIcons(Channel c, List<PasspointOsuProvider> requested,
+ /** @hide */
+ public void requestOsuIcons(Channel c, List<WifiPasspointOsuProvider> requested,
int resolution, ActionListener listener) {
}
- /**
- * TODO: doc
- *
- * @param requested
- * @return
- */
- public List<PasspointPolicy> requestCredentialMatch(List<ScanResult> requested) {
+ /** @hide */
+ public List<WifiPasspointPolicy> requestCredentialMatch(List<ScanResult> requested) {
return null;
}
@@ -447,7 +450,7 @@
*
* @return The list of credentials
*/
- public List<PasspointCredential> getSavedCredentials() {
+ public List<WifiPasspointCredential> getSavedCredentials() {
return null;
}
@@ -457,32 +460,34 @@
* @param cred The credential to be added
* @return {@code true} if the operation succeeds, {@code false} otherwise
*/
- public boolean addCredential(PasspointCredential cred) {
+ public boolean addCredential(WifiPasspointCredential cred) {
return true;
}
/**
- * Update an existing Passpoint credential.
+ * Update an existing Passpoint credential. Only system or the owner of this
+ * credential has the permission to do this.
*
* @param cred The credential to be updated
* @return {@code true} if the operation succeeds, {@code false} otherwise
*/
- public boolean updateCredential(PasspointCredential cred) {
+ public boolean updateCredential(WifiPasspointCredential cred) {
return true;
}
/**
- * Remove an existing Passpoint credential.
+ * Remove an existing Passpoint credential. Only system or the owner of this
+ * credential has the permission to do this.
*
* @param cred The credential to be removed
* @return {@code true} if the operation succeeds, {@code false} otherwise
*/
- public boolean removeCredential(PasspointCredential cred) {
+ public boolean removeCredential(WifiPasspointCredential cred) {
return true;
}
/** @hide */
- public void startOsu(Channel c, PasspointOsuProvider selected, OsuRemListener listener) {
+ public void startOsu(Channel c, WifiPasspointOsuProvider selected, OsuRemListener listener) {
}
@@ -490,15 +495,12 @@
public void startUserRemediation(Channel c, OsuRemListener listener) {
}
- /**
- * Select and connect to a Passpoint network.
- *
- * @param selected Selected Passpoint network, see {@link PasspointPolicy}
- */
- public void connect(PasspointPolicy selected) {
+ /** @hide */
+ public void connect(WifiPasspointPolicy selected) {
}
private static void checkChannel(Channel c) {
- if (c == null) throw new IllegalArgumentException("Channel needs to be initialized");
+ if (c == null)
+ throw new IllegalArgumentException("Channel needs to be initialized");
}
}
diff --git a/wifi/java/android/net/wifi/passpoint/PasspointOsuProvider.aidl b/wifi/java/android/net/wifi/passpoint/WifiPasspointOsuProvider.aidl
similarity index 94%
copy from wifi/java/android/net/wifi/passpoint/PasspointOsuProvider.aidl
copy to wifi/java/android/net/wifi/passpoint/WifiPasspointOsuProvider.aidl
index f5ecb7c..088136f 100644
--- a/wifi/java/android/net/wifi/passpoint/PasspointOsuProvider.aidl
+++ b/wifi/java/android/net/wifi/passpoint/WifiPasspointOsuProvider.aidl
@@ -16,4 +16,4 @@
package android.net.wifi.passpoint;
-parcelable PasspointOsuProvider;
+parcelable WifiPasspointOsuProvider;
diff --git a/wifi/java/android/net/wifi/passpoint/PasspointOsuProvider.java b/wifi/java/android/net/wifi/passpoint/WifiPasspointOsuProvider.java
similarity index 60%
rename from wifi/java/android/net/wifi/passpoint/PasspointOsuProvider.java
rename to wifi/java/android/net/wifi/passpoint/WifiPasspointOsuProvider.java
index 80d5315..18a8f1e 100644
--- a/wifi/java/android/net/wifi/passpoint/PasspointOsuProvider.java
+++ b/wifi/java/android/net/wifi/passpoint/WifiPasspointOsuProvider.java
@@ -19,18 +19,22 @@
import android.os.Parcel;
import android.os.Parcelable;
-/**
- * TODO: doc
- */
-public class PasspointOsuProvider implements Parcelable {
+/** @hide */
+public class WifiPasspointOsuProvider implements Parcelable {
- /** TODO: doc */
+ /** TODO: doc
+ * @hide
+ */
public static final int OSU_METHOD_UNKNOWN = -1;
- /** TODO: doc */
+ /** TODO: doc
+ * @hide
+ */
public static final int OSU_METHOD_OMADM = 0;
- /** TODO: doc */
+ /** TODO: doc
+ * @hide
+ */
public static final int OSU_METHOD_SOAP = 1;
/** TODO: doc */
@@ -39,10 +43,14 @@
/** TODO: doc */
public String friendlyName;
- /** TODO: doc */
+ /** TODO: doc
+ * @hide
+ */
public String serverUri;
- /** TODO: doc */
+ /** TODO: doc
+ * @hide
+ */
public int osuMethod = OSU_METHOD_UNKNOWN;
/** TODO: doc */
@@ -66,14 +74,13 @@
/** TODO: doc */
public String osuService;
-
/** default constructor @hide */
- public PasspointOsuProvider() {
+ public WifiPasspointOsuProvider() {
// TODO
}
/** copy constructor @hide */
- public PasspointOsuProvider(PasspointOsuProvider source) {
+ public WifiPasspointOsuProvider(WifiPasspointOsuProvider source) {
// TODO
}
@@ -88,9 +95,9 @@
sb.append(" osuMethod: ").append(osuMethod);
if (iconFileName != null) {
sb.append(" icon: [").append(iconWidth).append("x")
- .append(iconHeight).append(" ")
- .append(iconType).append(" ")
- .append(iconFileName);
+ .append(iconHeight).append(" ")
+ .append(iconType).append(" ")
+ .append(iconFileName);
}
if (osuNai != null)
sb.append(" osuNai: ").append(osuNai);
@@ -119,27 +126,27 @@
// TODO: icon image?
}
- public static final Parcelable.Creator<PasspointOsuProvider> CREATOR =
- new Parcelable.Creator<PasspointOsuProvider>() {
- @Override
- public PasspointOsuProvider createFromParcel(Parcel in) {
- PasspointOsuProvider osu = new PasspointOsuProvider();
- osu.ssid = (String) in.readValue(String.class.getClassLoader());
- osu.friendlyName = (String) in.readValue(String.class.getClassLoader());
- osu.serverUri = (String) in.readValue(String.class.getClassLoader());
- osu.osuMethod = in.readInt();
- osu.iconWidth = in.readInt();
- osu.iconHeight = in.readInt();
- osu.iconType = (String) in.readValue(String.class.getClassLoader());
- osu.iconFileName = (String) in.readValue(String.class.getClassLoader());
- osu.osuNai = (String) in.readValue(String.class.getClassLoader());
- osu.osuService = (String) in.readValue(String.class.getClassLoader());
- return osu;
- }
+ public static final Parcelable.Creator<WifiPasspointOsuProvider> CREATOR =
+ new Parcelable.Creator<WifiPasspointOsuProvider>() {
+ @Override
+ public WifiPasspointOsuProvider createFromParcel(Parcel in) {
+ WifiPasspointOsuProvider osu = new WifiPasspointOsuProvider();
+ osu.ssid = (String) in.readValue(String.class.getClassLoader());
+ osu.friendlyName = (String) in.readValue(String.class.getClassLoader());
+ osu.serverUri = (String) in.readValue(String.class.getClassLoader());
+ osu.osuMethod = in.readInt();
+ osu.iconWidth = in.readInt();
+ osu.iconHeight = in.readInt();
+ osu.iconType = (String) in.readValue(String.class.getClassLoader());
+ osu.iconFileName = (String) in.readValue(String.class.getClassLoader());
+ osu.osuNai = (String) in.readValue(String.class.getClassLoader());
+ osu.osuService = (String) in.readValue(String.class.getClassLoader());
+ return osu;
+ }
- @Override
- public PasspointOsuProvider[] newArray(int size) {
- return new PasspointOsuProvider[size];
- }
- };
+ @Override
+ public WifiPasspointOsuProvider[] newArray(int size) {
+ return new WifiPasspointOsuProvider[size];
+ }
+ };
}
diff --git a/wifi/java/android/net/wifi/passpoint/PasspointInfo.aidl b/wifi/java/android/net/wifi/passpoint/WifiPasspointPolicy.aidl
similarity index 95%
rename from wifi/java/android/net/wifi/passpoint/PasspointInfo.aidl
rename to wifi/java/android/net/wifi/passpoint/WifiPasspointPolicy.aidl
index cc11045..1d61da0 100644
--- a/wifi/java/android/net/wifi/passpoint/PasspointInfo.aidl
+++ b/wifi/java/android/net/wifi/passpoint/WifiPasspointPolicy.aidl
@@ -16,4 +16,4 @@
package android.net.wifi.passpoint;
-parcelable PasspointInfo;
+parcelable WifiPasspointPolicy;
diff --git a/wifi/java/android/net/wifi/passpoint/WifiPasspointPolicy.java b/wifi/java/android/net/wifi/passpoint/WifiPasspointPolicy.java
new file mode 100644
index 0000000..5f76562
--- /dev/null
+++ b/wifi/java/android/net/wifi/passpoint/WifiPasspointPolicy.java
@@ -0,0 +1,226 @@
+/*
+ * Copyright (C) 2014 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.
+ */
+
+package android.net.wifi.passpoint;
+
+import android.os.Parcelable;
+import android.os.Parcel;
+import android.util.Log;
+
+/** @hide */
+public class WifiPasspointPolicy implements Parcelable {
+
+ private final static String TAG = "PasspointPolicy";
+
+ /** @hide */
+ public static final int HOME_SP = 0;
+
+ /** @hide */
+ public static final int ROAMING_PARTNER = 1;
+
+ /** @hide */
+ public static final int UNRESTRICTED = 2;
+
+ private String mName;
+ private int mSubscriptionPriority;
+ private int mRoamingPriority;
+ private String mBssid;
+ private String mSsid;
+ private WifiPasspointCredential mCredential;
+ private int mRestriction;// Permitted values are "HomeSP", "RoamingPartner", or "Unrestricted"
+ private boolean mIsHomeSp;
+
+ /** @hide */
+ public WifiPasspointPolicy(String name, int priority, String ssid,
+ String bssid, WifiPasspointCredential pc,
+ int restriction, boolean ishomesp) {
+ mName = name;
+ mSubscriptionPriority = priority;
+ //PerProviderSubscription/<X+>/Policy/PreferredRoamingPartnerList/<X+>/Priority
+ mRoamingPriority = 128; //default priority value of 128
+ mSsid = ssid;
+ mCredential = pc;
+ mBssid = bssid;
+ mRestriction = restriction;
+ mIsHomeSp = ishomesp;
+ }
+
+ public String getSsid() {
+ return mSsid;
+ }
+
+ /** @hide */
+ public void setBssid(String bssid) {
+ mBssid = bssid;
+ }
+
+ public String getBssid() {
+ return mBssid;
+ }
+
+ /** @hide */
+ public void setRestriction(int r) {
+ mRestriction = r;
+ }
+
+ /** @hide */
+ public int getRestriction() {
+ return mRestriction;
+ }
+
+ /** @hide */
+ public void setHomeSp(boolean b) {
+ mIsHomeSp = b;
+ }
+
+ /** @hide */
+ public boolean getHomeSp() {
+ return mIsHomeSp;
+ }
+
+ /** @hide */
+ public void setCredential(WifiPasspointCredential newCredential) {
+ mCredential = newCredential;
+ }
+
+ public WifiPasspointCredential getCredential() {
+ // TODO: return a copy
+ return mCredential;
+ }
+
+ /** @hide */
+ public void setSubscriptionPriority(int priority) {
+ mSubscriptionPriority = priority;
+ }
+
+ /** @hide */
+ public void setRoamingPriority(int priority) {
+ mRoamingPriority = priority;
+ }
+
+ public int getSubscriptionPriority() {
+ return mSubscriptionPriority;
+ }
+
+ public int getRoamingPriority() {
+ return mRoamingPriority;
+ }
+
+ /** {@inheritDoc} @hide */
+ public int compareTo(WifiPasspointPolicy another) {
+ Log.d(TAG, "this:" + this);
+ Log.d(TAG, "another:" + another);
+
+ if (another == null) {
+ return -1;
+ } else if (this.mIsHomeSp == true && another.getHomeSp() == false) {
+ //home sp priority is higher then roaming
+ Log.d(TAG, "compare HomeSP first, this is HomeSP, another isn't");
+ return -1;
+ } else if ((this.mIsHomeSp == true && another.getHomeSp() == true)) {
+ Log.d(TAG, "both HomeSP");
+ //if both home sp, compare subscription priority
+ if (this.mSubscriptionPriority < another.getSubscriptionPriority()) {
+ Log.d(TAG, "this priority is higher");
+ return -1;
+ } else if (this.mSubscriptionPriority == another.getSubscriptionPriority()) {
+ Log.d(TAG, "both priorities equal");
+ //if priority still the same, compare name(ssid)
+ if (this.mName.compareTo(another.mName) != 0) {
+ Log.d(TAG, "compare mName return:" + this.mName.compareTo(another.mName));
+ return this.mName.compareTo(another.mName);
+ }
+ /**
+ *if name still the same, compare credential
+ *the device may has two more credentials(TLS,SIM..etc)
+ *it can associate to one AP(same ssid). so we should compare by credential
+ */
+ if (this.mCredential != null && another.mCredential != null) {
+ if (this.mCredential.compareTo(another.mCredential) != 0) {
+ Log.d(TAG,
+ "compare mCredential return:" + this.mName.compareTo(another.mName));
+ return this.mCredential.compareTo(another.mCredential);
+ }
+ }
+ } else {
+ return 1;
+ }
+ } else if ((this.mIsHomeSp == false && another.getHomeSp() == false)) {
+ Log.d(TAG, "both RoamingSp");
+ //if both roaming sp, compare roaming priority(preferredRoamingPartnerList/<X+>/priority)
+ if (this.mRoamingPriority < another.getRoamingPriority()) {
+ Log.d(TAG, "this priority is higher");
+ return -1;
+ } else if (this.mRoamingPriority == another.getRoamingPriority()) {//priority equals, compare name
+ Log.d(TAG, "both priorities equal");
+ //if priority still the same, compare name(ssid)
+ if (this.mName.compareTo(another.mName) != 0) {
+ Log.d(TAG, "compare mName return:" + this.mName.compareTo(another.mName));
+ return this.mName.compareTo(another.mName);
+ }
+ //if name still the same, compare credential
+ if (this.mCredential != null && another.mCredential != null) {
+ if (this.mCredential.compareTo(another.mCredential) != 0) {
+ Log.d(TAG,
+ "compare mCredential return:"
+ + this.mCredential.compareTo(another.mCredential));
+ return this.mCredential.compareTo(another.mCredential);
+ }
+ }
+ } else {
+ return 1;
+ }
+ }
+
+ Log.d(TAG, "both policies equal");
+ return 0;
+ }
+
+ @Override
+ /** @hide */
+ public String toString() {
+ return "PasspointPolicy: name=" + mName + " SubscriptionPriority=" + mSubscriptionPriority +
+ " mRoamingPriority" + mRoamingPriority +
+ " ssid=" + mSsid + " restriction=" + mRestriction +
+ " ishomesp=" + mIsHomeSp + " Credential=" + mCredential;
+ }
+
+ /** Implement the Parcelable interface {@hide} */
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ /** Implement the Parcelable interface {@hide} */
+ @Override
+ public void writeToParcel(Parcel dest, int flags) {
+ // TODO
+ }
+
+ /** Implement the Parcelable interface {@hide} */
+ public static final Creator<WifiPasspointPolicy> CREATOR =
+ new Creator<WifiPasspointPolicy>() {
+ @Override
+ public WifiPasspointPolicy createFromParcel(Parcel in) {
+ return null;
+ }
+
+ @Override
+ public WifiPasspointPolicy[] newArray(int size) {
+ return new WifiPasspointPolicy[size];
+ }
+ };
+}
diff --git a/wifi/java/android/net/wifi/passpoint/WifiTree.aidl b/wifi/java/android/net/wifi/passpoint/WifiTree.aidl
deleted file mode 100644
index 8e2fab742..0000000
--- a/wifi/java/android/net/wifi/passpoint/WifiTree.aidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * Copyright (c) 2014, 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.
- */
-
-package android.net.wifi.passpoint;
-
-parcelable WifiTree;
diff --git a/wifi/java/android/net/wifi/passpoint/WifiTree.java b/wifi/java/android/net/wifi/passpoint/WifiTree.java
deleted file mode 100644
index 8fdb6e1..0000000
--- a/wifi/java/android/net/wifi/passpoint/WifiTree.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (C) 2014 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.
- */
-
-package android.net.wifi.passpoint;
-
-import android.os.Parcelable;
-import android.os.Parcel;
-
-/** @hide */
-public class WifiTree implements Parcelable {
-
- /** Implement the Parcelable interface {@hide} */
- @Override
- public int describeContents() {
- return 0;
- }
-
- /** Implement the Parcelable interface {@hide} */
- @Override
- public void writeToParcel(Parcel out, int flags) {
- // TODO
- }
-
- /** Implement the Parcelable interface {@hide} */
- public static final Parcelable.Creator<WifiTree> CREATOR =
- new Parcelable.Creator<WifiTree>() {
- @Override
- public WifiTree createFromParcel(Parcel in) {
- // TODO
- return null;
- }
-
- @Override
- public WifiTree[] newArray(int size) {
- return new WifiTree[size];
- }
- };
-}