summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/java/android/alsa/AlsaCardsParser.java116
-rw-r--r--core/java/android/alsa/AlsaDevicesParser.java240
-rw-r--r--core/java/android/alsa/LineTokenizer.java57
-rw-r--r--core/jni/Android.mk6
-rw-r--r--core/jni/android_media_AudioTrack.cpp20
-rw-r--r--core/res/res/drawable-hdpi/ab_bottom_solid_qntm_alpha.9.pngbin0 -> 135 bytes
-rw-r--r--core/res/res/drawable-hdpi/ab_bottom_transparent_qntm_alpha.9.pngbin0 -> 138 bytes
-rw-r--r--core/res/res/drawable-hdpi/ab_share_pack_qntm_alpha.9.pngbin0 -> 124 bytes
-rw-r--r--core/res/res/drawable-hdpi/ab_solid_qntm_alpha.9.pngbin0 -> 133 bytes
-rw-r--r--core/res/res/drawable-hdpi/ab_solid_shadow_qntm.9.pngbin190 -> 0 bytes
-rw-r--r--core/res/res/drawable-hdpi/ab_solid_shadow_qntm_alpha.9.pngbin0 -> 192 bytes
-rw-r--r--core/res/res/drawable-hdpi/ab_stacked_solid_qntm_alpha.9.pngbin0 -> 141 bytes
-rw-r--r--core/res/res/drawable-hdpi/ab_stacked_transparent_qntm_alpha.9.pngbin0 -> 140 bytes
-rw-r--r--core/res/res/drawable-hdpi/btn_cab_done_qntm_alpha.9.pngbin0 -> 92 bytes
-rw-r--r--core/res/res/drawable-hdpi/ic_media_route_disabled_qntm_alpha.pngbin0 -> 409 bytes
-rw-r--r--core/res/res/drawable-hdpi/ic_media_route_off_qntm_alpha.pngbin0 -> 445 bytes
-rw-r--r--core/res/res/drawable-hdpi/ic_media_route_on_0_qntm_alpha.pngbin0 -> 426 bytes
-rw-r--r--core/res/res/drawable-hdpi/ic_media_route_on_1_qntm_alpha.pngbin0 -> 446 bytes
-rw-r--r--core/res/res/drawable-hdpi/ic_media_route_on_2_qntm_alpha.pngbin0 -> 448 bytes
-rw-r--r--core/res/res/drawable-hdpi/ic_media_route_on_qntm_alpha.pngbin0 -> 494 bytes
-rw-r--r--core/res/res/drawable-mdpi/ab_bottom_solid_qntm_alpha.9.pngbin0 -> 117 bytes
-rw-r--r--core/res/res/drawable-mdpi/ab_bottom_transparent_qntm_alpha.9.pngbin0 -> 120 bytes
-rw-r--r--core/res/res/drawable-mdpi/ab_share_pack_qntm_alpha.9.pngbin0 -> 117 bytes
-rw-r--r--core/res/res/drawable-mdpi/ab_solid_qntm_alpha.9.pngbin0 -> 117 bytes
-rw-r--r--core/res/res/drawable-mdpi/ab_solid_shadow_qntm.9.pngbin145 -> 0 bytes
-rw-r--r--core/res/res/drawable-mdpi/ab_solid_shadow_qntm_alpha.9.pngbin0 -> 152 bytes
-rw-r--r--core/res/res/drawable-mdpi/ab_stacked_solid_qntm_alpha.9.pngbin0 -> 122 bytes
-rw-r--r--core/res/res/drawable-mdpi/ab_stacked_transparent_qntm_alpha.9.pngbin0 -> 121 bytes
-rw-r--r--core/res/res/drawable-mdpi/btn_cab_done_qntm_alpha.9.pngbin0 -> 85 bytes
-rw-r--r--core/res/res/drawable-mdpi/ic_media_route_disabled_qntm_alpha.pngbin0 -> 349 bytes
-rw-r--r--core/res/res/drawable-mdpi/ic_media_route_off_qntm_alpha.pngbin0 -> 388 bytes
-rw-r--r--core/res/res/drawable-mdpi/ic_media_route_on_0_qntm_alpha.pngbin0 -> 363 bytes
-rw-r--r--core/res/res/drawable-mdpi/ic_media_route_on_1_qntm_alpha.pngbin0 -> 376 bytes
-rw-r--r--core/res/res/drawable-mdpi/ic_media_route_on_2_qntm_alpha.pngbin0 -> 381 bytes
-rw-r--r--core/res/res/drawable-mdpi/ic_media_route_on_qntm_alpha.pngbin0 -> 415 bytes
-rw-r--r--core/res/res/drawable-xhdpi/ab_bottom_solid_qntm_alpha.9.pngbin0 -> 150 bytes
-rw-r--r--core/res/res/drawable-xhdpi/ab_bottom_transparent_qntm_alpha.9.pngbin0 -> 145 bytes
-rw-r--r--core/res/res/drawable-xhdpi/ab_share_pack_qntm_alpha.9.pngbin0 -> 139 bytes
-rw-r--r--core/res/res/drawable-xhdpi/ab_solid_qntm_alpha.9.pngbin0 -> 149 bytes
-rw-r--r--core/res/res/drawable-xhdpi/ab_solid_shadow_qntm.9.pngbin241 -> 0 bytes
-rw-r--r--core/res/res/drawable-xhdpi/ab_solid_shadow_qntm_alpha.9.pngbin0 -> 246 bytes
-rw-r--r--core/res/res/drawable-xhdpi/ab_stacked_solid_qntm_alpha.9.pngbin0 -> 155 bytes
-rw-r--r--core/res/res/drawable-xhdpi/ab_stacked_transparent_qntm_alpha.9.pngbin0 -> 150 bytes
-rw-r--r--core/res/res/drawable-xhdpi/btn_cab_done_qntm_alpha.9.pngbin0 -> 93 bytes
-rw-r--r--core/res/res/drawable-xhdpi/ic_media_route_disabled_qntm_alpha.pngbin0 -> 559 bytes
-rw-r--r--core/res/res/drawable-xhdpi/ic_media_route_off_qntm_alpha.pngbin0 -> 658 bytes
-rw-r--r--core/res/res/drawable-xhdpi/ic_media_route_on_0_qntm_alpha.pngbin0 -> 584 bytes
-rw-r--r--core/res/res/drawable-xhdpi/ic_media_route_on_1_qntm_alpha.pngbin0 -> 610 bytes
-rw-r--r--core/res/res/drawable-xhdpi/ic_media_route_on_2_qntm_alpha.pngbin0 -> 637 bytes
-rw-r--r--core/res/res/drawable-xhdpi/ic_media_route_on_qntm_alpha.pngbin0 -> 723 bytes
-rw-r--r--core/res/res/drawable-xxhdpi/ab_bottom_solid_qntm_alpha.9.pngbin0 -> 233 bytes
-rw-r--r--core/res/res/drawable-xxhdpi/ab_bottom_transparent_qntm_alpha.9.pngbin0 -> 220 bytes
-rw-r--r--core/res/res/drawable-xxhdpi/ab_share_pack_qntm_alpha.9.pngbin0 -> 1140 bytes
-rw-r--r--core/res/res/drawable-xxhdpi/ab_solid_qntm_alpha.9.pngbin0 -> 275 bytes
-rw-r--r--core/res/res/drawable-xxhdpi/ab_solid_shadow_qntm.9.pngbin314 -> 0 bytes
-rw-r--r--core/res/res/drawable-xxhdpi/ab_solid_shadow_qntm_alpha.9.pngbin0 -> 344 bytes
-rw-r--r--core/res/res/drawable-xxhdpi/ab_stacked_solid_qntm_alpha.9.pngbin0 -> 218 bytes
-rw-r--r--core/res/res/drawable-xxhdpi/ab_stacked_transparent_qntm_alpha.9.pngbin0 -> 218 bytes
-rw-r--r--core/res/res/drawable-xxhdpi/ab_transparent_qntm_alpha.9.pngbin234 -> 205 bytes
-rw-r--r--core/res/res/drawable-xxhdpi/btn_cab_done_qntm_alpha.9.pngbin0 -> 1046 bytes
-rw-r--r--core/res/res/drawable-xxhdpi/ic_media_route_disabled_qntm_alpha.pngbin0 -> 1000 bytes
-rw-r--r--core/res/res/drawable-xxhdpi/ic_media_route_off_qntm_alpha.pngbin0 -> 1067 bytes
-rw-r--r--core/res/res/drawable-xxhdpi/ic_media_route_on_0_qntm_alpha.pngbin0 -> 1014 bytes
-rw-r--r--core/res/res/drawable-xxhdpi/ic_media_route_on_1_qntm_alpha.pngbin0 -> 1043 bytes
-rw-r--r--core/res/res/drawable-xxhdpi/ic_media_route_on_2_qntm_alpha.pngbin0 -> 1026 bytes
-rw-r--r--core/res/res/drawable-xxhdpi/ic_media_route_on_qntm_alpha.pngbin0 -> 1148 bytes
-rw-r--r--core/res/res/drawable/ab_bottom_solid_quantum.xml20
-rw-r--r--core/res/res/drawable/ab_bottom_transparent_quantum.xml21
-rw-r--r--core/res/res/drawable/ab_share_pack_quantum.xml19
-rw-r--r--core/res/res/drawable/ab_solid_quantum.xml20
-rw-r--r--core/res/res/drawable/ab_solid_shadow_quantum.xml19
-rw-r--r--core/res/res/drawable/ab_stacked_solid_quantum.xml20
-rw-r--r--core/res/res/drawable/ab_stacked_transparent_quantum.xml20
-rw-r--r--core/res/res/drawable/btn_cab_done_quantum.xml31
-rw-r--r--core/res/res/drawable/ic_media_route_connecting_quantum.xml36
-rw-r--r--core/res/res/drawable/ic_media_route_quantum.xml33
-rw-r--r--core/res/res/layout/tab_indicator_quantum.xml37
-rw-r--r--core/res/res/values/styles_quantum.xml32
-rw-r--r--core/res/res/values/themes_quantum.xml2
-rw-r--r--docs/html/about/dashboards/index.jd43
-rw-r--r--docs/html/google/index.jd2
-rw-r--r--docs/html/sdk/installing/studio-build.jd2
-rw-r--r--docs/html/tools/tools_toc.cs2
-rw-r--r--docs/html/wear/images/laptop-bridge.pngbin238742 -> 252319 bytes
-rw-r--r--media/java/android/media/AudioService.java30
-rw-r--r--media/java/android/media/AudioSystem.java2
-rw-r--r--media/java/android/media/AudioTrack.java8
-rw-r--r--media/jni/android_media_MediaCodec.cpp6
-rw-r--r--packages/SystemUI/res/values/dimens.xml4
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/ZenModeView.java122
-rwxr-xr-xservices/core/java/com/android/server/pm/PackageManagerService.java47
-rw-r--r--services/usb/java/com/android/server/usb/UsbHostManager.java94
-rw-r--r--tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java23
94 files changed, 984 insertions, 152 deletions
diff --git a/core/java/android/alsa/AlsaCardsParser.java b/core/java/android/alsa/AlsaCardsParser.java
new file mode 100644
index 0000000..f9af979
--- /dev/null
+++ b/core/java/android/alsa/AlsaCardsParser.java
@@ -0,0 +1,116 @@
+/*
+ * 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.alsascan;
+
+import android.util.Slog;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.Vector;
+
+/**
+ * @hide Retrieves information from an ALSA "cards" file.
+ */
+public class AlsaCardsParser {
+ private static final String TAG = "AlsaCardsParser";
+
+ private static LineTokenizer tokenizer_ = new LineTokenizer(" :[]");
+
+ public class AlsaCardRecord {
+ public int mCardNum = -1;
+ public String mField1 = "";
+ public String mCardName = "";
+ public String mCardDescription = "";
+
+ public AlsaCardRecord() {}
+
+ public boolean parse(String line, int lineIndex) {
+ int tokenIndex = 0;
+ int delimIndex = 0;
+ if (lineIndex == 0) {
+ // line # (skip)
+ tokenIndex = tokenizer_.nextToken(line, tokenIndex);
+ delimIndex = tokenizer_.nextDelimiter(line, tokenIndex);
+
+ // mField1
+ tokenIndex = tokenizer_.nextToken(line, delimIndex);
+ delimIndex = tokenizer_.nextDelimiter(line, tokenIndex);
+ mField1 = line.substring(tokenIndex, delimIndex);
+
+ // mCardName
+ tokenIndex = tokenizer_.nextToken(line, delimIndex);
+ // delimIndex = tokenizer_.nextDelimiter(line, tokenIndex);
+ mCardName = line.substring(tokenIndex);
+ // done
+ } else if (lineIndex == 1) {
+ tokenIndex = tokenizer_.nextToken(line, 0);
+ if (tokenIndex != -1) {
+ mCardDescription = line.substring(tokenIndex);
+ }
+ }
+
+ return true;
+ }
+
+ public String textFormat() {
+ return mCardName + " : " + mCardDescription;
+ }
+ }
+
+ private Vector<AlsaCardRecord> cardRecords_ = new Vector<AlsaCardRecord>();
+
+ public void scan() {
+ cardRecords_.clear();
+ final String cardsFilePath = "/proc/asound/cards";
+ File cardsFile = new File(cardsFilePath);
+ try {
+ FileReader reader = new FileReader(cardsFile);
+ BufferedReader bufferedReader = new BufferedReader(reader);
+ String line = "";
+ while ((line = bufferedReader.readLine()) != null) {
+ AlsaCardRecord cardRecord = new AlsaCardRecord();
+ cardRecord.parse(line, 0);
+ cardRecord.parse(line = bufferedReader.readLine(), 1);
+ cardRecords_.add(cardRecord);
+ }
+ reader.close();
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public AlsaCardRecord getCardRecordAt(int index) {
+ return cardRecords_.get(index);
+ }
+
+ public int getNumCardRecords() {
+ return cardRecords_.size();
+ }
+
+ public void Log() {
+ int numCardRecs = getNumCardRecords();
+ for (int index = 0; index < numCardRecs; ++index) {
+ Slog.w(TAG, "usb:" + getCardRecordAt(index).textFormat());
+ }
+ }
+
+ public AlsaCardsParser() {}
+}
diff --git a/core/java/android/alsa/AlsaDevicesParser.java b/core/java/android/alsa/AlsaDevicesParser.java
new file mode 100644
index 0000000..3835942
--- /dev/null
+++ b/core/java/android/alsa/AlsaDevicesParser.java
@@ -0,0 +1,240 @@
+/*
+ * 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.alsascan;
+
+import android.util.Slog;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.Vector;
+
+/**
+ * @hide
+ * Retrieves information from an ALSA "devices" file.
+ */
+public class AlsaDevicesParser {
+ private static final String TAG = "AlsaDevicesParser";
+
+ private static final int kIndex_CardDeviceField = 5;
+ private static final int kStartIndex_CardNum = 6;
+ private static final int kEndIndex_CardNum = 8; // one past
+ private static final int kStartIndex_DeviceNum = 9;
+ private static final int kEndIndex_DeviceNum = 11; // one past
+ private static final int kStartIndex_Type = 14;
+
+ private static LineTokenizer mTokenizer = new LineTokenizer(" :[]-");
+
+ private boolean mHasCaptureDevices = false;
+ private boolean mHasPlaybackDevices = false;
+ private boolean mHasMIDIDevices = false;
+
+ public class AlsaDeviceRecord {
+ public static final int kDeviceType_Unknown = -1;
+ public static final int kDeviceType_Audio = 0;
+ public static final int kDeviceType_Control = 1;
+ public static final int kDeviceType_MIDI = 2;
+
+ public static final int kDeviceDir_Unknown = -1;
+ public static final int kDeviceDir_Capture = 0;
+ public static final int kDeviceDir_Playback = 1;
+
+ int mCardNum = -1;
+ int mDeviceNum = -1;
+ int mDeviceType = kDeviceType_Unknown;
+ int mDeviceDir = kDeviceDir_Unknown;
+
+ public AlsaDeviceRecord() {
+ }
+
+ public boolean parse(String line) {
+ // "0123456789012345678901234567890"
+ // " 2: [ 0-31]: digital audio playback"
+ // " 3: [ 0-30]: digital audio capture"
+ // " 35: [ 1] : control"
+ // " 36: [ 2- 0]: raw midi"
+
+ final int kToken_LineNum = 0;
+ final int kToken_CardNum = 1;
+ final int kToken_DeviceNum = 2;
+ final int kToken_Type0 = 3; // "digital", "control", "raw"
+ final int kToken_Type1 = 4; // "audio", "midi"
+ final int kToken_Type2 = 5; // "capture", "playback"
+
+ int tokenOffset = 0;
+ int delimOffset = 0;
+ int tokenIndex = kToken_LineNum;
+ while (true) {
+ tokenOffset = mTokenizer.nextToken(line, delimOffset);
+ if (tokenOffset == LineTokenizer.kTokenNotFound) {
+ break; // bail
+ }
+ delimOffset = mTokenizer.nextDelimiter(line, tokenOffset);
+ if (delimOffset == LineTokenizer.kTokenNotFound) {
+ delimOffset = line.length();
+ }
+ String token = line.substring(tokenOffset, delimOffset);
+
+ switch (tokenIndex) {
+ case kToken_LineNum:
+ // ignore
+ break;
+
+ case kToken_CardNum:
+ mCardNum = Integer.parseInt(token);
+ if (line.charAt(delimOffset) != '-') {
+ tokenIndex++; // no device # in the token stream
+ }
+ break;
+
+ case kToken_DeviceNum:
+ mDeviceNum = Integer.parseInt(token);
+ break;
+
+ case kToken_Type0:
+ if (token.equals("digital")) {
+ // NOP
+ } else if (token.equals("control")) {
+ mDeviceType = kDeviceType_Control;
+ } else if (token.equals("raw")) {
+ // NOP
+ }
+ break;
+
+ case kToken_Type1:
+ if (token.equals("audio")) {
+ mDeviceType = kDeviceType_Audio;
+ } else if (token.equals("midi")) {
+ mDeviceType = kDeviceType_MIDI;
+ mHasMIDIDevices = true;
+ }
+ break;
+
+ case kToken_Type2:
+ if (token.equals("capture")) {
+ mDeviceDir = kDeviceDir_Capture;
+ mHasCaptureDevices = true;
+ } else if (token.equals("playback")) {
+ mDeviceDir = kDeviceDir_Playback;
+ mHasPlaybackDevices = true;
+ }
+ break;
+ } // switch (tokenIndex)
+
+ tokenIndex++;
+ } // while (true)
+
+ return true;
+ } // parse()
+
+ public String textFormat() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("[" + mCardNum + ":" + mDeviceNum + "]");
+
+ switch (mDeviceType) {
+ case kDeviceType_Unknown:
+ sb.append(" N/A");
+ break;
+ case kDeviceType_Audio:
+ sb.append(" Audio");
+ break;
+ case kDeviceType_Control:
+ sb.append(" Control");
+ break;
+ case kDeviceType_MIDI:
+ sb.append(" MIDI");
+ break;
+ }
+
+ switch (mDeviceDir) {
+ case kDeviceDir_Unknown:
+ sb.append(" N/A");
+ break;
+ case kDeviceDir_Capture:
+ sb.append(" Capture");
+ break;
+ case kDeviceDir_Playback:
+ sb.append(" Playback");
+ break;
+ }
+
+ return sb.toString();
+ }
+ }
+
+ private Vector<AlsaDeviceRecord>
+ deviceRecords_ = new Vector<AlsaDeviceRecord>();
+
+ private boolean isLineDeviceRecord(String line) {
+ return line.charAt(kIndex_CardDeviceField) == '[';
+ }
+
+ public AlsaDevicesParser() {
+ }
+
+ public int getNumDeviceRecords() {
+ return deviceRecords_.size();
+ }
+
+ public AlsaDeviceRecord getDeviceRecordAt(int index) {
+ return deviceRecords_.get(index);
+ }
+
+ public void Log() {
+ int numDevRecs = getNumDeviceRecords();
+ for (int index = 0; index < numDevRecs; ++index) {
+ Slog.w(TAG, "usb:" + getDeviceRecordAt(index).textFormat());
+ }
+ }
+
+ public boolean hasPlaybackDevices() {
+ return mHasPlaybackDevices;
+ }
+
+ public boolean hasCaptureDevices() {
+ return mHasCaptureDevices;
+ }
+
+ public boolean hasMIDIDevices() {
+ return mHasMIDIDevices;
+ }
+
+ public void scan() {
+ deviceRecords_.clear();
+
+ final String devicesFilePath = "/proc/asound/devices";
+ File devicesFile = new File(devicesFilePath);
+ try {
+ FileReader reader = new FileReader(devicesFile);
+ BufferedReader bufferedReader = new BufferedReader(reader);
+ String line = "";
+ while ((line = bufferedReader.readLine()) != null) {
+ if (isLineDeviceRecord(line)) {
+ AlsaDeviceRecord deviceRecord = new AlsaDeviceRecord();
+ deviceRecord.parse(line);
+ deviceRecords_.add(deviceRecord);
+ }
+ }
+ reader.close();
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+} // class AlsaDevicesParser
+
diff --git a/core/java/android/alsa/LineTokenizer.java b/core/java/android/alsa/LineTokenizer.java
new file mode 100644
index 0000000..c138fc5
--- /dev/null
+++ b/core/java/android/alsa/LineTokenizer.java
@@ -0,0 +1,57 @@
+/*
+ * 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.alsascan;
+
+/**
+ * @hide
+ * Breaks lines in an ALSA "cards" or "devices" file into tokens.
+ * TODO(pmclean) Look into replacing this with String.split().
+ */
+public class LineTokenizer {
+ public static final int kTokenNotFound = -1;
+
+ private String mDelimiters = "";
+
+ public LineTokenizer(String delimiters) {
+ mDelimiters = delimiters;
+ }
+
+ int nextToken(String line, int startIndex) {
+ int len = line.length();
+ int offset = startIndex;
+ for (; offset < len; offset++) {
+ if (mDelimiters.indexOf(line.charAt(offset)) == -1) {
+ // past a delimiter
+ break;
+ }
+ }
+
+ return offset < len ? offset : kTokenNotFound;
+ }
+
+ int nextDelimiter(String line, int startIndex) {
+ int len = line.length();
+ int offset = startIndex;
+ for (; offset < len; offset++) {
+ if (mDelimiters.indexOf(line.charAt(offset)) != -1) {
+ // past a delimiter
+ break;
+ }
+ }
+
+ return offset < len ? offset : kTokenNotFound;
+ }
+}
diff --git a/core/jni/Android.mk b/core/jni/Android.mk
index 51c5a86..52c463d 100644
--- a/core/jni/Android.mk
+++ b/core/jni/Android.mk
@@ -177,7 +177,8 @@ LOCAL_C_INCLUDES += \
external/harfbuzz_ng/src \
external/zlib \
frameworks/opt/emoji \
- libcore/include
+ libcore/include \
+ $(call include-path-for, audio-utils) \
LOCAL_SHARED_LIBRARIES := \
libmemtrack \
@@ -213,7 +214,8 @@ LOCAL_SHARED_LIBRARIES := \
libjpeg \
libusbhost \
libharfbuzz_ng \
- libz
+ libz \
+ libaudioutils \
ifeq ($(USE_OPENGL_RENDERER),true)
LOCAL_SHARED_LIBRARIES += libhwui
diff --git a/core/jni/android_media_AudioTrack.cpp b/core/jni/android_media_AudioTrack.cpp
index 79a46fa..162d0c4 100644
--- a/core/jni/android_media_AudioTrack.cpp
+++ b/core/jni/android_media_AudioTrack.cpp
@@ -26,6 +26,7 @@
#include <utils/Log.h>
#include <media/AudioSystem.h>
#include <media/AudioTrack.h>
+#include <audio_utils/primitives.h>
#include <binder/MemoryHeapBase.h>
#include <binder/MemoryBase.h>
@@ -550,10 +551,8 @@ jint writeToTrack(const sp<AudioTrack>& track, jint audioFormat, const jbyte* da
}
int count = sizeInBytes;
int16_t *dst = (int16_t *)track->sharedBuffer()->pointer();
- const int8_t *src = (const int8_t *)(data + offsetInBytes);
- while (count--) {
- *dst++ = (int16_t)(*src++^0x80) << 8;
- }
+ const uint8_t *src = (const uint8_t *)(data + offsetInBytes);
+ memcpy_to_i16_from_u8(dst, src, count);
// even though we wrote 2*sizeInBytes, we only report sizeInBytes as written to hide
// the 8bit mixer restriction from the user of this function
written = sizeInBytes;
@@ -888,17 +887,22 @@ static jint android_media_AudioTrack_get_min_buff_size(JNIEnv *env, jobject thi
}
// ----------------------------------------------------------------------------
-static void
+static jint
android_media_AudioTrack_setAuxEffectSendLevel(JNIEnv *env, jobject thiz, jfloat level )
{
sp<AudioTrack> lpTrack = getAudioTrack(env, thiz);
if (lpTrack == NULL ) {
jniThrowException(env, "java/lang/IllegalStateException",
"Unable to retrieve AudioTrack pointer for setAuxEffectSendLevel()");
- return;
+ return -1;
}
- lpTrack->setAuxEffectSendLevel(level);
+ status_t status = lpTrack->setAuxEffectSendLevel(level);
+ if (status != NO_ERROR) {
+ ALOGE("AudioTrack::setAuxEffectSendLevel() for level %g failed with status %d",
+ level, status);
+ }
+ return (jint) status;
}
// ----------------------------------------------------------------------------
@@ -954,7 +958,7 @@ static JNINativeMethod gMethods[] = {
{"native_get_min_buff_size",
"(III)I", (void *)android_media_AudioTrack_get_min_buff_size},
{"native_setAuxEffectSendLevel",
- "(F)V", (void *)android_media_AudioTrack_setAuxEffectSendLevel},
+ "(F)I", (void *)android_media_AudioTrack_setAuxEffectSendLevel},
{"native_attachAuxEffect",
"(I)I", (void *)android_media_AudioTrack_attachAuxEffect},
};
diff --git a/core/res/res/drawable-hdpi/ab_bottom_solid_qntm_alpha.9.png b/core/res/res/drawable-hdpi/ab_bottom_solid_qntm_alpha.9.png
new file mode 100644
index 0000000..406bf58
--- /dev/null
+++ b/core/res/res/drawable-hdpi/ab_bottom_solid_qntm_alpha.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ab_bottom_transparent_qntm_alpha.9.png b/core/res/res/drawable-hdpi/ab_bottom_transparent_qntm_alpha.9.png
new file mode 100644
index 0000000..409d3cd
--- /dev/null
+++ b/core/res/res/drawable-hdpi/ab_bottom_transparent_qntm_alpha.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ab_share_pack_qntm_alpha.9.png b/core/res/res/drawable-hdpi/ab_share_pack_qntm_alpha.9.png
new file mode 100644
index 0000000..b07da0c
--- /dev/null
+++ b/core/res/res/drawable-hdpi/ab_share_pack_qntm_alpha.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ab_solid_qntm_alpha.9.png b/core/res/res/drawable-hdpi/ab_solid_qntm_alpha.9.png
new file mode 100644
index 0000000..9d7b25f
--- /dev/null
+++ b/core/res/res/drawable-hdpi/ab_solid_qntm_alpha.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ab_solid_shadow_qntm.9.png b/core/res/res/drawable-hdpi/ab_solid_shadow_qntm.9.png
deleted file mode 100644
index 717ec1a..0000000
--- a/core/res/res/drawable-hdpi/ab_solid_shadow_qntm.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ab_solid_shadow_qntm_alpha.9.png b/core/res/res/drawable-hdpi/ab_solid_shadow_qntm_alpha.9.png
new file mode 100644
index 0000000..e49ad54
--- /dev/null
+++ b/core/res/res/drawable-hdpi/ab_solid_shadow_qntm_alpha.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ab_stacked_solid_qntm_alpha.9.png b/core/res/res/drawable-hdpi/ab_stacked_solid_qntm_alpha.9.png
new file mode 100644
index 0000000..1222711
--- /dev/null
+++ b/core/res/res/drawable-hdpi/ab_stacked_solid_qntm_alpha.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ab_stacked_transparent_qntm_alpha.9.png b/core/res/res/drawable-hdpi/ab_stacked_transparent_qntm_alpha.9.png
new file mode 100644
index 0000000..d0fcc25
--- /dev/null
+++ b/core/res/res/drawable-hdpi/ab_stacked_transparent_qntm_alpha.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/btn_cab_done_qntm_alpha.9.png b/core/res/res/drawable-hdpi/btn_cab_done_qntm_alpha.9.png
new file mode 100644
index 0000000..992a8ff
--- /dev/null
+++ b/core/res/res/drawable-hdpi/btn_cab_done_qntm_alpha.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_media_route_disabled_qntm_alpha.png b/core/res/res/drawable-hdpi/ic_media_route_disabled_qntm_alpha.png
new file mode 100644
index 0000000..e0a2ba1
--- /dev/null
+++ b/core/res/res/drawable-hdpi/ic_media_route_disabled_qntm_alpha.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_media_route_off_qntm_alpha.png b/core/res/res/drawable-hdpi/ic_media_route_off_qntm_alpha.png
new file mode 100644
index 0000000..d37e8ee
--- /dev/null
+++ b/core/res/res/drawable-hdpi/ic_media_route_off_qntm_alpha.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_media_route_on_0_qntm_alpha.png b/core/res/res/drawable-hdpi/ic_media_route_on_0_qntm_alpha.png
new file mode 100644
index 0000000..0c604d9
--- /dev/null
+++ b/core/res/res/drawable-hdpi/ic_media_route_on_0_qntm_alpha.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_media_route_on_1_qntm_alpha.png b/core/res/res/drawable-hdpi/ic_media_route_on_1_qntm_alpha.png
new file mode 100644
index 0000000..2c3f4ff
--- /dev/null
+++ b/core/res/res/drawable-hdpi/ic_media_route_on_1_qntm_alpha.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_media_route_on_2_qntm_alpha.png b/core/res/res/drawable-hdpi/ic_media_route_on_2_qntm_alpha.png
new file mode 100644
index 0000000..991c50e
--- /dev/null
+++ b/core/res/res/drawable-hdpi/ic_media_route_on_2_qntm_alpha.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_media_route_on_qntm_alpha.png b/core/res/res/drawable-hdpi/ic_media_route_on_qntm_alpha.png
new file mode 100644
index 0000000..05fb919
--- /dev/null
+++ b/core/res/res/drawable-hdpi/ic_media_route_on_qntm_alpha.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ab_bottom_solid_qntm_alpha.9.png b/core/res/res/drawable-mdpi/ab_bottom_solid_qntm_alpha.9.png
new file mode 100644
index 0000000..219d311
--- /dev/null
+++ b/core/res/res/drawable-mdpi/ab_bottom_solid_qntm_alpha.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ab_bottom_transparent_qntm_alpha.9.png b/core/res/res/drawable-mdpi/ab_bottom_transparent_qntm_alpha.9.png
new file mode 100644
index 0000000..bfdc933
--- /dev/null
+++ b/core/res/res/drawable-mdpi/ab_bottom_transparent_qntm_alpha.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ab_share_pack_qntm_alpha.9.png b/core/res/res/drawable-mdpi/ab_share_pack_qntm_alpha.9.png
new file mode 100644
index 0000000..f31730d
--- /dev/null
+++ b/core/res/res/drawable-mdpi/ab_share_pack_qntm_alpha.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ab_solid_qntm_alpha.9.png b/core/res/res/drawable-mdpi/ab_solid_qntm_alpha.9.png
new file mode 100644
index 0000000..bd818b5
--- /dev/null
+++ b/core/res/res/drawable-mdpi/ab_solid_qntm_alpha.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ab_solid_shadow_qntm.9.png b/core/res/res/drawable-mdpi/ab_solid_shadow_qntm.9.png
deleted file mode 100644
index c00c545..0000000
--- a/core/res/res/drawable-mdpi/ab_solid_shadow_qntm.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ab_solid_shadow_qntm_alpha.9.png b/core/res/res/drawable-mdpi/ab_solid_shadow_qntm_alpha.9.png
new file mode 100644
index 0000000..ebdea00
--- /dev/null
+++ b/core/res/res/drawable-mdpi/ab_solid_shadow_qntm_alpha.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ab_stacked_solid_qntm_alpha.9.png b/core/res/res/drawable-mdpi/ab_stacked_solid_qntm_alpha.9.png
new file mode 100644
index 0000000..41c7ce6
--- /dev/null
+++ b/core/res/res/drawable-mdpi/ab_stacked_solid_qntm_alpha.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ab_stacked_transparent_qntm_alpha.9.png b/core/res/res/drawable-mdpi/ab_stacked_transparent_qntm_alpha.9.png
new file mode 100644
index 0000000..961a73e
--- /dev/null
+++ b/core/res/res/drawable-mdpi/ab_stacked_transparent_qntm_alpha.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/btn_cab_done_qntm_alpha.9.png b/core/res/res/drawable-mdpi/btn_cab_done_qntm_alpha.9.png
new file mode 100644
index 0000000..5903856
--- /dev/null
+++ b/core/res/res/drawable-mdpi/btn_cab_done_qntm_alpha.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_media_route_disabled_qntm_alpha.png b/core/res/res/drawable-mdpi/ic_media_route_disabled_qntm_alpha.png
new file mode 100644
index 0000000..ec43047
--- /dev/null
+++ b/core/res/res/drawable-mdpi/ic_media_route_disabled_qntm_alpha.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_media_route_off_qntm_alpha.png b/core/res/res/drawable-mdpi/ic_media_route_off_qntm_alpha.png
new file mode 100644
index 0000000..a652117
--- /dev/null
+++ b/core/res/res/drawable-mdpi/ic_media_route_off_qntm_alpha.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_media_route_on_0_qntm_alpha.png b/core/res/res/drawable-mdpi/ic_media_route_on_0_qntm_alpha.png
new file mode 100644
index 0000000..35d1c56
--- /dev/null
+++ b/core/res/res/drawable-mdpi/ic_media_route_on_0_qntm_alpha.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_media_route_on_1_qntm_alpha.png b/core/res/res/drawable-mdpi/ic_media_route_on_1_qntm_alpha.png
new file mode 100644
index 0000000..264188b
--- /dev/null
+++ b/core/res/res/drawable-mdpi/ic_media_route_on_1_qntm_alpha.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_media_route_on_2_qntm_alpha.png b/core/res/res/drawable-mdpi/ic_media_route_on_2_qntm_alpha.png
new file mode 100644
index 0000000..06ae665
--- /dev/null
+++ b/core/res/res/drawable-mdpi/ic_media_route_on_2_qntm_alpha.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_media_route_on_qntm_alpha.png b/core/res/res/drawable-mdpi/ic_media_route_on_qntm_alpha.png
new file mode 100644
index 0000000..a69e301
--- /dev/null
+++ b/core/res/res/drawable-mdpi/ic_media_route_on_qntm_alpha.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/ab_bottom_solid_qntm_alpha.9.png b/core/res/res/drawable-xhdpi/ab_bottom_solid_qntm_alpha.9.png
new file mode 100644
index 0000000..312f76c
--- /dev/null
+++ b/core/res/res/drawable-xhdpi/ab_bottom_solid_qntm_alpha.9.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/ab_bottom_transparent_qntm_alpha.9.png b/core/res/res/drawable-xhdpi/ab_bottom_transparent_qntm_alpha.9.png
new file mode 100644
index 0000000..49e0a49
--- /dev/null
+++ b/core/res/res/drawable-xhdpi/ab_bottom_transparent_qntm_alpha.9.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/ab_share_pack_qntm_alpha.9.png b/core/res/res/drawable-xhdpi/ab_share_pack_qntm_alpha.9.png
new file mode 100644
index 0000000..8337ffe
--- /dev/null
+++ b/core/res/res/drawable-xhdpi/ab_share_pack_qntm_alpha.9.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/ab_solid_qntm_alpha.9.png b/core/res/res/drawable-xhdpi/ab_solid_qntm_alpha.9.png
new file mode 100644
index 0000000..fb0d0b6
--- /dev/null
+++ b/core/res/res/drawable-xhdpi/ab_solid_qntm_alpha.9.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/ab_solid_shadow_qntm.9.png b/core/res/res/drawable-xhdpi/ab_solid_shadow_qntm.9.png
deleted file mode 100644
index 1443b7f..0000000
--- a/core/res/res/drawable-xhdpi/ab_solid_shadow_qntm.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/ab_solid_shadow_qntm_alpha.9.png b/core/res/res/drawable-xhdpi/ab_solid_shadow_qntm_alpha.9.png
new file mode 100644
index 0000000..f51af63
--- /dev/null
+++ b/core/res/res/drawable-xhdpi/ab_solid_shadow_qntm_alpha.9.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/ab_stacked_solid_qntm_alpha.9.png b/core/res/res/drawable-xhdpi/ab_stacked_solid_qntm_alpha.9.png
new file mode 100644
index 0000000..6d87890
--- /dev/null
+++ b/core/res/res/drawable-xhdpi/ab_stacked_solid_qntm_alpha.9.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/ab_stacked_transparent_qntm_alpha.9.png b/core/res/res/drawable-xhdpi/ab_stacked_transparent_qntm_alpha.9.png
new file mode 100644
index 0000000..58f3e0f
--- /dev/null
+++ b/core/res/res/drawable-xhdpi/ab_stacked_transparent_qntm_alpha.9.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/btn_cab_done_qntm_alpha.9.png b/core/res/res/drawable-xhdpi/btn_cab_done_qntm_alpha.9.png
new file mode 100644
index 0000000..d0d0b1e
--- /dev/null
+++ b/core/res/res/drawable-xhdpi/btn_cab_done_qntm_alpha.9.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/ic_media_route_disabled_qntm_alpha.png b/core/res/res/drawable-xhdpi/ic_media_route_disabled_qntm_alpha.png
new file mode 100644
index 0000000..a020d64
--- /dev/null
+++ b/core/res/res/drawable-xhdpi/ic_media_route_disabled_qntm_alpha.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/ic_media_route_off_qntm_alpha.png b/core/res/res/drawable-xhdpi/ic_media_route_off_qntm_alpha.png
new file mode 100644
index 0000000..e75ffb8
--- /dev/null
+++ b/core/res/res/drawable-xhdpi/ic_media_route_off_qntm_alpha.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/ic_media_route_on_0_qntm_alpha.png b/core/res/res/drawable-xhdpi/ic_media_route_on_0_qntm_alpha.png
new file mode 100644
index 0000000..1b9fc12
--- /dev/null
+++ b/core/res/res/drawable-xhdpi/ic_media_route_on_0_qntm_alpha.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/ic_media_route_on_1_qntm_alpha.png b/core/res/res/drawable-xhdpi/ic_media_route_on_1_qntm_alpha.png
new file mode 100644
index 0000000..f63d47e
--- /dev/null
+++ b/core/res/res/drawable-xhdpi/ic_media_route_on_1_qntm_alpha.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/ic_media_route_on_2_qntm_alpha.png b/core/res/res/drawable-xhdpi/ic_media_route_on_2_qntm_alpha.png
new file mode 100644
index 0000000..fe005d9
--- /dev/null
+++ b/core/res/res/drawable-xhdpi/ic_media_route_on_2_qntm_alpha.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/ic_media_route_on_qntm_alpha.png b/core/res/res/drawable-xhdpi/ic_media_route_on_qntm_alpha.png
new file mode 100644
index 0000000..ea86408
--- /dev/null
+++ b/core/res/res/drawable-xhdpi/ic_media_route_on_qntm_alpha.png
Binary files differ
diff --git a/core/res/res/drawable-xxhdpi/ab_bottom_solid_qntm_alpha.9.png b/core/res/res/drawable-xxhdpi/ab_bottom_solid_qntm_alpha.9.png
new file mode 100644
index 0000000..65b8d4a
--- /dev/null
+++ b/core/res/res/drawable-xxhdpi/ab_bottom_solid_qntm_alpha.9.png
Binary files differ
diff --git a/core/res/res/drawable-xxhdpi/ab_bottom_transparent_qntm_alpha.9.png b/core/res/res/drawable-xxhdpi/ab_bottom_transparent_qntm_alpha.9.png
new file mode 100644
index 0000000..a397baa
--- /dev/null
+++ b/core/res/res/drawable-xxhdpi/ab_bottom_transparent_qntm_alpha.9.png
Binary files differ
diff --git a/core/res/res/drawable-xxhdpi/ab_share_pack_qntm_alpha.9.png b/core/res/res/drawable-xxhdpi/ab_share_pack_qntm_alpha.9.png
new file mode 100644
index 0000000..469f736
--- /dev/null
+++ b/core/res/res/drawable-xxhdpi/ab_share_pack_qntm_alpha.9.png
Binary files differ
diff --git a/core/res/res/drawable-xxhdpi/ab_solid_qntm_alpha.9.png b/core/res/res/drawable-xxhdpi/ab_solid_qntm_alpha.9.png
new file mode 100644
index 0000000..b56fa4a
--- /dev/null
+++ b/core/res/res/drawable-xxhdpi/ab_solid_qntm_alpha.9.png
Binary files differ
diff --git a/core/res/res/drawable-xxhdpi/ab_solid_shadow_qntm.9.png b/core/res/res/drawable-xxhdpi/ab_solid_shadow_qntm.9.png
deleted file mode 100644
index e89c9fe..0000000
--- a/core/res/res/drawable-xxhdpi/ab_solid_shadow_qntm.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xxhdpi/ab_solid_shadow_qntm_alpha.9.png b/core/res/res/drawable-xxhdpi/ab_solid_shadow_qntm_alpha.9.png
new file mode 100644
index 0000000..e8a94dc
--- /dev/null
+++ b/core/res/res/drawable-xxhdpi/ab_solid_shadow_qntm_alpha.9.png
Binary files differ
diff --git a/core/res/res/drawable-xxhdpi/ab_stacked_solid_qntm_alpha.9.png b/core/res/res/drawable-xxhdpi/ab_stacked_solid_qntm_alpha.9.png
new file mode 100644
index 0000000..71b9737
--- /dev/null
+++ b/core/res/res/drawable-xxhdpi/ab_stacked_solid_qntm_alpha.9.png
Binary files differ
diff --git a/core/res/res/drawable-xxhdpi/ab_stacked_transparent_qntm_alpha.9.png b/core/res/res/drawable-xxhdpi/ab_stacked_transparent_qntm_alpha.9.png
new file mode 100644
index 0000000..e2cc715
--- /dev/null
+++ b/core/res/res/drawable-xxhdpi/ab_stacked_transparent_qntm_alpha.9.png
Binary files differ
diff --git a/core/res/res/drawable-xxhdpi/ab_transparent_qntm_alpha.9.png b/core/res/res/drawable-xxhdpi/ab_transparent_qntm_alpha.9.png
index f220168..605d1de 100644
--- a/core/res/res/drawable-xxhdpi/ab_transparent_qntm_alpha.9.png
+++ b/core/res/res/drawable-xxhdpi/ab_transparent_qntm_alpha.9.png
Binary files differ
diff --git a/core/res/res/drawable-xxhdpi/btn_cab_done_qntm_alpha.9.png b/core/res/res/drawable-xxhdpi/btn_cab_done_qntm_alpha.9.png
new file mode 100644
index 0000000..e1c55ad
--- /dev/null
+++ b/core/res/res/drawable-xxhdpi/btn_cab_done_qntm_alpha.9.png
Binary files differ
diff --git a/core/res/res/drawable-xxhdpi/ic_media_route_disabled_qntm_alpha.png b/core/res/res/drawable-xxhdpi/ic_media_route_disabled_qntm_alpha.png
new file mode 100644
index 0000000..6fad4a64
--- /dev/null
+++ b/core/res/res/drawable-xxhdpi/ic_media_route_disabled_qntm_alpha.png
Binary files differ
diff --git a/core/res/res/drawable-xxhdpi/ic_media_route_off_qntm_alpha.png b/core/res/res/drawable-xxhdpi/ic_media_route_off_qntm_alpha.png
new file mode 100644
index 0000000..44d98d5
--- /dev/null
+++ b/core/res/res/drawable-xxhdpi/ic_media_route_off_qntm_alpha.png
Binary files differ
diff --git a/core/res/res/drawable-xxhdpi/ic_media_route_on_0_qntm_alpha.png b/core/res/res/drawable-xxhdpi/ic_media_route_on_0_qntm_alpha.png
new file mode 100644
index 0000000..c807b50
--- /dev/null
+++ b/core/res/res/drawable-xxhdpi/ic_media_route_on_0_qntm_alpha.png
Binary files differ
diff --git a/core/res/res/drawable-xxhdpi/ic_media_route_on_1_qntm_alpha.png b/core/res/res/drawable-xxhdpi/ic_media_route_on_1_qntm_alpha.png
new file mode 100644
index 0000000..d54f44a
--- /dev/null
+++ b/core/res/res/drawable-xxhdpi/ic_media_route_on_1_qntm_alpha.png
Binary files differ
diff --git a/core/res/res/drawable-xxhdpi/ic_media_route_on_2_qntm_alpha.png b/core/res/res/drawable-xxhdpi/ic_media_route_on_2_qntm_alpha.png
new file mode 100644
index 0000000..17c1d99
--- /dev/null
+++ b/core/res/res/drawable-xxhdpi/ic_media_route_on_2_qntm_alpha.png
Binary files differ
diff --git a/core/res/res/drawable-xxhdpi/ic_media_route_on_qntm_alpha.png b/core/res/res/drawable-xxhdpi/ic_media_route_on_qntm_alpha.png
new file mode 100644
index 0000000..906401e
--- /dev/null
+++ b/core/res/res/drawable-xxhdpi/ic_media_route_on_qntm_alpha.png
Binary files differ
diff --git a/core/res/res/drawable/ab_bottom_solid_quantum.xml b/core/res/res/drawable/ab_bottom_solid_quantum.xml
new file mode 100644
index 0000000..848737e
--- /dev/null
+++ b/core/res/res/drawable/ab_bottom_solid_quantum.xml
@@ -0,0 +1,20 @@
+<?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/ab_bottom_solid_qntm_alpha"
+ android:tint="?attr/colorBackground"
+ android:tintMode="multiply" />
diff --git a/core/res/res/drawable/ab_bottom_transparent_quantum.xml b/core/res/res/drawable/ab_bottom_transparent_quantum.xml
new file mode 100644
index 0000000..29df6b9
--- /dev/null
+++ b/core/res/res/drawable/ab_bottom_transparent_quantum.xml
@@ -0,0 +1,21 @@
+<?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/ab_bottom_transparent_qntm_alpha"
+ android:tint="?attr/colorBackground"
+ android:tintMode="multiply" />
diff --git a/core/res/res/drawable/ab_share_pack_quantum.xml b/core/res/res/drawable/ab_share_pack_quantum.xml
new file mode 100644
index 0000000..7d33ff4d
--- /dev/null
+++ b/core/res/res/drawable/ab_share_pack_quantum.xml
@@ -0,0 +1,19 @@
+<?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/ab_share_pack_qntm_alpha"
+ android:tint="?attr/colorControlNormal" />
diff --git a/core/res/res/drawable/ab_solid_quantum.xml b/core/res/res/drawable/ab_solid_quantum.xml
new file mode 100644
index 0000000..e56bb40
--- /dev/null
+++ b/core/res/res/drawable/ab_solid_quantum.xml
@@ -0,0 +1,20 @@
+<?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/ab_solid_qntm_alpha"
+ android:tint="?attr/colorBackground"
+ android:tintMode="multiply" />
diff --git a/core/res/res/drawable/ab_solid_shadow_quantum.xml b/core/res/res/drawable/ab_solid_shadow_quantum.xml
new file mode 100644
index 0000000..88e142a
--- /dev/null
+++ b/core/res/res/drawable/ab_solid_shadow_quantum.xml
@@ -0,0 +1,19 @@
+<?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.
+-->
+
+<nine-patch xmlns:android="http://schemas.android.com/apk/res/android"
+ android:src="@drawable/ab_solid_shadow_qntm_alpha"
+ android:tint="@color/black" />
diff --git a/core/res/res/drawable/ab_stacked_solid_quantum.xml b/core/res/res/drawable/ab_stacked_solid_quantum.xml
new file mode 100644
index 0000000..df775af
--- /dev/null
+++ b/core/res/res/drawable/ab_stacked_solid_quantum.xml
@@ -0,0 +1,20 @@
+<?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/ab_stacked_solid_qntm_alpha"
+ android:tint="?attr/colorBackground"
+ android:tintMode="multiply" />
diff --git a/core/res/res/drawable/ab_stacked_transparent_quantum.xml b/core/res/res/drawable/ab_stacked_transparent_quantum.xml
new file mode 100644
index 0000000..bdae6b9
--- /dev/null
+++ b/core/res/res/drawable/ab_stacked_transparent_quantum.xml
@@ -0,0 +1,20 @@
+<?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/ab_stacked_transparent_qntm_alpha"
+ android:tint="?attr/colorBackground"
+ android:tintMode="multiply" />
diff --git a/core/res/res/drawable/btn_cab_done_quantum.xml b/core/res/res/drawable/btn_cab_done_quantum.xml
new file mode 100644
index 0000000..c03ab0a
--- /dev/null
+++ b/core/res/res/drawable/btn_cab_done_quantum.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.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:autoMirrored="true">
+ <item android:state_pressed="true">
+ <color android:color="?attr/colorButtonPressed" />
+ </item>
+ <item android:state_focused="true" android:state_enabled="true">
+ <nine-patch android:src="@drawable/btn_cab_done_qntm_alpha"
+ android:tint="?attr/colorButtonPressed" />
+ </item>
+ <item android:state_enabled="true">
+ <nine-patch android:src="@drawable/btn_cab_done_qntm_alpha"
+ android:tint="?attr/colorButtonNormal" />
+ </item>
+</selector>
diff --git a/core/res/res/drawable/ic_media_route_connecting_quantum.xml b/core/res/res/drawable/ic_media_route_connecting_quantum.xml
new file mode 100644
index 0000000..0029dd4
--- /dev/null
+++ b/core/res/res/drawable/ic_media_route_connecting_quantum.xml
@@ -0,0 +1,36 @@
+<?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="false">
+ <item android:duration="500">
+ <bitmap android:src="@drawable/ic_media_route_on_0_qntm_alpha"
+ android:tint="?attr/colorControlNormal" />
+ </item>
+ <item android:duration="500">
+ <bitmap android:src="@drawable/ic_media_route_on_1_qntm_alpha"
+ android:tint="?attr/colorControlNormal" />
+ </item>
+ <item android:duration="500">
+ <bitmap android:src="@drawable/ic_media_route_on_2_qntm_alpha"
+ android:tint="?attr/colorControlNormal" />
+ </item>
+ <item android:duration="500">
+ <bitmap android:src="@drawable/ic_media_route_on_1_qntm_alpha"
+ android:tint="?attr/colorControlNormal" />
+ </item>
+</animation-list>
diff --git a/core/res/res/drawable/ic_media_route_quantum.xml b/core/res/res/drawable/ic_media_route_quantum.xml
new file mode 100644
index 0000000..16b63d4
--- /dev/null
+++ b/core/res/res/drawable/ic_media_route_quantum.xml
@@ -0,0 +1,33 @@
+<?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.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_checked="true" android:state_enabled="true"
+ android:drawable="@android:drawable/ic_media_route_connecting_quantum" />
+ <item android:state_activated="true" android:state_enabled="true">
+ <bitmap android:src="@android:drawable/ic_media_route_on_qntm_alpha"
+ android:tint="?attr/colorControlNormal" />
+ </item>
+ <item android:state_enabled="true">
+ <bitmap android:src="@android:drawable/ic_media_route_off_qntm_alpha"
+ android:tint="?attr/colorControlNormal" />
+ </item>
+ <item>
+ <bitmap android:src="@android:drawable/ic_media_route_disabled_qntm_alpha"
+ android:tint="?attr/colorControlNormal" />
+ </item>
+</selector>
diff --git a/core/res/res/layout/tab_indicator_quantum.xml b/core/res/res/layout/tab_indicator_quantum.xml
new file mode 100644
index 0000000..fcb2d5f
--- /dev/null
+++ b/core/res/res/layout/tab_indicator_quantum.xml
@@ -0,0 +1,37 @@
+<?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.
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_height="?android:attr/actionBarSize"
+ android:orientation="horizontal"
+ style="@android:style/Widget.Quantum.Tab">
+
+ <ImageView
+ android:id="@android:id/icon"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_vertical"
+ android:visibility="gone" />
+
+ <TextView
+ android:id="@android:id/title"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_vertical"
+ style="@android:style/Widget.Quantum.TabText" />
+
+</LinearLayout>
diff --git a/core/res/res/values/styles_quantum.xml b/core/res/res/values/styles_quantum.xml
index 13edf6a..2bbc2e4 100644
--- a/core/res/res/values/styles_quantum.xml
+++ b/core/res/res/values/styles_quantum.xml
@@ -677,7 +677,7 @@ please see styles_device_defaults.xml.
<item name="showDividers">middle</item>
<item name="dividerPadding">8dip</item>
<item name="measureWithLargestChild">true</item>
- <item name="tabLayout">@layout/tab_indicator_holo</item>
+ <item name="tabLayout">@layout/tab_indicator_quantum</item>
</style>
<style name="Widget.Quantum.Tab" parent="Widget.Quantum.ActionBar.TabView">
@@ -731,7 +731,7 @@ please see styles_device_defaults.xml.
</style>
<style name="Widget.Quantum.ActionButton.CloseMode">
- <item name="background">@drawable/btn_cab_done_holo_dark</item>
+ <item name="background">@drawable/btn_cab_done_quantum</item>
</style>
<style name="Widget.Quantum.ActionButton.Overflow">
@@ -768,8 +768,8 @@ please see styles_device_defaults.xml.
<item name="titleTextStyle">@style/TextAppearance.Quantum.Widget.ActionBar.Title</item>
<item name="subtitleTextStyle">@style/TextAppearance.Quantum.Widget.ActionBar.Subtitle</item>
<item name="background">@drawable/ab_transparent_quantum</item>
- <item name="backgroundStacked">@drawable/ab_stacked_transparent_dark_holo</item>
- <item name="backgroundSplit">@drawable/ab_bottom_transparent_dark_holo</item>
+ <item name="backgroundStacked">@drawable/ab_stacked_transparent_quantum</item>
+ <item name="backgroundSplit">@drawable/ab_bottom_transparent_quantum</item>
<item name="divider">?attr/dividerVertical</item>
<item name="progressBarStyle">@style/Widget.Quantum.ProgressBar.Horizontal</item>
<item name="indeterminateProgressStyle">@style/Widget.Quantum.ProgressBar</item>
@@ -780,9 +780,9 @@ please see styles_device_defaults.xml.
<style name="Widget.Quantum.ActionBar.Solid">
<item name="titleTextStyle">@style/TextAppearance.Quantum.Widget.ActionBar.Title</item>
<item name="subtitleTextStyle">@style/TextAppearance.Quantum.Widget.ActionBar.Subtitle</item>
- <item name="background">@drawable/ab_solid_dark_holo</item>
- <item name="backgroundStacked">@drawable/ab_stacked_solid_dark_holo</item>
- <item name="backgroundSplit">@drawable/ab_bottom_solid_dark_holo</item>
+ <item name="background">@drawable/ab_solid_quantum</item>
+ <item name="backgroundStacked">@drawable/ab_stacked_solid_quantum</item>
+ <item name="backgroundSplit">@drawable/ab_bottom_solid_quantum</item>
<item name="divider">?attr/dividerVertical</item>
<item name="progressBarStyle">@style/Widget.Quantum.ProgressBar.Horizontal</item>
<item name="indeterminateProgressStyle">@style/Widget.Quantum.ProgressBar</item>
@@ -809,7 +809,7 @@ please see styles_device_defaults.xml.
<style name="Widget.Quantum.MediaRouteButton">
<item name="background">?attr/selectableItemBackground</item>
- <item name="externalRouteEnabledDrawable">@drawable/ic_media_route_holo_dark</item>
+ <item name="externalRouteEnabledDrawable">@drawable/ic_media_route_quantum</item>
<item name="minWidth">56dp</item>
<item name="minHeight">48dp</item>
<item name="focusable">true</item>
@@ -896,7 +896,7 @@ please see styles_device_defaults.xml.
<style name="Widget.Quantum.Light.DatePicker" parent="Widget.Quantum.DatePicker"/>
<style name="Widget.Quantum.Light.ActivityChooserView" parent="Widget.Quantum.ActivityChooserView">
- <item name="background">@drawable/ab_share_pack_holo_light</item>
+ <item name="background">@drawable/ab_share_pack_quantum</item>
</style>
<style name="Widget.Quantum.Light.ImageWell" parent="Widget.Quantum.ImageWell"/>
@@ -991,15 +991,15 @@ please see styles_device_defaults.xml.
</style>
<style name="Widget.Quantum.Light.ActionButton.CloseMode">
- <item name="background">@drawable/btn_cab_done_holo_light</item>
+ <item name="background">@drawable/btn_cab_done_quantum</item>
</style>
<style name="Widget.Quantum.Light.ActionBar" parent="Widget.Quantum.ActionBar">
<item name="titleTextStyle">@style/TextAppearance.Quantum.Widget.ActionBar.Title</item>
<item name="subtitleTextStyle">@style/TextAppearance.Quantum.Widget.ActionBar.Subtitle</item>
<item name="background">@drawable/ab_transparent_quantum</item>
- <item name="backgroundStacked">@drawable/ab_stacked_transparent_light_holo</item>
- <item name="backgroundSplit">@drawable/ab_bottom_transparent_light_holo</item>
+ <item name="backgroundStacked">@drawable/ab_stacked_transparent_quantum</item>
+ <item name="backgroundSplit">@drawable/ab_bottom_transparent_quantum</item>
<item name="homeAsUpIndicator">@drawable/ic_ab_back_quantum</item>
<item name="progressBarStyle">@style/Widget.Quantum.Light.ProgressBar.Horizontal</item>
<item name="indeterminateProgressStyle">@style/Widget.Quantum.Light.ProgressBar</item>
@@ -1008,9 +1008,9 @@ please see styles_device_defaults.xml.
<style name="Widget.Quantum.Light.ActionBar.Solid">
<item name="titleTextStyle">@style/TextAppearance.Quantum.Widget.ActionBar.Title</item>
<item name="subtitleTextStyle">@style/TextAppearance.Quantum.Widget.ActionBar.Subtitle</item>
- <item name="background">@drawable/ab_solid_light_holo</item>
- <item name="backgroundStacked">@drawable/ab_stacked_solid_light_holo</item>
- <item name="backgroundSplit">@drawable/ab_bottom_solid_light_holo</item>
+ <item name="background">@drawable/ab_solid_quantum</item>
+ <item name="backgroundStacked">@drawable/ab_stacked_solid_quantum</item>
+ <item name="backgroundSplit">@drawable/ab_bottom_solid_quantum</item>
<item name="divider">?attr/dividerVertical</item>
<item name="progressBarStyle">@style/Widget.Quantum.Light.ProgressBar.Horizontal</item>
<item name="indeterminateProgressStyle">@style/Widget.Quantum.Light.ProgressBar</item>
@@ -1025,7 +1025,7 @@ please see styles_device_defaults.xml.
<style name="Widget.Quantum.Light.FastScroll" parent="Widget.Quantum.FastScroll"/>
<style name="Widget.Quantum.Light.MediaRouteButton" parent="Widget.Quantum.MediaRouteButton">
- <item name="externalRouteEnabledDrawable">@drawable/ic_media_route_holo_light</item>
+ <item name="externalRouteEnabledDrawable">@drawable/ic_media_route_quantum</item>
</style>
<!-- Animation Styles -->
diff --git a/core/res/res/values/themes_quantum.xml b/core/res/res/values/themes_quantum.xml
index 24abd55..d39a1f86 100644
--- a/core/res/res/values/themes_quantum.xml
+++ b/core/res/res/values/themes_quantum.xml
@@ -476,7 +476,7 @@ please see themes_device_defaults.xml.
<item name="windowFullscreen">false</item>
<item name="windowOverscan">false</item>
<item name="windowIsFloating">false</item>
- <item name="windowContentOverlay">@drawable/ab_solid_shadow_qntm</item>
+ <item name="windowContentOverlay">@drawable/ab_solid_shadow_quantum</item>
<item name="windowShowWallpaper">false</item>
<item name="windowTitleStyle">@style/WindowTitle.Quantum</item>
<item name="windowTitleSize">25dip</item>
diff --git a/docs/html/about/dashboards/index.jd b/docs/html/about/dashboards/index.jd
index 6d29c69..92ecd24 100644
--- a/docs/html/about/dashboards/index.jd
+++ b/docs/html/about/dashboards/index.jd
@@ -61,7 +61,7 @@ Platform Versions</a>.</p>
</div>
-<p style="clear:both"><em>Data collected during a 7-day period ending on March 3, 2014.
+<p style="clear:both"><em>Data collected during a 7-day period ending on April 1, 2014.
<br/>Any versions with less than 0.1% distribution are not shown.</em>
</p>
@@ -92,7 +92,7 @@ Screens</a>.</p>
</div>
-<p style="clear:both"><em>Data collected during a 7-day period ending on March 3, 2014.
+<p style="clear:both"><em>Data collected during a 7-day period ending on April 1, 2014.
<br/>Any screen configurations with less than 0.1% distribution are not shown.</em></p>
@@ -133,17 +133,17 @@ uses.</p>
</tr>
<tr>
<td>2.0</th>
-<td>91.1%</td>
+<td>89.4%</td>
</tr>
<tr>
<td>3.0</th>
-<td>8.8%</td>
+<td>10.5%</td>
</tr>
</table>
-<p style="clear:both"><em>Data collected during a 7-day period ending on March 3, 2014</em></p>
+<p style="clear:both"><em>Data collected during a 7-day period ending on April 1, 2014</em></p>
@@ -161,17 +161,17 @@ uses.</p>
var VERSION_DATA =
[
{
- "chart": "//chart.googleapis.com/chart?chl=Froyo%7CGingerbread%7CHoneycomb%7CIce%20Cream%20Sandwich%7CJelly%20Bean%7CKitKat&chd=t%3A1.2%2C19.0%2C0.1%2C15.2%2C62.0%2C2.5&chf=bg%2Cs%2C00000000&chco=c4df9b%2C6fad0c&chs=500x250&cht=p",
+ "chart": "//chart.googleapis.com/chart?cht=p&chs=500x250&chco=c4df9b%2C6fad0c&chf=bg%2Cs%2C00000000&chd=t%3A1.1%2C17.8%2C0.1%2C14.3%2C61.4%2C5.3&chl=Froyo%7CGingerbread%7CHoneycomb%7CIce%20Cream%20Sandwich%7CJelly%20Bean%7CKitKat",
"data": [
{
"api": 8,
"name": "Froyo",
- "perc": "1.2"
+ "perc": "1.1"
},
{
"api": 10,
"name": "Gingerbread",
- "perc": "19.0"
+ "perc": "17.8"
},
{
"api": 13,
@@ -181,27 +181,27 @@ var VERSION_DATA =
{
"api": 15,
"name": "Ice Cream Sandwich",
- "perc": "15.2"
+ "perc": "14.3"
},
{
"api": 16,
"name": "Jelly Bean",
- "perc": "35.3"
+ "perc": "34.4"
},
{
"api": 17,
"name": "Jelly Bean",
- "perc": "17.1"
+ "perc": "18.1"
},
{
"api": 18,
"name": "Jelly Bean",
- "perc": "9.6"
+ "perc": "8.9"
},
{
"api": 19,
"name": "KitKat",
- "perc": "2.5"
+ "perc": "5.3"
}
]
}
@@ -218,16 +218,15 @@ var SCREEN_DATA =
"Large": {
"hdpi": "0.6",
"ldpi": "0.7",
- "mdpi": "4.3",
+ "mdpi": "4.4",
"tvdpi": "1.5",
"xhdpi": "0.6"
},
"Normal": {
"hdpi": "33.7",
- "ldpi": "0.2",
- "mdpi": "13.6",
- "xhdpi": "19.9",
- "xxhdpi": "11.9"
+ "mdpi": "13.2",
+ "xhdpi": "19.8",
+ "xxhdpi": "12.5"
},
"Small": {
"ldpi": "8.1"
@@ -235,12 +234,12 @@ var SCREEN_DATA =
"Xlarge": {
"hdpi": "0.3",
"ldpi": "0.1",
- "mdpi": "4.3",
- "xhdpi": "0.2"
+ "mdpi": "4.2",
+ "xhdpi": "0.3"
}
},
- "densitychart": "//chart.googleapis.com/chart?chl=ldpi%7Cmdpi%7Ctvdpi%7Chdpi%7Cxhdpi%7Cxxhdpi&chd=t%3A9.1%2C22.2%2C1.5%2C34.6%2C20.7%2C11.9&chf=bg%2Cs%2C00000000&chco=c4df9b%2C6fad0c&chs=400x250&cht=p",
- "layoutchart": "//chart.googleapis.com/chart?chl=Xlarge%7CLarge%7CNormal%7CSmall&chd=t%3A4.9%2C7.7%2C79.3%2C8.1&chf=bg%2Cs%2C00000000&chco=c4df9b%2C6fad0c&chs=400x250&cht=p"
+ "densitychart": "//chart.googleapis.com/chart?cht=p&chs=400x250&chco=c4df9b%2C6fad0c&chf=bg%2Cs%2C00000000&chd=t%3A8.9%2C21.8%2C1.5%2C34.6%2C20.7%2C12.6&chl=ldpi%7Cmdpi%7Ctvdpi%7Chdpi%7Cxhdpi%7Cxxhdpi",
+ "layoutchart": "//chart.googleapis.com/chart?cht=p&chs=400x250&chco=c4df9b%2C6fad0c&chf=bg%2Cs%2C00000000&chd=t%3A4.9%2C7.8%2C79.3%2C8.1&chl=Xlarge%7CLarge%7CNormal%7CSmall"
}
];
diff --git a/docs/html/google/index.jd b/docs/html/google/index.jd
index b743b66..2e97d62 100644
--- a/docs/html/google/index.jd
+++ b/docs/html/google/index.jd
@@ -125,7 +125,7 @@ cloud messaging.</p>
<img src="{@docRoot}images/google/analytics.png" width="40" />
</div>
<h4><a class="external-link"
-href="https://developers.google.com/analytics/devguides/collection/android/v2/"
+href="https://developers.google.com/analytics/devguides/collection/android/v4/"
>Google Analytics</a></h4>
<p>Measure your success and gain insights into how users engage with your app content
diff --git a/docs/html/sdk/installing/studio-build.jd b/docs/html/sdk/installing/studio-build.jd
index 41ad5de..8674134 100644
--- a/docs/html/sdk/installing/studio-build.jd
+++ b/docs/html/sdk/installing/studio-build.jd
@@ -1,4 +1,4 @@
-page.title=Building your Project
+page.title=Building Your Project with Gradle
@jd:body
diff --git a/docs/html/tools/tools_toc.cs b/docs/html/tools/tools_toc.cs
index 0e543e4..c281644 100644
--- a/docs/html/tools/tools_toc.cs
+++ b/docs/html/tools/tools_toc.cs
@@ -37,7 +37,7 @@
<li><a href="<?cs var:toroot ?>sdk/installing/studio-layout.html">
Using the Layout Editor</a></li>
<li><a href="<?cs var:toroot ?>sdk/installing/studio-build.html">
- Building your Project</a></li>
+ Building Your Project with Gradle</a></li>
</ul>
</li>
<li><a href="<?cs var:toroot ?>sdk/exploring.html">
diff --git a/docs/html/wear/images/laptop-bridge.png b/docs/html/wear/images/laptop-bridge.png
index b481224..083b82b 100644
--- a/docs/html/wear/images/laptop-bridge.png
+++ b/docs/html/wear/images/laptop-bridge.png
Binary files differ
diff --git a/media/java/android/media/AudioService.java b/media/java/android/media/AudioService.java
index 7f1c5c7..4bd5a80 100644
--- a/media/java/android/media/AudioService.java
+++ b/media/java/android/media/AudioService.java
@@ -43,6 +43,7 @@ import android.content.res.Configuration;
import android.content.res.Resources;
import android.content.res.XmlResourceParser;
import android.database.ContentObserver;
+import android.hardware.usb.UsbManager;
import android.media.MediaPlayer.OnCompletionListener;
import android.media.MediaPlayer.OnErrorListener;
import android.os.Binder;
@@ -528,6 +529,7 @@ public class AudioService extends IAudioService.Stub {
intentFilter.addAction(Intent.ACTION_SCREEN_ON);
intentFilter.addAction(Intent.ACTION_SCREEN_OFF);
intentFilter.addAction(Intent.ACTION_USER_SWITCHED);
+ intentFilter.addAction(UsbManager.ACTION_USB_DEVICE_ATTACHED);
intentFilter.addAction(Intent.ACTION_CONFIGURATION_CHANGED);
// TODO merge orientation and rotation
@@ -3975,7 +3977,8 @@ public class AudioService extends IAudioService.Stub {
(device == AudioSystem.DEVICE_OUT_WIRED_HEADPHONE))) {
setBluetoothA2dpOnInt(true);
}
- boolean isUsb = ((device & AudioSystem.DEVICE_OUT_ALL_USB) != 0);
+ boolean isUsb = ((device & AudioSystem.DEVICE_OUT_ALL_USB) != 0) ||
+ ((device & AudioSystem.DEVICE_IN_ALL_USB) != 0);
handleDeviceConnection((state == 1), device, (isUsb ? name : ""));
if (state != 0) {
if ((device == AudioSystem.DEVICE_OUT_WIRED_HEADSET) ||
@@ -4083,18 +4086,31 @@ public class AudioService extends IAudioService.Stub {
} else if (action.equals(Intent.ACTION_USB_AUDIO_ACCESSORY_PLUG) ||
action.equals(Intent.ACTION_USB_AUDIO_DEVICE_PLUG)) {
state = intent.getIntExtra("state", 0);
+
int alsaCard = intent.getIntExtra("card", -1);
int alsaDevice = intent.getIntExtra("device", -1);
+ boolean hasPlayback = intent.getBooleanExtra("hasPlayback", false);
+ boolean hasCapture = intent.getBooleanExtra("hasCapture", false);
+ boolean hasMIDI = intent.getBooleanExtra("hasMIDI", false);
+
String params = (alsaCard == -1 && alsaDevice == -1 ? ""
: "card=" + alsaCard + ";device=" + alsaDevice);
+
+ //TODO(pmclean) - Ignore for now the hasPlayback & hasCapture flags since we
+ // still need to call setWiredDeviceConnectionState() on disconnect (when we
+ // don't have card/device files to parse for this info). We will need to store
+ // that info here when we get smarter about multiple USB card/devices.
+ // Playback Device
device = action.equals(Intent.ACTION_USB_AUDIO_ACCESSORY_PLUG) ?
AudioSystem.DEVICE_OUT_USB_ACCESSORY : AudioSystem.DEVICE_OUT_USB_DEVICE;
- Log.v(TAG, "Broadcast Receiver: Got "
- + (action.equals(Intent.ACTION_USB_AUDIO_ACCESSORY_PLUG) ?
- "ACTION_USB_AUDIO_ACCESSORY_PLUG" : "ACTION_USB_AUDIO_DEVICE_PLUG")
- + ", state = " + state + ", card: " + alsaCard + ", device: " + alsaDevice);
setWiredDeviceConnectionState(device, state, params);
- } else if (action.equals(BluetoothHeadset.ACTION_AUDIO_STATE_CHANGED)) {
+
+ // Capture Device
+ device = action.equals(Intent.ACTION_USB_AUDIO_ACCESSORY_PLUG) ?
+ AudioSystem.DEVICE_IN_USB_ACCESSORY : AudioSystem.DEVICE_IN_USB_DEVICE;
+ setWiredDeviceConnectionState(device, state, params);
+ }
+ else if (action.equals(BluetoothHeadset.ACTION_AUDIO_STATE_CHANGED)) {
boolean broadcast = false;
int scoAudioState = AudioManager.SCO_AUDIO_STATE_ERROR;
synchronized (mScoClients) {
@@ -4199,7 +4215,7 @@ public class AudioService extends IAudioService.Stub {
mStreamStates[AudioSystem.STREAM_MUSIC], 0);
}
}
- }
+ } // end class AudioServiceBroadcastReceiver
//==========================================================================================
// RemoteControlDisplay / RemoteControlClient / Remote info
diff --git a/media/java/android/media/AudioSystem.java b/media/java/android/media/AudioSystem.java
index 9c67bae..327c10c 100644
--- a/media/java/android/media/AudioSystem.java
+++ b/media/java/android/media/AudioSystem.java
@@ -288,6 +288,8 @@ public class AudioSystem
DEVICE_IN_USB_DEVICE |
DEVICE_IN_DEFAULT);
public static final int DEVICE_IN_ALL_SCO = DEVICE_IN_BLUETOOTH_SCO_HEADSET;
+ public static final int DEVICE_IN_ALL_USB = (DEVICE_IN_USB_ACCESSORY |
+ DEVICE_IN_USB_DEVICE);
// device states, must match AudioSystem::device_connection_state
public static final int DEVICE_STATE_UNAVAILABLE = 0;
diff --git a/media/java/android/media/AudioTrack.java b/media/java/android/media/AudioTrack.java
index 40c6797..57bc171 100644
--- a/media/java/android/media/AudioTrack.java
+++ b/media/java/android/media/AudioTrack.java
@@ -1321,7 +1321,7 @@ public class AudioTrack
*
* @param level send level scalar
* @return error code or success, see {@link #SUCCESS},
- * {@link #ERROR_INVALID_OPERATION}
+ * {@link #ERROR_INVALID_OPERATION}, {@link #ERROR}
*/
public int setAuxEffectSendLevel(float level) {
if (isRestricted()) {
@@ -1337,8 +1337,8 @@ public class AudioTrack
if (level > getMaxVolume()) {
level = getMaxVolume();
}
- native_setAuxEffectSendLevel(level);
- return SUCCESS;
+ int err = native_setAuxEffectSendLevel(level);
+ return err == 0 ? SUCCESS : ERROR;
}
//---------------------------------------------------------
@@ -1508,7 +1508,7 @@ public class AudioTrack
int sampleRateInHz, int channelConfig, int audioFormat);
private native final int native_attachAuxEffect(int effectId);
- private native final void native_setAuxEffectSendLevel(float level);
+ private native final int native_setAuxEffectSendLevel(float level);
//---------------------------------------------------------
// Utility methods
diff --git a/media/jni/android_media_MediaCodec.cpp b/media/jni/android_media_MediaCodec.cpp
index b2fb2df..d04b1f8 100644
--- a/media/jni/android_media_MediaCodec.cpp
+++ b/media/jni/android_media_MediaCodec.cpp
@@ -27,6 +27,8 @@
#include "jni.h"
#include "JNIHelp.h"
+#include <cutils/compiler.h>
+
#include <gui/Surface.h>
#include <media/ICrypto.h>
@@ -738,6 +740,10 @@ static void android_media_MediaCodec_queueSecureInputBuffer(
} else if (numBytesOfClearDataObj != NULL
&& env->GetArrayLength(numBytesOfClearDataObj) < numSubSamples) {
err = -ERANGE;
+ // subSamples array may silently overflow if number of samples are too large. Use
+ // INT32_MAX as maximum allocation size may be less than SIZE_MAX on some platforms
+ } else if ( CC_UNLIKELY(numSubSamples >= INT32_MAX / sizeof(*subSamples)) ) {
+ err = -EINVAL;
} else {
jboolean isCopy;
diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml
index a9b6985..38e1083 100644
--- a/packages/SystemUI/res/values/dimens.xml
+++ b/packages/SystemUI/res/values/dimens.xml
@@ -248,6 +248,6 @@
<!-- Z distance between notifications if they are in the stack -->
<dimen name="z_distance_between_notifications">2dp</dimen>
- <!-- Width of the zen mode interstitial dialog. Defaults to MATCH_PARENT. -->
- <dimen name="zen_mode_dialog_width">-1px</dimen>
+ <!-- Width of the zen mode interstitial dialog. -->
+ <dimen name="zen_mode_dialog_width">320dp</dimen>
</resources>
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java
index aed9a71..d67f7cd 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java
@@ -911,6 +911,7 @@ class QuickSettings {
d.getWindow().setAttributes(lp);
}
};
+ v.setAutoActivate(true);
v.setAdapter(new ZenModeViewAdapter(mContext) {
@Override
public void configure() {
@@ -928,7 +929,6 @@ class QuickSettings {
d.create();
d.getWindow().setType(WindowManager.LayoutParams.TYPE_VOLUME_OVERLAY);
WindowManager.LayoutParams lp = d.getWindow().getAttributes();
- lp.horizontalMargin = 0;
lp.width = mContext.getResources().getDimensionPixelSize(R.dimen.zen_mode_dialog_width);
d.getWindow().setAttributes(lp);
d.show();
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ZenModeView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ZenModeView.java
index d1a9d57..49cf78b 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ZenModeView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ZenModeView.java
@@ -16,11 +16,8 @@
package com.android.systemui.statusbar.phone;
-import android.animation.Animator;
-import android.animation.AnimatorListenerAdapter;
import android.animation.ValueAnimator;
import android.content.Context;
-import android.graphics.Paint;
import android.graphics.PorterDuff.Mode;
import android.graphics.Typeface;
import android.graphics.drawable.ShapeDrawable;
@@ -39,14 +36,12 @@ import android.view.View;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.FrameLayout;
-import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.Switch;
import android.widget.TextView;
import android.widget.Toast;
-import com.android.systemui.R;
import com.android.systemui.statusbar.phone.ZenModeView.Adapter.ExitCondition;
public class ZenModeView extends RelativeLayout {
@@ -63,20 +58,21 @@ public class ZenModeView extends RelativeLayout {
private static final long DURATION = new ValueAnimator().getDuration();
private static final long PAGER_DURATION = DURATION / 2;
- private static final float BOUNCE_SCALE = 0.8f;
private static final long CLOSE_DELAY = 600;
+ private static final long AUTO_ACTIVATE_DELAY = 100;
private final Context mContext;
- private final Paint mPathPaint;
- private final ImageView mSettingsButton;
private final TextView mModeText;
private final Switch mModeSwitch;
private final View mDivider;
private final UntilPager mUntilPager;
private final ProgressDots mProgressDots;
+ private final View mDivider2;
+ private final TextView mSettingsButton;
private Adapter mAdapter;
private boolean mInit;
+ private boolean mAutoActivate;
public ZenModeView(Context context) {
this(context, null);
@@ -90,29 +86,9 @@ public class ZenModeView extends RelativeLayout {
final int iconSize = mContext.getResources()
.getDimensionPixelSize(com.android.internal.R.dimen.notification_large_icon_width);
final int topRowSize = iconSize * 2 / 3;
- final int p = topRowSize / 7;
+ final int p = topRowSize / 3;
- mPathPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
- mPathPaint.setStyle(Paint.Style.STROKE);
- mPathPaint.setColor(GRAY);
- mPathPaint.setStrokeWidth(p / 2);
-
- mSettingsButton = new ImageView(mContext);
- mSettingsButton.setPadding(p, p, p, p);
- mSettingsButton.setImageResource(R.drawable.ic_notify_settings_normal);
- LayoutParams lp = new LayoutParams(topRowSize, topRowSize);
- lp.topMargin = p;
- lp.leftMargin = p;
- addView(mSettingsButton, lp);
- mSettingsButton.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- if (mAdapter != null) {
- mAdapter.configure();
- }
- bounce(mSettingsButton, null);
- }
- });
+ LayoutParams lp = null;
mModeText = new TextView(mContext);
mModeText.setText(MODE_LABEL);
@@ -120,11 +96,10 @@ public class ZenModeView extends RelativeLayout {
mModeText.setTextColor(GRAY);
mModeText.setTypeface(CONDENSED);
mModeText.setAllCaps(true);
- mModeText.setGravity(Gravity.CENTER);
- mModeText.setTextSize(TypedValue.COMPLEX_UNIT_PX, mModeText.getTextSize() * 1.1f);
+ mModeText.setGravity(Gravity.LEFT | Gravity.CENTER_VERTICAL);
+ mModeText.setTextSize(TypedValue.COMPLEX_UNIT_PX, mModeText.getTextSize() * 1.5f);
lp = new LayoutParams(LayoutParams.WRAP_CONTENT, topRowSize);
- lp.topMargin = p;
- lp.addRule(CENTER_HORIZONTAL);
+ lp.leftMargin = p;
addView(mModeText, lp);
mModeSwitch = new Switch(mContext);
@@ -132,6 +107,7 @@ public class ZenModeView extends RelativeLayout {
mModeSwitch.setSwitchTypeface(CONDENSED);
lp = new LayoutParams(LayoutParams.WRAP_CONTENT, topRowSize);
lp.topMargin = p;
+ lp.rightMargin = p;
lp.addRule(ALIGN_PARENT_RIGHT);
lp.addRule(ALIGN_BASELINE, mModeText.getId());
addView(mModeSwitch, lp);
@@ -154,11 +130,10 @@ public class ZenModeView extends RelativeLayout {
mDivider.setBackgroundColor(GRAY);
lp = new LayoutParams(LayoutParams.MATCH_PARENT, 2);
lp.addRule(BELOW, mModeText.getId());
- lp.topMargin = p;
- lp.bottomMargin = p * 2;
+ lp.bottomMargin = p;
addView(mDivider, lp);
- mUntilPager = new UntilPager(mContext, mPathPaint, iconSize * 3 / 4);
+ mUntilPager = new UntilPager(mContext, iconSize * 3 / 4);
mUntilPager.setId(android.R.id.tabhost);
lp = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
lp.leftMargin = lp.rightMargin = iconSize / 2;
@@ -167,10 +142,41 @@ public class ZenModeView extends RelativeLayout {
addView(mUntilPager, lp);
mProgressDots = new ProgressDots(mContext, iconSize / 5);
+ mProgressDots.setId(android.R.id.progress);
lp = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
lp.addRule(CENTER_HORIZONTAL);
lp.addRule(BELOW, mUntilPager.getId());
addView(mProgressDots, lp);
+
+ mDivider2 = new View(mContext);
+ mDivider2.setId(android.R.id.widget_frame);
+ mDivider2.setBackgroundColor(GRAY);
+ lp = new LayoutParams(LayoutParams.MATCH_PARENT, 2);
+ lp.addRule(BELOW, mProgressDots.getId());
+ addView(mDivider2, lp);
+
+ mSettingsButton = new TextView(mContext);
+ mSettingsButton.setTypeface(CONDENSED);
+ mSettingsButton.setTextSize(TypedValue.COMPLEX_UNIT_PX, mSettingsButton.getTextSize() * 1.3f);
+ mSettingsButton.setPadding(p, p, p, p);
+ mSettingsButton.setText("More settings...");
+ lp = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
+ lp.addRule(BELOW, mDivider2.getId());
+ addView(mSettingsButton, lp);
+ mSettingsButton.setOnTouchListener(new OnTouchListener() {
+ @Override
+ public boolean onTouch(View v, MotionEvent event) {
+ if (event.getAction() == MotionEvent.ACTION_DOWN) {
+ mSettingsButton.setBackgroundColor(DARK_GRAY);
+ } else if (event.getAction() == MotionEvent.ACTION_UP) {
+ mSettingsButton.setBackground(null);
+ if (mAdapter != null) {
+ mAdapter.configure();
+ }
+ }
+ return true;
+ }
+ });
}
public void setAdapter(Adapter adapter) {
@@ -189,6 +195,27 @@ public class ZenModeView extends RelativeLayout {
updateState(false);
}
+ @Override
+ protected void onAttachedToWindow() {
+ super.onAttachedToWindow();
+ if (mAutoActivate) {
+ mAutoActivate = false;
+ postDelayed(new Runnable() {
+ @Override
+ public void run() {
+ if (!mModeSwitch.isChecked()) {
+ mInit = false;
+ mModeSwitch.setChecked(true);
+ }
+ }
+ }, AUTO_ACTIVATE_DELAY);
+ }
+ }
+
+ public void setAutoActivate(boolean value) {
+ mAutoActivate = value;
+ }
+
private void updateState(boolean animate) {
mUntilPager.updateState();
mModeSwitch.setChecked(mAdapter.getMode());
@@ -199,23 +226,6 @@ public class ZenModeView extends RelativeLayout {
Log.d(TAG, args == null || args.length == 0 ? msg : String.format(msg, args));
}
- private static void bounce(final View v, final Runnable midBounce) {
- v.animate().scaleX(BOUNCE_SCALE).scaleY(BOUNCE_SCALE).setDuration(DURATION / 3)
- .setListener(new AnimatorListenerAdapter() {
- private boolean mFired;
- @Override
- public void onAnimationEnd(Animator animation) {
- if (!mFired) {
- mFired = true;
- if (midBounce != null) {
- midBounce.run();
- }
- v.animate().scaleX(1).scaleY(1).setListener(null).start();
- }
- }
- }).start();
- }
-
private final class UntilView extends FrameLayout {
private static final boolean SUPPORT_LINKS = false;
@@ -223,7 +233,7 @@ public class ZenModeView extends RelativeLayout {
public UntilView(Context context) {
super(context);
mText = new TextView(mContext);
- mText.setTextSize(TypedValue.COMPLEX_UNIT_PX, mText.getTextSize() * 1.2f);
+ mText.setTextSize(TypedValue.COMPLEX_UNIT_PX, mText.getTextSize() * 1.3f);
mText.setTypeface(CONDENSED);
mText.setTextColor(GRAY);
mText.setGravity(Gravity.CENTER);
@@ -284,7 +294,7 @@ public class ZenModeView extends RelativeLayout {
private int mCurrent;
private float mDownX;
- public UntilPager(Context context, Paint pathPaint, int iconSize) {
+ public UntilPager(Context context, int iconSize) {
super(context);
mViews = new UntilView[3];
for (int i = 0; i < mViews.length; i++) {
diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java
index 09a414e..288e8e0 100755
--- a/services/core/java/com/android/server/pm/PackageManagerService.java
+++ b/services/core/java/com/android/server/pm/PackageManagerService.java
@@ -700,7 +700,7 @@ public class PackageManagerService extends IPackageManager.Stub {
// Just post MCS_BOUND message to trigger processing
// of next pending install.
if (DEBUG_SD_INSTALL) Log.i(TAG,
- "Posting MCS_BOUND for next woek");
+ "Posting MCS_BOUND for next work");
mHandler.sendEmptyMessage(MCS_BOUND);
}
}
@@ -7533,32 +7533,34 @@ public class PackageManagerService extends IPackageManager.Stub {
mSuccess = getPackageSizeInfoLI(mStats.packageName, mStats.userHandle, mStats);
}
- final boolean mounted;
- if (Environment.isExternalStorageEmulated()) {
- mounted = true;
- } else {
- final String status = Environment.getExternalStorageState();
- mounted = (Environment.MEDIA_MOUNTED.equals(status)
- || Environment.MEDIA_MOUNTED_READ_ONLY.equals(status));
- }
+ if (mSuccess) {
+ final boolean mounted;
+ if (Environment.isExternalStorageEmulated()) {
+ mounted = true;
+ } else {
+ final String status = Environment.getExternalStorageState();
+ mounted = (Environment.MEDIA_MOUNTED.equals(status)
+ || Environment.MEDIA_MOUNTED_READ_ONLY.equals(status));
+ }
- if (mounted) {
- final UserEnvironment userEnv = new UserEnvironment(mStats.userHandle);
+ if (mounted) {
+ final UserEnvironment userEnv = new UserEnvironment(mStats.userHandle);
- mStats.externalCacheSize = calculateDirectorySize(mContainerService,
- userEnv.buildExternalStorageAppCacheDirs(mStats.packageName));
+ mStats.externalCacheSize = calculateDirectorySize(mContainerService,
+ userEnv.buildExternalStorageAppCacheDirs(mStats.packageName));
- mStats.externalDataSize = calculateDirectorySize(mContainerService,
- userEnv.buildExternalStorageAppDataDirs(mStats.packageName));
+ mStats.externalDataSize = calculateDirectorySize(mContainerService,
+ userEnv.buildExternalStorageAppDataDirs(mStats.packageName));
- // Always subtract cache size, since it's a subdirectory
- mStats.externalDataSize -= mStats.externalCacheSize;
+ // Always subtract cache size, since it's a subdirectory
+ mStats.externalDataSize -= mStats.externalCacheSize;
- mStats.externalMediaSize = calculateDirectorySize(mContainerService,
- userEnv.buildExternalStorageAppMediaDirs(mStats.packageName));
+ mStats.externalMediaSize = calculateDirectorySize(mContainerService,
+ userEnv.buildExternalStorageAppMediaDirs(mStats.packageName));
- mStats.externalObbSize = calculateDirectorySize(mContainerService,
- userEnv.buildExternalStorageAppObbDirs(mStats.packageName));
+ mStats.externalObbSize = calculateDirectorySize(mContainerService,
+ userEnv.buildExternalStorageAppObbDirs(mStats.packageName));
+ }
}
}
@@ -10271,6 +10273,9 @@ public class PackageManagerService extends IPackageManager.Stub {
final IPackageStatsObserver observer) {
mContext.enforceCallingOrSelfPermission(
android.Manifest.permission.GET_PACKAGE_SIZE, null);
+ if (packageName == null) {
+ throw new IllegalArgumentException("Attempt to get size of null packageName");
+ }
PackageStats stats = new PackageStats(packageName, userHandle);
diff --git a/services/usb/java/com/android/server/usb/UsbHostManager.java b/services/usb/java/com/android/server/usb/UsbHostManager.java
index 7ae5460..9ccb809 100644
--- a/services/usb/java/com/android/server/usb/UsbHostManager.java
+++ b/services/usb/java/com/android/server/usb/UsbHostManager.java
@@ -17,6 +17,7 @@
package com.android.server.usb;
import android.content.Context;
+import android.content.Intent;
import android.hardware.usb.UsbConfiguration;
import android.hardware.usb.UsbConstants;
import android.hardware.usb.UsbDevice;
@@ -25,21 +26,25 @@ import android.hardware.usb.UsbInterface;
import android.os.Bundle;
import android.os.ParcelFileDescriptor;
import android.os.Parcelable;
+import android.os.UserHandle;
import android.util.Slog;
import com.android.internal.annotations.GuardedBy;
+import java.io.File;
import java.io.FileDescriptor;
+import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap;
+import java.util.Scanner;
/**
* UsbHostManager manages USB state in host mode.
*/
public class UsbHostManager {
private static final String TAG = UsbHostManager.class.getSimpleName();
- private static final boolean LOG = false;
+ private static final boolean DEBUG_AUDIO = false;
// contains all connected USB devices
private final HashMap<String, UsbDevice> mDevices = new HashMap<String, UsbDevice>();
@@ -102,6 +107,30 @@ public class UsbHostManager {
return false;
}
+ // Broadcasts the arrival/departure of a USB audio interface
+ // card - the ALSA card number of the physical interface
+ // device - the ALSA device number of the physical interface
+ // enabled - if true, we're connecting a device (it's arrived), else disconnecting
+ private void sendDeviceNotification(int card, int device, boolean enabled,
+ boolean hasPlayback, boolean hasCapture, boolean hasMIDI) {
+ // send a sticky broadcast containing current USB state
+ Intent intent = new Intent(Intent.ACTION_USB_AUDIO_DEVICE_PLUG);
+ intent.addFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING);
+ intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY);
+ intent.putExtra("state", enabled ? 1 : 0);
+ intent.putExtra("card", card);
+ intent.putExtra("device", device);
+ intent.putExtra("hasPlayback", hasPlayback);
+ intent.putExtra("hasCapture", hasCapture);
+ intent.putExtra("hasMIDI", hasMIDI);
+ mContext.sendStickyBroadcastAsUser(intent, UserHandle.ALL);
+ }
+
+ static boolean isBuiltInUsbDevice(String deviceName) {
+ // This may be too broad an assumption
+ return deviceName.equals("/dev/bus/usb/001/001");
+ }
+
/* Called from JNI in monitorUsbHostBus() to report new USB devices
Returns true if successful, in which case the JNI code will continue adding configurations,
interfaces and endpoints, and finally call endUsbDeviceAdded after all descriptors
@@ -111,6 +140,59 @@ public class UsbHostManager {
int deviceClass, int deviceSubclass, int deviceProtocol,
String manufacturerName, String productName, String serialNumber) {
+ if (DEBUG_AUDIO) {
+ Slog.d(TAG, "usb:UsbHostManager.beginUsbDeviceAdded(" + deviceName + ")");
+ // Audio Class Codes:
+ // Audio: 0x01
+ // Audio Subclass Codes:
+ // undefined: 0x00
+ // audio control: 0x01
+ // audio streaming: 0x02
+ // midi streaming: 0x03
+
+ // some useful debugging info
+ Slog.d(TAG, "usb:UsbHostManager.usbDeviceAdded()");
+ Slog.d(TAG, "usb: nm:" + deviceName +
+ " vnd:" + vendorID +
+ " prd:" + productID +
+ " cls:" + deviceClass +
+ " sub:" + deviceSubclass +
+ " proto:" + deviceProtocol);
+ }
+
+ if (!isBuiltInUsbDevice(deviceName)) {
+ //TODO(pmclean) we will need this when we need to support USB interfaces
+ // beyond card1, device0 but turn them off for now
+ //com.android.alsascan.AlsaCardsParser cardsParser =
+ // new com.android.alsascan.AlsaCardsParser();
+ //cardsParser.scan();
+ //cardsParser.Log();
+
+ // But we need to parse the device to determine its capabilities.
+ com.android.alsascan.AlsaDevicesParser devicesParser =
+ new com.android.alsascan.AlsaDevicesParser();
+ devicesParser.scan();
+ //devicesParser.Log();
+
+ boolean hasPlaybackDevices = devicesParser.hasPlaybackDevices();
+ boolean hasCaptureDevices = devicesParser.hasCaptureDevices();
+ boolean hasMIDI = devicesParser.hasMIDIDevices();
+
+ if (DEBUG_AUDIO) {
+ Slog.d(TAG, "usb: hasPlayback:" + hasPlaybackDevices
+ + " hasCapture:" + hasCaptureDevices);
+ }
+
+ //TODO(pmclean)
+ // For now just assume that any USB device that is attached is:
+ // 1. An audio interface and
+ // 2. is card:1 device:0
+ int cardNum = 1;
+ int deviceNum = 0;
+ sendDeviceNotification(cardNum, deviceNum, true,
+ hasPlaybackDevices, hasCaptureDevices, hasMIDI);
+ }
+
if (isBlackListed(deviceName) ||
isBlackListed(deviceClass, deviceSubclass, deviceProtocol)) {
return false;
@@ -176,6 +258,9 @@ public class UsbHostManager {
/* Called from JNI in monitorUsbHostBus() to finish adding a new device */
private void endUsbDeviceAdded() {
+ if (DEBUG_AUDIO) {
+ Slog.d(TAG, "usb:UsbHostManager.endUsbDeviceAdded()");
+ }
if (mNewInterface != null) {
mNewInterface.setEndpoints(
mNewEndpoints.toArray(new UsbEndpoint[mNewEndpoints.size()]));
@@ -204,6 +289,13 @@ public class UsbHostManager {
/* Called from JNI in monitorUsbHostBus to report USB device removal */
private void usbDeviceRemoved(String deviceName) {
+ if (DEBUG_AUDIO) {
+ Slog.d(TAG, "usb:UsbHostManager.usbDeviceRemoved() nm:" + deviceName);
+ }
+
+ // Same assumptions as the fake-out above
+ sendDeviceNotification(1, 0, false, /*NA*/false, /*NA*/false, /*NA*/false);
+
synchronized (mLock) {
UsbDevice device = mDevices.remove(deviceName);
if (device != null) {
diff --git a/tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java b/tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java
index cfe7525..cc621c4 100644
--- a/tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java
+++ b/tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java
@@ -52,9 +52,9 @@ public final class BridgeTypedArray extends TypedArray {
private final BridgeContext mContext;
private final boolean mPlatformFile;
- private ResourceValue[] mResourceData;
- private String[] mNames;
- private boolean[] mIsFramework;
+ private final ResourceValue[] mResourceData;
+ private final String[] mNames;
+ private final boolean[] mIsFramework;
public BridgeTypedArray(BridgeResources resources, BridgeContext context, int len,
boolean platformFile) {
@@ -81,8 +81,8 @@ public final class BridgeTypedArray extends TypedArray {
}
/**
- * Seals the array after all calls to {@link #bridgeSetValue(int, String, ResourceValue)} have
- * been done.
+ * Seals the array after all calls to
+ * {@link #bridgeSetValue(int, String, boolean, ResourceValue)} have been done.
* <p/>This allows to compute the list of non default values, permitting
* {@link #getIndexCount()} to return the proper value.
*/
@@ -252,7 +252,7 @@ public final class BridgeTypedArray extends TypedArray {
for (String keyword : keywords) {
Integer i = map.get(keyword.trim());
if (i != null) {
- result |= i.intValue();
+ result |= i;
} else {
Bridge.getLog().warning(LayoutLog.TAG_RESOURCES_FORMAT,
String.format(
@@ -731,7 +731,7 @@ public final class BridgeTypedArray extends TypedArray {
}
// not a direct id valid reference? resolve it
- Integer idValue = null;
+ Integer idValue;
if (resValue.isFramework()) {
idValue = Bridge.getResourceId(resValue.getResourceType(),
@@ -742,7 +742,7 @@ public final class BridgeTypedArray extends TypedArray {
}
if (idValue != null) {
- return idValue.intValue();
+ return idValue;
}
Bridge.getLog().warning(LayoutLog.TAG_RESOURCES_RESOLVE,
@@ -753,6 +753,12 @@ public final class BridgeTypedArray extends TypedArray {
return defValue;
}
+ @Override
+ public int getThemeAttributeId(int index, int defValue) {
+ // TODO: Get the right Theme Attribute ID to enable caching of the drawables.
+ return defValue;
+ }
+
/**
* Retrieve the Drawable for the attribute at <var>index</var>. This
* gets the resource ID of the selected attribute, and uses
@@ -854,6 +860,7 @@ public final class BridgeTypedArray extends TypedArray {
*/
@Override
public boolean hasValue(int index) {
+ //noinspection SimplifiableIfStatement
if (index < 0 || index >= mResourceData.length) {
return false;
}