Merge "HdmiControlManager with HdmiPlaybackClient API definition"
diff --git a/Android.mk b/Android.mk
index dc06243..19ee855 100644
--- a/Android.mk
+++ b/Android.mk
@@ -335,7 +335,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/hotspot/IWifiHotspotManager.aidl \
+ wifi/java/android/net/wifi/passpoint/IPasspointManager.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 8e68a56..3e52b7e 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -6661,8 +6661,8 @@
field public static final java.lang.String USER_SERVICE = "user";
field public static final java.lang.String VIBRATOR_SERVICE = "vibrator";
field public static final java.lang.String WALLPAPER_SERVICE = "wallpaper";
- field public static final java.lang.String WIFI_HOTSPOT_SERVICE = "wifihotspot";
field public static final java.lang.String WIFI_P2P_SERVICE = "wifip2p";
+ field public static final java.lang.String WIFI_PASSPOINT_SERVICE = "wifipasspoint";
field public static final java.lang.String WIFI_SERVICE = "wifi";
field public static final java.lang.String WINDOW_SERVICE = "window";
}
@@ -15875,6 +15875,16 @@
field public int serverAddress;
}
+ public class LinkAddress implements android.os.Parcelable {
+ method public int describeContents();
+ method public java.net.InetAddress getAddress();
+ method public int getFlags();
+ method public int getNetworkPrefixLength();
+ method public int getScope();
+ method public boolean isSameAddressAs(android.net.LinkAddress);
+ method public void writeToParcel(android.os.Parcel, int);
+ }
+
public class LocalServerSocket {
ctor public LocalServerSocket(java.lang.String) throws java.io.IOException;
ctor public LocalServerSocket(java.io.FileDescriptor) throws java.io.IOException;
@@ -16852,6 +16862,86 @@
method public void setWorkSource(android.os.WorkSource);
}
+ public class WifiScanner {
+ method public void configureWifiChange(int, int, int, int, int, android.net.wifi.WifiScanner.HotspotInfo[]);
+ method public void resetHotlist(android.net.wifi.WifiScanner.HotlistListener);
+ method public void retrieveScanResults(boolean, android.net.wifi.WifiScanner.ScanListener);
+ method public void setHotlist(android.net.wifi.WifiScanner.HotspotInfo[], int, android.net.wifi.WifiScanner.HotlistListener);
+ method public void startBackgroundScan(android.net.wifi.WifiScanner.ScanSettings, android.net.wifi.WifiScanner.ScanListener);
+ method public void startTrackingWifiChange(android.net.wifi.WifiScanner.WifiChangeListener);
+ method public void stopBackgroundScan(android.net.wifi.WifiScanner.ScanListener);
+ method public void stopTrackingWifiChange(android.net.wifi.WifiScanner.WifiChangeListener);
+ field public static final int MAX_SCAN_PERIOD_MS = 1024000; // 0xfa000
+ field public static final int MIN_SCAN_PERIOD_MS = 2000; // 0x7d0
+ field public static final int REASON_CONFLICTING_REQUEST = -4; // 0xfffffffc
+ field public static final int REASON_INVALID_LISTENER = -2; // 0xfffffffe
+ field public static final int REASON_INVALID_REQUEST = -3; // 0xfffffffd
+ field public static final int REASON_SUCCEEDED = 0; // 0x0
+ field public static final int REASON_UNSPECIFIED = -1; // 0xffffffff
+ field public static final int REPORT_EVENT_AFTER_BUFFER_FULL = 0; // 0x0
+ field public static final int REPORT_EVENT_AFTER_EACH_SCAN = 1; // 0x1
+ field public static final int REPORT_EVENT_FULL_SCAN_RESULT = 2; // 0x2
+ field public static final int WIFI_BAND_24_GHZ = 1; // 0x1
+ field public static final int WIFI_BAND_5_GHZ = 2; // 0x2
+ field public static final int WIFI_BAND_5_GHZ_DFS_ONLY = 4; // 0x4
+ field public static final int WIFI_BAND_5_GHZ_WITH_DFS = 6; // 0x6
+ field public static final int WIFI_BAND_BOTH = 3; // 0x3
+ field public static final int WIFI_BAND_BOTH_WITH_DFS = 7; // 0x7
+ field public static final int WIFI_BAND_UNSPECIFIED = 0; // 0x0
+ }
+
+ public static class WifiScanner.ChannelSpec {
+ ctor public WifiScanner.ChannelSpec(int);
+ field public int frequency;
+ }
+
+ public static class WifiScanner.FullScanResult implements android.os.Parcelable {
+ ctor public WifiScanner.FullScanResult();
+ method public int describeContents();
+ method public void writeToParcel(android.os.Parcel, int);
+ field public android.net.wifi.WifiScanner.InformationElement[] informationElements;
+ field public android.net.wifi.ScanResult result;
+ }
+
+ public static abstract interface WifiScanner.HotlistListener {
+ method public abstract void onFound(android.net.wifi.ScanResult[]);
+ }
+
+ public static class WifiScanner.HotspotInfo {
+ ctor public WifiScanner.HotspotInfo();
+ field public java.lang.String bssid;
+ field public int frequencyHint;
+ field public int high;
+ field public int low;
+ }
+
+ public static class WifiScanner.InformationElement {
+ ctor public WifiScanner.InformationElement();
+ field public byte[] bytes;
+ field public int id;
+ }
+
+ public static abstract interface WifiScanner.ScanListener {
+ method public abstract void onFullResult(android.net.wifi.WifiScanner.FullScanResult);
+ method public abstract void onPeriodChanged(int);
+ method public abstract void onResults(android.net.wifi.ScanResult[]);
+ }
+
+ public static class WifiScanner.ScanSettings implements android.os.Parcelable {
+ ctor public WifiScanner.ScanSettings();
+ method public int describeContents();
+ method public void writeToParcel(android.os.Parcel, int);
+ field public int band;
+ field public android.net.wifi.WifiScanner.ChannelSpec[] channels;
+ field public int periodInMs;
+ field public int reportEvents;
+ }
+
+ public static abstract interface WifiScanner.WifiChangeListener {
+ method public abstract void onChanging(android.net.wifi.ScanResult[]);
+ method public abstract void onQuiescence(android.net.wifi.ScanResult[]);
+ }
+
public class WpsInfo implements android.os.Parcelable {
ctor public WpsInfo();
ctor public WpsInfo(android.net.wifi.WpsInfo);
@@ -16869,19 +16959,6 @@
}
-package android.net.wifi.hotspot {
-
- public abstract interface IWifiHotspotManager implements android.os.IInterface {
- method public abstract void test() throws android.os.RemoteException;
- }
-
- public class WifiHotspotManager {
- ctor public WifiHotspotManager(android.content.Context, android.net.wifi.hotspot.IWifiHotspotManager);
- method public void test();
- }
-
-}
-
package android.net.wifi.p2p {
public class WifiP2pConfig implements android.os.Parcelable {
@@ -17077,6 +17154,114 @@
}
+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();
+ method public int describeContents();
+ 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);
+ }
+
+}
+
package android.nfc {
public class FormatException extends java.lang.Exception {
diff --git a/core/java/android/app/ContextImpl.java b/core/java/android/app/ContextImpl.java
index eeb5283..ca6b008 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.hotspot.IWifiHotspotManager;
-import android.net.wifi.hotspot.WifiHotspotManager;
+import android.net.wifi.passpoint.IPasspointManager;
+import android.net.wifi.passpoint.PasspointManager;
import android.net.wifi.p2p.IWifiP2pManager;
import android.net.wifi.p2p.WifiP2pManager;
import android.nfc.NfcManager;
@@ -578,11 +578,11 @@
return new WifiManager(ctx.getOuterContext(), service);
}});
- registerService(WIFI_HOTSPOT_SERVICE, new ServiceFetcher() {
+ registerService(WIFI_PASSPOINT_SERVICE, new ServiceFetcher() {
public Object createService(ContextImpl ctx) {
- IBinder b = ServiceManager.getService(WIFI_HOTSPOT_SERVICE);
- IWifiHotspotManager service = IWifiHotspotManager.Stub.asInterface(b);
- return new WifiHotspotManager(ctx.getOuterContext(), service);
+ IBinder b = ServiceManager.getService(WIFI_PASSPOINT_SERVICE);
+ IPasspointManager service = IPasspointManager.Stub.asInterface(b);
+ return new PasspointManager(ctx.getOuterContext(), service);
}});
registerService(WIFI_P2P_SERVICE, new ServiceFetcher() {
diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java
index f029b37..f7f51fe 100644
--- a/core/java/android/content/Context.java
+++ b/core/java/android/content/Context.java
@@ -1991,7 +1991,7 @@
//@hide: NETWORK_STATS_SERVICE,
//@hide: NETWORK_POLICY_SERVICE,
WIFI_SERVICE,
- WIFI_HOTSPOT_SERVICE,
+ WIFI_PASSPOINT_SERVICE,
WIFI_P2P_SERVICE,
WIFI_SCANNING_SERVICE,
NSD_SERVICE,
@@ -2352,13 +2352,13 @@
/**
* Use with {@link #getSystemService} to retrieve a {@link
- * android.net.wifi.hotspot.WifiHotspotManager} for handling management of
- * Wi-Fi hotspot access.
+ * android.net.wifi.passpoint.PasspointManager} for handling management of
+ * Wi-Fi passpoint access.
*
* @see #getSystemService
- * @see android.net.wifi.hotspot.WifiHotspotManager
+ * @see android.net.wifi.passpoint.PasspointManager
*/
- public static final String WIFI_HOTSPOT_SERVICE = "wifihotspot";
+ public static final String WIFI_PASSPOINT_SERVICE = "wifipasspoint";
/**
* Use with {@link #getSystemService} to retrieve a {@link
diff --git a/core/java/android/net/LinkAddress.java b/core/java/android/net/LinkAddress.java
index a725bec..d07c0b61 100644
--- a/core/java/android/net/LinkAddress.java
+++ b/core/java/android/net/LinkAddress.java
@@ -39,7 +39,8 @@
* <ul>
* <li>An IP address and prefix length (e.g., {@code 2001:db8::1/64} or {@code 192.0.2.1/24}).
* The address must be unicast, as multicast addresses cannot be assigned to interfaces.
- * <li>Address flags: A bitmask of {@code IFA_F_*} values representing properties of the address.
+ * <li>Address flags: A bitmask of {@code IFA_F_*} values representing properties
+ * of the address.
* <li>Address scope: An integer defining the scope in which the address is unique (e.g.,
* {@code RT_SCOPE_LINK} or {@code RT_SCOPE_SITE}).
* <ul>
@@ -47,10 +48,9 @@
* When constructing a {@code LinkAddress}, the IP address and prefix are required. The flags and
* scope are optional. If they are not specified, the flags are set to zero, and the scope will be
* determined based on the IP address (e.g., link-local addresses will be created with a scope of
- * {@code RT_SCOPE_LINK}, global addresses with {@code RT_SCOPE_UNIVERSE}, etc.) If they are
- * specified, they are not checked for validity.
+ * {@code RT_SCOPE_LINK}, global addresses with {@code RT_SCOPE_UNIVERSE},
+ * etc.) If they are specified, they are not checked for validity.
*
- * @hide
*/
public class LinkAddress implements Parcelable {
/**
@@ -119,6 +119,10 @@
* the specified flags and scope. Flags and scope are not checked for validity.
* @param address The IP address.
* @param prefixLength The prefix length.
+ * @param flags A bitmask of {@code IFA_F_*} values representing properties of the address.
+ * @param scope An integer defining the scope in which the address is unique (e.g.,
+ * {@link OsConstants#RT_SCOPE_LINK} or {@link OsConstants#RT_SCOPE_SITE}).
+ * @hide
*/
public LinkAddress(InetAddress address, int prefixLength, int flags, int scope) {
init(address, prefixLength, flags, scope);
@@ -129,6 +133,7 @@
* The flags are set to zero and the scope is determined from the address.
* @param address The IP address.
* @param prefixLength The prefix length.
+ * @hide
*/
public LinkAddress(InetAddress address, int prefixLength) {
this(address, prefixLength, 0, 0);
@@ -139,6 +144,7 @@
* Constructs a new {@code LinkAddress} from an {@code InterfaceAddress}.
* The flags are set to zero and the scope is determined from the address.
* @param interfaceAddress The interface address.
+ * @hide
*/
public LinkAddress(InterfaceAddress interfaceAddress) {
this(interfaceAddress.getAddress(),
@@ -149,6 +155,7 @@
* Constructs a new {@code LinkAddress} from a string such as "192.0.2.5/24" or
* "2001:db8::1/64". The flags are set to zero and the scope is determined from the address.
* @param string The string to parse.
+ * @hide
*/
public LinkAddress(String address) {
this(address, 0, 0);
@@ -161,6 +168,7 @@
* @param string The string to parse.
* @param flags The address flags.
* @param scope The address scope.
+ * @hide
*/
public LinkAddress(String address, int flags, int scope) {
InetAddress inetAddress = null;
@@ -220,9 +228,10 @@
}
/**
- * Determines whether this {@code LinkAddress} and the provided {@code LinkAddress} represent
- * the same address. Two LinkAddresses represent the same address if they have the same IP
- * address and prefix length, even if their properties are different.
+ * Determines whether this {@code LinkAddress} and the provided {@code LinkAddress}
+ * represent the same address. Two {@code LinkAddresses} represent the same address
+ * if they have the same IP address and prefix length, even if their properties are
+ * different.
*
* @param other the {@code LinkAddress} to compare to.
* @return {@code true} if both objects have the same address and prefix length, {@code false}
@@ -233,28 +242,28 @@
}
/**
- * Returns the InetAddress of this address.
+ * Returns the {@link InetAddress} of this {@code LinkAddress}.
*/
public InetAddress getAddress() {
return address;
}
/**
- * Returns the prefix length of this address.
+ * Returns the prefix length of this {@code LinkAddress}.
*/
public int getNetworkPrefixLength() {
return prefixLength;
}
/**
- * Returns the flags of this address.
+ * Returns the flags of this {@code LinkAddress}.
*/
public int getFlags() {
return flags;
}
/**
- * Returns the scope of this address.
+ * Returns the scope of this {@code LinkAddress}.
*/
public int getScope() {
return scope;
@@ -262,6 +271,7 @@
/**
* Returns true if this {@code LinkAddress} is global scope and preferred.
+ * @hide
*/
public boolean isGlobalPreferred() {
return (scope == RT_SCOPE_UNIVERSE &&
diff --git a/core/java/android/preference/PreferenceManager.java b/core/java/android/preference/PreferenceManager.java
index 5c8c8e9..ad940c6 100644
--- a/core/java/android/preference/PreferenceManager.java
+++ b/core/java/android/preference/PreferenceManager.java
@@ -621,8 +621,9 @@
* Registers a listener.
*
* @see OnActivityStopListener
+ * @hide
*/
- void registerOnActivityStopListener(OnActivityStopListener listener) {
+ public void registerOnActivityStopListener(OnActivityStopListener listener) {
synchronized (this) {
if (mActivityStopListeners == null) {
mActivityStopListeners = new ArrayList<OnActivityStopListener>();
@@ -638,8 +639,9 @@
* Unregisters a listener.
*
* @see OnActivityStopListener
+ * @hide
*/
- void unregisterOnActivityStopListener(OnActivityStopListener listener) {
+ public void unregisterOnActivityStopListener(OnActivityStopListener listener) {
synchronized (this) {
if (mActivityStopListeners != null) {
mActivityStopListeners.remove(listener);
diff --git a/core/java/android/preference/SeekBarVolumizer.java b/core/java/android/preference/SeekBarVolumizer.java
new file mode 100644
index 0000000..d2d6ade
--- /dev/null
+++ b/core/java/android/preference/SeekBarVolumizer.java
@@ -0,0 +1,248 @@
+/*
+ * 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.preference;
+
+import android.content.Context;
+import android.database.ContentObserver;
+import android.media.AudioManager;
+import android.media.Ringtone;
+import android.media.RingtoneManager;
+import android.net.Uri;
+import android.os.Handler;
+import android.os.HandlerThread;
+import android.os.Message;
+import android.preference.VolumePreference.VolumeStore;
+import android.provider.Settings;
+import android.provider.Settings.System;
+import android.util.Log;
+import android.widget.SeekBar;
+import android.widget.SeekBar.OnSeekBarChangeListener;
+
+/**
+ * Turns a {@link SeekBar} into a volume control.
+ * @hide
+ */
+public class SeekBarVolumizer implements OnSeekBarChangeListener, Handler.Callback {
+
+ public interface Callback {
+ void onSampleStarting(SeekBarVolumizer sbv);
+ }
+
+ private Context mContext;
+ private Handler mHandler;
+ private final Callback mCallback;
+
+ private AudioManager mAudioManager;
+ private int mStreamType;
+ private int mOriginalStreamVolume;
+ private Ringtone mRingtone;
+
+ private int mLastProgress = -1;
+ private SeekBar mSeekBar;
+ private int mVolumeBeforeMute = -1;
+
+ private static final int MSG_SET_STREAM_VOLUME = 0;
+ private static final int MSG_START_SAMPLE = 1;
+ private static final int MSG_STOP_SAMPLE = 2;
+ private static final int CHECK_RINGTONE_PLAYBACK_DELAY_MS = 1000;
+
+ private ContentObserver mVolumeObserver = new ContentObserver(mHandler) {
+ @Override
+ public void onChange(boolean selfChange) {
+ super.onChange(selfChange);
+ if (mSeekBar != null && mAudioManager != null) {
+ int volume = mAudioManager.getStreamVolume(mStreamType);
+ mSeekBar.setProgress(volume);
+ }
+ }
+ };
+
+ public SeekBarVolumizer(Context context, SeekBar seekBar, int streamType, Uri defaultUri,
+ Callback callback) {
+ mContext = context;
+ mAudioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
+ mStreamType = streamType;
+ mSeekBar = seekBar;
+
+ HandlerThread thread = new HandlerThread(VolumePreference.TAG + ".CallbackHandler");
+ thread.start();
+ mHandler = new Handler(thread.getLooper(), this);
+ mCallback = callback;
+
+ initSeekBar(seekBar, defaultUri);
+ }
+
+ private void initSeekBar(SeekBar seekBar, Uri defaultUri) {
+ seekBar.setMax(mAudioManager.getStreamMaxVolume(mStreamType));
+ mOriginalStreamVolume = mAudioManager.getStreamVolume(mStreamType);
+ seekBar.setProgress(mOriginalStreamVolume);
+ seekBar.setOnSeekBarChangeListener(this);
+
+ mContext.getContentResolver().registerContentObserver(
+ System.getUriFor(System.VOLUME_SETTINGS[mStreamType]),
+ false, mVolumeObserver);
+
+ if (defaultUri == null) {
+ if (mStreamType == AudioManager.STREAM_RING) {
+ defaultUri = Settings.System.DEFAULT_RINGTONE_URI;
+ } else if (mStreamType == AudioManager.STREAM_NOTIFICATION) {
+ defaultUri = Settings.System.DEFAULT_NOTIFICATION_URI;
+ } else {
+ defaultUri = Settings.System.DEFAULT_ALARM_ALERT_URI;
+ }
+ }
+
+ mRingtone = RingtoneManager.getRingtone(mContext, defaultUri);
+
+ if (mRingtone != null) {
+ mRingtone.setStreamType(mStreamType);
+ }
+ }
+
+ @Override
+ public boolean handleMessage(Message msg) {
+ switch (msg.what) {
+ case MSG_SET_STREAM_VOLUME:
+ mAudioManager.setStreamVolume(mStreamType, mLastProgress, 0);
+ break;
+ case MSG_START_SAMPLE:
+ onStartSample();
+ break;
+ case MSG_STOP_SAMPLE:
+ onStopSample();
+ break;
+ default:
+ Log.e(VolumePreference.TAG, "invalid SeekBarVolumizer message: "+msg.what);
+ }
+ return true;
+ }
+
+ private void postStartSample() {
+ mHandler.removeMessages(MSG_START_SAMPLE);
+ mHandler.sendMessageDelayed(mHandler.obtainMessage(MSG_START_SAMPLE),
+ isSamplePlaying() ? CHECK_RINGTONE_PLAYBACK_DELAY_MS : 0);
+ }
+
+ private void onStartSample() {
+ if (!isSamplePlaying()) {
+ if (mCallback != null) {
+ mCallback.onSampleStarting(this);
+ }
+ if (mRingtone != null) {
+ mRingtone.play();
+ }
+ }
+ }
+
+ void postStopSample() {
+ // remove pending delayed start messages
+ mHandler.removeMessages(MSG_START_SAMPLE);
+ mHandler.removeMessages(MSG_STOP_SAMPLE);
+ mHandler.sendMessage(mHandler.obtainMessage(MSG_STOP_SAMPLE));
+ }
+
+ private void onStopSample() {
+ if (mRingtone != null) {
+ mRingtone.stop();
+ }
+ }
+
+ public void stop() {
+ postStopSample();
+ mContext.getContentResolver().unregisterContentObserver(mVolumeObserver);
+ mSeekBar.setOnSeekBarChangeListener(null);
+ }
+
+ public void revertVolume() {
+ mAudioManager.setStreamVolume(mStreamType, mOriginalStreamVolume, 0);
+ }
+
+ public void onProgressChanged(SeekBar seekBar, int progress,
+ boolean fromTouch) {
+ if (!fromTouch) {
+ return;
+ }
+
+ postSetVolume(progress);
+ }
+
+ void postSetVolume(int progress) {
+ // Do the volume changing separately to give responsive UI
+ mLastProgress = progress;
+ mHandler.removeMessages(MSG_SET_STREAM_VOLUME);
+ mHandler.sendMessage(mHandler.obtainMessage(MSG_SET_STREAM_VOLUME));
+ }
+
+ public void onStartTrackingTouch(SeekBar seekBar) {
+ }
+
+ public void onStopTrackingTouch(SeekBar seekBar) {
+ postStartSample();
+ }
+
+ public boolean isSamplePlaying() {
+ return mRingtone != null && mRingtone.isPlaying();
+ }
+
+ public void startSample() {
+ postStartSample();
+ }
+
+ public void stopSample() {
+ postStopSample();
+ }
+
+ public SeekBar getSeekBar() {
+ return mSeekBar;
+ }
+
+ public void changeVolumeBy(int amount) {
+ mSeekBar.incrementProgressBy(amount);
+ postSetVolume(mSeekBar.getProgress());
+ postStartSample();
+ mVolumeBeforeMute = -1;
+ }
+
+ public void muteVolume() {
+ if (mVolumeBeforeMute != -1) {
+ mSeekBar.setProgress(mVolumeBeforeMute);
+ postSetVolume(mVolumeBeforeMute);
+ postStartSample();
+ mVolumeBeforeMute = -1;
+ } else {
+ mVolumeBeforeMute = mSeekBar.getProgress();
+ mSeekBar.setProgress(0);
+ postStopSample();
+ postSetVolume(0);
+ }
+ }
+
+ public void onSaveInstanceState(VolumeStore volumeStore) {
+ if (mLastProgress >= 0) {
+ volumeStore.volume = mLastProgress;
+ volumeStore.originalVolume = mOriginalStreamVolume;
+ }
+ }
+
+ public void onRestoreInstanceState(VolumeStore volumeStore) {
+ if (volumeStore.volume != -1) {
+ mOriginalStreamVolume = volumeStore.originalVolume;
+ mLastProgress = volumeStore.volume;
+ postSetVolume(mLastProgress);
+ }
+ }
+}
\ No newline at end of file
diff --git a/core/java/android/preference/VolumePreference.java b/core/java/android/preference/VolumePreference.java
index 39cb826..171e5c3 100644
--- a/core/java/android/preference/VolumePreference.java
+++ b/core/java/android/preference/VolumePreference.java
@@ -19,32 +19,20 @@
import android.app.Dialog;
import android.content.Context;
import android.content.res.TypedArray;
-import android.database.ContentObserver;
-import android.media.AudioManager;
-import android.media.Ringtone;
-import android.media.RingtoneManager;
-import android.net.Uri;
-import android.os.Handler;
-import android.os.HandlerThread;
-import android.os.Message;
import android.os.Parcel;
import android.os.Parcelable;
-import android.provider.Settings;
-import android.provider.Settings.System;
import android.util.AttributeSet;
-import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.widget.SeekBar;
-import android.widget.SeekBar.OnSeekBarChangeListener;
/**
* @hide
*/
public class VolumePreference extends SeekBarDialogPreference implements
- PreferenceManager.OnActivityStopListener, View.OnKeyListener {
+ PreferenceManager.OnActivityStopListener, View.OnKeyListener, SeekBarVolumizer.Callback {
- private static final String TAG = "VolumePreference";
+ static final String TAG = "VolumePreference";
private int mStreamType;
@@ -78,7 +66,7 @@
super.onBindDialogView(view);
final SeekBar seekBar = (SeekBar) view.findViewById(com.android.internal.R.id.seekbar);
- mSeekBarVolumizer = new SeekBarVolumizer(getContext(), seekBar, mStreamType);
+ mSeekBarVolumizer = new SeekBarVolumizer(getContext(), seekBar, mStreamType, null, this);
getPreferenceManager().registerOnActivityStopListener(this);
@@ -152,7 +140,8 @@
}
- protected void onSampleStarting(SeekBarVolumizer volumizer) {
+ @Override
+ public void onSampleStarting(SeekBarVolumizer volumizer) {
if (mSeekBarVolumizer != null && volumizer != mSeekBarVolumizer) {
mSeekBarVolumizer.stopSample();
}
@@ -228,213 +217,4 @@
}
};
}
-
- /**
- * Turns a {@link SeekBar} into a volume control.
- */
- public class SeekBarVolumizer implements OnSeekBarChangeListener, Handler.Callback {
-
- private Context mContext;
- private Handler mHandler;
-
- private AudioManager mAudioManager;
- private int mStreamType;
- private int mOriginalStreamVolume;
- private Ringtone mRingtone;
-
- private int mLastProgress = -1;
- private SeekBar mSeekBar;
- private int mVolumeBeforeMute = -1;
-
- private static final int MSG_SET_STREAM_VOLUME = 0;
- private static final int MSG_START_SAMPLE = 1;
- private static final int MSG_STOP_SAMPLE = 2;
- private static final int CHECK_RINGTONE_PLAYBACK_DELAY_MS = 1000;
-
- private ContentObserver mVolumeObserver = new ContentObserver(mHandler) {
- @Override
- public void onChange(boolean selfChange) {
- super.onChange(selfChange);
- if (mSeekBar != null && mAudioManager != null) {
- int volume = mAudioManager.getStreamVolume(mStreamType);
- mSeekBar.setProgress(volume);
- }
- }
- };
-
- public SeekBarVolumizer(Context context, SeekBar seekBar, int streamType) {
- this(context, seekBar, streamType, null);
- }
-
- public SeekBarVolumizer(Context context, SeekBar seekBar, int streamType, Uri defaultUri) {
- mContext = context;
- mAudioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
- mStreamType = streamType;
- mSeekBar = seekBar;
-
- HandlerThread thread = new HandlerThread(TAG + ".CallbackHandler");
- thread.start();
- mHandler = new Handler(thread.getLooper(), this);
-
- initSeekBar(seekBar, defaultUri);
- }
-
- private void initSeekBar(SeekBar seekBar, Uri defaultUri) {
- seekBar.setMax(mAudioManager.getStreamMaxVolume(mStreamType));
- mOriginalStreamVolume = mAudioManager.getStreamVolume(mStreamType);
- seekBar.setProgress(mOriginalStreamVolume);
- seekBar.setOnSeekBarChangeListener(this);
-
- mContext.getContentResolver().registerContentObserver(
- System.getUriFor(System.VOLUME_SETTINGS[mStreamType]),
- false, mVolumeObserver);
-
- if (defaultUri == null) {
- if (mStreamType == AudioManager.STREAM_RING) {
- defaultUri = Settings.System.DEFAULT_RINGTONE_URI;
- } else if (mStreamType == AudioManager.STREAM_NOTIFICATION) {
- defaultUri = Settings.System.DEFAULT_NOTIFICATION_URI;
- } else {
- defaultUri = Settings.System.DEFAULT_ALARM_ALERT_URI;
- }
- }
-
- mRingtone = RingtoneManager.getRingtone(mContext, defaultUri);
-
- if (mRingtone != null) {
- mRingtone.setStreamType(mStreamType);
- }
- }
-
- @Override
- public boolean handleMessage(Message msg) {
- switch (msg.what) {
- case MSG_SET_STREAM_VOLUME:
- mAudioManager.setStreamVolume(mStreamType, mLastProgress, 0);
- break;
- case MSG_START_SAMPLE:
- onStartSample();
- break;
- case MSG_STOP_SAMPLE:
- onStopSample();
- break;
- default:
- Log.e(TAG, "invalid SeekBarVolumizer message: "+msg.what);
- }
- return true;
- }
-
- private void postStartSample() {
- mHandler.removeMessages(MSG_START_SAMPLE);
- mHandler.sendMessageDelayed(mHandler.obtainMessage(MSG_START_SAMPLE),
- isSamplePlaying() ? CHECK_RINGTONE_PLAYBACK_DELAY_MS : 0);
- }
-
- private void onStartSample() {
- if (!isSamplePlaying()) {
- onSampleStarting(this);
- if (mRingtone != null) {
- mRingtone.play();
- }
- }
- }
-
- private void postStopSample() {
- // remove pending delayed start messages
- mHandler.removeMessages(MSG_START_SAMPLE);
- mHandler.removeMessages(MSG_STOP_SAMPLE);
- mHandler.sendMessage(mHandler.obtainMessage(MSG_STOP_SAMPLE));
- }
-
- private void onStopSample() {
- if (mRingtone != null) {
- mRingtone.stop();
- }
- }
-
- public void stop() {
- postStopSample();
- mContext.getContentResolver().unregisterContentObserver(mVolumeObserver);
- mSeekBar.setOnSeekBarChangeListener(null);
- }
-
- public void revertVolume() {
- mAudioManager.setStreamVolume(mStreamType, mOriginalStreamVolume, 0);
- }
-
- public void onProgressChanged(SeekBar seekBar, int progress,
- boolean fromTouch) {
- if (!fromTouch) {
- return;
- }
-
- postSetVolume(progress);
- }
-
- void postSetVolume(int progress) {
- // Do the volume changing separately to give responsive UI
- mLastProgress = progress;
- mHandler.removeMessages(MSG_SET_STREAM_VOLUME);
- mHandler.sendMessage(mHandler.obtainMessage(MSG_SET_STREAM_VOLUME));
- }
-
- public void onStartTrackingTouch(SeekBar seekBar) {
- }
-
- public void onStopTrackingTouch(SeekBar seekBar) {
- postStartSample();
- }
-
- public boolean isSamplePlaying() {
- return mRingtone != null && mRingtone.isPlaying();
- }
-
- public void startSample() {
- postStartSample();
- }
-
- public void stopSample() {
- postStopSample();
- }
-
- public SeekBar getSeekBar() {
- return mSeekBar;
- }
-
- public void changeVolumeBy(int amount) {
- mSeekBar.incrementProgressBy(amount);
- postSetVolume(mSeekBar.getProgress());
- postStartSample();
- mVolumeBeforeMute = -1;
- }
-
- public void muteVolume() {
- if (mVolumeBeforeMute != -1) {
- mSeekBar.setProgress(mVolumeBeforeMute);
- postSetVolume(mVolumeBeforeMute);
- postStartSample();
- mVolumeBeforeMute = -1;
- } else {
- mVolumeBeforeMute = mSeekBar.getProgress();
- mSeekBar.setProgress(0);
- postStopSample();
- postSetVolume(0);
- }
- }
-
- public void onSaveInstanceState(VolumeStore volumeStore) {
- if (mLastProgress >= 0) {
- volumeStore.volume = mLastProgress;
- volumeStore.originalVolume = mOriginalStreamVolume;
- }
- }
-
- public void onRestoreInstanceState(VolumeStore volumeStore) {
- if (volumeStore.volume != -1) {
- mOriginalStreamVolume = volumeStore.originalVolume;
- mLastProgress = volumeStore.volume;
- postSetVolume(mLastProgress);
- }
- }
- }
}
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index cd28085..e896063 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -4556,6 +4556,12 @@
public static final String PAYMENT_SERVICE_SEARCH_URI = "payment_service_search_uri";
/**
+ * If enabled, intercepted notifications will be displayed (not suppressed) in zen mode.
+ * @hide
+ */
+ public static final String DISPLAY_INTERCEPTED_NOTIFICATIONS = "display_intercepted_notifications";
+
+ /**
* This are the settings to be backed up.
*
* NOTE: Settings are backed up and restored in the order they appear
diff --git a/core/java/com/android/internal/app/WindowDecorActionBar.java b/core/java/com/android/internal/app/WindowDecorActionBar.java
index 79a8f44..a238ae3 100644
--- a/core/java/com/android/internal/app/WindowDecorActionBar.java
+++ b/core/java/com/android/internal/app/WindowDecorActionBar.java
@@ -183,7 +183,7 @@
private void init(View decor) {
mOverlayLayout = (ActionBarOverlayLayout) decor.findViewById(
- com.android.internal.R.id.action_bar_overlay_layout);
+ com.android.internal.R.id.decor_content_parent);
if (mOverlayLayout != null) {
mOverlayLayout.setActionBarVisibilityCallback(this);
}
diff --git a/core/java/com/android/internal/util/Protocol.java b/core/java/com/android/internal/util/Protocol.java
index 4b84941..81e67d8 100644
--- a/core/java/com/android/internal/util/Protocol.java
+++ b/core/java/com/android/internal/util/Protocol.java
@@ -48,6 +48,8 @@
public static final int BASE_WIFI_CONTROLLER = 0x00026000;
public static final int BASE_WIFI_SCANNER = 0x00027000;
public static final int BASE_WIFI_SCANNER_SERVICE = 0x00027100;
+ public static final int BASE_WIFI_PASSPOINT_MANAGER = 0x00028000;
+ public static final int BASE_WIFI_PASSPOINT_SERVICE = 0x00028100;
public static final int BASE_DHCP = 0x00030000;
public static final int BASE_DATA_CONNECTION = 0x00040000;
public static final int BASE_DATA_CONNECTION_AC = 0x00041000;
diff --git a/core/java/com/android/internal/widget/ActionBarOverlayLayout.java b/core/java/com/android/internal/widget/ActionBarOverlayLayout.java
index 19d58bf..7ab4bed 100644
--- a/core/java/com/android/internal/widget/ActionBarOverlayLayout.java
+++ b/core/java/com/android/internal/widget/ActionBarOverlayLayout.java
@@ -19,26 +19,34 @@
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.content.Context;
+import android.content.pm.ActivityInfo;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.os.Build;
+import android.os.Parcelable;
import android.util.AttributeSet;
import android.util.IntProperty;
+import android.util.Log;
import android.util.Property;
+import android.util.SparseArray;
+import android.view.KeyEvent;
+import android.view.Menu;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewPropertyAnimator;
+import android.view.Window;
import android.view.WindowInsets;
import android.widget.OverScroller;
+import com.android.internal.view.menu.MenuPresenter;
/**
* Special layout for the containing of an overlay action bar (and its
* content) to correctly handle fitting system windows when the content
* has request that its layout ignore them.
*/
-public class ActionBarOverlayLayout extends ViewGroup {
+public class ActionBarOverlayLayout extends ViewGroup implements DecorContentParent {
private static final String TAG = "ActionBarOverlayLayout";
private int mActionBarHeight;
@@ -47,7 +55,7 @@
// The main UI elements that we handle the layout of.
private View mContent;
- private View mActionBarBottom;
+ private ActionBarContainer mActionBarBottom;
private ActionBarContainer mActionBarTop;
// Some interior UI elements.
@@ -556,7 +564,8 @@
mActionBarTop = (ActionBarContainer) findViewById(
com.android.internal.R.id.action_bar_container);
mActionBarView = (ActionBarView) findViewById(com.android.internal.R.id.action_bar);
- mActionBarBottom = findViewById(com.android.internal.R.id.split_action_bar);
+ mActionBarBottom = (ActionBarContainer) findViewById(
+ com.android.internal.R.id.split_action_bar);
}
}
@@ -629,6 +638,179 @@
return finalY > mActionBarTop.getHeight();
}
+ @Override
+ public boolean dispatchKeyEvent(KeyEvent event) {
+ if (super.dispatchKeyEvent(event)) {
+ return true;
+ }
+
+ if (event.getKeyCode() == KeyEvent.KEYCODE_BACK) {
+ final int action = event.getAction();
+
+ // Collapse any expanded action views.
+ if (mActionBarView != null && mActionBarView.hasExpandedActionView()) {
+ if (action == KeyEvent.ACTION_UP) {
+ mActionBarView.collapseActionView();
+ }
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ @Override
+ public void setWindowCallback(Window.Callback cb) {
+ pullChildren();
+ mActionBarView.setWindowCallback(cb);
+ }
+
+ @Override
+ public void setWindowTitle(CharSequence title) {
+ pullChildren();
+ mActionBarView.setWindowTitle(title);
+ }
+
+ @Override
+ public CharSequence getTitle() {
+ pullChildren();
+ return mActionBarView.getTitle();
+ }
+
+ @Override
+ public void initFeature(int windowFeature) {
+ pullChildren();
+ switch (windowFeature) {
+ case Window.FEATURE_PROGRESS:
+ mActionBarView.initProgress();
+ break;
+ case Window.FEATURE_INDETERMINATE_PROGRESS:
+ mActionBarView.initIndeterminateProgress();
+ break;
+ case Window.FEATURE_ACTION_BAR_OVERLAY:
+ setOverlayMode(true);
+ break;
+ }
+ }
+
+ @Override
+ public void setUiOptions(int uiOptions) {
+ boolean splitActionBar = false;
+ final boolean splitWhenNarrow =
+ (uiOptions & ActivityInfo.UIOPTION_SPLIT_ACTION_BAR_WHEN_NARROW) != 0;
+ if (splitWhenNarrow) {
+ splitActionBar = getContext().getResources().getBoolean(
+ com.android.internal.R.bool.split_action_bar_is_narrow);
+ }
+ if (splitActionBar) {
+ pullChildren();
+ if (mActionBarBottom != null) {
+ mActionBarView.setSplitView(mActionBarBottom);
+ mActionBarView.setSplitActionBar(splitActionBar);
+ mActionBarView.setSplitWhenNarrow(splitWhenNarrow);
+
+ final ActionBarContextView cab = (ActionBarContextView) findViewById(
+ com.android.internal.R.id.action_context_bar);
+ cab.setSplitView(mActionBarBottom);
+ cab.setSplitActionBar(splitActionBar);
+ cab.setSplitWhenNarrow(splitWhenNarrow);
+ } else if (splitActionBar) {
+ Log.e(TAG, "Requested split action bar with " +
+ "incompatible window decor! Ignoring request.");
+ }
+ }
+ }
+
+ @Override
+ public boolean hasIcon() {
+ pullChildren();
+ return mActionBarView.hasIcon();
+ }
+
+ @Override
+ public boolean hasLogo() {
+ pullChildren();
+ return mActionBarView.hasLogo();
+ }
+
+ @Override
+ public void setIcon(int resId) {
+ pullChildren();
+ mActionBarView.setIcon(resId);
+ }
+
+ @Override
+ public void setIcon(Drawable d) {
+ pullChildren();
+ mActionBarView.setIcon(d);
+ }
+
+ @Override
+ public void setLogo(int resId) {
+ pullChildren();
+ mActionBarView.setLogo(resId);
+ }
+
+ @Override
+ public boolean canShowOverflowMenu() {
+ pullChildren();
+ return mActionBarView.isOverflowReserved() && mActionBarView.getVisibility() == VISIBLE;
+ }
+
+ @Override
+ public boolean isOverflowMenuShowing() {
+ pullChildren();
+ return mActionBarView.isOverflowMenuShowing();
+ }
+
+ @Override
+ public boolean isOverflowMenuShowPending() {
+ pullChildren();
+ return mActionBarView.isOverflowMenuShowPending();
+ }
+
+ @Override
+ public boolean showOverflowMenu() {
+ pullChildren();
+ return mActionBarView.showOverflowMenu();
+ }
+
+ @Override
+ public boolean hideOverflowMenu() {
+ pullChildren();
+ return mActionBarView.hideOverflowMenu();
+ }
+
+ @Override
+ public void setMenuPrepared() {
+ pullChildren();
+ mActionBarView.setMenuPrepared();
+ }
+
+ @Override
+ public void setMenu(Menu menu, MenuPresenter.Callback cb) {
+ pullChildren();
+ mActionBarView.setMenu(menu, cb);
+ }
+
+ @Override
+ public void saveToolbarHierarchyState(SparseArray<Parcelable> toolbarStates) {
+ pullChildren();
+ mActionBarView.saveHierarchyState(toolbarStates);
+ }
+
+ @Override
+ public void restoreToolbarHierarchyState(SparseArray<Parcelable> toolbarStates) {
+ pullChildren();
+ mActionBarView.restoreHierarchyState(toolbarStates);
+ }
+
+ @Override
+ public void dismissPopups() {
+ pullChildren();
+ mActionBarView.dismissPopupMenus();
+ }
+
public static class LayoutParams extends MarginLayoutParams {
public LayoutParams(Context c, AttributeSet attrs) {
super(c, attrs);
diff --git a/core/java/com/android/internal/widget/DecorContentParent.java b/core/java/com/android/internal/widget/DecorContentParent.java
new file mode 100644
index 0000000..4fa370a
--- /dev/null
+++ b/core/java/com/android/internal/widget/DecorContentParent.java
@@ -0,0 +1,53 @@
+/*
+ * 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 com.android.internal.widget;
+
+import android.graphics.drawable.Drawable;
+import android.os.Parcelable;
+import android.util.SparseArray;
+import android.view.Menu;
+import android.view.Window;
+import com.android.internal.view.menu.MenuPresenter;
+
+/**
+ * Implemented by the top-level decor layout for a window. DecorContentParent offers
+ * entry points for a number of title/window decor features.
+ */
+public interface DecorContentParent {
+ void setWindowCallback(Window.Callback cb);
+ void setWindowTitle(CharSequence title);
+ CharSequence getTitle();
+ void initFeature(int windowFeature);
+ void setUiOptions(int uiOptions);
+ boolean hasIcon();
+ boolean hasLogo();
+ void setIcon(int resId);
+ void setIcon(Drawable d);
+ void setLogo(int resId);
+ boolean canShowOverflowMenu();
+ boolean isOverflowMenuShowing();
+ boolean isOverflowMenuShowPending();
+ boolean showOverflowMenu();
+ boolean hideOverflowMenu();
+ void setMenuPrepared();
+ void setMenu(Menu menu, MenuPresenter.Callback cb);
+ void saveToolbarHierarchyState(SparseArray<Parcelable> toolbarStates);
+ void restoreToolbarHierarchyState(SparseArray<Parcelable> toolbarStates);
+ void dismissPopups();
+
+}
diff --git a/core/res/res/layout-xlarge/screen_action_bar.xml b/core/res/res/layout-xlarge/screen_action_bar.xml
deleted file mode 100644
index 02c99fe..0000000
--- a/core/res/res/layout-xlarge/screen_action_bar.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2010 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- 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.
--->
-
-<!--
-This is an optimized layout for a screen with
-the Action Bar enabled overlaying application content.
--->
-
-<com.android.internal.widget.ActionBarOverlayLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/action_bar_overlay_layout"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:splitMotionEvents="false">
- <FrameLayout android:id="@android:id/content"
- android:layout_width="match_parent"
- android:layout_height="match_parent" />
- <com.android.internal.widget.ActionBarContainer
- android:id="@+id/action_bar_container"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_alignParentTop="true"
- style="?android:attr/actionBarStyle"
- android:viewName="android:action_bar"
- android:gravity="top">
- <com.android.internal.widget.ActionBarView
- android:id="@+id/action_bar"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- style="?android:attr/actionBarStyle" />
- <com.android.internal.widget.ActionBarContextView
- android:id="@+id/action_context_bar"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:visibility="gone"
- style="?android:attr/actionModeStyle" />
- </com.android.internal.widget.ActionBarContainer>
-</com.android.internal.widget.ActionBarOverlayLayout>
diff --git a/core/res/res/layout/screen_action_bar.xml b/core/res/res/layout/screen_action_bar.xml
index eb237b3..8bf8416 100644
--- a/core/res/res/layout/screen_action_bar.xml
+++ b/core/res/res/layout/screen_action_bar.xml
@@ -20,7 +20,7 @@
<com.android.internal.widget.ActionBarOverlayLayout
xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/action_bar_overlay_layout"
+ android:id="@+id/decor_content_parent"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:splitMotionEvents="false"
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index 3746780..9fba1bf 100644
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -355,10 +355,6 @@
when there is not reserved space for their UI (such as an Action Bar). -->
<attr name="windowActionModeOverlay" format="boolean" />
- <!-- Flag indicating that the action bar should be split to provide more
- room for elements. -->
- <attr name="windowSplitActionBar" format="boolean" />
-
<!-- Defines the default soft input state that this window would
like when it is displayed. Corresponds
to {@link android.view.WindowManager.LayoutParams#softInputMode}. -->
@@ -1705,7 +1701,6 @@
<attr name="windowActionBar" />
<attr name="windowActionModeOverlay" />
<attr name="windowActionBarOverlay" />
- <attr name="windowSplitActionBar" />
<attr name="windowEnableSplitTouch" />
<attr name="windowCloseOnTouchOutside" />
<attr name="windowTranslucentStatus" />
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index 2f0ac49..2d60b86 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -31,7 +31,6 @@
<java-symbol type="id" name="account_type" />
<java-symbol type="id" name="action_bar" />
<java-symbol type="id" name="action_bar_container" />
- <java-symbol type="id" name="action_bar_overlay_layout" />
<java-symbol type="id" name="action_bar_title" />
<java-symbol type="id" name="action_bar_subtitle" />
<java-symbol type="id" name="action_context_bar" />
@@ -61,6 +60,7 @@
<java-symbol type="id" name="day" />
<java-symbol type="id" name="day_names" />
<java-symbol type="id" name="decrement" />
+ <java-symbol type="id" name="decor_content_parent" />
<java-symbol type="id" name="default_activity_button" />
<java-symbol type="id" name="deny_button" />
<java-symbol type="id" name="description" />
diff --git a/packages/SystemUI/res/drawable-hdpi/ic_qs_airplane_off.png b/packages/SystemUI/res/drawable-hdpi/ic_qs_airplane_off.png
deleted file mode 100644
index 6f48fe8..0000000
--- a/packages/SystemUI/res/drawable-hdpi/ic_qs_airplane_off.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/ic_qs_airplane_on.png b/packages/SystemUI/res/drawable-hdpi/ic_qs_airplane_on.png
deleted file mode 100644
index 5f2e95a..0000000
--- a/packages/SystemUI/res/drawable-hdpi/ic_qs_airplane_on.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/ic_qs_bluetooth_not_connected.png b/packages/SystemUI/res/drawable-hdpi/ic_qs_bluetooth_not_connected.png
deleted file mode 100644
index e417a19..0000000
--- a/packages/SystemUI/res/drawable-hdpi/ic_qs_bluetooth_not_connected.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/ic_qs_bluetooth_off.png b/packages/SystemUI/res/drawable-hdpi/ic_qs_bluetooth_off.png
deleted file mode 100644
index f325220..0000000
--- a/packages/SystemUI/res/drawable-hdpi/ic_qs_bluetooth_off.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/ic_qs_bluetooth_on.png b/packages/SystemUI/res/drawable-hdpi/ic_qs_bluetooth_on.png
deleted file mode 100644
index ee88a1b..0000000
--- a/packages/SystemUI/res/drawable-hdpi/ic_qs_bluetooth_on.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/ic_qs_cast_connecting_0.png b/packages/SystemUI/res/drawable-hdpi/ic_qs_cast_connecting_0.png
deleted file mode 100644
index 48606a8..0000000
--- a/packages/SystemUI/res/drawable-hdpi/ic_qs_cast_connecting_0.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/ic_qs_cast_connecting_1.png b/packages/SystemUI/res/drawable-hdpi/ic_qs_cast_connecting_1.png
deleted file mode 100644
index d006f13..0000000
--- a/packages/SystemUI/res/drawable-hdpi/ic_qs_cast_connecting_1.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/ic_qs_cast_connecting_2.png b/packages/SystemUI/res/drawable-hdpi/ic_qs_cast_connecting_2.png
deleted file mode 100644
index 867947b..0000000
--- a/packages/SystemUI/res/drawable-hdpi/ic_qs_cast_connecting_2.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/ic_qs_color_space_alpha.png b/packages/SystemUI/res/drawable-hdpi/ic_qs_color_space_alpha.png
deleted file mode 100644
index fe6dc52..0000000
--- a/packages/SystemUI/res/drawable-hdpi/ic_qs_color_space_alpha.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/ic_qs_inversion_alpha.png b/packages/SystemUI/res/drawable-hdpi/ic_qs_inversion_alpha.png
deleted file mode 100644
index aea75c1..0000000
--- a/packages/SystemUI/res/drawable-hdpi/ic_qs_inversion_alpha.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_zen_full.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_zen_full.png
deleted file mode 100644
index fa23e85..0000000
--- a/packages/SystemUI/res/drawable-hdpi/stat_sys_zen_full.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_zen_limited.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_zen_limited.png
deleted file mode 100644
index aa8635c..0000000
--- a/packages/SystemUI/res/drawable-hdpi/stat_sys_zen_limited.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-ldrtl-hdpi/ic_qs_airplane_off.png b/packages/SystemUI/res/drawable-ldrtl-hdpi/ic_qs_airplane_off.png
deleted file mode 100644
index c36809b..0000000
--- a/packages/SystemUI/res/drawable-ldrtl-hdpi/ic_qs_airplane_off.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-ldrtl-hdpi/ic_qs_airplane_on.png b/packages/SystemUI/res/drawable-ldrtl-hdpi/ic_qs_airplane_on.png
deleted file mode 100644
index 6158c01..0000000
--- a/packages/SystemUI/res/drawable-ldrtl-hdpi/ic_qs_airplane_on.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-ldrtl-mdpi/ic_qs_airplane_off.png b/packages/SystemUI/res/drawable-ldrtl-mdpi/ic_qs_airplane_off.png
deleted file mode 100644
index 084799a..0000000
--- a/packages/SystemUI/res/drawable-ldrtl-mdpi/ic_qs_airplane_off.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-ldrtl-mdpi/ic_qs_airplane_on.png b/packages/SystemUI/res/drawable-ldrtl-mdpi/ic_qs_airplane_on.png
deleted file mode 100644
index c37ba79..0000000
--- a/packages/SystemUI/res/drawable-ldrtl-mdpi/ic_qs_airplane_on.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-ldrtl-xhdpi/ic_qs_airplane_off.png b/packages/SystemUI/res/drawable-ldrtl-xhdpi/ic_qs_airplane_off.png
deleted file mode 100644
index 714f07e..0000000
--- a/packages/SystemUI/res/drawable-ldrtl-xhdpi/ic_qs_airplane_off.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-ldrtl-xhdpi/ic_qs_airplane_on.png b/packages/SystemUI/res/drawable-ldrtl-xhdpi/ic_qs_airplane_on.png
deleted file mode 100644
index d59f0e92..0000000
--- a/packages/SystemUI/res/drawable-ldrtl-xhdpi/ic_qs_airplane_on.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-ldrtl-xxhdpi/ic_qs_airplane_off.png b/packages/SystemUI/res/drawable-ldrtl-xxhdpi/ic_qs_airplane_off.png
deleted file mode 100644
index 6fc556d..0000000
--- a/packages/SystemUI/res/drawable-ldrtl-xxhdpi/ic_qs_airplane_off.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-ldrtl-xxhdpi/ic_qs_airplane_on.png b/packages/SystemUI/res/drawable-ldrtl-xxhdpi/ic_qs_airplane_on.png
deleted file mode 100644
index a2342fc..0000000
--- a/packages/SystemUI/res/drawable-ldrtl-xxhdpi/ic_qs_airplane_on.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/ic_qs_airplane_off.png b/packages/SystemUI/res/drawable-mdpi/ic_qs_airplane_off.png
deleted file mode 100644
index 95df4d45..0000000
--- a/packages/SystemUI/res/drawable-mdpi/ic_qs_airplane_off.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/ic_qs_airplane_on.png b/packages/SystemUI/res/drawable-mdpi/ic_qs_airplane_on.png
deleted file mode 100644
index 251fc30..0000000
--- a/packages/SystemUI/res/drawable-mdpi/ic_qs_airplane_on.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/ic_qs_bluetooth_not_connected.png b/packages/SystemUI/res/drawable-mdpi/ic_qs_bluetooth_not_connected.png
deleted file mode 100644
index b01b27f..0000000
--- a/packages/SystemUI/res/drawable-mdpi/ic_qs_bluetooth_not_connected.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/ic_qs_bluetooth_off.png b/packages/SystemUI/res/drawable-mdpi/ic_qs_bluetooth_off.png
deleted file mode 100644
index 541e801..0000000
--- a/packages/SystemUI/res/drawable-mdpi/ic_qs_bluetooth_off.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/ic_qs_bluetooth_on.png b/packages/SystemUI/res/drawable-mdpi/ic_qs_bluetooth_on.png
deleted file mode 100644
index 0acf3a4..0000000
--- a/packages/SystemUI/res/drawable-mdpi/ic_qs_bluetooth_on.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/ic_qs_cast_connecting_0.png b/packages/SystemUI/res/drawable-mdpi/ic_qs_cast_connecting_0.png
deleted file mode 100644
index 25fc759..0000000
--- a/packages/SystemUI/res/drawable-mdpi/ic_qs_cast_connecting_0.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/ic_qs_cast_connecting_1.png b/packages/SystemUI/res/drawable-mdpi/ic_qs_cast_connecting_1.png
deleted file mode 100644
index 9dfc3c6..0000000
--- a/packages/SystemUI/res/drawable-mdpi/ic_qs_cast_connecting_1.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/ic_qs_cast_connecting_2.png b/packages/SystemUI/res/drawable-mdpi/ic_qs_cast_connecting_2.png
deleted file mode 100644
index 82f4113..0000000
--- a/packages/SystemUI/res/drawable-mdpi/ic_qs_cast_connecting_2.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/ic_qs_color_space_alpha.png b/packages/SystemUI/res/drawable-mdpi/ic_qs_color_space_alpha.png
deleted file mode 100644
index 18b6029..0000000
--- a/packages/SystemUI/res/drawable-mdpi/ic_qs_color_space_alpha.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/ic_qs_inversion_alpha.png b/packages/SystemUI/res/drawable-mdpi/ic_qs_inversion_alpha.png
deleted file mode 100644
index b6ea14e..0000000
--- a/packages/SystemUI/res/drawable-mdpi/ic_qs_inversion_alpha.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_zen_full.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_zen_full.png
deleted file mode 100644
index b0185a5..0000000
--- a/packages/SystemUI/res/drawable-mdpi/stat_sys_zen_full.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_zen_limited.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_zen_limited.png
deleted file mode 100644
index 949ab10..0000000
--- a/packages/SystemUI/res/drawable-mdpi/stat_sys_zen_limited.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/ic_qs_airplane_off.png b/packages/SystemUI/res/drawable-xhdpi/ic_qs_airplane_off.png
deleted file mode 100644
index 4411097..0000000
--- a/packages/SystemUI/res/drawable-xhdpi/ic_qs_airplane_off.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/ic_qs_airplane_on.png b/packages/SystemUI/res/drawable-xhdpi/ic_qs_airplane_on.png
deleted file mode 100644
index 79e4ff6..0000000
--- a/packages/SystemUI/res/drawable-xhdpi/ic_qs_airplane_on.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/ic_qs_bluetooth_not_connected.png b/packages/SystemUI/res/drawable-xhdpi/ic_qs_bluetooth_not_connected.png
deleted file mode 100644
index ce965c2..0000000
--- a/packages/SystemUI/res/drawable-xhdpi/ic_qs_bluetooth_not_connected.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/ic_qs_bluetooth_off.png b/packages/SystemUI/res/drawable-xhdpi/ic_qs_bluetooth_off.png
deleted file mode 100644
index c798fd6..0000000
--- a/packages/SystemUI/res/drawable-xhdpi/ic_qs_bluetooth_off.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/ic_qs_bluetooth_on.png b/packages/SystemUI/res/drawable-xhdpi/ic_qs_bluetooth_on.png
deleted file mode 100644
index ac5b09d..0000000
--- a/packages/SystemUI/res/drawable-xhdpi/ic_qs_bluetooth_on.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/ic_qs_cast_connecting_0.png b/packages/SystemUI/res/drawable-xhdpi/ic_qs_cast_connecting_0.png
deleted file mode 100644
index 945c606..0000000
--- a/packages/SystemUI/res/drawable-xhdpi/ic_qs_cast_connecting_0.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/ic_qs_cast_connecting_1.png b/packages/SystemUI/res/drawable-xhdpi/ic_qs_cast_connecting_1.png
deleted file mode 100644
index 0a3f73e..0000000
--- a/packages/SystemUI/res/drawable-xhdpi/ic_qs_cast_connecting_1.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/ic_qs_cast_connecting_2.png b/packages/SystemUI/res/drawable-xhdpi/ic_qs_cast_connecting_2.png
deleted file mode 100644
index 398cbef..0000000
--- a/packages/SystemUI/res/drawable-xhdpi/ic_qs_cast_connecting_2.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/ic_qs_color_space_alpha.png b/packages/SystemUI/res/drawable-xhdpi/ic_qs_color_space_alpha.png
deleted file mode 100644
index 95cf67f..0000000
--- a/packages/SystemUI/res/drawable-xhdpi/ic_qs_color_space_alpha.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/ic_qs_inversion_alpha.png b/packages/SystemUI/res/drawable-xhdpi/ic_qs_inversion_alpha.png
deleted file mode 100644
index efd8b9e..0000000
--- a/packages/SystemUI/res/drawable-xhdpi/ic_qs_inversion_alpha.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_zen_full.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_zen_full.png
deleted file mode 100644
index 7f7cb63..0000000
--- a/packages/SystemUI/res/drawable-xhdpi/stat_sys_zen_full.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_zen_limited.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_zen_limited.png
deleted file mode 100644
index abdeb3b..0000000
--- a/packages/SystemUI/res/drawable-xhdpi/stat_sys_zen_limited.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xxhdpi/ic_qs_airplane_off.png b/packages/SystemUI/res/drawable-xxhdpi/ic_qs_airplane_off.png
deleted file mode 100644
index 65b0204..0000000
--- a/packages/SystemUI/res/drawable-xxhdpi/ic_qs_airplane_off.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xxhdpi/ic_qs_airplane_on.png b/packages/SystemUI/res/drawable-xxhdpi/ic_qs_airplane_on.png
deleted file mode 100644
index dd16165..0000000
--- a/packages/SystemUI/res/drawable-xxhdpi/ic_qs_airplane_on.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xxhdpi/ic_qs_bluetooth_not_connected.png b/packages/SystemUI/res/drawable-xxhdpi/ic_qs_bluetooth_not_connected.png
deleted file mode 100644
index c5b7333..0000000
--- a/packages/SystemUI/res/drawable-xxhdpi/ic_qs_bluetooth_not_connected.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xxhdpi/ic_qs_bluetooth_off.png b/packages/SystemUI/res/drawable-xxhdpi/ic_qs_bluetooth_off.png
deleted file mode 100644
index 1045e07..0000000
--- a/packages/SystemUI/res/drawable-xxhdpi/ic_qs_bluetooth_off.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xxhdpi/ic_qs_bluetooth_on.png b/packages/SystemUI/res/drawable-xxhdpi/ic_qs_bluetooth_on.png
deleted file mode 100644
index 7c20110..0000000
--- a/packages/SystemUI/res/drawable-xxhdpi/ic_qs_bluetooth_on.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xxhdpi/ic_qs_cast_connecting_0.png b/packages/SystemUI/res/drawable-xxhdpi/ic_qs_cast_connecting_0.png
deleted file mode 100644
index 4621d18..0000000
--- a/packages/SystemUI/res/drawable-xxhdpi/ic_qs_cast_connecting_0.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xxhdpi/ic_qs_cast_connecting_1.png b/packages/SystemUI/res/drawable-xxhdpi/ic_qs_cast_connecting_1.png
deleted file mode 100644
index a1ab61b..0000000
--- a/packages/SystemUI/res/drawable-xxhdpi/ic_qs_cast_connecting_1.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xxhdpi/ic_qs_cast_connecting_2.png b/packages/SystemUI/res/drawable-xxhdpi/ic_qs_cast_connecting_2.png
deleted file mode 100644
index ea42a7f..0000000
--- a/packages/SystemUI/res/drawable-xxhdpi/ic_qs_cast_connecting_2.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xxhdpi/ic_qs_color_space_alpha.png b/packages/SystemUI/res/drawable-xxhdpi/ic_qs_color_space_alpha.png
deleted file mode 100644
index 7f441c8..0000000
--- a/packages/SystemUI/res/drawable-xxhdpi/ic_qs_color_space_alpha.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xxhdpi/ic_qs_inversion_alpha.png b/packages/SystemUI/res/drawable-xxhdpi/ic_qs_inversion_alpha.png
deleted file mode 100644
index ce9bae2..0000000
--- a/packages/SystemUI/res/drawable-xxhdpi/ic_qs_inversion_alpha.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xxhdpi/stat_sys_zen_full.png b/packages/SystemUI/res/drawable-xxhdpi/stat_sys_zen_full.png
deleted file mode 100644
index afe85b4..0000000
--- a/packages/SystemUI/res/drawable-xxhdpi/stat_sys_zen_full.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xxhdpi/stat_sys_zen_limited.png b/packages/SystemUI/res/drawable-xxhdpi/stat_sys_zen_limited.png
deleted file mode 100644
index 5e5053f..0000000
--- a/packages/SystemUI/res/drawable-xxhdpi/stat_sys_zen_limited.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable/ic_location_off_anim.xml b/packages/SystemUI/res/drawable/ic_location_off_anim.xml
deleted file mode 100644
index 864eda1..0000000
--- a/packages/SystemUI/res/drawable/ic_location_off_anim.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-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.
--->
-<animation-list
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:oneshot="true">
- <item android:drawable="@drawable/ic_location_24_01" android:duration="16" />
- <item android:drawable="@drawable/ic_location_24_02" android:duration="16" />
- <item android:drawable="@drawable/ic_location_24_03" android:duration="16" />
- <item android:drawable="@drawable/ic_location_24_04" android:duration="16" />
- <item android:drawable="@drawable/ic_location_24_05" android:duration="16" />
- <item android:drawable="@drawable/ic_location_24_06" android:duration="16" />
- <item android:drawable="@drawable/ic_location_24_07" android:duration="16" />
- <item android:drawable="@drawable/ic_location_24_08" android:duration="16" />
- <item android:drawable="@drawable/ic_location_24_09" android:duration="16" />
- <item android:drawable="@drawable/ic_location_24_10" android:duration="16" />
- <item android:drawable="@drawable/ic_location_24_11" android:duration="16" />
-</animation-list>
diff --git a/packages/SystemUI/res/drawable/ic_location_on_anim.xml b/packages/SystemUI/res/drawable/ic_location_on_anim.xml
deleted file mode 100644
index 65a8afe..0000000
--- a/packages/SystemUI/res/drawable/ic_location_on_anim.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-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.
--->
-<animation-list
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:oneshot="true">
- <item android:drawable="@drawable/ic_location_24_11" android:duration="16" />
- <item android:drawable="@drawable/ic_location_24_10" android:duration="16" />
- <item android:drawable="@drawable/ic_location_24_09" android:duration="16" />
- <item android:drawable="@drawable/ic_location_24_08" android:duration="16" />
- <item android:drawable="@drawable/ic_location_24_07" android:duration="16" />
- <item android:drawable="@drawable/ic_location_24_06" android:duration="16" />
- <item android:drawable="@drawable/ic_location_24_05" android:duration="16" />
- <item android:drawable="@drawable/ic_location_24_04" android:duration="16" />
- <item android:drawable="@drawable/ic_location_24_03" android:duration="16" />
- <item android:drawable="@drawable/ic_location_24_02" android:duration="16" />
- <item android:drawable="@drawable/ic_location_24_01" android:duration="16" />
-</animation-list>
diff --git a/packages/SystemUI/res/drawable/ic_qs_airplane.xml b/packages/SystemUI/res/drawable/ic_qs_airplane_off.xml
similarity index 85%
copy from packages/SystemUI/res/drawable/ic_qs_airplane.xml
copy to packages/SystemUI/res/drawable/ic_qs_airplane_off.xml
index ffe571f..9f0ec67 100644
--- a/packages/SystemUI/res/drawable/ic_qs_airplane.xml
+++ b/packages/SystemUI/res/drawable/ic_qs_airplane_off.xml
@@ -23,9 +23,13 @@
android:viewportHeight="24.0"/>
<path
- android:fill="#FF000000"
+ android:fill="#00000000"
+ android:stroke="#CCCCCC"
+ android:strokeWidth="1.0"
android:pathData="M10.2,9.0"/>
<path
- android:fill="#FF000000"
+ android:fill="#00000000"
+ android:stroke="#CCCCCC"
+ android:strokeWidth="1.0"
android:pathData="M21.0,16.0l0.0,-2.0l-8.0,-5.0L13.0,3.5C13.0,2.7 12.3,2.0 11.5,2.0C10.7,2.0 10.0,2.7 10.0,3.5L10.0,9.0l-8.0,5.0l0.0,2.0l8.0,-2.5L10.0,19.0l-2.0,1.5L8.0,22.0l3.5,-1.0l3.5,1.0l0.0,-1.5L13.0,19.0l0.0,-5.5L21.0,16.0z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_airplane.xml b/packages/SystemUI/res/drawable/ic_qs_airplane_on.xml
similarity index 94%
rename from packages/SystemUI/res/drawable/ic_qs_airplane.xml
rename to packages/SystemUI/res/drawable/ic_qs_airplane_on.xml
index ffe571f..95c20bb 100644
--- a/packages/SystemUI/res/drawable/ic_qs_airplane.xml
+++ b/packages/SystemUI/res/drawable/ic_qs_airplane_on.xml
@@ -23,9 +23,9 @@
android:viewportHeight="24.0"/>
<path
- android:fill="#FF000000"
+ android:fill="#FFFFFFFF"
android:pathData="M10.2,9.0"/>
<path
- android:fill="#FF000000"
+ android:fill="#FFFFFFFF"
android:pathData="M21.0,16.0l0.0,-2.0l-8.0,-5.0L13.0,3.5C13.0,2.7 12.3,2.0 11.5,2.0C10.7,2.0 10.0,2.7 10.0,3.5L10.0,9.0l-8.0,5.0l0.0,2.0l8.0,-2.5L10.0,19.0l-2.0,1.5L8.0,22.0l3.5,-1.0l3.5,1.0l0.0,-1.5L13.0,19.0l0.0,-5.5L21.0,16.0z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_bluetooth.xml b/packages/SystemUI/res/drawable/ic_qs_bluetooth_connected.xml
similarity index 96%
rename from packages/SystemUI/res/drawable/ic_qs_bluetooth.xml
rename to packages/SystemUI/res/drawable/ic_qs_bluetooth_connected.xml
index 22d0dcf..61a7777 100644
--- a/packages/SystemUI/res/drawable/ic_qs_bluetooth.xml
+++ b/packages/SystemUI/res/drawable/ic_qs_bluetooth_connected.xml
@@ -23,6 +23,6 @@
android:viewportHeight="24.0"/>
<path
- android:fill="#FF000000"
+ android:fill="#FFFFFFFF"
android:pathData="M17.7,7.7L12.0,2.0l-1.0,0.0l0.0,7.6L6.4,5.0L5.0,6.4l5.6,5.6L5.0,17.6L6.4,19.0l4.6,-4.6L11.0,22.0l1.0,0.0l5.7,-5.7L13.4,12.0L17.7,7.7zM13.0,5.8l1.9,1.9L13.0,9.6L13.0,5.8zM14.9,16.3L13.0,18.2l0.0,-3.8L14.9,16.3z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_bluetooth.xml b/packages/SystemUI/res/drawable/ic_qs_bluetooth_off.xml
similarity index 91%
copy from packages/SystemUI/res/drawable/ic_qs_bluetooth.xml
copy to packages/SystemUI/res/drawable/ic_qs_bluetooth_off.xml
index 22d0dcf..7ac1cb9 100644
--- a/packages/SystemUI/res/drawable/ic_qs_bluetooth.xml
+++ b/packages/SystemUI/res/drawable/ic_qs_bluetooth_off.xml
@@ -23,6 +23,8 @@
android:viewportHeight="24.0"/>
<path
- android:fill="#FF000000"
+ android:fill="#00000000"
+ android:stroke="#CCCCCC"
+ android:strokeWidth="1.0"
android:pathData="M17.7,7.7L12.0,2.0l-1.0,0.0l0.0,7.6L6.4,5.0L5.0,6.4l5.6,5.6L5.0,17.6L6.4,19.0l4.6,-4.6L11.0,22.0l1.0,0.0l5.7,-5.7L13.4,12.0L17.7,7.7zM13.0,5.8l1.9,1.9L13.0,9.6L13.0,5.8zM14.9,16.3L13.0,18.2l0.0,-3.8L14.9,16.3z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_bluetooth.xml b/packages/SystemUI/res/drawable/ic_qs_bluetooth_on.xml
similarity index 96%
copy from packages/SystemUI/res/drawable/ic_qs_bluetooth.xml
copy to packages/SystemUI/res/drawable/ic_qs_bluetooth_on.xml
index 22d0dcf..61a7777 100644
--- a/packages/SystemUI/res/drawable/ic_qs_bluetooth.xml
+++ b/packages/SystemUI/res/drawable/ic_qs_bluetooth_on.xml
@@ -23,6 +23,6 @@
android:viewportHeight="24.0"/>
<path
- android:fill="#FF000000"
+ android:fill="#FFFFFFFF"
android:pathData="M17.7,7.7L12.0,2.0l-1.0,0.0l0.0,7.6L6.4,5.0L5.0,6.4l5.6,5.6L5.0,17.6L6.4,19.0l4.6,-4.6L11.0,22.0l1.0,0.0l5.7,-5.7L13.4,12.0L17.7,7.7zM13.0,5.8l1.9,1.9L13.0,9.6L13.0,5.8zM14.9,16.3L13.0,18.2l0.0,-3.8L14.9,16.3z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_bugreport.xml b/packages/SystemUI/res/drawable/ic_qs_bugreport.xml
index 2dfe183..2958848 100644
--- a/packages/SystemUI/res/drawable/ic_qs_bugreport.xml
+++ b/packages/SystemUI/res/drawable/ic_qs_bugreport.xml
@@ -23,6 +23,6 @@
android:viewportHeight="24.0"/>
<path
- android:fill="#FF000000"
+ android:fill="#FFFFFFFF"
android:pathData="M20.0,8.0l-2.8,0.0c-0.5,-0.8 -1.1,-1.5 -1.8,-2.0L17.0,4.4L15.6,3.0l-2.2,2.2C13.0,5.1 12.5,5.0 12.0,5.0s-1.0,0.1 -1.4,0.2L8.4,3.0L7.0,4.4L8.6,6.0C7.9,6.5 7.3,7.2 6.8,8.0L4.0,8.0l0.0,2.0l2.1,0.0C6.0,10.3 6.0,10.7 6.0,11.0l0.0,1.0L4.0,12.0l0.0,2.0l2.0,0.0l0.0,1.0c0.0,0.3 0.0,0.7 0.1,1.0L4.0,16.0l0.0,2.0l2.8,0.0c1.0,1.8 3.0,3.0 5.2,3.0s4.2,-1.2 5.2,-3.0L20.0,18.0l0.0,-2.0l-2.1,0.0c0.1,-0.3 0.1,-0.7 0.1,-1.0l0.0,-1.0l2.0,0.0l0.0,-2.0l-2.0,0.0l0.0,-1.0c0.0,-0.3 0.0,-0.7 -0.1,-1.0L20.0,10.0L20.0,8.0zM14.0,16.0l-4.0,0.0l0.0,-2.0l4.0,0.0L14.0,16.0zM14.0,12.0l-4.0,0.0l0.0,-2.0l4.0,0.0L14.0,12.0z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_cast_connecting.xml b/packages/SystemUI/res/drawable/ic_qs_cast_connecting.xml
deleted file mode 100644
index 70db2a9..0000000
--- a/packages/SystemUI/res/drawable/ic_qs_cast_connecting.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
- * Copyright 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.
- */
--->
-<animation-list
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:oneshot="false">
- <item android:drawable="@drawable/ic_qs_cast_connecting_0" android:duration="500" />
- <item android:drawable="@drawable/ic_qs_cast_connecting_1" android:duration="500" />
- <item android:drawable="@drawable/ic_qs_cast_connecting_2" android:duration="500" />
- <item android:drawable="@drawable/ic_qs_cast_connecting_1" android:duration="500" />
-</animation-list>
diff --git a/packages/SystemUI/res/drawable/ic_qs_cast.xml b/packages/SystemUI/res/drawable/ic_qs_cast_off.xml
similarity index 92%
copy from packages/SystemUI/res/drawable/ic_qs_cast.xml
copy to packages/SystemUI/res/drawable/ic_qs_cast_off.xml
index 6f2840b..130c639 100644
--- a/packages/SystemUI/res/drawable/ic_qs_cast.xml
+++ b/packages/SystemUI/res/drawable/ic_qs_cast_off.xml
@@ -23,6 +23,8 @@
android:viewportHeight="24.0"/>
<path
- android:fill="#FF000000"
+ android:fill="#00000000"
+ android:stroke="#CCCCCC"
+ android:strokeWidth="1.0"
android:pathData="M21.0,3.0L3.0,3.0C1.9,3.0 1.0,3.9 1.0,5.0l0.0,3.0l2.0,0.0L3.0,5.0l18.0,0.0l0.0,14.0l-7.0,0.0l0.0,2.0l7.0,0.0c1.1,0.0 2.0,-0.9 2.0,-2.0L23.0,5.0C23.0,3.9 22.1,3.0 21.0,3.0zM1.0,18.0l0.0,3.0l3.0,0.0C4.0,19.3 2.7,18.0 1.0,18.0zM1.0,14.0l0.0,2.0c2.8,0.0 5.0,2.2 5.0,5.0l2.0,0.0C8.0,17.1 4.9,14.0 1.0,14.0zM1.0,10.0l0.0,2.0c5.0,0.0 9.0,4.0 9.0,9.0l2.0,0.0C12.0,14.9 7.1,10.0 1.0,10.0z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_cast.xml b/packages/SystemUI/res/drawable/ic_qs_cast_on.xml
similarity index 97%
rename from packages/SystemUI/res/drawable/ic_qs_cast.xml
rename to packages/SystemUI/res/drawable/ic_qs_cast_on.xml
index 6f2840b..6c82b1c 100644
--- a/packages/SystemUI/res/drawable/ic_qs_cast.xml
+++ b/packages/SystemUI/res/drawable/ic_qs_cast_on.xml
@@ -23,6 +23,6 @@
android:viewportHeight="24.0"/>
<path
- android:fill="#FF000000"
+ android:fill="#FFFFFFFF"
android:pathData="M21.0,3.0L3.0,3.0C1.9,3.0 1.0,3.9 1.0,5.0l0.0,3.0l2.0,0.0L3.0,5.0l18.0,0.0l0.0,14.0l-7.0,0.0l0.0,2.0l7.0,0.0c1.1,0.0 2.0,-0.9 2.0,-2.0L23.0,5.0C23.0,3.9 22.1,3.0 21.0,3.0zM1.0,18.0l0.0,3.0l3.0,0.0C4.0,19.3 2.7,18.0 1.0,18.0zM1.0,14.0l0.0,2.0c2.8,0.0 5.0,2.2 5.0,5.0l2.0,0.0C8.0,17.1 4.9,14.0 1.0,14.0zM1.0,10.0l0.0,2.0c5.0,0.0 9.0,4.0 9.0,9.0l2.0,0.0C12.0,14.9 7.1,10.0 1.0,10.0z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_close.xml b/packages/SystemUI/res/drawable/ic_qs_close.xml
index c2c72c8..dd43e6c 100644
--- a/packages/SystemUI/res/drawable/ic_qs_close.xml
+++ b/packages/SystemUI/res/drawable/ic_qs_close.xml
@@ -23,6 +23,6 @@
android:viewportHeight="24.0"/>
<path
- android:fill="#FF000000"
+ android:fill="#FFFFFFFF"
android:pathData="M19.0,6.4l-1.3999996,-1.4000001 -5.6000004,5.6000004 -5.6,-5.6000004 -1.4000001,1.4000001 5.6000004,5.6 -5.6000004,5.6000004 1.4000001,1.3999996 5.6,-5.6000004 5.6000004,5.6000004 1.3999996,-1.3999996 -5.6000004,-5.6000004z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_invert_colors.xml b/packages/SystemUI/res/drawable/ic_qs_color_inversion.xml
similarity index 97%
rename from packages/SystemUI/res/drawable/ic_qs_invert_colors.xml
rename to packages/SystemUI/res/drawable/ic_qs_color_inversion.xml
index 7c92052..dc30a53 100644
--- a/packages/SystemUI/res/drawable/ic_qs_invert_colors.xml
+++ b/packages/SystemUI/res/drawable/ic_qs_color_inversion.xml
@@ -23,6 +23,6 @@
android:viewportHeight="24.0"/>
<path
- android:fill="#FF000000"
+ android:fill="#FFFFFFFF"
android:pathData="M18.939,7.244c-5.887,-5.885 -6.214,-6.214 -6.222,-6.222l-0.707,-0.737L5.088,7.207c-2.914,2.915 -3.74,6.629 -2.266,10.19c1.541,3.719 5.312,6.316 9.174,6.317l0.0,0.0c3.861,-0.001 7.636,-2.603 9.179,-6.328C22.646,13.834 21.832,10.138 18.939,7.244zM4.67,16.632c-1.149,-2.776 -0.481,-5.696 1.832,-8.011l5.494,-5.492c0.0,0.002 0.002,0.003 0.003,0.004l0.0,18.582c-0.001,0.0 -0.002,0.0 -0.003,0.0C8.922,21.714 5.91,19.624 4.67,16.632z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_color_space_off.xml b/packages/SystemUI/res/drawable/ic_qs_color_space_off.xml
deleted file mode 100644
index cf34ba6..0000000
--- a/packages/SystemUI/res/drawable/ic_qs_color_space_off.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- 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.
--->
-
-<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
- android:src="@drawable/ic_qs_color_space_alpha"
- android:tint="@color/ic_qs_off" />
diff --git a/packages/SystemUI/res/drawable/ic_qs_color_space_on.xml b/packages/SystemUI/res/drawable/ic_qs_color_space_on.xml
deleted file mode 100644
index 1806688..0000000
--- a/packages/SystemUI/res/drawable/ic_qs_color_space_on.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- 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.
--->
-
-<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
- android:src="@drawable/ic_qs_color_space_alpha"
- android:tint="@color/ic_qs_on" />
diff --git a/packages/SystemUI/res/drawable/ic_qs_hotspot.xml b/packages/SystemUI/res/drawable/ic_qs_hotspot_off.xml
similarity index 93%
copy from packages/SystemUI/res/drawable/ic_qs_hotspot.xml
copy to packages/SystemUI/res/drawable/ic_qs_hotspot_off.xml
index 965e3c1..7a62212 100644
--- a/packages/SystemUI/res/drawable/ic_qs_hotspot.xml
+++ b/packages/SystemUI/res/drawable/ic_qs_hotspot_off.xml
@@ -23,6 +23,8 @@
android:viewportHeight="24.0"/>
<path
- android:fill="#FF000000"
+ android:fill="#00000000"
+ android:stroke="#CCCCCC"
+ android:strokeWidth="1.0"
android:pathData="M12.0,11.0c-1.1,0.0 -2.0,0.9 -2.0,2.0c0.0,1.1 0.9,2.0 2.0,2.0c1.1,0.0 2.0,-0.9 2.0,-2.0C14.0,11.9 13.1,11.0 12.0,11.0zM18.0,13.0c0.0,-3.3 -2.7,-6.0 -6.0,-6.0c-3.3,0.0 -6.0,2.7 -6.0,6.0c0.0,2.2 1.2,4.1 3.0,5.2l1.0,-1.7c-1.2,-0.7 -2.0,-2.0 -2.0,-3.4c0.0,-2.2 1.8,-4.0 4.0,-4.0s4.0,1.8 4.0,4.0c0.0,1.5 -0.8,2.8 -2.0,3.4l1.0,1.7C16.8,17.1 18.0,15.2 18.0,13.0zM12.0,3.0C6.5,3.0 2.0,7.5 2.0,13.0c0.0,3.7 2.0,6.9 5.0,8.6l1.0,-1.7c-2.4,-1.4 -4.0,-4.0 -4.0,-6.9c0.0,-4.4 3.6,-8.0 8.0,-8.0s8.0,3.6 8.0,8.0c0.0,3.0 -1.6,5.5 -4.0,6.9l1.0,1.7c3.0,-1.7 5.0,-5.0 5.0,-8.6C22.0,7.5 17.5,3.0 12.0,3.0z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_hotspot.xml b/packages/SystemUI/res/drawable/ic_qs_hotspot_on.xml
similarity index 97%
rename from packages/SystemUI/res/drawable/ic_qs_hotspot.xml
rename to packages/SystemUI/res/drawable/ic_qs_hotspot_on.xml
index 965e3c1..3ccdd81 100644
--- a/packages/SystemUI/res/drawable/ic_qs_hotspot.xml
+++ b/packages/SystemUI/res/drawable/ic_qs_hotspot_on.xml
@@ -23,6 +23,6 @@
android:viewportHeight="24.0"/>
<path
- android:fill="#FF000000"
+ android:fill="#FFFFFFFF"
android:pathData="M12.0,11.0c-1.1,0.0 -2.0,0.9 -2.0,2.0c0.0,1.1 0.9,2.0 2.0,2.0c1.1,0.0 2.0,-0.9 2.0,-2.0C14.0,11.9 13.1,11.0 12.0,11.0zM18.0,13.0c0.0,-3.3 -2.7,-6.0 -6.0,-6.0c-3.3,0.0 -6.0,2.7 -6.0,6.0c0.0,2.2 1.2,4.1 3.0,5.2l1.0,-1.7c-1.2,-0.7 -2.0,-2.0 -2.0,-3.4c0.0,-2.2 1.8,-4.0 4.0,-4.0s4.0,1.8 4.0,4.0c0.0,1.5 -0.8,2.8 -2.0,3.4l1.0,1.7C16.8,17.1 18.0,15.2 18.0,13.0zM12.0,3.0C6.5,3.0 2.0,7.5 2.0,13.0c0.0,3.7 2.0,6.9 5.0,8.6l1.0,-1.7c-2.4,-1.4 -4.0,-4.0 -4.0,-6.9c0.0,-4.4 3.6,-8.0 8.0,-8.0s8.0,3.6 8.0,8.0c0.0,3.0 -1.6,5.5 -4.0,6.9l1.0,1.7c3.0,-1.7 5.0,-5.0 5.0,-8.6C22.0,7.5 17.5,3.0 12.0,3.0z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_inversion_off.xml b/packages/SystemUI/res/drawable/ic_qs_inversion_off.xml
deleted file mode 100644
index 9018a90..0000000
--- a/packages/SystemUI/res/drawable/ic_qs_inversion_off.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- 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.
--->
-
-<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
- android:src="@drawable/ic_qs_inversion_alpha"
- android:tint="@color/ic_qs_off" />
diff --git a/packages/SystemUI/res/drawable/ic_qs_inversion_on.xml b/packages/SystemUI/res/drawable/ic_qs_inversion_on.xml
deleted file mode 100644
index 9110201..0000000
--- a/packages/SystemUI/res/drawable/ic_qs_inversion_on.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- 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.
--->
-
-<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
- android:src="@drawable/ic_qs_inversion_alpha"
- android:tint="@color/ic_qs_on" />
diff --git a/packages/SystemUI/res/drawable/ic_qs_location.xml b/packages/SystemUI/res/drawable/ic_qs_location.xml
deleted file mode 100644
index e6e98a0..0000000
--- a/packages/SystemUI/res/drawable/ic_qs_location.xml
+++ /dev/null
@@ -1,28 +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.
--->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
- android:width="64dp"
- android:height="64dp"/>
-
- <viewport
- android:viewportWidth="24.0"
- android:viewportHeight="24.0"/>
-
- <path
- android:fill="#FF000000"
- android:pathData="M12.0,2.0C8.1,2.0 5.0,5.1 5.0,9.0c0.0,5.2 7.0,13.0 7.0,13.0s7.0,-7.8 7.0,-13.0C19.0,5.1 15.9,2.0 12.0,2.0zM12.0,11.5c-1.4,0.0 -2.5,-1.1 -2.5,-2.5s1.1,-2.5 2.5,-2.5c1.4,0.0 2.5,1.1 2.5,2.5S13.4,11.5 12.0,11.5z"/>
-</vector>
diff --git a/packages/SystemUI/res/drawable/ic_location_24_01.xml b/packages/SystemUI/res/drawable/ic_qs_location_01.xml
similarity index 100%
rename from packages/SystemUI/res/drawable/ic_location_24_01.xml
rename to packages/SystemUI/res/drawable/ic_qs_location_01.xml
diff --git a/packages/SystemUI/res/drawable/ic_location_24_02.xml b/packages/SystemUI/res/drawable/ic_qs_location_02.xml
similarity index 100%
rename from packages/SystemUI/res/drawable/ic_location_24_02.xml
rename to packages/SystemUI/res/drawable/ic_qs_location_02.xml
diff --git a/packages/SystemUI/res/drawable/ic_location_24_03.xml b/packages/SystemUI/res/drawable/ic_qs_location_03.xml
similarity index 100%
rename from packages/SystemUI/res/drawable/ic_location_24_03.xml
rename to packages/SystemUI/res/drawable/ic_qs_location_03.xml
diff --git a/packages/SystemUI/res/drawable/ic_location_24_04.xml b/packages/SystemUI/res/drawable/ic_qs_location_04.xml
similarity index 100%
rename from packages/SystemUI/res/drawable/ic_location_24_04.xml
rename to packages/SystemUI/res/drawable/ic_qs_location_04.xml
diff --git a/packages/SystemUI/res/drawable/ic_location_24_05.xml b/packages/SystemUI/res/drawable/ic_qs_location_05.xml
similarity index 100%
rename from packages/SystemUI/res/drawable/ic_location_24_05.xml
rename to packages/SystemUI/res/drawable/ic_qs_location_05.xml
diff --git a/packages/SystemUI/res/drawable/ic_location_24_06.xml b/packages/SystemUI/res/drawable/ic_qs_location_06.xml
similarity index 100%
rename from packages/SystemUI/res/drawable/ic_location_24_06.xml
rename to packages/SystemUI/res/drawable/ic_qs_location_06.xml
diff --git a/packages/SystemUI/res/drawable/ic_location_24_07.xml b/packages/SystemUI/res/drawable/ic_qs_location_07.xml
similarity index 100%
rename from packages/SystemUI/res/drawable/ic_location_24_07.xml
rename to packages/SystemUI/res/drawable/ic_qs_location_07.xml
diff --git a/packages/SystemUI/res/drawable/ic_location_24_08.xml b/packages/SystemUI/res/drawable/ic_qs_location_08.xml
similarity index 100%
rename from packages/SystemUI/res/drawable/ic_location_24_08.xml
rename to packages/SystemUI/res/drawable/ic_qs_location_08.xml
diff --git a/packages/SystemUI/res/drawable/ic_location_24_09.xml b/packages/SystemUI/res/drawable/ic_qs_location_09.xml
similarity index 100%
rename from packages/SystemUI/res/drawable/ic_location_24_09.xml
rename to packages/SystemUI/res/drawable/ic_qs_location_09.xml
diff --git a/packages/SystemUI/res/drawable/ic_location_24_10.xml b/packages/SystemUI/res/drawable/ic_qs_location_10.xml
similarity index 100%
rename from packages/SystemUI/res/drawable/ic_location_24_10.xml
rename to packages/SystemUI/res/drawable/ic_qs_location_10.xml
diff --git a/packages/SystemUI/res/drawable/ic_location_24_11.xml b/packages/SystemUI/res/drawable/ic_qs_location_11.xml
similarity index 100%
rename from packages/SystemUI/res/drawable/ic_location_24_11.xml
rename to packages/SystemUI/res/drawable/ic_qs_location_11.xml
diff --git a/packages/SystemUI/res/drawable/ic_qs_location_off.xml b/packages/SystemUI/res/drawable/ic_qs_location_off.xml
new file mode 100644
index 0000000..d28d347
--- /dev/null
+++ b/packages/SystemUI/res/drawable/ic_qs_location_off.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+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.
+-->
+<animation-list
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:oneshot="true">
+ <item android:drawable="@drawable/ic_qs_location_01" android:duration="16" />
+ <item android:drawable="@drawable/ic_qs_location_02" android:duration="16" />
+ <item android:drawable="@drawable/ic_qs_location_03" android:duration="16" />
+ <item android:drawable="@drawable/ic_qs_location_04" android:duration="16" />
+ <item android:drawable="@drawable/ic_qs_location_05" android:duration="16" />
+ <item android:drawable="@drawable/ic_qs_location_06" android:duration="16" />
+ <item android:drawable="@drawable/ic_qs_location_07" android:duration="16" />
+ <item android:drawable="@drawable/ic_qs_location_08" android:duration="16" />
+ <item android:drawable="@drawable/ic_qs_location_09" android:duration="16" />
+ <item android:drawable="@drawable/ic_qs_location_10" android:duration="16" />
+ <item android:drawable="@drawable/ic_qs_location_11" android:duration="16" />
+</animation-list>
diff --git a/packages/SystemUI/res/drawable/ic_qs_location_on.xml b/packages/SystemUI/res/drawable/ic_qs_location_on.xml
new file mode 100644
index 0000000..72512ac
--- /dev/null
+++ b/packages/SystemUI/res/drawable/ic_qs_location_on.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+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.
+-->
+<animation-list
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:oneshot="true">
+ <item android:drawable="@drawable/ic_qs_location_11" android:duration="16" />
+ <item android:drawable="@drawable/ic_qs_location_10" android:duration="16" />
+ <item android:drawable="@drawable/ic_qs_location_09" android:duration="16" />
+ <item android:drawable="@drawable/ic_qs_location_08" android:duration="16" />
+ <item android:drawable="@drawable/ic_qs_location_07" android:duration="16" />
+ <item android:drawable="@drawable/ic_qs_location_06" android:duration="16" />
+ <item android:drawable="@drawable/ic_qs_location_05" android:duration="16" />
+ <item android:drawable="@drawable/ic_qs_location_04" android:duration="16" />
+ <item android:drawable="@drawable/ic_qs_location_03" android:duration="16" />
+ <item android:drawable="@drawable/ic_qs_location_02" android:duration="16" />
+ <item android:drawable="@drawable/ic_qs_location_01" android:duration="16" />
+</animation-list>
diff --git a/packages/SystemUI/res/drawable/ic_qs_minus.xml b/packages/SystemUI/res/drawable/ic_qs_minus.xml
index 8323e89..376cc28 100644
--- a/packages/SystemUI/res/drawable/ic_qs_minus.xml
+++ b/packages/SystemUI/res/drawable/ic_qs_minus.xml
@@ -23,6 +23,6 @@
android:viewportHeight="24.0"/>
<path
- android:fill="#FF000000"
+ android:fill="#FFFFFFFF"
android:pathData="M7.0,11.0l0.0,2.0l10.0,0.0l0.0,-2.0L7.0,11.0zM12.0,2.0C6.5,2.0 2.0,6.5 2.0,12.0s4.5,10.0 10.0,10.0c5.5,0.0 10.0,-4.5 10.0,-10.0S17.5,2.0 12.0,2.0zM12.0,20.0c-4.4,0.0 -8.0,-3.6 -8.0,-8.0s3.6,-8.0 8.0,-8.0c4.4,0.0 8.0,3.6 8.0,8.0S16.4,20.0 12.0,20.0z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_plus.xml b/packages/SystemUI/res/drawable/ic_qs_plus.xml
index 84cd72a..a315f7f 100644
--- a/packages/SystemUI/res/drawable/ic_qs_plus.xml
+++ b/packages/SystemUI/res/drawable/ic_qs_plus.xml
@@ -23,6 +23,6 @@
android:viewportHeight="24.0"/>
<path
- android:fill="#FF000000"
+ android:fill="#FFFFFFFF"
android:pathData="M13.0,7.0l-2.0,0.0l0.0,4.0L7.0,11.0l0.0,2.0l4.0,0.0l0.0,4.0l2.0,0.0l0.0,-4.0l4.0,0.0l0.0,-2.0l-4.0,0.0L13.0,7.0zM12.0,2.0C6.5,2.0 2.0,6.5 2.0,12.0s4.5,10.0 10.0,10.0c5.5,0.0 10.0,-4.5 10.0,-10.0S17.5,2.0 12.0,2.0zM12.0,20.0c-4.4,0.0 -8.0,-3.6 -8.0,-8.0s3.6,-8.0 8.0,-8.0c4.4,0.0 8.0,3.6 8.0,8.0S16.4,20.0 12.0,20.0z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_ringer_audible.xml b/packages/SystemUI/res/drawable/ic_qs_ringer_audible.xml
index fa6f20c..45b5548 100644
--- a/packages/SystemUI/res/drawable/ic_qs_ringer_audible.xml
+++ b/packages/SystemUI/res/drawable/ic_qs_ringer_audible.xml
@@ -23,6 +23,6 @@
android:viewportHeight="24.0"/>
<path
- android:fill="#FF000000"
+ android:fill="#FFFFFFFF"
android:pathData="M3.0,9.0c0.0,0.0 0.0,6.0 0.0,6.0l4.0,0.0l5.0,5.0L12.0,4.0L7.0,9.0L3.0,9.0zM16.5,12.0c0.0,-1.8 -1.0,-3.3 -2.5,-4.0L14.0,16.0C15.5,15.3 16.5,13.8 16.5,12.0zM14.0,3.2l0.0,2.1c2.9,0.9 5.0,3.5 5.0,6.7s-2.1,5.8 -5.0,6.7l0.0,2.1c4.0,-0.9 7.0,-4.5 7.0,-8.8S18.0,4.1 14.0,3.2z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_ringer_silent.xml b/packages/SystemUI/res/drawable/ic_qs_ringer_silent.xml
index 0665196..6d44406 100644
--- a/packages/SystemUI/res/drawable/ic_qs_ringer_silent.xml
+++ b/packages/SystemUI/res/drawable/ic_qs_ringer_silent.xml
@@ -23,6 +23,6 @@
android:viewportHeight="24.0"/>
<path
- android:fill="#FF000000"
+ android:fill="#FFFFFFFF"
android:pathData="M16.5,12.0c0.0,-1.8 -1.0,-3.3 -2.5,-4.0l0.0,2.2l2.5,2.5C16.5,12.4 16.5,12.2 16.5,12.0zM19.0,12.0c0.0,0.9 -0.2,1.8 -0.5,2.6l1.5,1.5c0.7,-1.2 1.0,-2.7 1.0,-4.2c0.0,-4.3 -3.0,-7.9 -7.0,-8.8l0.0,2.1C16.9,6.2 19.0,8.8 19.0,12.0zM4.3,3.0L3.0,4.3L7.7,9.0L3.0,9.0c0.0,0.0 0.0,6.0 0.0,6.0l4.0,0.0l5.0,5.0l0.0,-6.7l4.3,4.3c-0.7,0.5 -1.4,0.9 -2.3,1.2l0.0,2.1c1.4,-0.3 2.6,-0.9 3.7,-1.8l2.0,2.0l1.3,-1.3l-9.0,-9.0L4.3,3.0zM12.0,4.0L9.9,6.1L12.0,8.2L12.0,4.0z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_ringer_vibrate.xml b/packages/SystemUI/res/drawable/ic_qs_ringer_vibrate.xml
index 299a2ef..96d20e8 100644
--- a/packages/SystemUI/res/drawable/ic_qs_ringer_vibrate.xml
+++ b/packages/SystemUI/res/drawable/ic_qs_ringer_vibrate.xml
@@ -23,6 +23,6 @@
android:viewportHeight="24.0"/>
<path
- android:fill="#FF000000"
+ android:fill="#FFFFFFFF"
android:pathData="M0.0,15.0l2.0,0.0L2.0,9.0L0.0,9.0L0.0,15.0zM3.0,17.0l2.0,0.0L5.0,7.0L3.0,7.0L3.0,17.0zM22.0,9.0l0.0,6.0l2.0,0.0L24.0,9.0L22.0,9.0zM19.0,17.0l2.0,0.0L21.0,7.0l-2.0,0.0L19.0,17.0zM16.5,3.0l-9.0,0.0C6.7,3.0 6.0,3.7 6.0,4.5l0.0,15.0C6.0,20.3 6.7,21.0 7.5,21.0l9.0,0.0c0.8,0.0 1.5,-0.7 1.5,-1.5l0.0,-15.0C18.0,3.7 17.3,3.0 16.5,3.0zM16.0,19.0L8.0,19.0L8.0,5.0l8.0,0.0L16.0,19.0z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_rotate_24_01.xml b/packages/SystemUI/res/drawable/ic_qs_rotation_01.xml
similarity index 100%
rename from packages/SystemUI/res/drawable/ic_rotate_24_01.xml
rename to packages/SystemUI/res/drawable/ic_qs_rotation_01.xml
diff --git a/packages/SystemUI/res/drawable/ic_rotate_24_02.xml b/packages/SystemUI/res/drawable/ic_qs_rotation_02.xml
similarity index 100%
rename from packages/SystemUI/res/drawable/ic_rotate_24_02.xml
rename to packages/SystemUI/res/drawable/ic_qs_rotation_02.xml
diff --git a/packages/SystemUI/res/drawable/ic_rotate_24_03.xml b/packages/SystemUI/res/drawable/ic_qs_rotation_03.xml
similarity index 100%
rename from packages/SystemUI/res/drawable/ic_rotate_24_03.xml
rename to packages/SystemUI/res/drawable/ic_qs_rotation_03.xml
diff --git a/packages/SystemUI/res/drawable/ic_rotate_24_04.xml b/packages/SystemUI/res/drawable/ic_qs_rotation_04.xml
similarity index 100%
rename from packages/SystemUI/res/drawable/ic_rotate_24_04.xml
rename to packages/SystemUI/res/drawable/ic_qs_rotation_04.xml
diff --git a/packages/SystemUI/res/drawable/ic_rotate_24_05.xml b/packages/SystemUI/res/drawable/ic_qs_rotation_05.xml
similarity index 100%
rename from packages/SystemUI/res/drawable/ic_rotate_24_05.xml
rename to packages/SystemUI/res/drawable/ic_qs_rotation_05.xml
diff --git a/packages/SystemUI/res/drawable/ic_rotate_24_06.xml b/packages/SystemUI/res/drawable/ic_qs_rotation_06.xml
similarity index 100%
rename from packages/SystemUI/res/drawable/ic_rotate_24_06.xml
rename to packages/SystemUI/res/drawable/ic_qs_rotation_06.xml
diff --git a/packages/SystemUI/res/drawable/ic_rotate_24_07.xml b/packages/SystemUI/res/drawable/ic_qs_rotation_07.xml
similarity index 100%
rename from packages/SystemUI/res/drawable/ic_rotate_24_07.xml
rename to packages/SystemUI/res/drawable/ic_qs_rotation_07.xml
diff --git a/packages/SystemUI/res/drawable/ic_rotate_24_08.xml b/packages/SystemUI/res/drawable/ic_qs_rotation_08.xml
similarity index 100%
rename from packages/SystemUI/res/drawable/ic_rotate_24_08.xml
rename to packages/SystemUI/res/drawable/ic_qs_rotation_08.xml
diff --git a/packages/SystemUI/res/drawable/ic_rotate_24_09.xml b/packages/SystemUI/res/drawable/ic_qs_rotation_09.xml
similarity index 100%
rename from packages/SystemUI/res/drawable/ic_rotate_24_09.xml
rename to packages/SystemUI/res/drawable/ic_qs_rotation_09.xml
diff --git a/packages/SystemUI/res/drawable/ic_rotate_24_10.xml b/packages/SystemUI/res/drawable/ic_qs_rotation_10.xml
similarity index 100%
rename from packages/SystemUI/res/drawable/ic_rotate_24_10.xml
rename to packages/SystemUI/res/drawable/ic_qs_rotation_10.xml
diff --git a/packages/SystemUI/res/drawable/ic_rotate_24_11.xml b/packages/SystemUI/res/drawable/ic_qs_rotation_11.xml
similarity index 100%
rename from packages/SystemUI/res/drawable/ic_rotate_24_11.xml
rename to packages/SystemUI/res/drawable/ic_qs_rotation_11.xml
diff --git a/packages/SystemUI/res/drawable/ic_rotate_24_12.xml b/packages/SystemUI/res/drawable/ic_qs_rotation_12.xml
similarity index 100%
rename from packages/SystemUI/res/drawable/ic_rotate_24_12.xml
rename to packages/SystemUI/res/drawable/ic_qs_rotation_12.xml
diff --git a/packages/SystemUI/res/drawable/ic_rotate_24_13.xml b/packages/SystemUI/res/drawable/ic_qs_rotation_13.xml
similarity index 100%
rename from packages/SystemUI/res/drawable/ic_rotate_24_13.xml
rename to packages/SystemUI/res/drawable/ic_qs_rotation_13.xml
diff --git a/packages/SystemUI/res/drawable/ic_rotate_24_14.xml b/packages/SystemUI/res/drawable/ic_qs_rotation_14.xml
similarity index 100%
rename from packages/SystemUI/res/drawable/ic_rotate_24_14.xml
rename to packages/SystemUI/res/drawable/ic_qs_rotation_14.xml
diff --git a/packages/SystemUI/res/drawable/ic_rotate_24_15.xml b/packages/SystemUI/res/drawable/ic_qs_rotation_15.xml
similarity index 100%
rename from packages/SystemUI/res/drawable/ic_rotate_24_15.xml
rename to packages/SystemUI/res/drawable/ic_qs_rotation_15.xml
diff --git a/packages/SystemUI/res/drawable/ic_qs_rotation_locked.xml b/packages/SystemUI/res/drawable/ic_qs_rotation_locked.xml
new file mode 100644
index 0000000..75e20f0
--- /dev/null
+++ b/packages/SystemUI/res/drawable/ic_qs_rotation_locked.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+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.
+-->
+<animation-list
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:oneshot="true">
+ <item android:drawable="@drawable/ic_qs_rotation_01" android:duration="16" />
+ <item android:drawable="@drawable/ic_qs_rotation_02" android:duration="16" />
+ <item android:drawable="@drawable/ic_qs_rotation_03" android:duration="16" />
+ <item android:drawable="@drawable/ic_qs_rotation_04" android:duration="16" />
+ <item android:drawable="@drawable/ic_qs_rotation_05" android:duration="16" />
+ <item android:drawable="@drawable/ic_qs_rotation_06" android:duration="16" />
+ <item android:drawable="@drawable/ic_qs_rotation_07" android:duration="16" />
+ <item android:drawable="@drawable/ic_qs_rotation_08" android:duration="16" />
+ <item android:drawable="@drawable/ic_qs_rotation_09" android:duration="16" />
+ <item android:drawable="@drawable/ic_qs_rotation_10" android:duration="16" />
+ <item android:drawable="@drawable/ic_qs_rotation_11" android:duration="16" />
+ <item android:drawable="@drawable/ic_qs_rotation_12" android:duration="16" />
+ <item android:drawable="@drawable/ic_qs_rotation_13" android:duration="16" />
+ <item android:drawable="@drawable/ic_qs_rotation_14" android:duration="16" />
+ <item android:drawable="@drawable/ic_qs_rotation_15" android:duration="16" />
+</animation-list>
diff --git a/packages/SystemUI/res/drawable/ic_qs_rotation_unlocked.xml b/packages/SystemUI/res/drawable/ic_qs_rotation_unlocked.xml
new file mode 100644
index 0000000..a1cedb9
--- /dev/null
+++ b/packages/SystemUI/res/drawable/ic_qs_rotation_unlocked.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+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.
+-->
+<animation-list
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:oneshot="true">
+ <item android:drawable="@drawable/ic_qs_rotation_15" android:duration="16" />
+ <item android:drawable="@drawable/ic_qs_rotation_14" android:duration="16" />
+ <item android:drawable="@drawable/ic_qs_rotation_13" android:duration="16" />
+ <item android:drawable="@drawable/ic_qs_rotation_12" android:duration="16" />
+ <item android:drawable="@drawable/ic_qs_rotation_11" android:duration="16" />
+ <item android:drawable="@drawable/ic_qs_rotation_10" android:duration="16" />
+ <item android:drawable="@drawable/ic_qs_rotation_09" android:duration="16" />
+ <item android:drawable="@drawable/ic_qs_rotation_08" android:duration="16" />
+ <item android:drawable="@drawable/ic_qs_rotation_07" android:duration="16" />
+ <item android:drawable="@drawable/ic_qs_rotation_06" android:duration="16" />
+ <item android:drawable="@drawable/ic_qs_rotation_05" android:duration="16" />
+ <item android:drawable="@drawable/ic_qs_rotation_04" android:duration="16" />
+ <item android:drawable="@drawable/ic_qs_rotation_03" android:duration="16" />
+ <item android:drawable="@drawable/ic_qs_rotation_02" android:duration="16" />
+ <item android:drawable="@drawable/ic_qs_rotation_01" android:duration="16" />
+</animation-list>
diff --git a/packages/SystemUI/res/drawable/ic_qs_zen.xml b/packages/SystemUI/res/drawable/ic_qs_zen_off.xml
similarity index 66%
rename from packages/SystemUI/res/drawable/ic_qs_zen.xml
rename to packages/SystemUI/res/drawable/ic_qs_zen_off.xml
index 059c068..73886ec 100644
--- a/packages/SystemUI/res/drawable/ic_qs_zen.xml
+++ b/packages/SystemUI/res/drawable/ic_qs_zen_off.xml
@@ -23,6 +23,8 @@
android:viewportHeight="24.0"/>
<path
- android:fill="#FF000000"
- android:pathData="M11.5,22.0c1.1,0.0 2.0,-0.9 2.0,-2.0l-4.0,0.0C9.5,21.1 10.4,22.0 11.5,22.0zM18.0,16.0l0.0,-5.5c0.0,-3.1 -2.1,-5.6 -5.0,-6.3L13.0,3.5C13.0,2.7 12.3,2.0 11.5,2.0C10.7,2.0 10.0,2.7 10.0,3.5l0.0,0.7c-2.9,0.7 -5.0,3.2 -5.0,6.3L5.0,16.0l-2.0,2.0l0.0,1.0l17.0,0.0l0.0,-1.0L18.0,16.0zM14.0,9.8l-2.8,3.4L14.0,13.200001L14.0,15.0L9.0,15.0l0.0,-1.8l2.8,-3.4L9.0,9.799999L9.0,8.0l5.0,0.0L14.0,9.8z"/>
+ android:fill="#00000000"
+ android:stroke="#CCCCCC"
+ android:strokeWidth="1.0"
+ android:pathData="M12.0,2.0C6.5,2.0 2.0,6.5 2.0,12.0s4.5,10.0 10.0,10.0c5.5,0.0 10.0,-4.5 10.0,-10.0S17.5,2.0 12.0,2.0zM4.0,12.0c0.0,-4.4 3.6,-8.0 8.0,-8.0c1.8,0.0 3.5,0.6 4.9,1.7L5.7,16.9C4.6,15.5 4.0,13.8 4.0,12.0zM12.0,20.0c-1.8,0.0 -3.5,-0.6 -4.9,-1.7L18.3,7.1C19.4,8.5 20.0,10.2 20.0,12.0C20.0,16.4 16.4,20.0 12.0,20.0z" />
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_airplane.xml b/packages/SystemUI/res/drawable/ic_qs_zen_on.xml
similarity index 70%
copy from packages/SystemUI/res/drawable/ic_qs_airplane.xml
copy to packages/SystemUI/res/drawable/ic_qs_zen_on.xml
index ffe571f..8dff318 100644
--- a/packages/SystemUI/res/drawable/ic_qs_airplane.xml
+++ b/packages/SystemUI/res/drawable/ic_qs_zen_on.xml
@@ -23,9 +23,6 @@
android:viewportHeight="24.0"/>
<path
- android:fill="#FF000000"
- android:pathData="M10.2,9.0"/>
- <path
- android:fill="#FF000000"
- android:pathData="M21.0,16.0l0.0,-2.0l-8.0,-5.0L13.0,3.5C13.0,2.7 12.3,2.0 11.5,2.0C10.7,2.0 10.0,2.7 10.0,3.5L10.0,9.0l-8.0,5.0l0.0,2.0l8.0,-2.5L10.0,19.0l-2.0,1.5L8.0,22.0l3.5,-1.0l3.5,1.0l0.0,-1.5L13.0,19.0l0.0,-5.5L21.0,16.0z"/>
+ android:fill="#FFFFFFFF"
+ android:pathData="M12.0,2.0C6.5,2.0 2.0,6.5 2.0,12.0s4.5,10.0 10.0,10.0c5.5,0.0 10.0,-4.5 10.0,-10.0S17.5,2.0 12.0,2.0zM4.0,12.0c0.0,-4.4 3.6,-8.0 8.0,-8.0c1.8,0.0 3.5,0.6 4.9,1.7L5.7,16.9C4.6,15.5 4.0,13.8 4.0,12.0zM12.0,20.0c-1.8,0.0 -3.5,-0.6 -4.9,-1.7L18.3,7.1C19.4,8.5 20.0,10.2 20.0,12.0C20.0,16.4 16.4,20.0 12.0,20.0z" />
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_rotate_locked_anim.xml b/packages/SystemUI/res/drawable/ic_rotate_locked_anim.xml
deleted file mode 100644
index e14a1ce..0000000
--- a/packages/SystemUI/res/drawable/ic_rotate_locked_anim.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-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.
--->
-<animation-list
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:oneshot="true">
- <item android:drawable="@drawable/ic_rotate_24_01" android:duration="16" />
- <item android:drawable="@drawable/ic_rotate_24_02" android:duration="16" />
- <item android:drawable="@drawable/ic_rotate_24_03" android:duration="16" />
- <item android:drawable="@drawable/ic_rotate_24_04" android:duration="16" />
- <item android:drawable="@drawable/ic_rotate_24_05" android:duration="16" />
- <item android:drawable="@drawable/ic_rotate_24_06" android:duration="16" />
- <item android:drawable="@drawable/ic_rotate_24_07" android:duration="16" />
- <item android:drawable="@drawable/ic_rotate_24_08" android:duration="16" />
- <item android:drawable="@drawable/ic_rotate_24_09" android:duration="16" />
- <item android:drawable="@drawable/ic_rotate_24_10" android:duration="16" />
- <item android:drawable="@drawable/ic_rotate_24_11" android:duration="16" />
- <item android:drawable="@drawable/ic_rotate_24_12" android:duration="16" />
- <item android:drawable="@drawable/ic_rotate_24_13" android:duration="16" />
- <item android:drawable="@drawable/ic_rotate_24_14" android:duration="16" />
- <item android:drawable="@drawable/ic_rotate_24_15" android:duration="16" />
-</animation-list>
diff --git a/packages/SystemUI/res/drawable/ic_rotate_unlocked_anim.xml b/packages/SystemUI/res/drawable/ic_rotate_unlocked_anim.xml
deleted file mode 100644
index 63b8c5f..0000000
--- a/packages/SystemUI/res/drawable/ic_rotate_unlocked_anim.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-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.
--->
-<animation-list
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:oneshot="true">
- <item android:drawable="@drawable/ic_rotate_24_15" android:duration="16" />
- <item android:drawable="@drawable/ic_rotate_24_14" android:duration="16" />
- <item android:drawable="@drawable/ic_rotate_24_13" android:duration="16" />
- <item android:drawable="@drawable/ic_rotate_24_12" android:duration="16" />
- <item android:drawable="@drawable/ic_rotate_24_11" android:duration="16" />
- <item android:drawable="@drawable/ic_rotate_24_10" android:duration="16" />
- <item android:drawable="@drawable/ic_rotate_24_09" android:duration="16" />
- <item android:drawable="@drawable/ic_rotate_24_08" android:duration="16" />
- <item android:drawable="@drawable/ic_rotate_24_07" android:duration="16" />
- <item android:drawable="@drawable/ic_rotate_24_06" android:duration="16" />
- <item android:drawable="@drawable/ic_rotate_24_05" android:duration="16" />
- <item android:drawable="@drawable/ic_rotate_24_04" android:duration="16" />
- <item android:drawable="@drawable/ic_rotate_24_03" android:duration="16" />
- <item android:drawable="@drawable/ic_rotate_24_02" android:duration="16" />
- <item android:drawable="@drawable/ic_rotate_24_01" android:duration="16" />
-</animation-list>
diff --git a/packages/SystemUI/res/layout/qs_zen_mode_detail.xml b/packages/SystemUI/res/layout/qs_zen_mode_detail.xml
index 2df6d43..b73874a 100644
--- a/packages/SystemUI/res/layout/qs_zen_mode_detail.xml
+++ b/packages/SystemUI/res/layout/qs_zen_mode_detail.xml
@@ -19,8 +19,9 @@
android:layout_height="match_parent"
android:background="@color/system_secondary_color" >
- <com.android.systemui.qs.QSImageView
+ <ImageView
android:id="@android:id/button1"
+ android:src="@drawable/ic_qs_close"
android:layout_width="64dp"
android:layout_height="64dp"
android:layout_alignParentStart="true"
diff --git a/packages/SystemUI/res/layout/qs_zen_mode_detail_condition.xml b/packages/SystemUI/res/layout/qs_zen_mode_detail_condition.xml
index a5c8903..7e02bee 100644
--- a/packages/SystemUI/res/layout/qs_zen_mode_detail_condition.xml
+++ b/packages/SystemUI/res/layout/qs_zen_mode_detail_condition.xml
@@ -38,8 +38,9 @@
android:maxLines="1"
android:text="@string/accessibility_back" />
- <com.android.systemui.qs.QSImageView
+ <ImageView
android:id="@android:id/button1"
+ android:src="@drawable/ic_qs_plus"
android:layout_width="64dp"
android:layout_height="64dp"
android:layout_alignParentEnd="true"
@@ -47,8 +48,9 @@
android:padding="@dimen/quick_settings_panel_padding"
android:paddingRight="0px" />
- <com.android.systemui.qs.QSImageView
+ <ImageView
android:id="@android:id/button2"
+ android:src="@drawable/ic_qs_minus"
android:layout_width="64dp"
android:layout_height="64dp"
android:layout_alignParentEnd="true"
diff --git a/packages/SystemUI/res/values/colors.xml b/packages/SystemUI/res/values/colors.xml
index cba13004..77b4843 100644
--- a/packages/SystemUI/res/values/colors.xml
+++ b/packages/SystemUI/res/values/colors.xml
@@ -41,8 +41,6 @@
<color name="system_secondary_color">#ff384248</color>
<color name="system_accent_color">#ff7fcac3</color>
<color name="system_error_color">#fff0592b</color>
- <color name="quick_settings_tile_icon_enabled">#ffffffff</color>
- <color name="quick_settings_tile_icon_disabled">#ffcccccc</color>
<color name="quick_settings_tile_divider">#ff888888</color>
<color name="quick_settings_tile_text">#FFFFFFFF</color>
<color name="status_bar_clock_color">#FFFFFFFF</color>
diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml
index c15f25f..29955dd 100644
--- a/packages/SystemUI/res/values/dimens.xml
+++ b/packages/SystemUI/res/values/dimens.xml
@@ -284,7 +284,6 @@
<dimen name="quick_settings_tmp_scrim_stroke_width">8dp</dimen>
<dimen name="quick_settings_tmp_scrim_text_size">30dp</dimen>
<dimen name="quick_settings_panel_padding">16dp</dimen>
- <dimen name="quick_settings_tile_icon_outline">2dp</dimen>
<dimen name="quick_settings_tile_text_size">12sp</dimen>
<dimen name="quick_settings_tile_divider_height">1dp</dimen>
diff --git a/packages/SystemUI/src/com/android/systemui/qs/FilterCanvas.java b/packages/SystemUI/src/com/android/systemui/qs/FilterCanvas.java
deleted file mode 100644
index 05c8ee3..0000000
--- a/packages/SystemUI/src/com/android/systemui/qs/FilterCanvas.java
+++ /dev/null
@@ -1,79 +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 com.android.systemui.qs;
-
-import android.graphics.Canvas;
-import android.graphics.Matrix;
-import android.graphics.Paint;
-import android.graphics.Path;
-import android.graphics.Rect;
-
-/** Canvas that forwards calls to another canvas. Can be subclassed to transform drawing calls.
- * Temporary solution to runtime modification of a single drawable shape into two
- * enabled & disabled versions. See QSImageView. **/
-public class FilterCanvas extends Canvas {
- private final Canvas mCanvas;
-
- public FilterCanvas(Canvas c) {
- mCanvas = c;
- }
-
- @Override
- public void drawPath(Path path, Paint paint) {
- mCanvas.drawPath(path, paint);
- }
-
- @Override
- public int getSaveCount() {
- return mCanvas.getSaveCount();
- }
-
- @Override
- public int save() {
- return mCanvas.save();
- }
-
- @Override
- public void translate(float dx, float dy) {
- mCanvas.translate(dx, dy);
- }
-
- @Override
- public boolean clipRect(int left, int top, int right, int bottom) {
- return mCanvas.clipRect(left, top, right, bottom);
- }
-
- @Override
- public boolean clipRect(Rect rect) {
- return mCanvas.clipRect(rect);
- }
-
- @Override
- public void concat(Matrix matrix) {
- mCanvas.concat(matrix);
- }
-
- @Override
- public void restoreToCount(int saveCount) {
- mCanvas.restoreToCount(saveCount);
- }
-
- @Override
- public void drawRect(Rect r, Paint paint) {
- mCanvas.drawRect(r, paint);
- }
-}
\ No newline at end of file
diff --git a/packages/SystemUI/src/com/android/systemui/qs/GlobalSetting.java b/packages/SystemUI/src/com/android/systemui/qs/GlobalSetting.java
index 1e15b9f..c169df0 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/GlobalSetting.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/GlobalSetting.java
@@ -21,10 +21,10 @@
import android.os.Handler;
import android.provider.Settings.Global;
-import com.android.systemui.statusbar.policy.Disposable;
+import com.android.systemui.statusbar.policy.Listenable;
/** Helper for managing a global setting. **/
-public abstract class GlobalSetting extends ContentObserver implements Disposable {
+public abstract class GlobalSetting extends ContentObserver implements Listenable {
private final Context mContext;
private final String mSettingName;
@@ -34,8 +34,6 @@
super(handler);
mContext = context;
mSettingName = settingName;
- mContext.getContentResolver().registerContentObserver(
- Global.getUriFor(mSettingName), false, this);
}
public int getValue() {
@@ -47,8 +45,13 @@
}
@Override
- public void dispose() {
- mContext.getContentResolver().unregisterContentObserver(this);
+ public void setListening(boolean listening) {
+ if (listening) {
+ mContext.getContentResolver().registerContentObserver(
+ Global.getUriFor(mSettingName), false, this);
+ } else {
+ mContext.getContentResolver().unregisterContentObserver(this);
+ }
}
@Override
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSImageView.java b/packages/SystemUI/src/com/android/systemui/qs/QSImageView.java
deleted file mode 100644
index ed67560..0000000
--- a/packages/SystemUI/src/com/android/systemui/qs/QSImageView.java
+++ /dev/null
@@ -1,102 +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 com.android.systemui.qs;
-
-import android.content.Context;
-import android.content.res.Resources;
-import android.graphics.Canvas;
-import android.graphics.Paint;
-import android.graphics.Paint.Style;
-import android.graphics.Path;
-import android.graphics.drawable.Drawable;
-import android.graphics.drawable.VectorDrawable;
-import android.util.AttributeSet;
-import android.widget.ImageView;
-
-import com.android.systemui.R;
-
-/** ImageView that performs runtime modification of vector drawables (using FilterCanvas). **/
-public class QSImageView extends ImageView {
-
- private final int mOutlineWidth;
- private final int mColorEnabled;
- private final int mColorDisabled;
- private FilterCanvas mFilterCanvas;
- private Canvas mCanvas;
- private boolean mEnabledVersion = true;
- private boolean mFilter;
-
- public QSImageView(Context context) {
- this(context, null);
- }
-
- public QSImageView(Context context, AttributeSet attrs) {
- super(context, attrs);
- final Resources res = context.getResources();
- mOutlineWidth = res.getDimensionPixelSize(R.dimen.quick_settings_tile_icon_outline);
- mColorEnabled = res.getColor(R.color.quick_settings_tile_icon_enabled);
- mColorDisabled = res.getColor(R.color.quick_settings_tile_icon_disabled);
- }
-
- public void setEnabledVersion(boolean enabledVersion) {
- mEnabledVersion = enabledVersion;
- invalidate();
- }
-
- @Override
- public void setImageDrawable(Drawable drawable) {
- mFilter = drawable instanceof VectorDrawable;
- super.setImageDrawable(drawable);
- }
-
- @Override
- public void setImageResource(int resId) {
- setImageDrawable(mContext.getDrawable(resId));
- }
-
- @Override
- public void draw(Canvas canvas) {
- if (mFilter) {
- if (canvas != mCanvas) {
- mCanvas = canvas;
- mFilterCanvas = new QSFilterCanvas(canvas);
- }
- super.draw(mFilterCanvas);
- } else {
- super.draw(canvas);
- }
- }
-
- private class QSFilterCanvas extends FilterCanvas {
- public QSFilterCanvas(Canvas c) {
- super(c);
- }
-
- @Override
- public void drawPath(Path path, Paint paint) {
- if (mEnabledVersion) {
- paint.setColor(mColorEnabled);
- } else {
- paint.setStyle(Style.STROKE);
- paint.setStrokeJoin(Paint.Join.ROUND);
- paint.setColor(mColorDisabled);
- paint.setStrokeWidth(mOutlineWidth);
- }
- super.drawPath(path, paint);
- }
- }
-}
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java
index afb5483..6176eb6 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java
@@ -80,7 +80,10 @@
showDetail(false /*show*/, mDetailRecord);
}
for (TileRecord r : mRecords) {
- r.tile.setShown(expanded);
+ r.tile.setListening(expanded);
+ if (expanded) {
+ r.tile.refreshState();
+ }
}
}
@@ -125,6 +128,7 @@
}
};
r.tileView.init(click, clickSecondary);
+ r.tile.refreshState();
mRecords.add(r);
addView(r.tileView);
@@ -156,24 +160,29 @@
mCellHeight = (int)(mCellWidth / TILE_ASPECT);
mLargeCellWidth = (int)(mCellWidth * LARGE_TILE_FACTOR);
mLargeCellHeight = (int)(mCellHeight * LARGE_TILE_FACTOR);
- int r = 0;
- int c = 0;
+ int r = -1;
+ int c = -1;
int rows = 0;
+ boolean rowIsDual = false;
for (TileRecord record : mRecords) {
if (record.tileView.getVisibility() == GONE) continue;
+ // wrap to next column if we've reached the max # of columns
+ // also don't allow dual + single tiles on the same row
+ if (r == -1 || c == (mColumns - 1) || rowIsDual != record.tile.supportsDualTargets()) {
+ r++;
+ c = 0;
+ rowIsDual = record.tile.supportsDualTargets();
+ } else {
+ c++;
+ }
record.row = r;
record.col = c;
rows = r + 1;
- c++;
- if (c == mColumns /*end of normal column*/ || r == 0 && c == 2 /*end of 1st column*/) {
- c = 0;
- r++;
- }
}
for (TileRecord record : mRecords) {
if (record.tileView.getVisibility() == GONE) continue;
- record.tileView.setDual(record.row == 0);
+ record.tileView.setDual(record.tile.supportsDualTargets());
final int cw = record.row == 0 ? mLargeCellWidth : mCellWidth;
final int ch = record.row == 0 ? mLargeCellHeight : mCellHeight;
record.tileView.measure(exactly(cw), exactly(ch));
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSTile.java b/packages/SystemUI/src/com/android/systemui/qs/QSTile.java
index 05f308d..2be364b 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSTile.java
@@ -30,7 +30,7 @@
import com.android.systemui.qs.QSTile.State;
import com.android.systemui.statusbar.policy.BluetoothController;
import com.android.systemui.statusbar.policy.CastController;
-import com.android.systemui.statusbar.policy.Disposable;
+import com.android.systemui.statusbar.policy.Listenable;
import com.android.systemui.statusbar.policy.LocationController;
import com.android.systemui.statusbar.policy.NetworkController;
import com.android.systemui.statusbar.policy.RotationLockController;
@@ -47,8 +47,9 @@
* handleUpdateState. Callbacks affecting state should use refreshState to trigger another
* state update pass on tile looper.
*/
-public abstract class QSTile<TState extends State> implements Disposable {
- private final String TAG = "QSTile." + getClass().getSimpleName();
+public abstract class QSTile<TState extends State> implements Listenable {
+ protected final String TAG = "QSTile." + getClass().getSimpleName();
+ protected static final boolean DEBUG = false;
protected final Host mHost;
protected final Context mContext;
@@ -69,6 +70,10 @@
mHandler = new H(host.getLooper());
}
+ public boolean supportsDualTargets() {
+ return false;
+ }
+
public Host getHost() {
return mHost;
}
@@ -111,10 +116,6 @@
mHandler.obtainMessage(H.USER_SWITCH, newUserId).sendToTarget();
}
- public void setShown(boolean shown) {
- mHandler.obtainMessage(H.SHOWN, shown ? 1 : 0, 0).sendToTarget();
- }
-
// call only on tile worker looper
private void handleSetCallback(Callback callback) {
@@ -126,10 +127,6 @@
// optional
}
- protected void handleShown(boolean shown) {
- // optional, discouraged
- }
-
protected void handleRefreshState(Object arg) {
handleUpdateState(mTmpState, arg);
final boolean changed = mTmpState.copyTo(mState);
@@ -161,7 +158,6 @@
private static final int REFRESH_STATE = 4;
private static final int SHOW_DETAIL = 5;
private static final int USER_SWITCH = 6;
- private static final int SHOWN = 7;
private H(Looper looper) {
super(looper);
@@ -189,9 +185,6 @@
} else if (msg.what == USER_SWITCH) {
name = "handleUserSwitch";
handleUserSwitch(msg.arg1);
- } else if (msg.what == SHOWN) {
- name = "handleShown";
- handleShown(msg.arg1 != 0);
}
} catch (Throwable t) {
final String error = "Error in " + name;
@@ -212,7 +205,6 @@
void collapsePanels();
Looper getLooper();
Context getContext();
- VectorDrawable getVectorDrawable(int resId);
BluetoothController getBluetoothController();
LocationController getLocationController();
RotationLockController getRotationLockController();
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSTileView.java b/packages/SystemUI/src/com/android/systemui/qs/QSTileView.java
index 17a95fb..31aefe9 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSTileView.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSTileView.java
@@ -28,6 +28,7 @@
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
+import android.widget.ImageView;
import android.widget.ImageView.ScaleType;
import android.widget.TextView;
@@ -98,7 +99,7 @@
}
protected View createIcon() {
- QSImageView icon = new QSImageView(mContext);
+ final ImageView icon = new ImageView(mContext);
icon.setId(android.R.id.icon);
icon.setScaleType(ScaleType.CENTER_INSIDE);
return icon;
@@ -156,15 +157,12 @@
}
protected void handleStateChanged(QSTile.State state) {
- if (mIcon instanceof QSImageView) {
- QSImageView qsiv = (QSImageView) mIcon;
+ if (mIcon instanceof ImageView) {
+ ImageView iv = (ImageView) mIcon;
if (state.icon != null) {
- qsiv.setImageDrawable(state.icon);
+ iv.setImageDrawable(state.icon);
} else if (state.iconId > 0) {
- qsiv.setImageResource(state.iconId);
- }
- if (state.icon != null && state instanceof QSTile.BooleanState) {
- qsiv.setEnabledVersion(((QSTile.BooleanState)state).value);
+ iv.setImageResource(state.iconId);
}
}
mLabel.setText(state.label);
diff --git a/packages/SystemUI/src/com/android/systemui/qs/SecureSetting.java b/packages/SystemUI/src/com/android/systemui/qs/SecureSetting.java
index 4debaa9..3ed3d30 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/SecureSetting.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/SecureSetting.java
@@ -21,10 +21,10 @@
import android.os.Handler;
import android.provider.Settings.Secure;
-import com.android.systemui.statusbar.policy.Disposable;
+import com.android.systemui.statusbar.policy.Listenable;
/** Helper for managing a secure setting. **/
-public abstract class SecureSetting extends ContentObserver implements Disposable {
+public abstract class SecureSetting extends ContentObserver implements Listenable {
private final Context mContext;
private final String mSettingName;
@@ -38,8 +38,7 @@
}
public void rebindForCurrentUser() {
- mContext.getContentResolver().registerContentObserver(
- Secure.getUriFor(mSettingName), false, this);
+ setListening(true);
}
public int getValue() {
@@ -51,8 +50,13 @@
}
@Override
- public void dispose() {
- mContext.getContentResolver().unregisterContentObserver(this);
+ public void setListening(boolean listening) {
+ if (listening) {
+ mContext.getContentResolver().registerContentObserver(
+ Secure.getUriFor(mSettingName), false, this);
+ } else {
+ mContext.getContentResolver().unregisterContentObserver(this);
+ }
}
@Override
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/AirplaneModeTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/AirplaneModeTile.java
index 5fe8422..c0f9bf2 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/AirplaneModeTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/AirplaneModeTile.java
@@ -39,11 +39,6 @@
handleRefreshState(value);
}
};
-
- final IntentFilter filter = new IntentFilter();
- filter.addAction(Intent.ACTION_AIRPLANE_MODE_CHANGED);
- mContext.registerReceiver(mReceiver, filter);
- refreshState();
}
@Override
@@ -70,7 +65,6 @@
state.value = airplaneMode;
state.visible = true;
state.label = mContext.getString(R.string.quick_settings_airplane_mode_label);
- state.icon = mHost.getVectorDrawable(R.drawable.ic_qs_airplane);
if (airplaneMode) {
state.iconId = R.drawable.ic_qs_airplane_on;
state.contentDescription = mContext.getString(
@@ -84,9 +78,15 @@
}
}
- public void dispose() {
- mSetting.dispose();
- mContext.unregisterReceiver(mReceiver);
+ public void setListening(boolean listening) {
+ if (listening) {
+ final IntentFilter filter = new IntentFilter();
+ filter.addAction(Intent.ACTION_AIRPLANE_MODE_CHANGED);
+ mContext.registerReceiver(mReceiver, filter);
+ } else {
+ mContext.unregisterReceiver(mReceiver);
+ }
+ mSetting.setListening(listening);
}
private final BroadcastReceiver mReceiver = new BroadcastReceiver() {
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/BluetoothTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/BluetoothTile.java
index 60a6047..7335ab4 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/BluetoothTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/BluetoothTile.java
@@ -33,7 +33,11 @@
public BluetoothTile(Host host) {
super(host);
mController = host.getBluetoothController();
- mController.addStateChangedCallback(mCallback);
+ }
+
+ @Override
+ public boolean supportsDualTargets() {
+ return true;
}
@Override
@@ -42,8 +46,12 @@
}
@Override
- public void dispose() {
- mController.removeStateChangedCallback(mCallback);
+ public void setListening(boolean listening) {
+ if (listening) {
+ mController.addStateChangedCallback(mCallback);
+ } else {
+ mController.removeStateChangedCallback(mCallback);
+ }
}
@Override
@@ -64,14 +72,13 @@
final boolean connected = mController.isBluetoothConnected();
state.visible = supported;
state.value = enabled;
- state.icon = mHost.getVectorDrawable(R.drawable.ic_qs_bluetooth);
final String stateContentDescription;
if (enabled) {
if (connected) {
- state.iconId = R.drawable.ic_qs_bluetooth_on;
+ state.iconId = R.drawable.ic_qs_bluetooth_connected;
stateContentDescription = mContext.getString(R.string.accessibility_desc_connected);
} else {
- state.iconId = R.drawable.ic_qs_bluetooth_not_connected;
+ state.iconId = R.drawable.ic_qs_bluetooth_on;
stateContentDescription = mContext.getString(R.string.accessibility_desc_on);
}
state.label = mContext.getString(R.string.quick_settings_bluetooth_label);
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/BugreportTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/BugreportTile.java
index 0e9b9a7..81ea0eb 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/BugreportTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/BugreportTile.java
@@ -51,8 +51,8 @@
}
@Override
- public void dispose() {
- mSetting.dispose();
+ public void setListening(boolean listening) {
+ mSetting.setListening(listening);
}
@Override
@@ -64,8 +64,7 @@
@Override
protected void handleUpdateState(State state, Object pushArg) {
state.visible = mSetting.getValue() != 0;
- state.iconId = com.android.internal.R.drawable.stat_sys_adb;
- state.icon = mHost.getVectorDrawable(R.drawable.ic_qs_bugreport);
+ state.iconId = R.drawable.ic_qs_bugreport;
state.label = mContext.getString(com.android.internal.R.string.bugreport_title);
}
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/CastTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/CastTile.java
index a3eaa2c..d0a1246 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/CastTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/CastTile.java
@@ -35,14 +35,9 @@
private final CastController mController;
- private boolean mShown;
-
public CastTile(Host host) {
super(host);
mController = host.getCastController();
- if (mController != null) {
- mController.addCallback(mCallback);
- }
}
@Override
@@ -51,9 +46,14 @@
}
@Override
- public void dispose() {
+ public void setListening(boolean listening) {
if (mController == null) return;
- mController.removeCallback(mCallback);
+ if (listening) {
+ mController.addCallback(mCallback);
+ } else {
+ mController.removeCallback(mCallback);
+ }
+ mController.setDiscovering(listening);
}
@Override
@@ -64,14 +64,6 @@
}
@Override
- protected void handleShown(boolean shown) {
- if (mShown == shown) return;
- if (mController == null) return;
- mShown = shown;
- mController.setDiscovering(mShown);
- }
-
- @Override
protected void handleClick() {
mHost.collapsePanels();
mUiHandler.post(mShowDialog);
@@ -82,13 +74,13 @@
state.visible = true;
state.label = mContext
.getString(R.string.quick_settings_remote_display_no_connection_label);
- state.icon = mHost.getVectorDrawable(R.drawable.ic_qs_cast);
if (arg instanceof CallbackInfo) {
final CallbackInfo cb = (CallbackInfo) arg;
if (cb.connectedRouteName != null) {
state.value = !cb.connecting;
}
}
+ state.iconId = state.value ? R.drawable.ic_qs_cast_on : R.drawable.ic_qs_cast_off;
}
private static class CallbackInfo {
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java
index 86a4e79..182a0ce 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java
@@ -38,7 +38,6 @@
public CellularTile(Host host) {
super(host);
mController = host.getNetworkController();
- mController.addNetworkSignalChangedCallback(mCallback);
}
@Override
@@ -47,8 +46,12 @@
}
@Override
- public void dispose() {
- mController.removeNetworkSignalChangedCallback(mCallback);
+ public void setListening(boolean listening) {
+ if (listening) {
+ mController.addNetworkSignalChangedCallback(mCallback);
+ } else {
+ mController.removeNetworkSignalChangedCallback(mCallback);
+ }
}
@Override
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/ColorInversionTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/ColorInversionTile.java
index 66740af..5301362 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/ColorInversionTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/ColorInversionTile.java
@@ -39,8 +39,6 @@
handleRefreshState(value);
}
};
-
- refreshState();
}
@Override
@@ -49,8 +47,8 @@
}
@Override
- public void dispose() {
- mSetting.dispose();
+ public void setListening(boolean listening) {
+ mSetting.setListening(listening);
}
@Override
@@ -73,6 +71,6 @@
state.visible = mVisible;
state.value = enabled;
state.label = mContext.getString(R.string.quick_settings_inversion_label);
- state.icon = mHost.getVectorDrawable(R.drawable.ic_qs_invert_colors);
+ state.iconId = R.drawable.ic_qs_color_inversion;
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/HotspotTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/HotspotTile.java
index 1a67afc..f2ba558 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/HotspotTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/HotspotTile.java
@@ -42,7 +42,7 @@
}
@Override
- public void dispose() {
+ public void setListening(boolean listening) {
}
@@ -55,6 +55,6 @@
protected void handleUpdateState(State state, Object arg) {
state.visible = mController != null;
state.label = mContext.getString(R.string.quick_settings_hotspot_label);
- state.icon = mHost.getVectorDrawable(R.drawable.ic_qs_hotspot);
+ state.iconId = R.drawable.ic_qs_hotspot_off;
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/LocationTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/LocationTile.java
index 176e05c..c5ad9e6 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/LocationTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/LocationTile.java
@@ -31,7 +31,6 @@
public LocationTile(Host host) {
super(host);
mController = host.getLocationController();
- mController.addSettingsChangedCallback(mCallback);
}
@Override
@@ -39,8 +38,13 @@
return new BooleanState();
}
- public void dispose() {
- mController.removeSettingsChangedCallback(mCallback);
+ @Override
+ public void setListening(boolean listening) {
+ if (listening) {
+ mController.addSettingsChangedCallback(mCallback);
+ } else {
+ mController.removeSettingsChangedCallback(mCallback);
+ }
}
@Override
@@ -61,8 +65,8 @@
if (state.value != locationEnabled) {
state.value = locationEnabled;
final AnimationDrawable d = (AnimationDrawable) mContext.getDrawable(locationEnabled
- ? R.drawable.ic_location_on_anim
- : R.drawable.ic_location_off_anim);
+ ? R.drawable.ic_qs_location_on
+ : R.drawable.ic_qs_location_off);
state.icon = d;
mUiHandler.post(new Runnable() {
@Override
@@ -71,15 +75,14 @@
}
});
}
- //state.icon = mHost.getVectorDrawable(R.drawable.ic_qs_location);
if (locationEnabled) {
- if (state.icon == null) state.iconId = R.drawable.ic_location_24_01;
+ if (state.icon == null) state.iconId = R.drawable.ic_qs_location_01;
state.label = mContext.getString(R.string.quick_settings_location_label);
state.contentDescription = mContext.getString(
R.string.accessibility_quick_settings_location,
mContext.getString(R.string.accessibility_desc_on));
} else {
- if (state.icon == null) state.iconId = R.drawable.ic_location_24_11;
+ if (state.icon == null) state.iconId = R.drawable.ic_qs_location_11;
state.label = mContext.getString(R.string.quick_settings_location_off_label);
state.contentDescription = mContext.getString(
R.string.accessibility_quick_settings_location,
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/RingerModeTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/RingerModeTile.java
index 36a579c..c5e9b52 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/RingerModeTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/RingerModeTile.java
@@ -33,8 +33,6 @@
public RingerModeTile(Host host) {
super(host);
mAudioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);
- final IntentFilter filter = new IntentFilter(AudioManager.RINGER_MODE_CHANGED_ACTION);
- mContext.registerReceiver(mReceiver, filter);
}
@Override
@@ -43,8 +41,13 @@
}
@Override
- public void dispose() {
- mContext.unregisterReceiver(mReceiver);
+ public void setListening(boolean listening) {
+ if (listening) {
+ final IntentFilter filter = new IntentFilter(AudioManager.RINGER_MODE_CHANGED_ACTION);
+ mContext.registerReceiver(mReceiver, filter);
+ } else {
+ mContext.unregisterReceiver(mReceiver);
+ }
}
@Override
@@ -64,13 +67,13 @@
state.visible = true;
state.value = ringerMode;
if (ringerMode == AudioManager.RINGER_MODE_VIBRATE) {
- state.icon = mHost.getVectorDrawable(R.drawable.ic_qs_ringer_vibrate);
+ state.iconId = R.drawable.ic_qs_ringer_vibrate;
state.label = "Vibrate";
} else if (ringerMode == AudioManager.RINGER_MODE_SILENT) {
- state.icon = mHost.getVectorDrawable(R.drawable.ic_qs_ringer_silent);
+ state.iconId = R.drawable.ic_qs_ringer_silent;
state.label = "Silent";
} else {
- state.icon = mHost.getVectorDrawable(R.drawable.ic_qs_ringer_audible);
+ state.iconId = R.drawable.ic_qs_ringer_audible;
state.label = "Audible";
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/RotationLockTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/RotationLockTile.java
index d075299..1b0967b 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/RotationLockTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/RotationLockTile.java
@@ -33,8 +33,6 @@
public RotationLockTile(Host host) {
super(host);
mController = host.getRotationLockController();
- if (mController == null) return;
- mController.addRotationLockControllerCallback(mCallback);
}
@Override
@@ -42,9 +40,13 @@
return new BooleanState();
}
- public void dispose() {
+ public void setListening(boolean listening) {
if (mController == null) return;
- mController.removeRotationLockControllerCallback(mCallback);
+ if (listening) {
+ mController.addRotationLockControllerCallback(mCallback);
+ } else {
+ mController.removeRotationLockControllerCallback(mCallback);
+ }
}
@Override
@@ -61,8 +63,8 @@
if (state.value != rotationLocked) {
state.value = rotationLocked;
final AnimationDrawable d = (AnimationDrawable) mContext.getDrawable(rotationLocked
- ? R.drawable.ic_rotate_locked_anim
- : R.drawable.ic_rotate_unlocked_anim);
+ ? R.drawable.ic_qs_rotation_locked
+ : R.drawable.ic_qs_rotation_unlocked);
state.icon = d;
mUiHandler.post(new Runnable() {
@Override
@@ -80,12 +82,12 @@
: R.string.quick_settings_rotation_locked_label;
state.label = mContext.getString(label);
if (state.icon == null) {
- state.icon = mContext.getDrawable(R.drawable.ic_rotate_24_15);
+ state.icon = mContext.getDrawable(R.drawable.ic_qs_rotation_15);
}
} else {
state.label = mContext.getString(R.string.quick_settings_rotation_unlocked_label);
if (state.icon == null) {
- state.icon = mContext.getDrawable(R.drawable.ic_rotate_24_01);
+ state.icon = mContext.getDrawable(R.drawable.ic_qs_rotation_01);
}
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/WifiTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/WifiTile.java
index e08a6fa..ef7fb89 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/WifiTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/WifiTile.java
@@ -20,6 +20,7 @@
import android.content.Intent;
import android.content.res.Resources;
import android.provider.Settings;
+import android.util.Log;
import com.android.systemui.R;
import com.android.systemui.qs.QSTile;
@@ -37,7 +38,11 @@
public WifiTile(Host host) {
super(host);
mController = host.getNetworkController();
- mController.addNetworkSignalChangedCallback(mCallback);
+ }
+
+ @Override
+ public boolean supportsDualTargets() {
+ return true;
}
@Override
@@ -46,8 +51,12 @@
}
@Override
- public void dispose() {
- mController.removeNetworkSignalChangedCallback(mCallback);
+ public void setListening(boolean listening) {
+ if (listening) {
+ mController.addNetworkSignalChangedCallback(mCallback);
+ } else {
+ mController.removeNetworkSignalChangedCallback(mCallback);
+ }
}
@Override
@@ -67,8 +76,9 @@
@Override
protected void handleUpdateState(SignalState state, Object arg) {
- if (arg == null) return;
state.visible = true;
+ if (DEBUG) Log.d(TAG, "handleUpdateState arg=" + arg);
+ if (arg == null) return;
CallbackInfo cb = (CallbackInfo) arg;
boolean wifiConnected = cb.enabled && (cb.wifiSignalIconId > 0) && (cb.enabledDesc != null);
@@ -114,6 +124,18 @@
boolean activityIn;
boolean activityOut;
String wifiSignalContentDescription;
+
+ @Override
+ public String toString() {
+ return new StringBuilder("CallbackInfo[")
+ .append("enabled=").append(enabled)
+ .append(",wifiSignalIconId=").append(wifiSignalIconId)
+ .append(",enabledDesc=").append(enabledDesc)
+ .append(",activityIn=").append(activityIn)
+ .append(",activityOut=").append(activityOut)
+ .append(",wifiSignalContentDescription=").append(wifiSignalContentDescription)
+ .append(']').toString();
+ }
}
private final NetworkSignalChangedCallback mCallback = new NetworkSignalChangedCallback() {
@@ -121,6 +143,7 @@
public void onWifiSignalChanged(boolean enabled, int wifiSignalIconId,
boolean activityIn, boolean activityOut,
String wifiSignalContentDescriptionId, String description) {
+ if (DEBUG) Log.d(TAG, "onWifiSignalChanged enabled=" + enabled);
final CallbackInfo info = new CallbackInfo();
info.enabled = enabled;
info.wifiSignalIconId = wifiSignalIconId;
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/ZenModeDetail.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/ZenModeDetail.java
index dceb856..2edefe7 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/ZenModeDetail.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/ZenModeDetail.java
@@ -32,6 +32,7 @@
import android.widget.ArrayAdapter;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
+import android.widget.ImageView;
import android.widget.ListView;
import android.widget.RadioButton;
import android.widget.RelativeLayout;
@@ -39,7 +40,6 @@
import android.widget.TextView;
import com.android.systemui.R;
-import com.android.systemui.qs.QSImageView;
import com.android.systemui.qs.QSTile;
import com.android.systemui.statusbar.policy.ZenModeController;
@@ -72,9 +72,7 @@
mContext = getContext();
mController = mHost.getZenModeController();
- final QSImageView close = (QSImageView) findViewById(android.R.id.button1);
- close.setImageDrawable(mHost.getVectorDrawable(R.drawable.ic_qs_close));
- close.setEnabledVersion(true);
+ final ImageView close = (ImageView) findViewById(android.R.id.button1);
close.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
@@ -239,9 +237,7 @@
title.setText(condition.summary);
title.setEnabled(enabled);
title.setAlpha(enabled ? 1 : .5f);
- final QSImageView button1 = (QSImageView) row.findViewById(android.R.id.button1);
- button1.setImageDrawable(mHost.getVectorDrawable(R.drawable.ic_qs_minus));
- button1.setEnabledVersion(true);
+ final ImageView button1 = (ImageView) row.findViewById(android.R.id.button1);
button1.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
@@ -250,9 +246,7 @@
}
});
- final QSImageView button2 = (QSImageView) row.findViewById(android.R.id.button2);
- button2.setImageDrawable(mHost.getVectorDrawable(R.drawable.ic_qs_plus));
- button2.setEnabledVersion(true);
+ final ImageView button2 = (ImageView) row.findViewById(android.R.id.button2);
button2.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/ZenModeTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/ZenModeTile.java
index 83918e8..bfa9c19 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/ZenModeTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/ZenModeTile.java
@@ -17,6 +17,7 @@
package com.android.systemui.qs.tiles;
import android.content.Context;
+import android.util.Log;
import android.view.ContextThemeWrapper;
import android.view.LayoutInflater;
import android.view.View;
@@ -33,7 +34,6 @@
public ZenModeTile(Host host) {
super(host);
mController = host.getZenModeController();
- mController.addCallback(mCallback);
}
@Override
@@ -51,8 +51,12 @@
}
@Override
- public void dispose() {
- mController.removeCallback(mCallback);
+ public void setListening(boolean listening) {
+ if (listening) {
+ mController.addCallback(mCallback);
+ } else {
+ mController.removeCallback(mCallback);
+ }
}
@Override
@@ -69,14 +73,14 @@
final boolean zen = arg instanceof Boolean ? (Boolean)arg : mController.isZen();
state.value = zen;
state.visible = true;
- state.iconId = R.drawable.stat_sys_zen_limited;
- state.icon = mHost.getVectorDrawable(R.drawable.ic_qs_zen);
+ state.iconId = zen ? R.drawable.ic_qs_zen_on : R.drawable.ic_qs_zen_off;
state.label = mContext.getString(R.string.zen_mode_title);
}
private final ZenModeController.Callback mCallback = new ZenModeController.Callback() {
@Override
public void onZenChanged(boolean zen) {
+ if (DEBUG) Log.d(TAG, "onZenChanged " + zen);
refreshState(zen);
}
};
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/InterceptedNotifications.java b/packages/SystemUI/src/com/android/systemui/statusbar/InterceptedNotifications.java
index 6401695..9c39002 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/InterceptedNotifications.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/InterceptedNotifications.java
@@ -89,7 +89,7 @@
return;
}
final Notification n = new Notification.Builder(mContext)
- .setSmallIcon(R.drawable.stat_sys_zen_limited)
+ .setSmallIcon(R.drawable.ic_qs_zen_on)
.setContentTitle(mContext.getResources().getQuantityString(
R.plurals.zen_mode_notification_title,
mIntercepted.size(), mIntercepted.size()))
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
index a92061f..f56dadd 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -619,7 +619,7 @@
mMoreIcon = mStatusBarView.findViewById(R.id.moreIcon);
mNotificationIcons.setOverflowIndicator(mMoreIcon);
mModeIcon = (ImageView)mStatusBarView.findViewById(R.id.modeIcon);
- mModeIcon.setImageResource(R.drawable.stat_sys_zen_limited);
+ mModeIcon.setImageResource(R.drawable.ic_qs_zen_on);
mStatusBarContents = (LinearLayout)mStatusBarView.findViewById(R.id.status_bar_contents);
mTickerView = mStatusBarView.findViewById(R.id.ticker);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QSTileHost.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QSTileHost.java
index 1fe3be5..34d143a 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QSTileHost.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QSTileHost.java
@@ -18,7 +18,6 @@
import android.content.Context;
import android.content.Intent;
-import android.graphics.drawable.VectorDrawable;
import android.os.HandlerThread;
import android.os.Looper;
@@ -137,11 +136,6 @@
}
@Override
- public VectorDrawable getVectorDrawable(int resId) {
- return (VectorDrawable) mContext.getDrawable(resId);
- }
-
- @Override
public BluetoothController getBluetoothController() {
return mBluetooth;
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeaderView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeaderView.java
index 2305445..36b063b 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeaderView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeaderView.java
@@ -86,6 +86,7 @@
(ImageView) findViewById(R.id.brightness_icon),
(ToggleSlider) findViewById(R.id.brightness_slider));
loadDimens();
+ updateVisibilities();
}
private void loadDimens() {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothControllerImpl.java
index 1c7119f..5a19881 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothControllerImpl.java
@@ -59,6 +59,7 @@
public void addStateChangedCallback(BluetoothStateChangeCallback cb) {
mChangeCallbacks.add(cb);
+ fireCallback(cb);
}
@Override
@@ -131,7 +132,11 @@
private void fireCallbacks() {
for (BluetoothStateChangeCallback cb : mChangeCallbacks) {
- cb.onBluetoothStateChange(mEnabled);
+ fireCallback(cb);
}
}
+
+ private void fireCallback(BluetoothStateChangeCallback cb) {
+ cb.onBluetoothStateChange(mEnabled);
+ }
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/CastControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/CastControllerImpl.java
index 33a85b1..bcd865c 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/CastControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/CastControllerImpl.java
@@ -28,6 +28,10 @@
private final ArrayList<Callback> mCallbacks = new ArrayList<Callback>();
private final MediaRouter mMediaRouter;
+ private boolean mEnabled;
+ private boolean mConnecting;
+ private String mConnectedRouteName;
+
public CastControllerImpl(Context context) {
mMediaRouter = (MediaRouter) context.getSystemService(Context.MEDIA_ROUTER_SERVICE);
}
@@ -35,6 +39,7 @@
@Override
public void addCallback(Callback callback) {
mCallbacks.add(callback);
+ fireStateChanged(callback);
}
@Override
@@ -76,12 +81,23 @@
if (connectedRoute != null) {
connectedRouteName = connectedRoute.getName().toString();
}
- fireStateChanged(enabled, connecting, connectedRouteName);
+ synchronized(mCallbacks) {
+ mEnabled = enabled;
+ mConnecting = connecting;
+ mConnectedRouteName = connectedRouteName;
+ }
+ fireStateChanged();
}
- private void fireStateChanged(boolean enabled, boolean connecting, String connectedRouteName) {
+ private void fireStateChanged() {
for (Callback callback : mCallbacks) {
- callback.onStateChanged(enabled, connecting, connectedRouteName);
+ fireStateChanged(callback);
+ }
+ }
+
+ private void fireStateChanged(Callback callback) {
+ synchronized(mCallbacks) {
+ callback.onStateChanged(mEnabled, mConnecting, mConnectedRouteName);
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/Disposable.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/Listenable.java
similarity index 82%
rename from packages/SystemUI/src/com/android/systemui/statusbar/policy/Disposable.java
rename to packages/SystemUI/src/com/android/systemui/statusbar/policy/Listenable.java
index 158e9c1..4fa59fd 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/Disposable.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/Listenable.java
@@ -16,7 +16,7 @@
package com.android.systemui.statusbar.policy;
-/** Common interface for items requiring manual cleanup. **/
-public interface Disposable {
- void dispose();
+/** Common interface for components with an active listening state. **/
+public interface Listenable {
+ void setListening(boolean listening);
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/LocationControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/LocationControllerImpl.java
index 9e5ad18..d5b2548 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/LocationControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/LocationControllerImpl.java
@@ -92,6 +92,7 @@
*/
public void addSettingsChangedCallback(LocationSettingsChangeCallback cb) {
mSettingsChangeCallbacks.add(cb);
+ locationSettingsChanged(cb);
}
public void removeSettingsChangedCallback(LocationSettingsChangeCallback cb) {
@@ -204,6 +205,10 @@
}
}
+ private void locationSettingsChanged(LocationSettingsChangeCallback cb) {
+ cb.onLocationSettingsChanged(isLocationEnabled());
+ }
+
@Override
public void onReceive(Context context, Intent intent) {
final String action = intent.getAction();
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/RotationLockController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/RotationLockController.java
index 1eb678d..93c4691 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/RotationLockController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/RotationLockController.java
@@ -16,7 +16,7 @@
package com.android.systemui.statusbar.policy;
-public interface RotationLockController extends Disposable {
+public interface RotationLockController extends Listenable {
int getRotationLockOrientation();
boolean isRotationLockAffordanceVisible();
boolean isRotationLocked();
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/RotationLockControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/RotationLockControllerImpl.java
index caa07ef..c3bcd94 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/RotationLockControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/RotationLockControllerImpl.java
@@ -39,12 +39,12 @@
public RotationLockControllerImpl(Context context) {
mContext = context;
- RotationPolicy.registerRotationPolicyListener(mContext,
- mRotationPolicyListener, UserHandle.USER_ALL);
+ setListening(true);
}
public void addRotationLockControllerCallback(RotationLockControllerCallback callback) {
mCallbacks.add(callback);
+ notifyChanged(callback);
}
public void removeRotationLockControllerCallback(RotationLockControllerCallback callback) {
@@ -68,14 +68,23 @@
}
@Override
- public void dispose() {
- RotationPolicy.unregisterRotationPolicyListener(mContext, mRotationPolicyListener);
+ public void setListening(boolean listening) {
+ if (listening) {
+ RotationPolicy.registerRotationPolicyListener(mContext, mRotationPolicyListener,
+ UserHandle.USER_ALL);
+ } else {
+ RotationPolicy.unregisterRotationPolicyListener(mContext, mRotationPolicyListener);
+ }
}
private void notifyChanged() {
for (RotationLockControllerCallback callback : mCallbacks) {
- callback.onRotationLockStateChanged(RotationPolicy.isRotationLocked(mContext),
- RotationPolicy.isRotationLockToggleVisible(mContext));
+ notifyChanged(callback);
}
}
+
+ private void notifyChanged(RotationLockControllerCallback callback) {
+ callback.onRotationLockStateChanged(RotationPolicy.isRotationLocked(mContext),
+ RotationPolicy.isRotationLockToggleVisible(mContext));
+ }
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/ZenModeControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/ZenModeControllerImpl.java
index d760f78..adf2935 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/ZenModeControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/ZenModeControllerImpl.java
@@ -52,6 +52,7 @@
fireZenChanged(value != 0);
}
};
+ mSetting.setListening(true);
mNoMan = INotificationManager.Stub.asInterface(
ServiceManager.getService(Context.NOTIFICATION_SERVICE));
}
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindow.java b/policy/src/com/android/internal/policy/impl/PhoneWindow.java
index e204cb2..2fea785 100644
--- a/policy/src/com/android/internal/policy/impl/PhoneWindow.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindow.java
@@ -36,6 +36,7 @@
import com.android.internal.widget.ActionBarContextView;
import com.android.internal.widget.ActionBarOverlayLayout;
import com.android.internal.widget.ActionBarView;
+import com.android.internal.widget.DecorContentParent;
import com.android.internal.widget.SwipeDismissLayout;
import android.app.ActivityManager;
@@ -147,7 +148,7 @@
private TextView mTitleView;
- private ActionBarView mActionBar;
+ private DecorContentParent mDecorContentParent;
private ActionMenuPresenterCallback mActionMenuPresenterCallback;
private PanelMenuPresenterCallback mPanelMenuPresenterCallback;
@@ -441,8 +442,8 @@
public void setTitle(CharSequence title) {
if (mTitleView != null) {
mTitleView.setText(title);
- } else if (mActionBar != null) {
- mActionBar.setWindowTitle(title);
+ } else if (mDecorContentParent != null) {
+ mDecorContentParent.setWindowTitle(title);
}
mTitle = title;
}
@@ -489,10 +490,10 @@
final boolean isActionBarMenu =
(st.featureId == FEATURE_OPTIONS_PANEL || st.featureId == FEATURE_ACTION_BAR);
- if (isActionBarMenu && mActionBar != null) {
+ if (isActionBarMenu && mDecorContentParent != null) {
// Enforce ordering guarantees around events so that the action bar never
// dispatches menu-related events before the panel is prepared.
- mActionBar.setMenuPrepared();
+ mDecorContentParent.setMenuPrepared();
}
if (st.createdPanelView == null) {
@@ -504,11 +505,11 @@
}
}
- if (isActionBarMenu && mActionBar != null) {
+ if (isActionBarMenu && mDecorContentParent != null) {
if (mActionMenuPresenterCallback == null) {
mActionMenuPresenterCallback = new ActionMenuPresenterCallback();
}
- mActionBar.setMenu(st.menu, mActionMenuPresenterCallback);
+ mDecorContentParent.setMenu(st.menu, mActionMenuPresenterCallback);
}
// Call callback, and return if it doesn't want to display menu.
@@ -520,9 +521,9 @@
// Ditch the menu created above
st.setMenu(null);
- if (isActionBarMenu && mActionBar != null) {
+ if (isActionBarMenu && mDecorContentParent != null) {
// Don't show it in the action bar either
- mActionBar.setMenu(null, mActionMenuPresenterCallback);
+ mDecorContentParent.setMenu(null, mActionMenuPresenterCallback);
}
return false;
@@ -545,10 +546,10 @@
}
if (!cb.onPreparePanel(st.featureId, st.createdPanelView, st.menu)) {
- if (isActionBarMenu && mActionBar != null) {
+ if (isActionBarMenu && mDecorContentParent != null) {
// The app didn't want to show the menu for now but it still exists.
// Clear it out of the action bar.
- mActionBar.setMenu(null, mActionMenuPresenterCallback);
+ mDecorContentParent.setMenu(null, mActionMenuPresenterCallback);
}
st.menu.startDispatchingItemsChanged();
return false;
@@ -573,7 +574,7 @@
@Override
public void onConfigurationChanged(Configuration newConfig) {
// Action bars handle their own menu state
- if (mActionBar == null) {
+ if (mDecorContentParent == null) {
PanelFeatureState st = getPanelState(FEATURE_OPTIONS_PANEL, false);
if ((st != null) && (st.menu != null)) {
if (st.isOpen) {
@@ -625,12 +626,10 @@
@Override
public final void openPanel(int featureId, KeyEvent event) {
- if (featureId == FEATURE_OPTIONS_PANEL && mActionBar != null &&
- mActionBar.isOverflowReserved() &&
+ if (featureId == FEATURE_OPTIONS_PANEL && mDecorContentParent != null &&
+ mDecorContentParent.canShowOverflowMenu() &&
!ViewConfiguration.get(getContext()).hasPermanentMenuKey()) {
- if (mActionBar.getVisibility() == View.VISIBLE) {
- mActionBar.showOverflowMenu();
- }
+ mDecorContentParent.showOverflowMenu();
} else {
openPanel(getPanelState(featureId, true), event);
}
@@ -759,10 +758,10 @@
@Override
public final void closePanel(int featureId) {
- if (featureId == FEATURE_OPTIONS_PANEL && mActionBar != null &&
- mActionBar.isOverflowReserved() &&
+ if (featureId == FEATURE_OPTIONS_PANEL && mDecorContentParent != null &&
+ mDecorContentParent.canShowOverflowMenu() &&
!ViewConfiguration.get(getContext()).hasPermanentMenuKey()) {
- mActionBar.hideOverflowMenu();
+ mDecorContentParent.hideOverflowMenu();
} else if (featureId == FEATURE_CONTEXT_MENU) {
closeContextMenu();
} else {
@@ -784,7 +783,7 @@
public final void closePanel(PanelFeatureState st, boolean doCallback) {
// System.out.println("Close panel: isOpen=" + st.isOpen);
if (doCallback && st.featureId == FEATURE_OPTIONS_PANEL &&
- mActionBar != null && mActionBar.isOverflowMenuShowing()) {
+ mDecorContentParent != null && mDecorContentParent.isOverflowMenuShowing()) {
checkCloseActionMenu(st.menu);
return;
}
@@ -830,7 +829,7 @@
}
mClosingActionMenu = true;
- mActionBar.dismissPopupMenus();
+ mDecorContentParent.dismissPopups();
Callback cb = getCallback();
if (cb != null && !isDestroyed()) {
cb.onPanelClosed(FEATURE_ACTION_BAR, menu);
@@ -876,7 +875,7 @@
// Prepare the options panel if we have an action bar
if ((featureId == FEATURE_ACTION_BAR || featureId == FEATURE_OPTIONS_PANEL)
- && mActionBar != null) {
+ && mDecorContentParent != null) {
st = getPanelState(Window.FEATURE_OPTIONS_PANEL, false);
if (st != null) {
st.isPrepared = false;
@@ -923,17 +922,15 @@
boolean playSoundEffect = false;
final PanelFeatureState st = getPanelState(featureId, true);
- if (featureId == FEATURE_OPTIONS_PANEL && mActionBar != null &&
- mActionBar.isOverflowReserved() &&
+ if (featureId == FEATURE_OPTIONS_PANEL && mDecorContentParent != null &&
+ mDecorContentParent.canShowOverflowMenu() &&
!ViewConfiguration.get(getContext()).hasPermanentMenuKey()) {
- if (mActionBar.getVisibility() == View.VISIBLE) {
- if (!mActionBar.isOverflowMenuShowing()) {
- if (!isDestroyed() && preparePanel(st, event)) {
- playSoundEffect = mActionBar.showOverflowMenu();
- }
- } else {
- playSoundEffect = mActionBar.hideOverflowMenu();
+ if (!mDecorContentParent.isOverflowMenuShowing()) {
+ if (!isDestroyed() && preparePanel(st, event)) {
+ playSoundEffect = mDecorContentParent.showOverflowMenu();
}
+ } else {
+ playSoundEffect = mDecorContentParent.hideOverflowMenu();
}
} else {
if (st.isOpen || st.isHandled) {
@@ -1046,7 +1043,7 @@
st.isHandled = true;
// Only close down the menu if we don't have an action bar keeping it open.
- if ((flags & Menu.FLAG_PERFORM_NO_CLOSE) == 0 && mActionBar == null) {
+ if ((flags & Menu.FLAG_PERFORM_NO_CLOSE) == 0 && mDecorContentParent == null) {
closePanel(st, true);
}
}
@@ -1068,7 +1065,7 @@
boolean res = st.menu.performIdentifierAction(id, flags);
// Only close down the menu if we don't have an action bar keeping it open.
- if (mActionBar == null) {
+ if (mDecorContentParent == null) {
closePanel(st, true);
}
@@ -1103,12 +1100,12 @@
}
private void reopenMenu(boolean toggleMenuMode) {
- if (mActionBar != null && mActionBar.isOverflowReserved() &&
+ if (mDecorContentParent != null && mDecorContentParent.canShowOverflowMenu() &&
(!ViewConfiguration.get(getContext()).hasPermanentMenuKey() ||
- mActionBar.isOverflowMenuShowPending())) {
+ mDecorContentParent.isOverflowMenuShowPending())) {
final Callback cb = getCallback();
- if (!mActionBar.isOverflowMenuShowing() || !toggleMenuMode) {
- if (cb != null && !isDestroyed() && mActionBar.getVisibility() == View.VISIBLE) {
+ if (!mDecorContentParent.isOverflowMenuShowing() || !toggleMenuMode) {
+ if (cb != null && !isDestroyed()) {
// If we have a menu invalidation pending, do it now.
if (mInvalidatePanelMenuPosted &&
(mInvalidatePanelMenuFeatures & (1 << FEATURE_OPTIONS_PANEL)) != 0) {
@@ -1123,11 +1120,11 @@
if (st.menu != null && !st.refreshMenuContent &&
cb.onPreparePanel(FEATURE_OPTIONS_PANEL, st.createdPanelView, st.menu)) {
cb.onMenuOpened(FEATURE_ACTION_BAR, st.menu);
- mActionBar.showOverflowMenu();
+ mDecorContentParent.showOverflowMenu();
}
}
} else {
- mActionBar.hideOverflowMenu();
+ mDecorContentParent.hideOverflowMenu();
if (cb != null && !isDestroyed()) {
final PanelFeatureState st = getPanelState(FEATURE_OPTIONS_PANEL, true);
cb.onPanelClosed(FEATURE_ACTION_BAR, st.menu);
@@ -1164,7 +1161,7 @@
// If we have an action bar, initialize the menu with a context themed for it.
if ((st.featureId == FEATURE_OPTIONS_PANEL || st.featureId == FEATURE_ACTION_BAR) &&
- mActionBar != null) {
+ mDecorContentParent != null) {
TypedValue outValue = new TypedValue();
Resources.Theme currentTheme = context.getTheme();
currentTheme.resolveAttribute(com.android.internal.R.attr.actionBarWidgetTheme,
@@ -1509,8 +1506,8 @@
mIconRes = resId;
mResourcesSetFlags |= FLAG_RESOURCE_SET_ICON;
mResourcesSetFlags &= ~FLAG_RESOURCE_SET_ICON_FALLBACK;
- if (mActionBar != null) {
- mActionBar.setIcon(resId);
+ if (mDecorContentParent != null) {
+ mDecorContentParent.setIcon(resId);
}
}
@@ -1520,13 +1517,14 @@
return;
}
mIconRes = resId;
- if (mActionBar != null && (!mActionBar.hasIcon() ||
+ if (mDecorContentParent != null && (!mDecorContentParent.hasIcon() ||
(mResourcesSetFlags & FLAG_RESOURCE_SET_ICON_FALLBACK) != 0)) {
if (resId != 0) {
- mActionBar.setIcon(resId);
+ mDecorContentParent.setIcon(resId);
mResourcesSetFlags &= ~FLAG_RESOURCE_SET_ICON_FALLBACK;
} else {
- mActionBar.setIcon(getContext().getPackageManager().getDefaultActivityIcon());
+ mDecorContentParent.setIcon(
+ getContext().getPackageManager().getDefaultActivityIcon());
mResourcesSetFlags |= FLAG_RESOURCE_SET_ICON_FALLBACK;
}
}
@@ -1536,8 +1534,8 @@
public void setLogo(int resId) {
mLogoRes = resId;
mResourcesSetFlags |= FLAG_RESOURCE_SET_LOGO;
- if (mActionBar != null) {
- mActionBar.setLogo(resId);
+ if (mDecorContentParent != null) {
+ mDecorContentParent.setLogo(resId);
}
}
@@ -1547,8 +1545,8 @@
return;
}
mLogoRes = resId;
- if (mActionBar != null && !mActionBar.hasLogo()) {
- mActionBar.setLogo(resId);
+ if (mDecorContentParent != null && !mDecorContentParent.hasLogo()) {
+ mDecorContentParent.setLogo(resId);
}
}
@@ -1805,9 +1803,9 @@
outState.putSparseParcelableArray(PANELS_TAG, panelStates);
}
- if (mActionBar != null) {
+ if (mDecorContentParent != null) {
SparseArray<Parcelable> actionBarStates = new SparseArray<Parcelable>();
- mActionBar.saveHierarchyState(actionBarStates);
+ mDecorContentParent.saveToolbarHierarchyState(actionBarStates);
outState.putSparseParcelableArray(ACTION_BAR_TAG, actionBarStates);
}
@@ -1846,11 +1844,11 @@
restorePanelState(panelStates);
}
- if (mActionBar != null) {
+ if (mDecorContentParent != null) {
SparseArray<Parcelable> actionBarStates =
savedInstanceState.getSparseParcelableArray(ACTION_BAR_TAG);
if (actionBarStates != null) {
- mActionBar.restoreHierarchyState(actionBarStates);
+ mDecorContentParent.restoreToolbarHierarchyState(actionBarStates);
} else {
Log.w(TAG, "Missing saved instance states for action bar views! " +
"State will not be restored.");
@@ -2124,12 +2122,7 @@
}
public boolean superDispatchKeyEvent(KeyEvent event) {
- if (super.dispatchKeyEvent(event)) {
- return true;
- }
-
- // Not handled by the view hierarchy, does the action bar want it
- // to cancel out of something special?
+ // Give priority to closing action modes if applicable.
if (event.getKeyCode() == KeyEvent.KEYCODE_BACK) {
final int action = event.getAction();
// Back cancels action modes first.
@@ -2139,17 +2132,9 @@
}
return true;
}
-
- // Next collapse any expanded action views.
- if (mActionBar != null && mActionBar.hasExpandedActionView()) {
- if (action == KeyEvent.ACTION_UP) {
- mActionBar.collapseActionView();
- }
- return true;
- }
}
- return false;
+ return super.dispatchKeyEvent(event);
}
public boolean superDispatchKeyShortcutEvent(KeyEvent event) {
@@ -2844,8 +2829,8 @@
cb.onDetachedFromWindow();
}
- if (mActionBar != null) {
- mActionBar.dismissPopupMenus();
+ if (mDecorContentParent != null) {
+ mDecorContentParent.dismissPopups();
}
if (mActionModePopup != null) {
@@ -3281,96 +3266,68 @@
// Set up decor part of UI to ignore fitsSystemWindows if appropriate.
mDecor.makeOptionalFitsSystemWindows();
- mTitleView = (TextView)findViewById(com.android.internal.R.id.title);
- if (mTitleView != null) {
- mTitleView.setLayoutDirection(mDecor.getLayoutDirection());
- if ((getLocalFeatures() & (1 << FEATURE_NO_TITLE)) != 0) {
- View titleContainer = findViewById(com.android.internal.R.id.title_container);
- if (titleContainer != null) {
- titleContainer.setVisibility(View.GONE);
- } else {
- mTitleView.setVisibility(View.GONE);
- }
- if (mContentParent instanceof FrameLayout) {
- ((FrameLayout)mContentParent).setForeground(null);
- }
- } else {
- mTitleView.setText(mTitle);
+ final DecorContentParent decorContentParent = (DecorContentParent) mDecor.findViewById(
+ com.android.internal.R.id.decor_content_parent);
+
+ if (decorContentParent != null) {
+ mDecorContentParent = decorContentParent;
+ mDecorContentParent.setWindowCallback(getCallback());
+ if (mDecorContentParent.getTitle() == null) {
+ mDecorContentParent.setWindowTitle(mTitle);
}
- } else {
- mActionBar = (ActionBarView) findViewById(com.android.internal.R.id.action_bar);
- if (mActionBar != null) {
- mActionBar.setWindowCallback(getCallback());
- if (mActionBar.getTitle() == null) {
- mActionBar.setWindowTitle(mTitle);
- }
- final int localFeatures = getLocalFeatures();
- if ((localFeatures & (1 << FEATURE_PROGRESS)) != 0) {
- mActionBar.initProgress();
- }
- if ((localFeatures & (1 << FEATURE_INDETERMINATE_PROGRESS)) != 0) {
- mActionBar.initIndeterminateProgress();
- }
- final ActionBarOverlayLayout abol = (ActionBarOverlayLayout) findViewById(
- com.android.internal.R.id.action_bar_overlay_layout);
- if (abol != null) {
- abol.setOverlayMode(
- (localFeatures & (1 << FEATURE_ACTION_BAR_OVERLAY)) != 0);
+ final int localFeatures = getLocalFeatures();
+ for (int i = 0; i < FEATURE_MAX; i++) {
+ if ((localFeatures & (1 << i)) != 0) {
+ mDecorContentParent.initFeature(i);
}
+ }
- boolean splitActionBar = false;
- final boolean splitWhenNarrow =
- (mUiOptions & ActivityInfo.UIOPTION_SPLIT_ACTION_BAR_WHEN_NARROW) != 0;
- if (splitWhenNarrow) {
- splitActionBar = getContext().getResources().getBoolean(
- com.android.internal.R.bool.split_action_bar_is_narrow);
- } else {
- splitActionBar = getWindowStyle().getBoolean(
- com.android.internal.R.styleable.Window_windowSplitActionBar, false);
- }
- final ActionBarContainer splitView = (ActionBarContainer) findViewById(
- com.android.internal.R.id.split_action_bar);
- if (splitView != null) {
- mActionBar.setSplitView(splitView);
- mActionBar.setSplitActionBar(splitActionBar);
- mActionBar.setSplitWhenNarrow(splitWhenNarrow);
+ mDecorContentParent.setUiOptions(mUiOptions);
- final ActionBarContextView cab = (ActionBarContextView) findViewById(
- com.android.internal.R.id.action_context_bar);
- cab.setSplitView(splitView);
- cab.setSplitActionBar(splitActionBar);
- cab.setSplitWhenNarrow(splitWhenNarrow);
- } else if (splitActionBar) {
- Log.e(TAG, "Requested split action bar with " +
- "incompatible window decor! Ignoring request.");
- }
+ if ((mResourcesSetFlags & FLAG_RESOURCE_SET_ICON) != 0 ||
+ (mIconRes != 0 && !mDecorContentParent.hasIcon())) {
+ mDecorContentParent.setIcon(mIconRes);
+ } else if ((mResourcesSetFlags & FLAG_RESOURCE_SET_ICON) == 0 &&
+ mIconRes == 0 && !mDecorContentParent.hasIcon()) {
+ mDecorContentParent.setIcon(
+ getContext().getPackageManager().getDefaultActivityIcon());
+ mResourcesSetFlags |= FLAG_RESOURCE_SET_ICON_FALLBACK;
+ }
+ if ((mResourcesSetFlags & FLAG_RESOURCE_SET_LOGO) != 0 ||
+ (mLogoRes != 0 && !mDecorContentParent.hasLogo())) {
+ mDecorContentParent.setLogo(mLogoRes);
+ }
- if ((mResourcesSetFlags & FLAG_RESOURCE_SET_ICON) != 0 ||
- (mIconRes != 0 && !mActionBar.hasIcon())) {
- mActionBar.setIcon(mIconRes);
- } else if ((mResourcesSetFlags & FLAG_RESOURCE_SET_ICON) == 0 &&
- mIconRes == 0 && !mActionBar.hasIcon()) {
- mActionBar.setIcon(
- getContext().getPackageManager().getDefaultActivityIcon());
- mResourcesSetFlags |= FLAG_RESOURCE_SET_ICON_FALLBACK;
- }
- if ((mResourcesSetFlags & FLAG_RESOURCE_SET_LOGO) != 0 ||
- (mLogoRes != 0 && !mActionBar.hasLogo())) {
- mActionBar.setLogo(mLogoRes);
- }
-
- // Post the panel invalidate for later; avoid application onCreateOptionsMenu
- // being called in the middle of onCreate or similar.
- mDecor.post(new Runnable() {
- public void run() {
- // Invalidate if the panel menu hasn't been created before this.
- PanelFeatureState st = getPanelState(FEATURE_OPTIONS_PANEL, false);
- if (!isDestroyed() && (st == null || st.menu == null)) {
- invalidatePanelMenu(FEATURE_ACTION_BAR);
- }
+ // Post the panel invalidate for later; avoid application onCreateOptionsMenu
+ // being called in the middle of onCreate or similar.
+ mDecor.post(new Runnable() {
+ public void run() {
+ // Invalidate if the panel menu hasn't been created before this.
+ PanelFeatureState st = getPanelState(FEATURE_OPTIONS_PANEL, false);
+ if (!isDestroyed() && (st == null || st.menu == null)) {
+ invalidatePanelMenu(FEATURE_ACTION_BAR);
}
- });
+ }
+ });
+ } else {
+ mTitleView = (TextView)findViewById(com.android.internal.R.id.title);
+ if (mTitleView != null) {
+ mTitleView.setLayoutDirection(mDecor.getLayoutDirection());
+ if ((getLocalFeatures() & (1 << FEATURE_NO_TITLE)) != 0) {
+ View titleContainer = findViewById(
+ com.android.internal.R.id.title_container);
+ if (titleContainer != null) {
+ titleContainer.setVisibility(View.GONE);
+ } else {
+ mTitleView.setVisibility(View.GONE);
+ }
+ if (mContentParent instanceof FrameLayout) {
+ ((FrameLayout)mContentParent).setForeground(null);
+ }
+ } else {
+ mTitleView.setText(mTitle);
+ }
}
}
diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java
index 2d0f6d1..5f53e49 100644
--- a/services/core/java/com/android/server/ConnectivityService.java
+++ b/services/core/java/com/android/server/ConnectivityService.java
@@ -193,6 +193,9 @@
private static final boolean DBG = true;
private static final boolean VDBG = true; // STOPSHIP
+ // network sampling debugging
+ private static final boolean SAMPLE_DBG = false;
+
private static final boolean LOGD_RULES = false;
// TODO: create better separation between radio types and network types
@@ -219,10 +222,10 @@
// Set network sampling interval at 12 minutes, this way, even if the timers get
// aggregated, it will fire at around 15 minutes, which should allow us to
// aggregate this timer with other timers (specially the socket keep alive timers)
- private static final int DEFAULT_SAMPLING_INTERVAL_IN_SECONDS = (VDBG ? 30 : 12 * 60);
+ private static final int DEFAULT_SAMPLING_INTERVAL_IN_SECONDS = (SAMPLE_DBG ? 30 : 12 * 60);
// start network sampling a minute after booting ...
- private static final int DEFAULT_START_SAMPLING_INTERVAL_IN_SECONDS = (VDBG ? 30 : 60);
+ private static final int DEFAULT_START_SAMPLING_INTERVAL_IN_SECONDS = (SAMPLE_DBG ? 30 : 60);
AlarmManager mAlarmManager;
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java
index 22e2a6e..9b3f7ac 100644
--- a/services/java/com/android/server/SystemServer.java
+++ b/services/java/com/android/server/SystemServer.java
@@ -124,8 +124,8 @@
"com.android.server.usb.UsbService$Lifecycle";
private static final String WIFI_SERVICE_CLASS =
"com.android.server.wifi.WifiService";
- private static final String WIFI_HOTSPOT_SERVICE_CLASS =
- "com.android.server.wifi.hotspot.WifiHotspotService";
+ private static final String WIFI_PASSPOINT_SERVICE_CLASS =
+ "com.android.server.wifi.passpoint.WifiPasspointService";
private static final String WIFI_P2P_SERVICE_CLASS =
"com.android.server.wifi.p2p.WifiP2pService";
private static final String HDMI_CEC_SERVICE_CLASS =
@@ -639,9 +639,9 @@
}
try {
- mSystemServiceManager.startService(WIFI_HOTSPOT_SERVICE_CLASS);
+ mSystemServiceManager.startService(WIFI_PASSPOINT_SERVICE_CLASS);
} catch (Throwable e) {
- reportWtf("starting Wi-Fi HotspotService", e);
+ reportWtf("starting Wi-Fi PasspointService", e);
}
try {
diff --git a/wifi/java/android/net/wifi/IWifiManager.aidl b/wifi/java/android/net/wifi/IWifiManager.aidl
index 0535fe0..9ccd810 100644
--- a/wifi/java/android/net/wifi/IWifiManager.aidl
+++ b/wifi/java/android/net/wifi/IWifiManager.aidl
@@ -111,8 +111,6 @@
Messenger getWifiServiceMessenger();
- Messenger getWifiStateMachineMessenger();
-
String getConfigFile();
void enableTdls(String remoteIPAddress, boolean enable);
diff --git a/wifi/java/android/net/wifi/ScanResult.java b/wifi/java/android/net/wifi/ScanResult.java
index 1cb9546..3e3b6e3 100644
--- a/wifi/java/android/net/wifi/ScanResult.java
+++ b/wifi/java/android/net/wifi/ScanResult.java
@@ -16,6 +16,8 @@
package android.net.wifi;
+import android.net.wifi.passpoint.PasspointInfo;
+import android.net.wifi.passpoint.PasspointManager;
import android.os.Parcelable;
import android.os.Parcel;
@@ -77,6 +79,13 @@
public int distanceSdCm;
/**
+ * Passpoint ANQP information. This is not fetched automatically.
+ * Use {@link PasspointManager#requestAnqpInfo} to request ANQP info.
+ * {@hide}
+ */
+ public PasspointInfo passpoint;
+
+ /**
* {@hide}
*/
public final static int UNSPECIFIED = -1;
@@ -122,6 +131,8 @@
distanceCm = source.distanceCm;
distanceSdCm = source.distanceSdCm;
seen = source.seen;
+ if (source.passpoint != null)
+ passpoint = new PasspointInfo(source.passpoint);
}
}
@@ -155,6 +166,9 @@
sb.append(", distanceSd: ").append((distanceSdCm != UNSPECIFIED ? distanceSdCm : "?")).
append("(cm)");
+ if (passpoint != null)
+ sb.append(", passpoint: [").append(passpoint.toString()).append("]");
+
return sb.toString();
}
@@ -178,6 +192,12 @@
dest.writeLong(timestamp);
dest.writeInt(distanceCm);
dest.writeInt(distanceSdCm);
+ if (passpoint != null) {
+ dest.writeInt(1);
+ passpoint.writeToParcel(dest, flags);
+ } else {
+ dest.writeInt(0);
+ }
}
/** Implement the Parcelable interface {@hide} */
@@ -188,7 +208,7 @@
if (in.readInt() == 1) {
wifiSsid = WifiSsid.CREATOR.createFromParcel(in);
}
- return new ScanResult(
+ ScanResult sr = new ScanResult(
wifiSsid,
in.readString(),
in.readString(),
@@ -198,6 +218,10 @@
in.readInt(),
in.readInt()
);
+ if (in.readInt() == 1) {
+ sr.passpoint = PasspointInfo.CREATOR.createFromParcel(in);
+ }
+ return sr;
}
public ScanResult[] newArray(int size) {
diff --git a/wifi/java/android/net/wifi/WifiLinkLayerStats.java b/wifi/java/android/net/wifi/WifiLinkLayerStats.java
new file mode 100644
index 0000000..922eddd
--- /dev/null
+++ b/wifi/java/android/net/wifi/WifiLinkLayerStats.java
@@ -0,0 +1,189 @@
+/*
+ * 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;
+
+import android.os.Parcelable;
+import android.os.Parcel;
+import android.text.TextUtils;
+import java.util.HashMap;
+import java.util.Date;
+import java.util.ArrayList;
+
+import java.util.BitSet;
+
+/**
+ * A class representing link layer statistics collected over a Wifi Interface.
+ */
+/** {@hide} */
+public class WifiLinkLayerStats implements Parcelable {
+ private static final String TAG = "WifiLinkLayerStats";
+
+ /**
+ * The current status of this network configuration entry.
+ * @see Status
+ */
+ /** {@hide} */
+ public int status;
+
+ /**
+ * The network's SSID. Can either be an ASCII string,
+ * which must be enclosed in double quotation marks
+ * (e.g., {@code "MyNetwork"}, or a string of
+ * hex digits,which are not enclosed in quotes
+ * (e.g., {@code 01a243f405}).
+ */
+ /** {@hide} */
+ public String SSID;
+ /**
+ * When set. this is the BSSID the radio is currently associated with.
+ * The value is a string in the format of an Ethernet MAC address, e.g.,
+ * <code>XX:XX:XX:XX:XX:XX</code> where each <code>X</code> is a hex digit.
+ */
+ /** {@hide} */
+ public String BSSID;
+
+ /* number beacons received from our own AP */
+ /** {@hide} */
+ public int beacon_rx;
+
+ /* RSSI taken on management frames */
+ /** {@hide} */
+ public int rssi_mgmt;
+
+ /* packets counters */
+ /** {@hide} */
+ /* WME Best Effort Access Category (receive mpdu, transmit mpdu, lost mpdu, number of retries)*/
+ public long rxmpdu_be;
+ /** {@hide} */
+ public long txmpdu_be;
+ /** {@hide} */
+ public long lostmpdu_be;
+ /** {@hide} */
+ public long retries_be;
+ /** {@hide} */
+ /* WME Background Access Category (receive mpdu, transmit mpdu, lost mpdu, number of retries) */
+ public long rxmpdu_bk;
+ /** {@hide} */
+ public long txmpdu_bk;
+ /** {@hide} */
+ public long lostmpdu_bk;
+ /** {@hide} */
+ public long retries_bk;
+ /** {@hide} */
+ /* WME Video Access Category (receive mpdu, transmit mpdu, lost mpdu, number of retries) */
+ public long rxmpdu_vi;
+ /** {@hide} */
+ public long txmpdu_vi;
+ /** {@hide} */
+ public long lostmpdu_vi;
+ /** {@hide} */
+ public long retries_vi;
+ /** {@hide} */
+ /* WME Voice Access Category (receive mpdu, transmit mpdu, lost mpdu, number of retries) */
+ public long rxmpdu_vo;
+ /** {@hide} */
+ public long txmpdu_vo;
+ /** {@hide} */
+ public long lostmpdu_vo;
+ /** {@hide} */
+ public long retries_vo;
+
+
+ /** {@hide} */
+ public WifiLinkLayerStats() {
+ }
+
+ @Override
+ /** {@hide} */
+ public String toString() {
+ StringBuilder sbuf = new StringBuilder();
+ if (this.SSID != null) {
+ sbuf.append(" SSID: ").append(this.SSID).append('\n');
+ }
+ if (this.BSSID != null) {
+ sbuf.append(" BSSID: ").append(this.BSSID).append('\n');
+ }
+
+ sbuf.append(" my bss beacon rx: ").append(Integer.toString(this.beacon_rx)).append('\n');
+ sbuf.append(" RSSI mgmt: ").append(Integer.toString(this.rssi_mgmt)).append('\n');
+ sbuf.append(" BE : ").append(" rx=").append(Long.toString(this.rxmpdu_be))
+ .append(" tx=").append(Long.toString(this.txmpdu_be))
+ .append(" lost=").append(Long.toString(this.lostmpdu_be))
+ .append(" retries=").append(Long.toString(this.retries_be)).append('\n');
+ sbuf.append(" BK : ").append(" rx=").append(Long.toString(this.rxmpdu_bk))
+ .append(" tx=").append(Long.toString(this.txmpdu_bk))
+ .append(" lost=").append(Long.toString(this.lostmpdu_bk))
+ .append(" retries=").append(Long.toString(this.retries_bk)).append('\n');
+ sbuf.append(" VI : ").append(" rx=").append(Long.toString(this.rxmpdu_vi))
+ .append(" tx=").append(Long.toString(this.txmpdu_vi))
+ .append(" lost=").append(Long.toString(this.lostmpdu_vi))
+ .append(" retries=").append(Long.toString(this.retries_vi)).append('\n');
+ sbuf.append(" VO : ").append(" rx=").append(Long.toString(this.rxmpdu_vo))
+ .append(" tx=").append(Long.toString(this.txmpdu_vo))
+ .append(" lost=").append(Long.toString(this.lostmpdu_vo))
+ .append(" retries=").append(Long.toString(this.retries_vo)).append('\n');
+
+ return sbuf.toString();
+ }
+
+ /** Implement the Parcelable interface {@hide} */
+ public int describeContents() {
+ return 0;
+ }
+
+ /** {@hide} */
+ public String getPrintableSsid() {
+ if (SSID == null) return "";
+ final int length = SSID.length();
+ if (length > 2 && (SSID.charAt(0) == '"') && SSID.charAt(length - 1) == '"') {
+ return SSID.substring(1, length - 1);
+ }
+
+ /** The ascii-encoded string format is P"<ascii-encoded-string>"
+ * The decoding is implemented in the supplicant for a newly configured
+ * network.
+ */
+ if (length > 3 && (SSID.charAt(0) == 'P') && (SSID.charAt(1) == '"') &&
+ (SSID.charAt(length-1) == '"')) {
+ WifiSsid wifiSsid = WifiSsid.createFromAsciiEncoded(
+ SSID.substring(2, length - 1));
+ return wifiSsid.toString();
+ }
+ return SSID;
+ }
+
+ /** Implement the Parcelable interface {@hide} */
+ public void writeToParcel(Parcel dest, int flags) {
+ dest.writeString(SSID);
+ dest.writeString(BSSID);
+ }
+
+ /** Implement the Parcelable interface {@hide} */
+ public static final Creator<WifiLinkLayerStats> CREATOR =
+ new Creator<WifiLinkLayerStats>() {
+ public WifiLinkLayerStats createFromParcel(Parcel in) {
+ WifiLinkLayerStats stats = new WifiLinkLayerStats();
+ stats.SSID = in.readString();
+ stats.BSSID = in.readString();
+ return stats;
+ };
+ public WifiLinkLayerStats[] newArray(int size) {
+ return new WifiLinkLayerStats[size];
+ }
+
+ };
+}
diff --git a/wifi/java/android/net/wifi/WifiManager.java b/wifi/java/android/net/wifi/WifiManager.java
index 15b65c1..9558d50 100644
--- a/wifi/java/android/net/wifi/WifiManager.java
+++ b/wifi/java/android/net/wifi/WifiManager.java
@@ -1783,18 +1783,6 @@
}
}
- /**
- * Get a reference to WifiStateMachine handler.
- * @return Messenger pointing to the WifiService handler
- * @hide
- */
- public Messenger getWifiStateMachineMessenger() {
- try {
- return mService.getWifiStateMachineMessenger();
- } catch (RemoteException e) {
- return null;
- }
- }
/**
* Returns the file in which IP and proxy configuration data is stored
diff --git a/wifi/java/android/net/wifi/WifiScanner.java b/wifi/java/android/net/wifi/WifiScanner.java
index e02e14c..b766268 100644
--- a/wifi/java/android/net/wifi/WifiScanner.java
+++ b/wifi/java/android/net/wifi/WifiScanner.java
@@ -31,7 +31,6 @@
import com.android.internal.util.AsyncChannel;
import com.android.internal.util.Protocol;
-import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CountDownLatch;
@@ -41,27 +40,45 @@
* Get an instance of this class by calling
* {@link android.content.Context#getSystemService(String) Context.getSystemService(Context
* .WIFI_SCANNING_SERVICE)}.
- * @hide
*/
public class WifiScanner {
+ /** no band specified; use channel list instead */
public static final int WIFI_BAND_UNSPECIFIED = 0; /* not specified */
+
+ /** 2.4 GHz band */
public static final int WIFI_BAND_24_GHZ = 1; /* 2.4 GHz band */
+ /** 5 GHz band excluding DFS channels */
public static final int WIFI_BAND_5_GHZ = 2; /* 5 GHz band without DFS channels */
+ /** DFS channels from 5 GHz band only */
public static final int WIFI_BAND_5_GHZ_DFS_ONLY = 4; /* 5 GHz band with DFS channels */
+ /** 5 GHz band including DFS channels */
public static final int WIFI_BAND_5_GHZ_WITH_DFS = 6; /* 5 GHz band with DFS channels */
+ /** Both 2.4 GHz band and 5 GHz band; no DFS channels */
public static final int WIFI_BAND_BOTH = 3; /* both bands without DFS channels */
+ /** Both 2.4 GHz band and 5 GHz band; with DFS channels */
public static final int WIFI_BAND_BOTH_WITH_DFS = 7; /* both bands with DFS channels */
- public static final int MIN_SCAN_PERIOD_MS = 300; /* minimum supported period */
+ /** Minimum supported scanning period */
+ public static final int MIN_SCAN_PERIOD_MS = 2000; /* minimum supported period */
+ /** Maximum supported scanning period */
public static final int MAX_SCAN_PERIOD_MS = 1024000; /* maximum supported period */
+ /** No Error */
public static final int REASON_SUCCEEDED = 0;
+ /** Unknown error */
public static final int REASON_UNSPECIFIED = -1;
+ /** Invalid listener */
public static final int REASON_INVALID_LISTENER = -2;
+ /** Invalid request */
public static final int REASON_INVALID_REQUEST = -3;
+ /** Request conflicts with other scans that may be going on */
public static final int REASON_CONFLICTING_REQUEST = -4;
+ /**
+ * Generic action callback invocation interface
+ * @hide
+ */
public static interface ActionListener {
public void onSuccess(Object result);
public void onFailure(int reason, Object exception);
@@ -70,19 +87,35 @@
/**
* gives you all the possible channels; channel is specified as an
* integer with frequency in MHz i.e. channel 1 is 2412
+ * @hide
*/
public List<Integer> getAvailableChannels(int band) {
return null;
}
/**
- * provides channel specification to the APIs
+ * provides channel specification for scanning
*/
public static class ChannelSpec {
+ /**
+ * channel frequency in KHz; for example channel 1 is specified as 2412
+ */
public int frequency;
+ /**
+ * if true, scan this channel in passive fashion.
+ * This flag is ignored on DFS channel specification.
+ * @hide
+ */
public boolean passive; /* ignored on DFS channels */
+ /**
+ * how long to dwell on this channel
+ * @hide
+ */
public int dwellTimeMS; /* not supported for now */
+ /**
+ * default constructor for channel spec
+ */
public ChannelSpec(int frequency) {
this.frequency = frequency;
passive = false;
@@ -90,19 +123,26 @@
}
}
+ /** reports {@link ScanListener#onResults} when underlying buffers are full */
public static final int REPORT_EVENT_AFTER_BUFFER_FULL = 0;
+ /** reports {@link ScanListener#onResults} after each scan */
public static final int REPORT_EVENT_AFTER_EACH_SCAN = 1;
+ /** reports {@link ScanListener#onFullResult} whenever each beacon is discovered */
public static final int REPORT_EVENT_FULL_SCAN_RESULT = 2;
/**
- * scan configuration parameters
+ * scan configuration parameters to be sent to {@link #startBackgroundScan}
*/
public static class ScanSettings implements Parcelable {
- public int band; /* ignore channels if specified */
- public ChannelSpec[] channels; /* list of channels to scan */
- public int periodInMs; /* period of scan */
- public int reportEvents; /* a valid REPORT_EVENT value */
+ /** one of the WIFI_BAND values */
+ public int band;
+ /** list of channels; used when band is set to WIFI_BAND_UNSPECIFIED */
+ public ChannelSpec[] channels;
+ /** period of background scan; in millisecond */
+ public int periodInMs;
+ /** must have a valid REPORT_EVENT value */
+ public int reportEvents;
/** Implement the Parcelable interface {@hide} */
public int describeContents() {
@@ -113,6 +153,7 @@
public void writeToParcel(Parcel dest, int flags) {
dest.writeInt(band);
dest.writeInt(periodInMs);
+ dest.writeInt(reportEvents);
dest.writeInt(channels.length);
for (int i = 0; i < channels.length; i++) {
@@ -130,6 +171,7 @@
ScanSettings settings = new ScanSettings();
settings.band = in.readInt();
settings.periodInMs = in.readInt();
+ settings.reportEvents = in.readInt();
int num_channels = in.readInt();
settings.channels = new ChannelSpec[num_channels];
for (int i = 0; i < num_channels; i++) {
@@ -151,14 +193,56 @@
}
+ /** information element from beacon */
public static class InformationElement {
public int id;
public byte[] bytes;
}
- public static class FullScanResult {
+ /** scan result with information elements from beacons */
+ public static class FullScanResult implements Parcelable {
public ScanResult result;
public InformationElement informationElements[];
+
+ /** Implement the Parcelable interface {@hide} */
+ public int describeContents() {
+ return 0;
+ }
+
+ /** Implement the Parcelable interface {@hide} */
+ public void writeToParcel(Parcel dest, int flags) {
+ result.writeToParcel(dest, flags);
+ dest.writeInt(informationElements.length);
+ for (int i = 0; i < informationElements.length; i++) {
+ dest.writeInt(informationElements[i].id);
+ dest.writeInt(informationElements[i].bytes.length);
+ dest.writeByteArray(informationElements[i].bytes);
+ }
+ }
+
+ /** Implement the Parcelable interface {@hide} */
+ public static final Creator<FullScanResult> CREATOR =
+ new Creator<FullScanResult>() {
+ public FullScanResult createFromParcel(Parcel in) {
+ FullScanResult result = new FullScanResult();
+ result.result = ScanResult.CREATOR.createFromParcel(in);
+ int n = in.readInt();
+ result.informationElements = new InformationElement[n];
+ for (int i = 0; i < n; i++) {
+ result.informationElements[i] = new InformationElement();
+ result.informationElements[i].id = in.readInt();
+ int len = in.readInt();
+ result.informationElements[i].bytes = new byte[len];
+ in.readByteArray(result.informationElements[i].bytes);
+ }
+
+ return result;
+ }
+
+ public FullScanResult[] newArray(int size) {
+ return new FullScanResult[size];
+ }
+ };
}
/** @hide */
@@ -206,88 +290,210 @@
}
/**
- * Framework is co-ordinating scans across multiple apps; so it may not give exactly the
- * same period requested. The period granted is stated on the onSuccess() event; and
- * onPeriodChanged() will be called if/when it is changed because of multiple conflicting
- * requests. This is similar to the way timers are handled.
+ * interface to get scan events on; specify this on {@link #startBackgroundScan}
*/
public interface ScanListener extends ActionListener {
+ /**
+ * Framework co-ordinates scans across multiple apps; so it may not give exactly the
+ * same period requested. If period of a scan is changed; it is reported by this event.
+ */
public void onPeriodChanged(int periodInMs);
+ /**
+ * reports results retrieved from background scan
+ */
public void onResults(ScanResult[] results);
+ /**
+ * reports full scan result for each access point found in scan
+ */
public void onFullResult(FullScanResult fullScanResult);
}
+ /** @hide */
public void scan(ScanSettings settings, ScanListener listener) {
validateChannel();
sAsyncChannel.sendMessage(CMD_SCAN, 0, putListener(listener), settings);
}
+
+ /** start wifi scan in background
+ * @param settings specifies various parameters for the scan; for more information look at
+ * {@link ScanSettings}
+ * @param listener specifies the object to report events to. This object is also treated as a
+ * key for this scan, and must also be specified to cancel the scan. Multiple
+ * scans should also not share this object.
+ */
public void startBackgroundScan(ScanSettings settings, ScanListener listener) {
validateChannel();
sAsyncChannel.sendMessage(CMD_START_BACKGROUND_SCAN, 0, putListener(listener), settings);
}
- public void stopBackgroundScan(boolean flush, ScanListener listener) {
+ /**
+ * stop an ongoing wifi scan
+ * @param listener specifies which scan to cancel; must be same object as passed in {@link
+ * #startBackgroundScan}
+ */
+ public void stopBackgroundScan(ScanListener listener) {
validateChannel();
sAsyncChannel.sendMessage(CMD_STOP_BACKGROUND_SCAN, 0, removeListener(listener));
}
+ /**
+ * retrieves currently available scan results
+ * @param flush {@code true} means flush all results
+ * @param listener specifies which scan to cancel; must be same object as passed in {@link
+ * #startBackgroundScan}
+ */
public void retrieveScanResults(boolean flush, ScanListener listener) {
validateChannel();
sAsyncChannel.sendMessage(CMD_GET_SCAN_RESULTS, 0, getListenerKey(listener));
}
+ /** specifies information about an access point of interest */
public static class HotspotInfo {
+ /** bssid of the access point; in XX:XX:XX:XX:XX:XX format */
public String bssid;
+ /** low signal strength threshold; more information at {@link ScanResult#level} */
public int low; /* minimum RSSI */
+ /** high signal threshold; more information at {@link ScanResult#level} */
public int high; /* maximum RSSI */
+ /** channel frequency (in KHz) where you may find this BSSID */
+ public int frequencyHint;
}
- public static class WifiChangeSettings {
- public int rssiSampleSize; /* sample size for RSSI averaging */
- public int lostApSampleSize; /* samples to confirm AP's loss */
- public int unchangedSampleSize; /* samples to confirm no change */
- public int minApsBreachingThreshold; /* change threshold to trigger event */
+ /** @hide */
+ public static class WifiChangeSettings implements Parcelable {
+ public int rssiSampleSize; /* sample size for RSSI averaging */
+ public int lostApSampleSize; /* samples to confirm AP's loss */
+ public int unchangedSampleSize; /* samples to confirm no change */
+ public int minApsBreachingThreshold; /* change threshold to trigger event */
+ public int periodInMs; /* scan period in millisecond */
public HotspotInfo[] hotspotInfos;
+
+ /** Implement the Parcelable interface {@hide} */
+ public int describeContents() {
+ return 0;
+ }
+
+ /** Implement the Parcelable interface {@hide} */
+ public void writeToParcel(Parcel dest, int flags) {
+ dest.writeInt(rssiSampleSize);
+ dest.writeInt(lostApSampleSize);
+ dest.writeInt(unchangedSampleSize);
+ dest.writeInt(minApsBreachingThreshold);
+ dest.writeInt(periodInMs);
+ dest.writeInt(hotspotInfos.length);
+ for (int i = 0; i < hotspotInfos.length; i++) {
+ HotspotInfo info = hotspotInfos[i];
+ dest.writeString(info.bssid);
+ dest.writeInt(info.low);
+ dest.writeInt(info.high);
+ dest.writeInt(info.frequencyHint);
+ }
+ }
+
+ /** Implement the Parcelable interface {@hide} */
+ public static final Creator<WifiChangeSettings> CREATOR =
+ new Creator<WifiChangeSettings>() {
+ public WifiChangeSettings createFromParcel(Parcel in) {
+ WifiChangeSettings settings = new WifiChangeSettings();
+ settings.rssiSampleSize = in.readInt();
+ settings.lostApSampleSize = in.readInt();
+ settings.unchangedSampleSize = in.readInt();
+ settings.minApsBreachingThreshold = in.readInt();
+ settings.periodInMs = in.readInt();
+ int len = in.readInt();
+ settings.hotspotInfos = new HotspotInfo[len];
+ for (int i = 0; i < len; i++) {
+ HotspotInfo info = new HotspotInfo();
+ info.bssid = in.readString();
+ info.low = in.readInt();
+ info.high = in.readInt();
+ info.frequencyHint = in.readInt();
+ settings.hotspotInfos[i] = info;
+ }
+ return settings;
+ }
+
+ public WifiChangeSettings[] newArray(int size) {
+ return new WifiChangeSettings[size];
+ }
+ };
+
}
- /* overrides the significant wifi change state machine configuration */
- public void configureSignificantWifiChange(
+ /** configure WifiChange detection
+ * @param rssiSampleSize number of samples used for RSSI averaging
+ * @param lostApSampleSize number of samples to confirm an access point's loss
+ * @param unchangedSampleSize number of samples to confirm there are no changes
+ * @param minApsBreachingThreshold minimum number of access points that need to be
+ * out of range to detect WifiChange
+ * @param periodInMs indicates period of scan to find changes
+ * @param hotspotInfos access points to watch
+ */
+ public void configureWifiChange(
int rssiSampleSize, /* sample size for RSSI averaging */
int lostApSampleSize, /* samples to confirm AP's loss */
int unchangedSampleSize, /* samples to confirm no change */
int minApsBreachingThreshold, /* change threshold to trigger event */
+ int periodInMs, /* period of scan */
HotspotInfo[] hotspotInfos /* signal thresholds to crosss */
)
{
validateChannel();
+
WifiChangeSettings settings = new WifiChangeSettings();
settings.rssiSampleSize = rssiSampleSize;
settings.lostApSampleSize = lostApSampleSize;
settings.unchangedSampleSize = unchangedSampleSize;
settings.minApsBreachingThreshold = minApsBreachingThreshold;
+ settings.periodInMs = periodInMs;
settings.hotspotInfos = hotspotInfos;
- sAsyncChannel.sendMessage(CMD_CONFIGURE_WIFI_CHANGE, 0, 0, settings);
+ configureWifiChange(settings);
}
- public interface SignificantWifiChangeListener extends ActionListener {
+ /**
+ * interface to get wifi change events on; use this on {@link #startTrackingWifiChange}
+ */
+ public interface WifiChangeListener extends ActionListener {
+ /** indicates that changes were detected in wifi environment
+ * @param results indicate the access points that exhibited change
+ */
public void onChanging(ScanResult[] results); /* changes are found */
+ /** indicates that no wifi changes are being detected for a while
+ * @param results indicate the access points that are bing monitored for change
+ */
public void onQuiescence(ScanResult[] results); /* changes settled down */
}
- public void trackSignificantWifiChange(SignificantWifiChangeListener listener) {
+ /**
+ * track changes in wifi environment
+ * @param listener object to report events on; this object must be unique and must also be
+ * provided on {@link #stopTrackingWifiChange}
+ */
+ public void startTrackingWifiChange(WifiChangeListener listener) {
validateChannel();
sAsyncChannel.sendMessage(CMD_START_TRACKING_CHANGE, 0, putListener(listener));
}
- public void untrackSignificantWifiChange(SignificantWifiChangeListener listener) {
+
+ /**
+ * stop tracking changes in wifi environment
+ * @param listener object that was provided to report events on {@link
+ * #stopTrackingWifiChange}
+ */
+ public void stopTrackingWifiChange(WifiChangeListener listener) {
validateChannel();
sAsyncChannel.sendMessage(CMD_STOP_TRACKING_CHANGE, 0, removeListener(listener));
}
- public void configureSignificantWifiChange(WifiChangeSettings settings) {
+ /** @hide */
+ public void configureWifiChange(WifiChangeSettings settings) {
validateChannel();
sAsyncChannel.sendMessage(CMD_CONFIGURE_WIFI_CHANGE, 0, 0, settings);
}
+ /** interface to receive hotlist events on; use this on {@link #setHotlist} */
public static interface HotlistListener extends ActionListener {
+ /** indicates that access points were found by on going scans
+ * @param results list of scan results, one for each access point visible currently
+ */
public void onFound(ScanResult[] results);
}
@@ -310,6 +516,7 @@
dest.writeString(info.bssid);
dest.writeInt(info.low);
dest.writeInt(info.high);
+ dest.writeInt(info.frequencyHint);
}
}
@@ -326,6 +533,7 @@
info.bssid = in.readString();
info.low = in.readInt();
info.high = in.readInt();
+ info.frequencyHint = in.readInt();
settings.hotspotInfos[i] = info;
}
return settings;
@@ -337,6 +545,13 @@
};
}
+ /**
+ * set interesting access points to find
+ * @param hotspots access points of interest
+ * @param apLostThreshold number of scans needed to indicate that AP is lost
+ * @param listener object provided to report events on; this object must be unique and must
+ * also be provided on {@link #resetHotlist}
+ */
public void setHotlist(HotspotInfo[] hotspots,
int apLostThreshold, HotlistListener listener) {
validateChannel();
@@ -345,6 +560,10 @@
sAsyncChannel.sendMessage(CMD_SET_HOTLIST, 0, putListener(listener), settings);
}
+ /**
+ * remove tracking of interesting access points
+ * @param listener same object provided in {@link #setHotlist}
+ */
public void resetHotlist(HotlistListener listener) {
validateChannel();
sAsyncChannel.sendMessage(CMD_RESET_HOTLIST, 0, removeListener(listener));
@@ -554,6 +773,7 @@
break;
case CMD_OP_FAILED :
((ActionListener) listener).onFailure(msg.arg1, msg.obj);
+ removeListener(msg.arg2);
break;
case CMD_SCAN_RESULT :
((ScanListener) listener).onResults(
@@ -568,11 +788,11 @@
((ParcelableScanResults) msg.obj).getResults());
return;
case CMD_WIFI_CHANGE_DETECTED:
- ((SignificantWifiChangeListener) listener).onChanging(
+ ((WifiChangeListener) listener).onChanging(
((ParcelableScanResults) msg.obj).getResults());
return;
case CMD_WIFI_CHANGES_STABILIZED:
- ((SignificantWifiChangeListener) listener).onQuiescence(
+ ((WifiChangeListener) listener).onQuiescence(
((ParcelableScanResults) msg.obj).getResults());
return;
default:
diff --git a/wifi/java/android/net/wifi/hotspot/WifiHotspotManager.java b/wifi/java/android/net/wifi/hotspot/WifiHotspotManager.java
deleted file mode 100644
index ac15017..0000000
--- a/wifi/java/android/net/wifi/hotspot/WifiHotspotManager.java
+++ /dev/null
@@ -1,48 +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.hotspot;
-
-import android.content.Context;
-import android.os.RemoteException;
-import android.util.Log;
-
-/**
- * TODO: doc
- */
-public class WifiHotspotManager {
-
- private static final String TAG = "WifiHotspotManager";
-
- private Context mContext;
- IWifiHotspotManager mService;
-
- public WifiHotspotManager(Context context, IWifiHotspotManager service) {
- mContext = context;
- mService = service;
- }
-
- public void test() {
- try{
- Log.d(TAG, "test()");
- mService.test();
- }
- catch (RemoteException e) {
- Log.e(TAG, "test() exception");
- e.printStackTrace();
- }
- }
-}
diff --git a/wifi/java/android/net/wifi/hotspot/IWifiHotspotManager.aidl b/wifi/java/android/net/wifi/passpoint/IPasspointManager.aidl
similarity index 73%
copy from wifi/java/android/net/wifi/hotspot/IWifiHotspotManager.aidl
copy to wifi/java/android/net/wifi/passpoint/IPasspointManager.aidl
index 2b1601b..e57db64 100644
--- a/wifi/java/android/net/wifi/hotspot/IWifiHotspotManager.aidl
+++ b/wifi/java/android/net/wifi/passpoint/IPasspointManager.aidl
@@ -14,15 +14,18 @@
* limitations under the License.
*/
-package android.net.wifi.hotspot;
+package android.net.wifi.passpoint;
+
+import android.os.Messenger;
/**
- * Interface that allows controlling and querying Hotspot connectivity.
+ * Interface that allows controlling and querying Passpoint connectivity.
*
* {@hide}
*/
-interface IWifiHotspotManager
+interface IPasspointManager
{
- void test();
+ Messenger getMessenger();
+ int getPasspointState();
}
diff --git a/wifi/java/android/net/wifi/hotspot/IWifiHotspotManager.aidl b/wifi/java/android/net/wifi/passpoint/PasspointCredential.aidl
similarity index 77%
rename from wifi/java/android/net/wifi/hotspot/IWifiHotspotManager.aidl
rename to wifi/java/android/net/wifi/passpoint/PasspointCredential.aidl
index 2b1601b..6f75cbe 100644
--- a/wifi/java/android/net/wifi/hotspot/IWifiHotspotManager.aidl
+++ b/wifi/java/android/net/wifi/passpoint/PasspointCredential.aidl
@@ -14,15 +14,6 @@
* limitations under the License.
*/
-package android.net.wifi.hotspot;
+package android.net.wifi.passpoint;
-/**
- * Interface that allows controlling and querying Hotspot connectivity.
- *
- * {@hide}
- */
-interface IWifiHotspotManager
-{
- void test();
-}
-
+parcelable PasspointCredential;
diff --git a/wifi/java/android/net/wifi/passpoint/PasspointCredential.java b/wifi/java/android/net/wifi/passpoint/PasspointCredential.java
new file mode 100644
index 0000000..4218f23
--- /dev/null
+++ b/wifi/java/android/net/wifi/passpoint/PasspointCredential.java
@@ -0,0 +1,56 @@
+/*
+ * 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/hotspot/IWifiHotspotManager.aidl b/wifi/java/android/net/wifi/passpoint/PasspointInfo.aidl
similarity index 77%
copy from wifi/java/android/net/wifi/hotspot/IWifiHotspotManager.aidl
copy to wifi/java/android/net/wifi/passpoint/PasspointInfo.aidl
index 2b1601b..cc11045 100644
--- a/wifi/java/android/net/wifi/hotspot/IWifiHotspotManager.aidl
+++ b/wifi/java/android/net/wifi/passpoint/PasspointInfo.aidl
@@ -14,15 +14,6 @@
* limitations under the License.
*/
-package android.net.wifi.hotspot;
+package android.net.wifi.passpoint;
-/**
- * Interface that allows controlling and querying Hotspot connectivity.
- *
- * {@hide}
- */
-interface IWifiHotspotManager
-{
- void test();
-}
-
+parcelable PasspointInfo;
diff --git a/wifi/java/android/net/wifi/passpoint/PasspointInfo.java b/wifi/java/android/net/wifi/passpoint/PasspointInfo.java
new file mode 100644
index 0000000..d57b0aa
--- /dev/null
+++ b/wifi/java/android/net/wifi/passpoint/PasspointInfo.java
@@ -0,0 +1,274 @@
+/*
+ * 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/PasspointManager.java b/wifi/java/android/net/wifi/passpoint/PasspointManager.java
new file mode 100644
index 0000000..234a44c
--- /dev/null
+++ b/wifi/java/android/net/wifi/passpoint/PasspointManager.java
@@ -0,0 +1,504 @@
+/*
+ * 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.content.Context;
+import android.net.wifi.ScanResult;
+import android.os.Handler;
+import android.os.Looper;
+import android.os.Message;
+import android.os.Messenger;
+import android.os.RemoteException;
+import android.util.Log;
+
+import com.android.internal.util.AsyncChannel;
+import com.android.internal.util.Protocol;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * TODO: doc
+ */
+public class PasspointManager {
+
+ private static final String TAG = "PasspointManager";
+
+ private static final boolean DBG = true;
+
+ /* 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 disabled. This occurs when wifi is disabled. */
+ 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 access state. */
+ public static final int PASSPOINT_STATE_ACCESS = 3;
+
+ /** Passpoint is enabled and in provisioning state. */
+ 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 because wifi is disabled */
+ public static final int WIFI_DISABLED = 1;
+
+ /** Indicates that the operation failed because the framework is busy */
+ public static final int BUSY = 2;
+
+ /* Passpoint broadcasts */
+
+ /**
+ * Broadcast intent action indicating that the state of Passpoint
+ * connectivity has changed
+ */
+ public static final String PASSPOINT_STATE_CHANGED_ACTION =
+ "android.net.wifi.passpoint.STATE_CHANGE";
+
+ /**
+ * Broadcast intent action indicating that the saved Passpoint credential
+ * list has changed
+ */
+ public static final String PASSPOINT_CRED_CHANGED_ACTION =
+ "android.net.wifi.passpoint.CRED_CHANGE";
+
+ /**
+ * Broadcast intent action indicating that Passpoint online sign up is
+ * avaiable.
+ * @hide
+ */
+ public static final String PASSPOINT_OSU_AVAILABLE_ACTION =
+ "android.net.wifi.passpoint.OSU_AVAILABLE";
+
+ /**
+ * Broadcast intent action indicating that user remediation is required
+ * @hide
+ */
+ 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
+ */
+ public interface ChannelListener {
+ /**
+ * The channel to the framework has been disconnected. Application could
+ * try re-initializing using {@link #initialize}
+ */
+ public void onChannelDisconnected();
+ }
+
+ /**
+ * Interface for callback invocation on an application action
+ */
+ public interface ActionListener {
+ /** The operation succeeded */
+ public void onSuccess();
+
+ /**
+ * * The operation failed
+ *
+ * @param reason The reason for failure could be one of
+ * {@link #WIFI_DISABLED}, {@link #ERROR} or {@link #BUSY}
+ */
+ public void onFailure(int reason);
+ }
+
+ /**
+ * Interface for callback invocation when doing OSU or user remediation
+ * @hide
+ */
+ public interface OsuRemListener {
+ /** The operation succeeded */
+ public void onSuccess();
+
+ /**
+ * The operation failed
+ *
+ * @param reason The reason for failure could be one of
+ * {@link #WIFI_DISABLED}, {@link #ERROR} or {@link #BUSY}
+ */
+ public void onFailure(int reason);
+
+ /**
+ * Browser launch is requried for user interaction. When this callback
+ * is called, app should launch browser / webview to the given URL.
+ *
+ * @param url URL for browser launch
+ */
+ public void onBrowserLaunch(String url);
+
+ /**
+ * When this is called, app should dismiss the previously lanched browser.
+ */
+ public void onBrowserDismiss();
+ }
+
+ /**
+ * 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}
+ */
+ public static class Channel {
+ private final static int INVALID_LISTENER_KEY = 0;
+
+ private ChannelListener mChannelListener;
+
+ private HashMap<Integer, Object> mListenerMap = new HashMap<Integer, Object>();
+ private HashMap<Integer, Integer> mListenerMapCount = new HashMap<Integer, Integer>();
+ private Object mListenerMapLock = new Object();
+ private int mListenerKey = 0;
+
+ private List<ScanResult> mAnqpRequest = new LinkedList<ScanResult>();
+ private Object mAnqpRequestLock = new Object();
+
+ private AsyncChannel mAsyncChannel;
+ private PasspointHandler mHandler;
+ Context mContext;
+
+ Channel(Context context, Looper looper, ChannelListener l) {
+ mAsyncChannel = new AsyncChannel();
+ mHandler = new PasspointHandler(looper);
+ mChannelListener = l;
+ mContext = context;
+ }
+
+ private int putListener(Object listener) {
+ return putListener(listener, 1);
+ }
+
+ private int putListener(Object listener, int count) {
+ if (listener == null || count <= 0) return INVALID_LISTENER_KEY;
+ int key;
+ synchronized (mListenerMapLock) {
+ do {
+ key = mListenerKey++;
+ } while (key == INVALID_LISTENER_KEY);
+ mListenerMap.put(key, listener);
+ mListenerMapCount.put(key, count);
+ }
+ return key;
+ }
+
+ private Object getListener(int key, boolean force) {
+ Log.d(TAG, "getListener() key=" + key + " force=" + force);
+ 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;
+ }
+ Log.d(TAG, "remove key");
+ mListenerMapCount.remove(key);
+ return mListenerMap.remove(key);
+ }
+ }
+
+ private void anqpRequestStart(ScanResult sr) {
+ Log.d(TAG, "anqpRequestStart sr.bssid=" + sr.BSSID);
+ synchronized(mAnqpRequestLock) { mAnqpRequest.add(sr); }
+ }
+
+ private void anqpRequestFinish(PasspointInfo result) {
+ Log.d(TAG, "anqpRequestFinish pi.bssid=" + result.bssid);
+ synchronized(mAnqpRequestLock) {
+ for (ScanResult sr : mAnqpRequest)
+ if (sr.BSSID.equals(result.bssid)) {
+ Log.d(TAG, "find hit " + result.bssid);
+ sr.passpoint = result;
+ mAnqpRequest.remove(sr);
+ Log.d(TAG, "mAnqpRequest.len=" + mAnqpRequest.size());
+ break;
+ }
+ }
+ }
+
+ private void anqpRequestFinish(ScanResult sr) {
+ Log.d(TAG, "anqpRequestFinish sr.bssid=" + sr.BSSID);
+ synchronized(mAnqpRequestLock) {
+ for (ScanResult sr1 : mAnqpRequest)
+ if (sr1.BSSID.equals(sr.BSSID)) {
+ mAnqpRequest.remove(sr1);
+ break;
+ }
+ }
+ }
+
+ class PasspointHandler extends Handler {
+ PasspointHandler(Looper looper) {
+ super(looper);
+ }
+
+ @Override
+ public void handleMessage(Message message) {
+ Object listener = getListener(message.arg2, false);
+ switch (message.what) {
+ case AsyncChannel.CMD_CHANNEL_DISCONNECTED:
+ if (mChannelListener != null) {
+ mChannelListener.onChannelDisconnected();
+ mChannelListener = null;
+ }
+ break;
+
+ case REQUEST_ANQP_INFO_SUCCEEDED:
+ PasspointInfo result = (PasspointInfo) message.obj;
+ anqpRequestFinish(result);
+ if (listener != null) {
+ ((ActionListener) listener).onSuccess();
+ }
+ break;
+
+ case REQUEST_ANQP_INFO_FAILED:
+ anqpRequestFinish((ScanResult) message.obj);
+ if (listener == null) getListener(message.arg2, true);
+ if (listener != null) {
+ ((ActionListener) listener).onFailure(message.arg1);
+ }
+ break;
+
+ default:
+ Log.d(TAG, "Ignored " + message);
+ break;
+ }
+ }
+ }
+
+ }
+
+
+ private static final int BASE = Protocol.BASE_WIFI_PASSPOINT_MANAGER;
+
+ /** @hide */
+ public static final int REQUEST_ANQP_INFO = BASE + 1;
+
+ /** @hide */
+ public static final int REQUEST_ANQP_INFO_FAILED = BASE + 2;
+
+ /** @hide */
+ public static final int REQUEST_ANQP_INFO_SUCCEEDED = BASE + 3;
+
+ /** @hide */
+ public static final int REQUEST_OSU_INFO = BASE + 4;
+
+ /** @hide */
+ public static final int REQUEST_OSU_INFO_FAILED = BASE + 5;
+
+ /** @hide */
+ public static final int REQUEST_OSU_INFO_SUCCEEDED = BASE + 6;
+
+
+ private Context mContext;
+ IPasspointManager mService;
+
+
+ /**
+ * TODO: doc
+ * @param context
+ * @param service
+ */
+ public PasspointManager(Context context, IPasspointManager service) {
+ mContext = context;
+ mService = service;
+ }
+
+ /**
+ * Registers the application with the framework. This function must be the
+ * first to be called before any async passpoint operations are performed.
+ *
+ * @param srcContext is the context of the source
+ * @param srcLooper is the Looper on which the callbacks are receivied
+ * @param listener for callback at loss of framework communication. Can be
+ * null.
+ * @return Channel instance that is necessary for performing any further
+ * passpoint operations
+ */
+ public Channel initialize(Context srcContext, Looper srcLooper, ChannelListener listener) {
+ Messenger messenger = getMessenger();
+ if (messenger == null) return null;
+
+ Channel c = new Channel(srcContext, srcLooper, listener);
+ if (c.mAsyncChannel.connectSync(srcContext, c.mHandler, messenger)
+ == AsyncChannel.STATUS_SUCCESSFUL) {
+ return c;
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * STOPSHIP: temp solution, should use supplicant manager instead, check
+ * with b/13931972
+ *
+ * @hide
+ */
+ public Messenger getMessenger() {
+ try {
+ return mService.getMessenger();
+ } catch (RemoteException e) {
+ return null;
+ }
+ }
+
+ /**
+ * 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}
+ */
+ public int getPasspointState() {
+ try{
+ return mService.getPasspointState();
+ }
+ catch (RemoteException e) {
+ return PASSPOINT_STATE_UNKNOWN;
+ }
+ }
+
+ /**
+ * TODO: doc
+ *
+ * @param c
+ * @param requested
+ * @param mask
+ * @param listener
+ *
+ * @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);
+ }
+ 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");
+ listener.onSuccess();
+ return;
+ }
+ int key = c.putListener(listener, count);
+ for (ScanResult sr : list)
+ c.mAsyncChannel.sendMessage(REQUEST_ANQP_INFO, mask, key, sr);
+ Log.d(TAG, "requestAnqpInfo end");
+ }
+
+ /**
+ * TODO: doc
+ *
+ * @param c
+ * @param requested
+ * @param resolution
+ * @param listener
+ */
+ public void requestOsuIcons(Channel c, List<PasspointOsuProvider> requested,
+ int resolution, ActionListener listener) {
+ }
+
+ /**
+ * TODO: doc
+ *
+ * @param requested
+ * @return
+ */
+ public List<PasspointPolicy> requestCredentialMatch(List<ScanResult> requested) {
+ return null;
+ }
+
+ /* TODO: add credential APIs */
+
+ /**
+ * Give a list of all saved Passpoint credentials.
+ *
+ * @return The list of credentials
+ */
+ public List<PasspointCredential> getSavedCredentials() {
+ return null;
+ }
+
+ /**
+ * Add a new Passpoint credential.
+ *
+ * @param cred The credential to be added
+ * @return {@code true} if the operation succeeds, {@code false} otherwise
+ */
+ public boolean addCredential(PasspointCredential cred) {
+ return true;
+ }
+
+ /**
+ * Update an existing Passpoint credential.
+ *
+ * @param cred The credential to be updated
+ * @return {@code true} if the operation succeeds, {@code false} otherwise
+ */
+ public boolean updateCredential(PasspointCredential cred) {
+ return true;
+ }
+
+ /**
+ * Remove an existing Passpoint credential.
+ *
+ * @param cred The credential to be removed
+ * @return {@code true} if the operation succeeds, {@code false} otherwise
+ */
+ public boolean removeCredential(PasspointCredential cred) {
+ return true;
+ }
+
+ /** @hide */
+ public void startOsu(Channel c, PasspointOsuProvider selected, OsuRemListener listener) {
+
+ }
+
+ /** @hide */
+ 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) {
+ }
+
+ private static void checkChannel(Channel c) {
+ if (c == null) throw new IllegalArgumentException("Channel needs to be initialized");
+ }
+}
diff --git a/wifi/java/android/net/wifi/hotspot/IWifiHotspotManager.aidl b/wifi/java/android/net/wifi/passpoint/PasspointOsuProvider.aidl
similarity index 77%
copy from wifi/java/android/net/wifi/hotspot/IWifiHotspotManager.aidl
copy to wifi/java/android/net/wifi/passpoint/PasspointOsuProvider.aidl
index 2b1601b..f5ecb7c 100644
--- a/wifi/java/android/net/wifi/hotspot/IWifiHotspotManager.aidl
+++ b/wifi/java/android/net/wifi/passpoint/PasspointOsuProvider.aidl
@@ -14,15 +14,6 @@
* limitations under the License.
*/
-package android.net.wifi.hotspot;
+package android.net.wifi.passpoint;
-/**
- * Interface that allows controlling and querying Hotspot connectivity.
- *
- * {@hide}
- */
-interface IWifiHotspotManager
-{
- void test();
-}
-
+parcelable PasspointOsuProvider;
diff --git a/wifi/java/android/net/wifi/passpoint/PasspointOsuProvider.java b/wifi/java/android/net/wifi/passpoint/PasspointOsuProvider.java
new file mode 100644
index 0000000..80d5315
--- /dev/null
+++ b/wifi/java/android/net/wifi/passpoint/PasspointOsuProvider.java
@@ -0,0 +1,145 @@
+/*
+ * 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;
+
+/**
+ * TODO: doc
+ */
+public class PasspointOsuProvider implements Parcelable {
+
+ /** TODO: doc */
+ public static final int OSU_METHOD_UNKNOWN = -1;
+
+ /** TODO: doc */
+ public static final int OSU_METHOD_OMADM = 0;
+
+ /** TODO: doc */
+ public static final int OSU_METHOD_SOAP = 1;
+
+ /** TODO: doc */
+ public String ssid;
+
+ /** TODO: doc */
+ public String friendlyName;
+
+ /** TODO: doc */
+ public String serverUri;
+
+ /** TODO: doc */
+ public int osuMethod = OSU_METHOD_UNKNOWN;
+
+ /** TODO: doc */
+ public int iconWidth;
+
+ /** TODO: doc */
+ public int iconHeight;
+
+ /** TODO: doc */
+ public String iconType;
+
+ /** TODO: doc */
+ public String iconFileName;
+
+ /** TODO: doc */
+ public Object icon; // TODO: should change to image format
+
+ /** TODO: doc */
+ public String osuNai;
+
+ /** TODO: doc */
+ public String osuService;
+
+
+ /** default constructor @hide */
+ public PasspointOsuProvider() {
+ // TODO
+ }
+
+ /** copy constructor @hide */
+ public PasspointOsuProvider(PasspointOsuProvider source) {
+ // TODO
+ }
+
+ @Override
+ public String toString() {
+ StringBuffer sb = new StringBuffer();
+ sb.append("SSID: ").append(ssid);
+ if (friendlyName != null)
+ sb.append(" friendlyName: ").append(friendlyName);
+ if (serverUri != null)
+ sb.append(" serverUri: ").append(serverUri);
+ sb.append(" osuMethod: ").append(osuMethod);
+ if (iconFileName != null) {
+ sb.append(" icon: [").append(iconWidth).append("x")
+ .append(iconHeight).append(" ")
+ .append(iconType).append(" ")
+ .append(iconFileName);
+ }
+ if (osuNai != null)
+ sb.append(" osuNai: ").append(osuNai);
+ if (osuService != null)
+ sb.append(" osuService: ").append(osuService);
+ return sb.toString();
+ }
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
+ public void writeToParcel(Parcel out, int flags) {
+ out.writeValue(ssid);
+ out.writeValue(friendlyName);
+ out.writeValue(serverUri);
+ out.writeInt(osuMethod);
+ out.writeInt(iconWidth);
+ out.writeInt(iconHeight);
+ out.writeValue(iconType);
+ out.writeValue(iconFileName);
+ out.writeValue(osuNai);
+ out.writeValue(osuService);
+ // 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;
+ }
+
+ @Override
+ public PasspointOsuProvider[] newArray(int size) {
+ return new PasspointOsuProvider[size];
+ }
+ };
+}
diff --git a/wifi/java/android/net/wifi/hotspot/IWifiHotspotManager.aidl b/wifi/java/android/net/wifi/passpoint/PasspointPolicy.aidl
similarity index 77%
copy from wifi/java/android/net/wifi/hotspot/IWifiHotspotManager.aidl
copy to wifi/java/android/net/wifi/passpoint/PasspointPolicy.aidl
index 2b1601b..c2cc731 100644
--- a/wifi/java/android/net/wifi/hotspot/IWifiHotspotManager.aidl
+++ b/wifi/java/android/net/wifi/passpoint/PasspointPolicy.aidl
@@ -14,15 +14,6 @@
* limitations under the License.
*/
-package android.net.wifi.hotspot;
+package android.net.wifi.passpoint;
-/**
- * Interface that allows controlling and querying Hotspot connectivity.
- *
- * {@hide}
- */
-interface IWifiHotspotManager
-{
- void test();
-}
-
+parcelable PasspointPolicy;
diff --git a/wifi/java/android/net/wifi/passpoint/PasspointPolicy.java b/wifi/java/android/net/wifi/passpoint/PasspointPolicy.java
new file mode 100644
index 0000000..3a8806b
--- /dev/null
+++ b/wifi/java/android/net/wifi/passpoint/PasspointPolicy.java
@@ -0,0 +1,55 @@
+/*
+ * 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/hotspot/IWifiHotspotManager.aidl b/wifi/java/android/net/wifi/passpoint/WifiTree.aidl
similarity index 77%
copy from wifi/java/android/net/wifi/hotspot/IWifiHotspotManager.aidl
copy to wifi/java/android/net/wifi/passpoint/WifiTree.aidl
index 2b1601b..8e2fab742 100644
--- a/wifi/java/android/net/wifi/hotspot/IWifiHotspotManager.aidl
+++ b/wifi/java/android/net/wifi/passpoint/WifiTree.aidl
@@ -14,15 +14,6 @@
* limitations under the License.
*/
-package android.net.wifi.hotspot;
+package android.net.wifi.passpoint;
-/**
- * Interface that allows controlling and querying Hotspot connectivity.
- *
- * {@hide}
- */
-interface IWifiHotspotManager
-{
- void test();
-}
-
+parcelable WifiTree;
diff --git a/wifi/java/android/net/wifi/passpoint/WifiTree.java b/wifi/java/android/net/wifi/passpoint/WifiTree.java
new file mode 100644
index 0000000..8fdb6e1
--- /dev/null
+++ b/wifi/java/android/net/wifi/passpoint/WifiTree.java
@@ -0,0 +1,51 @@
+/*
+ * 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];
+ }
+ };
+}