Merge "Add TelecommManager to system services"
diff --git a/api/current.txt b/api/current.txt
index d82bc33..2f813ac 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -40028,109 +40028,6 @@
field public static final java.lang.Character.UnicodeBlock YI_SYLLABLES;
}
- public static final class Character.UnicodeScript extends java.lang.Enum {
- method public static java.lang.Character.UnicodeScript forName(java.lang.String);
- method public static java.lang.Character.UnicodeScript of(int);
- method public static java.lang.Character.UnicodeScript valueOf(java.lang.String);
- method public static final java.lang.Character.UnicodeScript[] values();
- enum_constant public static final java.lang.Character.UnicodeScript ARABIC;
- enum_constant public static final java.lang.Character.UnicodeScript ARMENIAN;
- enum_constant public static final java.lang.Character.UnicodeScript AVESTAN;
- enum_constant public static final java.lang.Character.UnicodeScript BALINESE;
- enum_constant public static final java.lang.Character.UnicodeScript BAMUM;
- enum_constant public static final java.lang.Character.UnicodeScript BATAK;
- enum_constant public static final java.lang.Character.UnicodeScript BENGALI;
- enum_constant public static final java.lang.Character.UnicodeScript BOPOMOFO;
- enum_constant public static final java.lang.Character.UnicodeScript BRAHMI;
- enum_constant public static final java.lang.Character.UnicodeScript BRAILLE;
- enum_constant public static final java.lang.Character.UnicodeScript BUGINESE;
- enum_constant public static final java.lang.Character.UnicodeScript BUHID;
- enum_constant public static final java.lang.Character.UnicodeScript CANADIAN_ABORIGINAL;
- enum_constant public static final java.lang.Character.UnicodeScript CARIAN;
- enum_constant public static final java.lang.Character.UnicodeScript CHAM;
- enum_constant public static final java.lang.Character.UnicodeScript CHEROKEE;
- enum_constant public static final java.lang.Character.UnicodeScript COMMON;
- enum_constant public static final java.lang.Character.UnicodeScript COPTIC;
- enum_constant public static final java.lang.Character.UnicodeScript CUNEIFORM;
- enum_constant public static final java.lang.Character.UnicodeScript CYPRIOT;
- enum_constant public static final java.lang.Character.UnicodeScript CYRILLIC;
- enum_constant public static final java.lang.Character.UnicodeScript DESERET;
- enum_constant public static final java.lang.Character.UnicodeScript DEVANAGARI;
- enum_constant public static final java.lang.Character.UnicodeScript EGYPTIAN_HIEROGLYPHS;
- enum_constant public static final java.lang.Character.UnicodeScript ETHIOPIC;
- enum_constant public static final java.lang.Character.UnicodeScript GEORGIAN;
- enum_constant public static final java.lang.Character.UnicodeScript GLAGOLITIC;
- enum_constant public static final java.lang.Character.UnicodeScript GOTHIC;
- enum_constant public static final java.lang.Character.UnicodeScript GREEK;
- enum_constant public static final java.lang.Character.UnicodeScript GUJARATI;
- enum_constant public static final java.lang.Character.UnicodeScript GURMUKHI;
- enum_constant public static final java.lang.Character.UnicodeScript HAN;
- enum_constant public static final java.lang.Character.UnicodeScript HANGUL;
- enum_constant public static final java.lang.Character.UnicodeScript HANUNOO;
- enum_constant public static final java.lang.Character.UnicodeScript HEBREW;
- enum_constant public static final java.lang.Character.UnicodeScript HIRAGANA;
- enum_constant public static final java.lang.Character.UnicodeScript IMPERIAL_ARAMAIC;
- enum_constant public static final java.lang.Character.UnicodeScript INHERITED;
- enum_constant public static final java.lang.Character.UnicodeScript INSCRIPTIONAL_PAHLAVI;
- enum_constant public static final java.lang.Character.UnicodeScript INSCRIPTIONAL_PARTHIAN;
- enum_constant public static final java.lang.Character.UnicodeScript JAVANESE;
- enum_constant public static final java.lang.Character.UnicodeScript KAITHI;
- enum_constant public static final java.lang.Character.UnicodeScript KANNADA;
- enum_constant public static final java.lang.Character.UnicodeScript KATAKANA;
- enum_constant public static final java.lang.Character.UnicodeScript KAYAH_LI;
- enum_constant public static final java.lang.Character.UnicodeScript KHAROSHTHI;
- enum_constant public static final java.lang.Character.UnicodeScript KHMER;
- enum_constant public static final java.lang.Character.UnicodeScript LAO;
- enum_constant public static final java.lang.Character.UnicodeScript LATIN;
- enum_constant public static final java.lang.Character.UnicodeScript LEPCHA;
- enum_constant public static final java.lang.Character.UnicodeScript LIMBU;
- enum_constant public static final java.lang.Character.UnicodeScript LINEAR_B;
- enum_constant public static final java.lang.Character.UnicodeScript LISU;
- enum_constant public static final java.lang.Character.UnicodeScript LYCIAN;
- enum_constant public static final java.lang.Character.UnicodeScript LYDIAN;
- enum_constant public static final java.lang.Character.UnicodeScript MALAYALAM;
- enum_constant public static final java.lang.Character.UnicodeScript MANDAIC;
- enum_constant public static final java.lang.Character.UnicodeScript MEETEI_MAYEK;
- enum_constant public static final java.lang.Character.UnicodeScript MONGOLIAN;
- enum_constant public static final java.lang.Character.UnicodeScript MYANMAR;
- enum_constant public static final java.lang.Character.UnicodeScript NEW_TAI_LUE;
- enum_constant public static final java.lang.Character.UnicodeScript NKO;
- enum_constant public static final java.lang.Character.UnicodeScript OGHAM;
- enum_constant public static final java.lang.Character.UnicodeScript OLD_ITALIC;
- enum_constant public static final java.lang.Character.UnicodeScript OLD_PERSIAN;
- enum_constant public static final java.lang.Character.UnicodeScript OLD_SOUTH_ARABIAN;
- enum_constant public static final java.lang.Character.UnicodeScript OLD_TURKIC;
- enum_constant public static final java.lang.Character.UnicodeScript OL_CHIKI;
- enum_constant public static final java.lang.Character.UnicodeScript ORIYA;
- enum_constant public static final java.lang.Character.UnicodeScript OSMANYA;
- enum_constant public static final java.lang.Character.UnicodeScript PHAGS_PA;
- enum_constant public static final java.lang.Character.UnicodeScript PHOENICIAN;
- enum_constant public static final java.lang.Character.UnicodeScript REJANG;
- enum_constant public static final java.lang.Character.UnicodeScript RUNIC;
- enum_constant public static final java.lang.Character.UnicodeScript SAMARITAN;
- enum_constant public static final java.lang.Character.UnicodeScript SAURASHTRA;
- enum_constant public static final java.lang.Character.UnicodeScript SHAVIAN;
- enum_constant public static final java.lang.Character.UnicodeScript SINHALA;
- enum_constant public static final java.lang.Character.UnicodeScript SUNDANESE;
- enum_constant public static final java.lang.Character.UnicodeScript SYLOTI_NAGRI;
- enum_constant public static final java.lang.Character.UnicodeScript SYRIAC;
- enum_constant public static final java.lang.Character.UnicodeScript TAGALOG;
- enum_constant public static final java.lang.Character.UnicodeScript TAGBANWA;
- enum_constant public static final java.lang.Character.UnicodeScript TAI_LE;
- enum_constant public static final java.lang.Character.UnicodeScript TAI_THAM;
- enum_constant public static final java.lang.Character.UnicodeScript TAI_VIET;
- enum_constant public static final java.lang.Character.UnicodeScript TAMIL;
- enum_constant public static final java.lang.Character.UnicodeScript TELUGU;
- enum_constant public static final java.lang.Character.UnicodeScript THAANA;
- enum_constant public static final java.lang.Character.UnicodeScript THAI;
- enum_constant public static final java.lang.Character.UnicodeScript TIBETAN;
- enum_constant public static final java.lang.Character.UnicodeScript TIFINAGH;
- enum_constant public static final java.lang.Character.UnicodeScript UGARITIC;
- enum_constant public static final java.lang.Character.UnicodeScript UNKNOWN;
- enum_constant public static final java.lang.Character.UnicodeScript VAI;
- enum_constant public static final java.lang.Character.UnicodeScript YI;
- }
-
public final class Class implements java.lang.reflect.AnnotatedElement java.lang.reflect.GenericDeclaration java.io.Serializable java.lang.reflect.Type {
method public java.lang.Class<? extends U> asSubclass(java.lang.Class<U>);
method public T cast(java.lang.Object);
@@ -41971,13 +41868,11 @@
method public java.lang.String getValue();
method public int getVersion();
method public boolean hasExpired();
- method public boolean isHttpOnly();
method public static java.util.List<java.net.HttpCookie> parse(java.lang.String);
method public void setComment(java.lang.String);
method public void setCommentURL(java.lang.String);
method public void setDiscard(boolean);
method public void setDomain(java.lang.String);
- method public void setHttpOnly(boolean);
method public void setMaxAge(long);
method public void setPath(java.lang.String);
method public void setPortlist(java.lang.String);
@@ -42368,11 +42263,6 @@
method public abstract java.net.SocketImpl createSocketImpl();
}
- public abstract interface SocketOption {
- method public abstract java.lang.String name();
- method public abstract java.lang.Class<T> type();
- }
-
public abstract interface SocketOptions {
method public abstract java.lang.Object getOption(int) throws java.net.SocketException;
method public abstract void setOption(int, java.lang.Object) throws java.net.SocketException;
@@ -42403,21 +42293,6 @@
ctor public SocketTimeoutException(java.lang.String);
}
- public final class StandardSocketOptions {
- ctor public StandardSocketOptions();
- field public static final java.net.SocketOption IP_MULTICAST_IF;
- field public static final java.net.SocketOption IP_MULTICAST_LOOP;
- field public static final java.net.SocketOption IP_MULTICAST_TTL;
- field public static final java.net.SocketOption IP_TOS;
- field public static final java.net.SocketOption SO_BROADCAST;
- field public static final java.net.SocketOption SO_KEEPALIVE;
- field public static final java.net.SocketOption SO_LINGER;
- field public static final java.net.SocketOption SO_RCVBUF;
- field public static final java.net.SocketOption SO_REUSEADDR;
- field public static final java.net.SocketOption SO_SNDBUF;
- field public static final java.net.SocketOption TCP_NODELAY;
- }
-
public final class URI implements java.lang.Comparable java.io.Serializable {
ctor public URI(java.lang.String) throws java.net.URISyntaxException;
ctor public URI(java.lang.String, java.lang.String, java.lang.String) throws java.net.URISyntaxException;
@@ -42513,7 +42388,6 @@
method public java.lang.Object getContent(java.lang.Class[]) throws java.io.IOException;
method public java.lang.String getContentEncoding();
method public int getContentLength();
- method public long getContentLengthLong();
method public java.lang.String getContentType();
method public long getDate();
method public static boolean getDefaultAllowUserInteraction();
@@ -42528,7 +42402,6 @@
method public long getHeaderFieldDate(java.lang.String, long);
method public int getHeaderFieldInt(java.lang.String, int);
method public java.lang.String getHeaderFieldKey(int);
- method public long getHeaderFieldLong(java.lang.String, long);
method public java.util.Map<java.lang.String, java.util.List<java.lang.String>> getHeaderFields();
method public long getIfModifiedSince();
method public java.io.InputStream getInputStream() throws java.io.IOException;
@@ -42879,10 +42752,6 @@
package java.nio.channels {
- public class AlreadyBoundException extends java.lang.IllegalStateException {
- ctor public AlreadyBoundException();
- }
-
public class AlreadyConnectedException extends java.lang.IllegalStateException {
ctor public AlreadyConnectedException();
}
@@ -42930,32 +42799,25 @@
ctor public ConnectionPendingException();
}
- public abstract class DatagramChannel extends java.nio.channels.spi.AbstractSelectableChannel implements java.nio.channels.ByteChannel java.nio.channels.GatheringByteChannel java.nio.channels.MulticastChannel java.nio.channels.ScatteringByteChannel {
+ public abstract class DatagramChannel extends java.nio.channels.spi.AbstractSelectableChannel implements java.nio.channels.ByteChannel java.nio.channels.GatheringByteChannel java.nio.channels.ScatteringByteChannel {
ctor protected DatagramChannel(java.nio.channels.spi.SelectorProvider);
- method public java.nio.channels.DatagramChannel bind(java.net.SocketAddress) throws java.io.IOException;
method public abstract java.nio.channels.DatagramChannel connect(java.net.SocketAddress) throws java.io.IOException;
method public abstract java.nio.channels.DatagramChannel disconnect() throws java.io.IOException;
- method public java.net.SocketAddress getLocalAddress() throws java.io.IOException;
- method public T getOption(java.net.SocketOption<T>) throws java.io.IOException;
method public abstract boolean isConnected();
- method public java.nio.channels.MembershipKey join(java.net.InetAddress, java.net.NetworkInterface) throws java.io.IOException;
- method public java.nio.channels.MembershipKey join(java.net.InetAddress, java.net.NetworkInterface, java.net.InetAddress) throws java.io.IOException;
method public static java.nio.channels.DatagramChannel open() throws java.io.IOException;
method public abstract int read(java.nio.ByteBuffer) throws java.io.IOException;
method public abstract long read(java.nio.ByteBuffer[], int, int) throws java.io.IOException;
method public final synchronized long read(java.nio.ByteBuffer[]) throws java.io.IOException;
method public abstract java.net.SocketAddress receive(java.nio.ByteBuffer) throws java.io.IOException;
method public abstract int send(java.nio.ByteBuffer, java.net.SocketAddress) throws java.io.IOException;
- method public java.nio.channels.DatagramChannel setOption(java.net.SocketOption<T>, T) throws java.io.IOException;
method public abstract java.net.DatagramSocket socket();
- method public java.util.Set<java.net.SocketOption<?>> supportedOptions();
method public final int validOps();
method public abstract int write(java.nio.ByteBuffer) throws java.io.IOException;
method public abstract long write(java.nio.ByteBuffer[], int, int) throws java.io.IOException;
method public final synchronized long write(java.nio.ByteBuffer[]) throws java.io.IOException;
}
- public abstract class FileChannel extends java.nio.channels.spi.AbstractInterruptibleChannel implements java.nio.channels.GatheringByteChannel java.nio.channels.ScatteringByteChannel java.nio.channels.SeekableByteChannel {
+ public abstract class FileChannel extends java.nio.channels.spi.AbstractInterruptibleChannel implements java.nio.channels.ByteChannel java.nio.channels.GatheringByteChannel java.nio.channels.ScatteringByteChannel {
ctor protected FileChannel();
method public abstract void force(boolean) throws java.io.IOException;
method public final java.nio.channels.FileLock lock() throws java.io.IOException;
@@ -42987,7 +42849,6 @@
public abstract class FileLock implements java.lang.AutoCloseable {
ctor protected FileLock(java.nio.channels.FileChannel, long, long, boolean);
- method public java.nio.channels.Channel acquiredBy();
method public final java.nio.channels.FileChannel channel();
method public final void close() throws java.io.IOException;
method public final boolean isShared();
@@ -43020,32 +42881,6 @@
method public abstract void close() throws java.io.IOException;
}
- public abstract class MembershipKey {
- ctor protected MembershipKey();
- method public abstract java.nio.channels.MembershipKey block(java.net.InetAddress) throws java.io.IOException;
- method public abstract java.nio.channels.MulticastChannel channel();
- method public abstract void drop();
- method public abstract java.net.InetAddress group();
- method public abstract boolean isValid();
- method public abstract java.net.NetworkInterface networkInterface();
- method public abstract java.net.InetAddress sourceAddress();
- method public abstract java.nio.channels.MembershipKey unblock(java.net.InetAddress);
- }
-
- public abstract interface MulticastChannel implements java.nio.channels.NetworkChannel {
- method public abstract void close() throws java.io.IOException;
- method public abstract java.nio.channels.MembershipKey join(java.net.InetAddress, java.net.NetworkInterface) throws java.io.IOException;
- method public abstract java.nio.channels.MembershipKey join(java.net.InetAddress, java.net.NetworkInterface, java.net.InetAddress) throws java.io.IOException;
- }
-
- public abstract interface NetworkChannel implements java.lang.AutoCloseable java.nio.channels.Channel java.io.Closeable {
- method public abstract java.nio.channels.NetworkChannel bind(java.net.SocketAddress) throws java.io.IOException;
- method public abstract java.net.SocketAddress getLocalAddress() throws java.io.IOException;
- method public abstract T getOption(java.net.SocketOption<T>) throws java.io.IOException;
- method public abstract java.nio.channels.NetworkChannel setOption(java.net.SocketOption<T>, T) throws java.io.IOException;
- method public abstract java.util.Set<java.net.SocketOption<?>> supportedOptions();
- }
-
public class NoConnectionPendingException extends java.lang.IllegalStateException {
ctor public NoConnectionPendingException();
}
@@ -43096,15 +42931,6 @@
method public abstract long read(java.nio.ByteBuffer[], int, int) throws java.io.IOException;
}
- public abstract interface SeekableByteChannel implements java.nio.channels.ByteChannel {
- method public abstract long position() throws java.io.IOException;
- method public abstract java.nio.channels.SeekableByteChannel position(long) throws java.io.IOException;
- method public abstract int read(java.nio.ByteBuffer) throws java.io.IOException;
- method public abstract long size() throws java.io.IOException;
- method public abstract java.nio.channels.SeekableByteChannel truncate(long) throws java.io.IOException;
- method public abstract int write(java.nio.ByteBuffer) throws java.io.IOException;
- }
-
public abstract class SelectableChannel extends java.nio.channels.spi.AbstractInterruptibleChannel implements java.nio.channels.Channel {
ctor protected SelectableChannel();
method public abstract java.lang.Object blockingLock();
@@ -43153,27 +42979,18 @@
method public abstract java.nio.channels.Selector wakeup();
}
- public abstract class ServerSocketChannel extends java.nio.channels.spi.AbstractSelectableChannel implements java.nio.channels.NetworkChannel {
+ public abstract class ServerSocketChannel extends java.nio.channels.spi.AbstractSelectableChannel {
ctor protected ServerSocketChannel(java.nio.channels.spi.SelectorProvider);
method public abstract java.nio.channels.SocketChannel accept() throws java.io.IOException;
- method public final java.nio.channels.ServerSocketChannel bind(java.net.SocketAddress) throws java.io.IOException;
- method public java.nio.channels.ServerSocketChannel bind(java.net.SocketAddress, int) throws java.io.IOException;
- method public java.net.SocketAddress getLocalAddress() throws java.io.IOException;
- method public T getOption(java.net.SocketOption<T>) throws java.io.IOException;
method public static java.nio.channels.ServerSocketChannel open() throws java.io.IOException;
- method public java.nio.channels.ServerSocketChannel setOption(java.net.SocketOption<T>, T) throws java.io.IOException;
method public abstract java.net.ServerSocket socket();
- method public java.util.Set<java.net.SocketOption<?>> supportedOptions();
method public final int validOps();
}
- public abstract class SocketChannel extends java.nio.channels.spi.AbstractSelectableChannel implements java.nio.channels.ByteChannel java.nio.channels.GatheringByteChannel java.nio.channels.NetworkChannel java.nio.channels.ScatteringByteChannel {
+ public abstract class SocketChannel extends java.nio.channels.spi.AbstractSelectableChannel implements java.nio.channels.ByteChannel java.nio.channels.GatheringByteChannel java.nio.channels.ScatteringByteChannel {
ctor protected SocketChannel(java.nio.channels.spi.SelectorProvider);
- method public java.nio.channels.SocketChannel bind(java.net.SocketAddress) throws java.io.IOException;
method public abstract boolean connect(java.net.SocketAddress) throws java.io.IOException;
method public abstract boolean finishConnect() throws java.io.IOException;
- method public java.net.SocketAddress getLocalAddress() throws java.io.IOException;
- method public T getOption(java.net.SocketOption<T>) throws java.io.IOException;
method public abstract boolean isConnected();
method public abstract boolean isConnectionPending();
method public static java.nio.channels.SocketChannel open() throws java.io.IOException;
@@ -43181,9 +42998,7 @@
method public abstract int read(java.nio.ByteBuffer) throws java.io.IOException;
method public abstract long read(java.nio.ByteBuffer[], int, int) throws java.io.IOException;
method public final synchronized long read(java.nio.ByteBuffer[]) throws java.io.IOException;
- method public java.nio.channels.SocketChannel setOption(java.net.SocketOption<T>, T) throws java.io.IOException;
method public abstract java.net.Socket socket();
- method public java.util.Set<java.net.SocketOption<?>> supportedOptions();
method public final int validOps();
method public abstract int write(java.nio.ByteBuffer) throws java.io.IOException;
method public abstract long write(java.nio.ByteBuffer[], int, int) throws java.io.IOException;
@@ -47143,7 +46958,6 @@
method public java.lang.String getDisplayName(java.util.Locale);
method public static java.util.Currency getInstance(java.lang.String);
method public static java.util.Currency getInstance(java.util.Locale);
- method public int getNumericCode();
method public java.lang.String getSymbol();
method public java.lang.String getSymbol(java.util.Locale);
}
@@ -47428,13 +47242,6 @@
method public int getWidth();
}
- public class IllformedLocaleException extends java.lang.RuntimeException {
- ctor public IllformedLocaleException();
- ctor public IllformedLocaleException(java.lang.String);
- ctor public IllformedLocaleException(java.lang.String, int);
- method public int getErrorIndex();
- }
-
public class InputMismatchException extends java.util.NoSuchElementException implements java.io.Serializable {
ctor public InputMismatchException();
ctor public InputMismatchException(java.lang.String);
@@ -47549,7 +47356,6 @@
ctor public Locale(java.lang.String, java.lang.String);
ctor public Locale(java.lang.String, java.lang.String, java.lang.String);
method public java.lang.Object clone();
- method public static java.util.Locale forLanguageTag(java.lang.String);
method public static java.util.Locale[] getAvailableLocales();
method public java.lang.String getCountry();
method public static java.util.Locale getDefault();
@@ -47559,24 +47365,15 @@
method public java.lang.String getDisplayLanguage(java.util.Locale);
method public final java.lang.String getDisplayName();
method public java.lang.String getDisplayName(java.util.Locale);
- method public java.lang.String getDisplayScript();
- method public java.lang.String getDisplayScript(java.util.Locale);
method public final java.lang.String getDisplayVariant();
method public java.lang.String getDisplayVariant(java.util.Locale);
- method public java.lang.String getExtension(char);
- method public java.util.Set<java.lang.Character> getExtensionKeys();
method public java.lang.String getISO3Country();
method public java.lang.String getISO3Language();
method public static java.lang.String[] getISOCountries();
method public static java.lang.String[] getISOLanguages();
method public java.lang.String getLanguage();
- method public java.lang.String getScript();
- method public java.util.Set<java.lang.String> getUnicodeLocaleAttributes();
- method public java.util.Set<java.lang.String> getUnicodeLocaleKeys();
- method public java.lang.String getUnicodeLocaleType(java.lang.String);
method public java.lang.String getVariant();
method public static synchronized void setDefault(java.util.Locale);
- method public java.lang.String toLanguageTag();
method public final java.lang.String toString();
field public static final java.util.Locale CANADA;
field public static final java.util.Locale CANADA_FRENCH;
@@ -47594,33 +47391,14 @@
field public static final java.util.Locale KOREA;
field public static final java.util.Locale KOREAN;
field public static final java.util.Locale PRC;
- field public static final char PRIVATE_USE_EXTENSION = 120; // 0x0078 'x'
field public static final java.util.Locale ROOT;
field public static final java.util.Locale SIMPLIFIED_CHINESE;
field public static final java.util.Locale TAIWAN;
field public static final java.util.Locale TRADITIONAL_CHINESE;
field public static final java.util.Locale UK;
- field public static final char UNICODE_LOCALE_EXTENSION = 117; // 0x0075 'u'
field public static final java.util.Locale US;
}
- public static final class Locale.Builder {
- ctor public Locale.Builder();
- method public java.util.Locale.Builder addUnicodeLocaleAttribute(java.lang.String);
- method public java.util.Locale build();
- method public java.util.Locale.Builder clear();
- method public java.util.Locale.Builder clearExtensions();
- method public java.util.Locale.Builder removeUnicodeLocaleAttribute(java.lang.String);
- method public java.util.Locale.Builder setExtension(char, java.lang.String);
- method public java.util.Locale.Builder setLanguage(java.lang.String);
- method public java.util.Locale.Builder setLanguageTag(java.lang.String);
- method public java.util.Locale.Builder setLocale(java.util.Locale);
- method public java.util.Locale.Builder setRegion(java.lang.String);
- method public java.util.Locale.Builder setScript(java.lang.String);
- method public java.util.Locale.Builder setUnicodeLocaleKeyword(java.lang.String, java.lang.String);
- method public java.util.Locale.Builder setVariant(java.lang.String);
- }
-
public abstract interface Map {
method public abstract void clear();
method public abstract boolean containsKey(java.lang.Object);
@@ -48307,35 +48085,6 @@
method public V replace(K, V);
}
- public class ConcurrentLinkedDeque extends java.util.AbstractCollection implements java.util.Deque java.io.Serializable {
- ctor public ConcurrentLinkedDeque();
- ctor public ConcurrentLinkedDeque(java.util.Collection<? extends E>);
- method public void addFirst(E);
- method public void addLast(E);
- method public java.util.Iterator<E> descendingIterator();
- method public E element();
- method public E getFirst();
- method public E getLast();
- method public java.util.Iterator<E> iterator();
- method public boolean offer(E);
- method public boolean offerFirst(E);
- method public boolean offerLast(E);
- method public E peek();
- method public E peekFirst();
- method public E peekLast();
- method public E poll();
- method public E pollFirst();
- method public E pollLast();
- method public E pop();
- method public void push(E);
- method public E remove();
- method public E removeFirst();
- method public boolean removeFirstOccurrence(java.lang.Object);
- method public E removeLast();
- method public boolean removeLastOccurrence(java.lang.Object);
- method public int size();
- }
-
public class ConcurrentLinkedQueue extends java.util.AbstractQueue implements java.util.Queue java.io.Serializable {
ctor public ConcurrentLinkedQueue();
ctor public ConcurrentLinkedQueue(java.util.Collection<? extends E>);
@@ -48576,94 +48325,6 @@
method public static java.util.concurrent.ScheduledExecutorService unconfigurableScheduledExecutorService(java.util.concurrent.ScheduledExecutorService);
}
- public class ForkJoinPool extends java.util.concurrent.AbstractExecutorService {
- ctor public ForkJoinPool();
- ctor public ForkJoinPool(int);
- ctor public ForkJoinPool(int, java.util.concurrent.ForkJoinPool.ForkJoinWorkerThreadFactory, java.lang.Thread.UncaughtExceptionHandler, boolean);
- method public boolean awaitQuiescence(long, java.util.concurrent.TimeUnit);
- method public boolean awaitTermination(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
- method protected int drainTasksTo(java.util.Collection<? super java.util.concurrent.ForkJoinTask<?>>);
- method public void execute(java.util.concurrent.ForkJoinTask<?>);
- method public void execute(java.lang.Runnable);
- method public int getActiveThreadCount();
- method public boolean getAsyncMode();
- method public java.util.concurrent.ForkJoinPool.ForkJoinWorkerThreadFactory getFactory();
- method public int getParallelism();
- method public int getPoolSize();
- method public int getQueuedSubmissionCount();
- method public long getQueuedTaskCount();
- method public int getRunningThreadCount();
- method public long getStealCount();
- method public java.lang.Thread.UncaughtExceptionHandler getUncaughtExceptionHandler();
- method public boolean hasQueuedSubmissions();
- method public T invoke(java.util.concurrent.ForkJoinTask<T>);
- method public boolean isQuiescent();
- method public boolean isShutdown();
- method public boolean isTerminated();
- method public boolean isTerminating();
- method public static void managedBlock(java.util.concurrent.ForkJoinPool.ManagedBlocker) throws java.lang.InterruptedException;
- method protected java.util.concurrent.ForkJoinTask<?> pollSubmission();
- method public void shutdown();
- method public java.util.List<java.lang.Runnable> shutdownNow();
- method public java.util.concurrent.ForkJoinTask<T> submit(java.util.concurrent.ForkJoinTask<T>);
- field public static final java.util.concurrent.ForkJoinPool.ForkJoinWorkerThreadFactory defaultForkJoinWorkerThreadFactory;
- }
-
- public static abstract interface ForkJoinPool.ForkJoinWorkerThreadFactory {
- method public abstract java.util.concurrent.ForkJoinWorkerThread newThread(java.util.concurrent.ForkJoinPool);
- }
-
- public static abstract interface ForkJoinPool.ManagedBlocker {
- method public abstract boolean block() throws java.lang.InterruptedException;
- method public abstract boolean isReleasable();
- }
-
- public abstract class ForkJoinTask implements java.util.concurrent.Future java.io.Serializable {
- ctor public ForkJoinTask();
- method public static java.util.concurrent.ForkJoinTask<?> adapt(java.lang.Runnable);
- method public static java.util.concurrent.ForkJoinTask<T> adapt(java.lang.Runnable, T);
- method public static java.util.concurrent.ForkJoinTask<T> adapt(java.util.concurrent.Callable<? extends T>);
- method public boolean cancel(boolean);
- method public void complete(V);
- method public void completeExceptionally(java.lang.Throwable);
- method protected abstract boolean exec();
- method public final java.util.concurrent.ForkJoinTask<V> fork();
- method public final V get() throws java.util.concurrent.ExecutionException, java.lang.InterruptedException;
- method public final V get(long, java.util.concurrent.TimeUnit) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException, java.util.concurrent.TimeoutException;
- method public final java.lang.Throwable getException();
- method public static java.util.concurrent.ForkJoinPool getPool();
- method public static int getQueuedTaskCount();
- method public abstract V getRawResult();
- method public static int getSurplusQueuedTaskCount();
- method public static void helpQuiesce();
- method public static boolean inForkJoinPool();
- method public final V invoke();
- method public static void invokeAll(java.util.concurrent.ForkJoinTask<?>, java.util.concurrent.ForkJoinTask<?>);
- method public static void invokeAll(java.util.concurrent.ForkJoinTask<?>...);
- method public static java.util.Collection<T> invokeAll(java.util.Collection<T>);
- method public final boolean isCancelled();
- method public final boolean isCompletedAbnormally();
- method public final boolean isCompletedNormally();
- method public final boolean isDone();
- method public final V join();
- method protected static java.util.concurrent.ForkJoinTask<?> peekNextLocalTask();
- method protected static java.util.concurrent.ForkJoinTask<?> pollNextLocalTask();
- method protected static java.util.concurrent.ForkJoinTask<?> pollTask();
- method public final void quietlyInvoke();
- method public final void quietlyJoin();
- method public void reinitialize();
- method protected abstract void setRawResult(V);
- method public boolean tryUnfork();
- }
-
- public class ForkJoinWorkerThread extends java.lang.Thread {
- ctor protected ForkJoinWorkerThread(java.util.concurrent.ForkJoinPool);
- method public java.util.concurrent.ForkJoinPool getPool();
- method public int getPoolIndex();
- method protected void onStart();
- method protected void onTermination(java.lang.Throwable);
- }
-
public abstract interface Future {
method public abstract boolean cancel(boolean);
method public abstract V get() throws java.util.concurrent.ExecutionException, java.lang.InterruptedException;
@@ -48748,52 +48409,6 @@
method public E take() throws java.lang.InterruptedException;
}
- public class LinkedTransferQueue extends java.util.AbstractQueue implements java.io.Serializable java.util.concurrent.TransferQueue {
- ctor public LinkedTransferQueue();
- ctor public LinkedTransferQueue(java.util.Collection<? extends E>);
- method public int drainTo(java.util.Collection<? super E>);
- method public int drainTo(java.util.Collection<? super E>, int);
- method public int getWaitingConsumerCount();
- method public boolean hasWaitingConsumer();
- method public java.util.Iterator<E> iterator();
- method public boolean offer(E, long, java.util.concurrent.TimeUnit);
- method public boolean offer(E);
- method public E peek();
- method public E poll(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
- method public E poll();
- method public void put(E);
- method public int remainingCapacity();
- method public int size();
- method public E take() throws java.lang.InterruptedException;
- method public void transfer(E) throws java.lang.InterruptedException;
- method public boolean tryTransfer(E);
- method public boolean tryTransfer(E, long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
- }
-
- public class Phaser {
- ctor public Phaser();
- ctor public Phaser(int);
- ctor public Phaser(java.util.concurrent.Phaser);
- ctor public Phaser(java.util.concurrent.Phaser, int);
- method public int arrive();
- method public int arriveAndAwaitAdvance();
- method public int arriveAndDeregister();
- method public int awaitAdvance(int);
- method public int awaitAdvanceInterruptibly(int) throws java.lang.InterruptedException;
- method public int awaitAdvanceInterruptibly(int, long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException, java.util.concurrent.TimeoutException;
- method public int bulkRegister(int);
- method public void forceTermination();
- method public int getArrivedParties();
- method public java.util.concurrent.Phaser getParent();
- method public final int getPhase();
- method public int getRegisteredParties();
- method public java.util.concurrent.Phaser getRoot();
- method public int getUnarrivedParties();
- method public boolean isTerminated();
- method protected boolean onAdvance(int, int);
- method public int register();
- }
-
public class PriorityBlockingQueue extends java.util.AbstractQueue implements java.util.concurrent.BlockingQueue java.io.Serializable {
ctor public PriorityBlockingQueue();
ctor public PriorityBlockingQueue(int);
@@ -48814,22 +48429,6 @@
method public E take() throws java.lang.InterruptedException;
}
- public abstract class RecursiveAction extends java.util.concurrent.ForkJoinTask {
- ctor public RecursiveAction();
- method protected abstract void compute();
- method protected final boolean exec();
- method public final java.lang.Void getRawResult();
- method protected final void setRawResult(java.lang.Void);
- }
-
- public abstract class RecursiveTask extends java.util.concurrent.ForkJoinTask {
- ctor public RecursiveTask();
- method protected abstract V compute();
- method protected final boolean exec();
- method public final V getRawResult();
- method protected final void setRawResult(V);
- }
-
public class RejectedExecutionException extends java.lang.RuntimeException {
ctor public RejectedExecutionException();
ctor public RejectedExecutionException(java.lang.String);
@@ -48868,14 +48467,12 @@
method protected java.util.concurrent.RunnableScheduledFuture<V> decorateTask(java.util.concurrent.Callable<V>, java.util.concurrent.RunnableScheduledFuture<V>);
method public boolean getContinueExistingPeriodicTasksAfterShutdownPolicy();
method public boolean getExecuteExistingDelayedTasksAfterShutdownPolicy();
- method public boolean getRemoveOnCancelPolicy();
method public java.util.concurrent.ScheduledFuture<?> schedule(java.lang.Runnable, long, java.util.concurrent.TimeUnit);
method public java.util.concurrent.ScheduledFuture<V> schedule(java.util.concurrent.Callable<V>, long, java.util.concurrent.TimeUnit);
method public java.util.concurrent.ScheduledFuture<?> scheduleAtFixedRate(java.lang.Runnable, long, long, java.util.concurrent.TimeUnit);
method public java.util.concurrent.ScheduledFuture<?> scheduleWithFixedDelay(java.lang.Runnable, long, long, java.util.concurrent.TimeUnit);
method public void setContinueExistingPeriodicTasksAfterShutdownPolicy(boolean);
method public void setExecuteExistingDelayedTasksAfterShutdownPolicy(boolean);
- method public void setRemoveOnCancelPolicy(boolean);
}
public class Semaphore implements java.io.Serializable {
@@ -48921,15 +48518,6 @@
method public abstract java.lang.Thread newThread(java.lang.Runnable);
}
- public class ThreadLocalRandom extends java.util.Random {
- method public static java.util.concurrent.ThreadLocalRandom current();
- method public double nextDouble(double);
- method public double nextDouble(double, double);
- method public int nextInt(int, int);
- method public long nextLong(long);
- method public long nextLong(long, long);
- }
-
public class ThreadPoolExecutor extends java.util.concurrent.AbstractExecutorService {
ctor public ThreadPoolExecutor(int, int, long, java.util.concurrent.TimeUnit, java.util.concurrent.BlockingQueue<java.lang.Runnable>);
ctor public ThreadPoolExecutor(int, int, long, java.util.concurrent.TimeUnit, java.util.concurrent.BlockingQueue<java.lang.Runnable>, java.util.concurrent.ThreadFactory);
@@ -49017,14 +48605,6 @@
ctor public TimeoutException(java.lang.String);
}
- public abstract interface TransferQueue implements java.util.concurrent.BlockingQueue {
- method public abstract int getWaitingConsumerCount();
- method public abstract boolean hasWaitingConsumer();
- method public abstract void transfer(E) throws java.lang.InterruptedException;
- method public abstract boolean tryTransfer(E);
- method public abstract boolean tryTransfer(E, long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
- }
-
}
package java.util.concurrent.atomic {
@@ -49234,7 +48814,6 @@
method public final int getWaitQueueLength(java.util.concurrent.locks.AbstractQueuedLongSynchronizer.ConditionObject);
method public final java.util.Collection<java.lang.Thread> getWaitingThreads(java.util.concurrent.locks.AbstractQueuedLongSynchronizer.ConditionObject);
method public final boolean hasContended();
- method public final boolean hasQueuedPredecessors();
method public final boolean hasQueuedThreads();
method public final boolean hasWaiters(java.util.concurrent.locks.AbstractQueuedLongSynchronizer.ConditionObject);
method protected boolean isHeldExclusively();
@@ -49281,7 +48860,6 @@
method public final int getWaitQueueLength(java.util.concurrent.locks.AbstractQueuedSynchronizer.ConditionObject);
method public final java.util.Collection<java.lang.Thread> getWaitingThreads(java.util.concurrent.locks.AbstractQueuedSynchronizer.ConditionObject);
method public final boolean hasContended();
- method public final boolean hasQueuedPredecessors();
method public final boolean hasQueuedThreads();
method public final boolean hasWaiters(java.util.concurrent.locks.AbstractQueuedSynchronizer.ConditionObject);
method protected boolean isHeldExclusively();
@@ -50226,10 +49804,8 @@
public class ZipFile implements java.io.Closeable {
ctor public ZipFile(java.io.File) throws java.io.IOException, java.util.zip.ZipException;
- ctor public ZipFile(java.io.File, java.nio.charset.Charset) throws java.io.IOException, java.util.zip.ZipException;
ctor public ZipFile(java.lang.String) throws java.io.IOException;
ctor public ZipFile(java.io.File, int) throws java.io.IOException;
- ctor public ZipFile(java.io.File, int, java.nio.charset.Charset) throws java.io.IOException;
method public void close() throws java.io.IOException;
method public java.util.Enumeration<? extends java.util.zip.ZipEntry> entries();
method public java.lang.String getComment();
@@ -50283,7 +49859,6 @@
public class ZipInputStream extends java.util.zip.InflaterInputStream {
ctor public ZipInputStream(java.io.InputStream);
- ctor public ZipInputStream(java.io.InputStream, java.nio.charset.Charset);
method public void closeEntry() throws java.io.IOException;
method protected java.util.zip.ZipEntry createZipEntry(java.lang.String);
method public java.util.zip.ZipEntry getNextEntry() throws java.io.IOException;
@@ -50331,7 +49906,6 @@
public class ZipOutputStream extends java.util.zip.DeflaterOutputStream {
ctor public ZipOutputStream(java.io.OutputStream);
- ctor public ZipOutputStream(java.io.OutputStream, java.nio.charset.Charset);
method public void closeEntry() throws java.io.IOException;
method public void putNextEntry(java.util.zip.ZipEntry) throws java.io.IOException;
method public void setComment(java.lang.String);
@@ -51830,7 +51404,6 @@
method public abstract boolean getEnableSessionCreation();
method public abstract java.lang.String[] getEnabledCipherSuites();
method public abstract java.lang.String[] getEnabledProtocols();
- method public javax.net.ssl.SSLSession getHandshakeSession();
method public abstract javax.net.ssl.SSLEngineResult.HandshakeStatus getHandshakeStatus();
method public abstract boolean getNeedClientAuth();
method public java.lang.String getPeerHost();
@@ -51904,12 +51477,10 @@
ctor public SSLParameters(java.lang.String[]);
ctor public SSLParameters(java.lang.String[], java.lang.String[]);
method public java.lang.String[] getCipherSuites();
- method public java.lang.String getEndpointIdentificationAlgorithm();
method public boolean getNeedClientAuth();
method public java.lang.String[] getProtocols();
method public boolean getWantClientAuth();
method public void setCipherSuites(java.lang.String[]);
- method public void setEndpointIdentificationAlgorithm(java.lang.String);
method public void setNeedClientAuth(boolean);
method public void setProtocols(java.lang.String[]);
method public void setWantClientAuth(boolean);
@@ -52010,7 +51581,6 @@
method public abstract boolean getEnableSessionCreation();
method public abstract java.lang.String[] getEnabledCipherSuites();
method public abstract java.lang.String[] getEnabledProtocols();
- method public javax.net.ssl.SSLSession getHandshakeSession();
method public abstract boolean getNeedClientAuth();
method public javax.net.ssl.SSLParameters getSSLParameters();
method public abstract javax.net.ssl.SSLSession getSession();
@@ -52066,14 +51636,6 @@
method public java.lang.String chooseEngineServerAlias(java.lang.String, java.security.Principal[], javax.net.ssl.SSLEngine);
}
- public abstract class X509ExtendedTrustManager implements javax.net.ssl.X509TrustManager {
- ctor public X509ExtendedTrustManager();
- method public abstract void checkClientTrusted(java.security.cert.X509Certificate[], java.lang.String, java.net.Socket) throws java.security.cert.CertificateException;
- method public abstract void checkClientTrusted(java.security.cert.X509Certificate[], java.lang.String, javax.net.ssl.SSLEngine) throws java.security.cert.CertificateException;
- method public abstract void checkServerTrusted(java.security.cert.X509Certificate[], java.lang.String, java.net.Socket) throws java.security.cert.CertificateException;
- method public abstract void checkServerTrusted(java.security.cert.X509Certificate[], java.lang.String, javax.net.ssl.SSLEngine) throws java.security.cert.CertificateException;
- }
-
public abstract interface X509KeyManager implements javax.net.ssl.KeyManager {
method public abstract java.lang.String chooseClientAlias(java.lang.String[], java.security.Principal[], java.net.Socket);
method public abstract java.lang.String chooseServerAlias(java.lang.String, java.security.Principal[], java.net.Socket);
diff --git a/core/res/res/drawable-hdpi/btn_toggle_off_disabled_focused_holo_dark.9.png b/core/res/res/drawable-hdpi/btn_toggle_off_disabled_focused_holo_dark.9.png
index 17acfc5..c5c0e97 100644
--- a/core/res/res/drawable-hdpi/btn_toggle_off_disabled_focused_holo_dark.9.png
+++ b/core/res/res/drawable-hdpi/btn_toggle_off_disabled_focused_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/btn_toggle_off_disabled_focused_holo_light.9.png b/core/res/res/drawable-hdpi/btn_toggle_off_disabled_focused_holo_light.9.png
index 17acfc5..c5c0e97 100644
--- a/core/res/res/drawable-hdpi/btn_toggle_off_disabled_focused_holo_light.9.png
+++ b/core/res/res/drawable-hdpi/btn_toggle_off_disabled_focused_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/btn_toggle_off_disabled_holo_dark.9.png b/core/res/res/drawable-hdpi/btn_toggle_off_disabled_holo_dark.9.png
index 9b8ca22..3b31225 100644
--- a/core/res/res/drawable-hdpi/btn_toggle_off_disabled_holo_dark.9.png
+++ b/core/res/res/drawable-hdpi/btn_toggle_off_disabled_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/btn_toggle_off_disabled_holo_light.9.png b/core/res/res/drawable-hdpi/btn_toggle_off_disabled_holo_light.9.png
index 9b8ca22..3b31225 100644
--- a/core/res/res/drawable-hdpi/btn_toggle_off_disabled_holo_light.9.png
+++ b/core/res/res/drawable-hdpi/btn_toggle_off_disabled_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/btn_toggle_off_focused_holo_dark.9.png b/core/res/res/drawable-hdpi/btn_toggle_off_focused_holo_dark.9.png
index bc20f6c..b65009e 100644
--- a/core/res/res/drawable-hdpi/btn_toggle_off_focused_holo_dark.9.png
+++ b/core/res/res/drawable-hdpi/btn_toggle_off_focused_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/btn_toggle_off_focused_holo_light.9.png b/core/res/res/drawable-hdpi/btn_toggle_off_focused_holo_light.9.png
index bc20f6c..b65009e 100644
--- a/core/res/res/drawable-hdpi/btn_toggle_off_focused_holo_light.9.png
+++ b/core/res/res/drawable-hdpi/btn_toggle_off_focused_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/btn_toggle_off_normal_holo_dark.9.png b/core/res/res/drawable-hdpi/btn_toggle_off_normal_holo_dark.9.png
index 571819b..a2dfcae 100644
--- a/core/res/res/drawable-hdpi/btn_toggle_off_normal_holo_dark.9.png
+++ b/core/res/res/drawable-hdpi/btn_toggle_off_normal_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/btn_toggle_off_normal_holo_light.9.png b/core/res/res/drawable-hdpi/btn_toggle_off_normal_holo_light.9.png
index 571819b..c3fda0e 100644
--- a/core/res/res/drawable-hdpi/btn_toggle_off_normal_holo_light.9.png
+++ b/core/res/res/drawable-hdpi/btn_toggle_off_normal_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/btn_toggle_on_disabled_focused_holo_dark.9.png b/core/res/res/drawable-hdpi/btn_toggle_on_disabled_focused_holo_dark.9.png
index 1f83b5a..bae60a7 100644
--- a/core/res/res/drawable-hdpi/btn_toggle_on_disabled_focused_holo_dark.9.png
+++ b/core/res/res/drawable-hdpi/btn_toggle_on_disabled_focused_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/btn_toggle_on_disabled_focused_holo_light.9.png b/core/res/res/drawable-hdpi/btn_toggle_on_disabled_focused_holo_light.9.png
index 1f83b5a..bae60a7 100644
--- a/core/res/res/drawable-hdpi/btn_toggle_on_disabled_focused_holo_light.9.png
+++ b/core/res/res/drawable-hdpi/btn_toggle_on_disabled_focused_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/btn_toggle_on_disabled_holo_dark.9.png b/core/res/res/drawable-hdpi/btn_toggle_on_disabled_holo_dark.9.png
index 733cf45..a9653b0 100644
--- a/core/res/res/drawable-hdpi/btn_toggle_on_disabled_holo_dark.9.png
+++ b/core/res/res/drawable-hdpi/btn_toggle_on_disabled_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/btn_toggle_on_disabled_holo_light.9.png b/core/res/res/drawable-hdpi/btn_toggle_on_disabled_holo_light.9.png
index 733cf45..a9653b0 100644
--- a/core/res/res/drawable-hdpi/btn_toggle_on_disabled_holo_light.9.png
+++ b/core/res/res/drawable-hdpi/btn_toggle_on_disabled_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/btn_toggle_on_focused_holo_dark.9.png b/core/res/res/drawable-hdpi/btn_toggle_on_focused_holo_dark.9.png
index 2265de4..394cb5e 100644
--- a/core/res/res/drawable-hdpi/btn_toggle_on_focused_holo_dark.9.png
+++ b/core/res/res/drawable-hdpi/btn_toggle_on_focused_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/btn_toggle_on_focused_holo_light.9.png b/core/res/res/drawable-hdpi/btn_toggle_on_focused_holo_light.9.png
index 2265de4..394cb5e 100644
--- a/core/res/res/drawable-hdpi/btn_toggle_on_focused_holo_light.9.png
+++ b/core/res/res/drawable-hdpi/btn_toggle_on_focused_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/btn_toggle_on_normal_holo_dark.9.png b/core/res/res/drawable-hdpi/btn_toggle_on_normal_holo_dark.9.png
index f3ada58..aa23c6e 100644
--- a/core/res/res/drawable-hdpi/btn_toggle_on_normal_holo_dark.9.png
+++ b/core/res/res/drawable-hdpi/btn_toggle_on_normal_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/btn_toggle_on_normal_holo_light.9.png b/core/res/res/drawable-hdpi/btn_toggle_on_normal_holo_light.9.png
index f3ada58..028b3b8 100644
--- a/core/res/res/drawable-hdpi/btn_toggle_on_normal_holo_light.9.png
+++ b/core/res/res/drawable-hdpi/btn_toggle_on_normal_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/btn_toggle_off_disabled_focused_holo_dark.9.png b/core/res/res/drawable-mdpi/btn_toggle_off_disabled_focused_holo_dark.9.png
index 3fdd3bc..4e6d076 100644
--- a/core/res/res/drawable-mdpi/btn_toggle_off_disabled_focused_holo_dark.9.png
+++ b/core/res/res/drawable-mdpi/btn_toggle_off_disabled_focused_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/btn_toggle_off_disabled_focused_holo_light.9.png b/core/res/res/drawable-mdpi/btn_toggle_off_disabled_focused_holo_light.9.png
index 3fdd3bc..4e6d076 100644
--- a/core/res/res/drawable-mdpi/btn_toggle_off_disabled_focused_holo_light.9.png
+++ b/core/res/res/drawable-mdpi/btn_toggle_off_disabled_focused_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/btn_toggle_off_disabled_holo_dark.9.png b/core/res/res/drawable-mdpi/btn_toggle_off_disabled_holo_dark.9.png
index eaa02b3..ca61cb2 100644
--- a/core/res/res/drawable-mdpi/btn_toggle_off_disabled_holo_dark.9.png
+++ b/core/res/res/drawable-mdpi/btn_toggle_off_disabled_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/btn_toggle_off_disabled_holo_light.9.png b/core/res/res/drawable-mdpi/btn_toggle_off_disabled_holo_light.9.png
index eaa02b3..ca61cb2 100644
--- a/core/res/res/drawable-mdpi/btn_toggle_off_disabled_holo_light.9.png
+++ b/core/res/res/drawable-mdpi/btn_toggle_off_disabled_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/btn_toggle_off_focused_holo_dark.9.png b/core/res/res/drawable-mdpi/btn_toggle_off_focused_holo_dark.9.png
index 28c8b94..b5999be 100644
--- a/core/res/res/drawable-mdpi/btn_toggle_off_focused_holo_dark.9.png
+++ b/core/res/res/drawable-mdpi/btn_toggle_off_focused_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/btn_toggle_off_focused_holo_light.9.png b/core/res/res/drawable-mdpi/btn_toggle_off_focused_holo_light.9.png
index 28c8b94..b5999be 100644
--- a/core/res/res/drawable-mdpi/btn_toggle_off_focused_holo_light.9.png
+++ b/core/res/res/drawable-mdpi/btn_toggle_off_focused_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/btn_toggle_off_normal_holo_dark.9.png b/core/res/res/drawable-mdpi/btn_toggle_off_normal_holo_dark.9.png
index 6090cce..8392ac3 100644
--- a/core/res/res/drawable-mdpi/btn_toggle_off_normal_holo_dark.9.png
+++ b/core/res/res/drawable-mdpi/btn_toggle_off_normal_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/btn_toggle_off_normal_holo_light.9.png b/core/res/res/drawable-mdpi/btn_toggle_off_normal_holo_light.9.png
index 6090cce..522bafd 100644
--- a/core/res/res/drawable-mdpi/btn_toggle_off_normal_holo_light.9.png
+++ b/core/res/res/drawable-mdpi/btn_toggle_off_normal_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/btn_toggle_on_disabled_focused_holo_dark.9.png b/core/res/res/drawable-mdpi/btn_toggle_on_disabled_focused_holo_dark.9.png
index 3f2e982..ebb2f8b 100644
--- a/core/res/res/drawable-mdpi/btn_toggle_on_disabled_focused_holo_dark.9.png
+++ b/core/res/res/drawable-mdpi/btn_toggle_on_disabled_focused_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/btn_toggle_on_disabled_focused_holo_light.9.png b/core/res/res/drawable-mdpi/btn_toggle_on_disabled_focused_holo_light.9.png
index 3f2e982..ebb2f8b 100644
--- a/core/res/res/drawable-mdpi/btn_toggle_on_disabled_focused_holo_light.9.png
+++ b/core/res/res/drawable-mdpi/btn_toggle_on_disabled_focused_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/btn_toggle_on_disabled_holo_dark.9.png b/core/res/res/drawable-mdpi/btn_toggle_on_disabled_holo_dark.9.png
index 14b958b..3fa20ca 100644
--- a/core/res/res/drawable-mdpi/btn_toggle_on_disabled_holo_dark.9.png
+++ b/core/res/res/drawable-mdpi/btn_toggle_on_disabled_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/btn_toggle_on_disabled_holo_light.9.png b/core/res/res/drawable-mdpi/btn_toggle_on_disabled_holo_light.9.png
index 14b958b..3fa20ca 100644
--- a/core/res/res/drawable-mdpi/btn_toggle_on_disabled_holo_light.9.png
+++ b/core/res/res/drawable-mdpi/btn_toggle_on_disabled_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/btn_toggle_on_focused_holo_dark.9.png b/core/res/res/drawable-mdpi/btn_toggle_on_focused_holo_dark.9.png
index 4db22d4..6cc59ed 100644
--- a/core/res/res/drawable-mdpi/btn_toggle_on_focused_holo_dark.9.png
+++ b/core/res/res/drawable-mdpi/btn_toggle_on_focused_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/btn_toggle_on_focused_holo_light.9.png b/core/res/res/drawable-mdpi/btn_toggle_on_focused_holo_light.9.png
index 4db22d4..6cc59ed 100644
--- a/core/res/res/drawable-mdpi/btn_toggle_on_focused_holo_light.9.png
+++ b/core/res/res/drawable-mdpi/btn_toggle_on_focused_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/btn_toggle_on_normal_holo_dark.9.png b/core/res/res/drawable-mdpi/btn_toggle_on_normal_holo_dark.9.png
index a11e1c7..a1fcd08 100644
--- a/core/res/res/drawable-mdpi/btn_toggle_on_normal_holo_dark.9.png
+++ b/core/res/res/drawable-mdpi/btn_toggle_on_normal_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/btn_toggle_on_normal_holo_light.9.png b/core/res/res/drawable-mdpi/btn_toggle_on_normal_holo_light.9.png
index a11e1c7..c6c0224 100644
--- a/core/res/res/drawable-mdpi/btn_toggle_on_normal_holo_light.9.png
+++ b/core/res/res/drawable-mdpi/btn_toggle_on_normal_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/btn_toggle_off_disabled_focused_holo_dark.9.png b/core/res/res/drawable-xhdpi/btn_toggle_off_disabled_focused_holo_dark.9.png
index c08deab..1e45530 100644
--- a/core/res/res/drawable-xhdpi/btn_toggle_off_disabled_focused_holo_dark.9.png
+++ b/core/res/res/drawable-xhdpi/btn_toggle_off_disabled_focused_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/btn_toggle_off_disabled_focused_holo_light.9.png b/core/res/res/drawable-xhdpi/btn_toggle_off_disabled_focused_holo_light.9.png
index c08deab..1e45530 100644
--- a/core/res/res/drawable-xhdpi/btn_toggle_off_disabled_focused_holo_light.9.png
+++ b/core/res/res/drawable-xhdpi/btn_toggle_off_disabled_focused_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/btn_toggle_off_disabled_holo_dark.9.png b/core/res/res/drawable-xhdpi/btn_toggle_off_disabled_holo_dark.9.png
index 8b1a55c..2c63c5d 100644
--- a/core/res/res/drawable-xhdpi/btn_toggle_off_disabled_holo_dark.9.png
+++ b/core/res/res/drawable-xhdpi/btn_toggle_off_disabled_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/btn_toggle_off_disabled_holo_light.9.png b/core/res/res/drawable-xhdpi/btn_toggle_off_disabled_holo_light.9.png
index 8b1a55c..2c63c5d 100644
--- a/core/res/res/drawable-xhdpi/btn_toggle_off_disabled_holo_light.9.png
+++ b/core/res/res/drawable-xhdpi/btn_toggle_off_disabled_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/btn_toggle_off_focused_holo_dark.9.png b/core/res/res/drawable-xhdpi/btn_toggle_off_focused_holo_dark.9.png
index 77cd1fa..dd5e26e 100644
--- a/core/res/res/drawable-xhdpi/btn_toggle_off_focused_holo_dark.9.png
+++ b/core/res/res/drawable-xhdpi/btn_toggle_off_focused_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/btn_toggle_off_focused_holo_light.9.png b/core/res/res/drawable-xhdpi/btn_toggle_off_focused_holo_light.9.png
index 77cd1fa..dd5e26e 100644
--- a/core/res/res/drawable-xhdpi/btn_toggle_off_focused_holo_light.9.png
+++ b/core/res/res/drawable-xhdpi/btn_toggle_off_focused_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/btn_toggle_off_normal_holo_dark.9.png b/core/res/res/drawable-xhdpi/btn_toggle_off_normal_holo_dark.9.png
index e0e3540..aa9b3c5 100644
--- a/core/res/res/drawable-xhdpi/btn_toggle_off_normal_holo_dark.9.png
+++ b/core/res/res/drawable-xhdpi/btn_toggle_off_normal_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/btn_toggle_off_normal_holo_light.9.png b/core/res/res/drawable-xhdpi/btn_toggle_off_normal_holo_light.9.png
index e0e3540..367c25a 100644
--- a/core/res/res/drawable-xhdpi/btn_toggle_off_normal_holo_light.9.png
+++ b/core/res/res/drawable-xhdpi/btn_toggle_off_normal_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/btn_toggle_on_disabled_focused_holo_dark.9.png b/core/res/res/drawable-xhdpi/btn_toggle_on_disabled_focused_holo_dark.9.png
index 324e490..df28ad0 100644
--- a/core/res/res/drawable-xhdpi/btn_toggle_on_disabled_focused_holo_dark.9.png
+++ b/core/res/res/drawable-xhdpi/btn_toggle_on_disabled_focused_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/btn_toggle_on_disabled_focused_holo_light.9.png b/core/res/res/drawable-xhdpi/btn_toggle_on_disabled_focused_holo_light.9.png
index 324e490..df28ad0 100644
--- a/core/res/res/drawable-xhdpi/btn_toggle_on_disabled_focused_holo_light.9.png
+++ b/core/res/res/drawable-xhdpi/btn_toggle_on_disabled_focused_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/btn_toggle_on_disabled_holo_dark.9.png b/core/res/res/drawable-xhdpi/btn_toggle_on_disabled_holo_dark.9.png
index e126cc6..3a27831 100644
--- a/core/res/res/drawable-xhdpi/btn_toggle_on_disabled_holo_dark.9.png
+++ b/core/res/res/drawable-xhdpi/btn_toggle_on_disabled_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/btn_toggle_on_disabled_holo_light.9.png b/core/res/res/drawable-xhdpi/btn_toggle_on_disabled_holo_light.9.png
index e126cc6..3a27831 100644
--- a/core/res/res/drawable-xhdpi/btn_toggle_on_disabled_holo_light.9.png
+++ b/core/res/res/drawable-xhdpi/btn_toggle_on_disabled_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/btn_toggle_on_focused_holo_dark.9.png b/core/res/res/drawable-xhdpi/btn_toggle_on_focused_holo_dark.9.png
index 4c1f1b9..d68bdf4 100644
--- a/core/res/res/drawable-xhdpi/btn_toggle_on_focused_holo_dark.9.png
+++ b/core/res/res/drawable-xhdpi/btn_toggle_on_focused_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/btn_toggle_on_focused_holo_light.9.png b/core/res/res/drawable-xhdpi/btn_toggle_on_focused_holo_light.9.png
index 4c1f1b9..d68bdf4 100644
--- a/core/res/res/drawable-xhdpi/btn_toggle_on_focused_holo_light.9.png
+++ b/core/res/res/drawable-xhdpi/btn_toggle_on_focused_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/btn_toggle_on_normal_holo_dark.9.png b/core/res/res/drawable-xhdpi/btn_toggle_on_normal_holo_dark.9.png
index 219d37b..da03ec9 100644
--- a/core/res/res/drawable-xhdpi/btn_toggle_on_normal_holo_dark.9.png
+++ b/core/res/res/drawable-xhdpi/btn_toggle_on_normal_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/btn_toggle_on_normal_holo_light.9.png b/core/res/res/drawable-xhdpi/btn_toggle_on_normal_holo_light.9.png
index 219d37b..482b249 100644
--- a/core/res/res/drawable-xhdpi/btn_toggle_on_normal_holo_light.9.png
+++ b/core/res/res/drawable-xhdpi/btn_toggle_on_normal_holo_light.9.png
Binary files differ
diff --git a/data/fonts/Android.mk b/data/fonts/Android.mk
index abb960c..6437e07 100644
--- a/data/fonts/Android.mk
+++ b/data/fonts/Android.mk
@@ -42,12 +42,21 @@
$(eval $(call create-font-symlink,DroidSerif-Italic.ttf,NotoSerif-Italic.ttf))
$(eval $(call create-font-symlink,DroidSerif-BoldItalic.ttf,NotoSerif-BoldItalic.ttf))
+extra_font_files := \
+ DroidSans.ttf \
+ DroidSans-Bold.ttf
+
################################
# On space-constrained devices, we include a subset of fonts:
ifeq ($(SMALLER_FONT_FOOTPRINT),true)
+
droidsans_fallback_src := DroidSansFallback.ttf
-extra_font_files := DroidSans.ttf DroidSans-Bold.ttf
-else
+
+else # !SMALLER_FONT_FOOTPRINT
+
+droidsans_fallback_src := DroidSansFallbackFull.ttf
+
+ifneq ($(EXTENDED_FONT_FOOTPRINT),true)
include $(CLEAR_VARS)
LOCAL_MODULE := MTLmr3m.ttf
LOCAL_SRC_FILES := $(LOCAL_MODULE)
@@ -55,12 +64,9 @@
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_PATH := $(TARGET_OUT)/fonts
include $(BUILD_PREBUILT)
+extra_font_files += MTLmr3m.ttf
+endif # !EXTENDED_FONT_FOOTPRINT
-droidsans_fallback_src := DroidSansFallbackFull.ttf
-extra_font_files := \
- DroidSans.ttf \
- DroidSans-Bold.ttf \
- MTLmr3m.ttf
endif # SMALLER_FONT_FOOTPRINT
################################
diff --git a/data/fonts/fallback_fonts.xml b/data/fonts/fallback_fonts.xml
index c2d5afe..1eaae65 100644
--- a/data/fonts/fallback_fonts.xml
+++ b/data/fonts/fallback_fonts.xml
@@ -219,6 +219,26 @@
</family>
<family>
<fileset>
+ <file lang="zh-CN">NotoSansHans-Regular.otf</file>
+ </fileset>
+ </family>
+ <family>
+ <fileset>
+ <file lang="zh-TW">NotoSansHant-Regular.otf</file>
+ </fileset>
+ </family>
+ <family>
+ <fileset>
+ <file lang="ja">NotoSansJP-Regular.otf</file>
+ </fileset>
+ </family>
+ <family>
+ <fileset>
+ <file lang="ko">NotoSansKR-Regular.otf</file>
+ </fileset>
+ </family>
+ <family>
+ <fileset>
<file>NanumGothic.ttf</file>
</fileset>
</family>
diff --git a/media/java/android/media/AudioManager.java b/media/java/android/media/AudioManager.java
index b1bc4c4..2f1e11e 100644
--- a/media/java/android/media/AudioManager.java
+++ b/media/java/android/media/AudioManager.java
@@ -50,12 +50,6 @@
*/
public class AudioManager {
- // If we should use the new sessions APIs.
- private final static boolean USE_SESSIONS = true;
- // If we should use the legacy APIs. If both are true information will be
- // duplicated through both paths. Currently this flag isn't used.
- private final static boolean USE_LEGACY = true;
-
private final Context mContext;
private long mVolumeKeyUpTime;
private final boolean mUseMasterVolume;
@@ -483,17 +477,8 @@
* or {@link KeyEvent#KEYCODE_MEDIA_AUDIO_TRACK}.
*/
public void dispatchMediaKeyEvent(KeyEvent keyEvent) {
- if (USE_SESSIONS) {
- MediaSessionLegacyHelper helper = MediaSessionLegacyHelper.getHelper(mContext);
- helper.sendMediaButtonEvent(keyEvent, false);
- } else {
- IAudioService service = getService();
- try {
- service.dispatchMediaKeyEvent(keyEvent);
- } catch (RemoteException e) {
- Log.e(TAG, "dispatchMediaKeyEvent threw exception ", e);
- }
- }
+ MediaSessionLegacyHelper helper = MediaSessionLegacyHelper.getHelper(mContext);
+ helper.sendMediaButtonEvent(keyEvent, false);
}
/**
@@ -644,12 +629,8 @@
if (mUseMasterVolume) {
service.adjustMasterVolume(direction, flags, mContext.getOpPackageName());
} else {
- if (USE_SESSIONS) {
- MediaSessionLegacyHelper helper = MediaSessionLegacyHelper.getHelper(mContext);
- helper.sendAdjustVolumeBy(USE_DEFAULT_STREAM_TYPE, direction, flags);
- } else {
- service.adjustVolume(direction, flags, mContext.getOpPackageName());
- }
+ MediaSessionLegacyHelper helper = MediaSessionLegacyHelper.getHelper(mContext);
+ helper.sendAdjustVolumeBy(USE_DEFAULT_STREAM_TYPE, direction, flags);
}
} catch (RemoteException e) {
Log.e(TAG, "Dead object in adjustVolume", e);
@@ -679,13 +660,8 @@
if (mUseMasterVolume) {
service.adjustMasterVolume(direction, flags, mContext.getOpPackageName());
} else {
- if (USE_SESSIONS) {
- MediaSessionLegacyHelper helper = MediaSessionLegacyHelper.getHelper(mContext);
- helper.sendAdjustVolumeBy(suggestedStreamType, direction, flags);
- } else {
- service.adjustSuggestedStreamVolume(direction, suggestedStreamType, flags,
- mContext.getOpPackageName());
- }
+ MediaSessionLegacyHelper helper = MediaSessionLegacyHelper.getHelper(mContext);
+ helper.sendAdjustVolumeBy(suggestedStreamType, direction, flags);
}
} catch (RemoteException e) {
Log.e(TAG, "Dead object in adjustSuggestedStreamVolume", e);
@@ -2215,16 +2191,15 @@
}
IAudioService service = getService();
try {
- // pi != null
+ // pi != null, this is currently still needed to support across
+ // reboot launching of the last app.
service.registerMediaButtonIntent(pi, eventReceiver,
eventReceiver == null ? mToken : null);
} catch (RemoteException e) {
Log.e(TAG, "Dead object in registerMediaButtonIntent"+e);
}
- if (USE_SESSIONS) {
- MediaSessionLegacyHelper helper = MediaSessionLegacyHelper.getHelper(mContext);
- helper.addMediaButtonListener(pi, mContext);
- }
+ MediaSessionLegacyHelper helper = MediaSessionLegacyHelper.getHelper(mContext);
+ helper.addMediaButtonListener(pi, mContext);
}
/**
@@ -2298,10 +2273,8 @@
} catch (RemoteException e) {
Log.e(TAG, "Dead object in unregisterMediaButtonIntent"+e);
}
- if (USE_SESSIONS) {
- MediaSessionLegacyHelper helper = MediaSessionLegacyHelper.getHelper(mContext);
- helper.removeMediaButtonListener(pi);
- }
+ MediaSessionLegacyHelper helper = MediaSessionLegacyHelper.getHelper(mContext);
+ helper.removeMediaButtonListener(pi);
}
/**
@@ -2315,20 +2288,7 @@
if ((rcClient == null) || (rcClient.getRcMediaIntent() == null)) {
return;
}
- IAudioService service = getService();
- try {
- int rcseId = service.registerRemoteControlClient(
- rcClient.getRcMediaIntent(), /* mediaIntent */
- rcClient.getIRemoteControlClient(),/* rcClient */
- // used to match media button event receiver and audio focus
- mContext.getPackageName()); /* packageName */
- rcClient.setRcseId(rcseId);
- } catch (RemoteException e) {
- Log.e(TAG, "Dead object in registerRemoteControlClient"+e);
- }
- if (USE_SESSIONS) {
- rcClient.registerWithSession(MediaSessionLegacyHelper.getHelper(mContext));
- }
+ rcClient.registerWithSession(MediaSessionLegacyHelper.getHelper(mContext));
}
/**
@@ -2341,16 +2301,7 @@
if ((rcClient == null) || (rcClient.getRcMediaIntent() == null)) {
return;
}
- IAudioService service = getService();
- try {
- service.unregisterRemoteControlClient(rcClient.getRcMediaIntent(), /* mediaIntent */
- rcClient.getIRemoteControlClient()); /* rcClient */
- } catch (RemoteException e) {
- Log.e(TAG, "Dead object in unregisterRemoteControlClient"+e);
- }
- if (USE_SESSIONS) {
- rcClient.unregisterWithSession(MediaSessionLegacyHelper.getHelper(mContext));
- }
+ rcClient.unregisterWithSession(MediaSessionLegacyHelper.getHelper(mContext));
}
/**
@@ -2368,25 +2319,8 @@
if (rctlr == null) {
return false;
}
- if (USE_SESSIONS) {
- rctlr.startListeningToSessions();
- return true;
- } else {
- IAudioService service = getService();
- final RemoteController.OnClientUpdateListener l = rctlr.getUpdateListener();
- final ComponentName listenerComponent = new ComponentName(mContext, l.getClass());
- try {
- int[] artworkDimensions = rctlr.getArtworkSize();
- boolean reg = service.registerRemoteController(rctlr.getRcDisplay(),
- artworkDimensions[0]/* w */, artworkDimensions[1]/* h */,
- listenerComponent);
- rctlr.setIsRegistered(reg);
- return reg;
- } catch (RemoteException e) {
- Log.e(TAG, "Dead object in registerRemoteController " + e);
- return false;
- }
- }
+ rctlr.startListeningToSessions();
+ return true;
}
/**
@@ -2398,17 +2332,7 @@
if (rctlr == null) {
return;
}
- if (USE_SESSIONS) {
- rctlr.stopListeningToSessions();
- } else {
- IAudioService service = getService();
- try {
- service.unregisterRemoteControlDisplay(rctlr.getRcDisplay());
- rctlr.setIsRegistered(false);
- } catch (RemoteException e) {
- Log.e(TAG, "Dead object in unregisterRemoteControlDisplay " + e);
- }
- }
+ rctlr.stopListeningToSessions();
}
/**
diff --git a/media/java/android/media/AudioService.java b/media/java/android/media/AudioService.java
index d496117..72f4a58 100644
--- a/media/java/android/media/AudioService.java
+++ b/media/java/android/media/AudioService.java
@@ -108,8 +108,7 @@
/** Debug volumes */
protected static final boolean DEBUG_VOL = false;
- /** Reroute calls to media session apis */
- private static final boolean USE_SESSIONS = true;
+ /** debug calls to media session apis */
private static final boolean DEBUG_SESSIONS = true;
/** Allow volume changes to set ringer mode to silent? */
@@ -4484,27 +4483,19 @@
}
public void dispatchMediaKeyEvent(KeyEvent keyEvent) {
- if (USE_SESSIONS) {
- if (DEBUG_SESSIONS) {
- int pid = getCallingPid();
- Log.w(TAG, "Call to dispatchMediaKeyEvent from " + pid);
- }
- MediaSessionLegacyHelper.getHelper(mContext).sendMediaButtonEvent(keyEvent, false);
- } else {
- mMediaFocusControl.dispatchMediaKeyEvent(keyEvent);
+ if (DEBUG_SESSIONS) {
+ int pid = getCallingPid();
+ Log.w(TAG, "Call to dispatchMediaKeyEvent from " + pid);
}
+ MediaSessionLegacyHelper.getHelper(mContext).sendMediaButtonEvent(keyEvent, false);
}
public void dispatchMediaKeyEventUnderWakelock(KeyEvent keyEvent) {
- if (USE_SESSIONS) {
- if (DEBUG_SESSIONS) {
- int pid = getCallingPid();
- Log.w(TAG, "Call to dispatchMediaKeyEventUnderWakelock from " + pid);
- }
- MediaSessionLegacyHelper.getHelper(mContext).sendMediaButtonEvent(keyEvent, true);
- } else {
- mMediaFocusControl.dispatchMediaKeyEventUnderWakelock(keyEvent);
+ if (DEBUG_SESSIONS) {
+ int pid = getCallingPid();
+ Log.w(TAG, "Call to dispatchMediaKeyEventUnderWakelock from " + pid);
}
+ MediaSessionLegacyHelper.getHelper(mContext).sendMediaButtonEvent(keyEvent, true);
}
//==========================================================================================
diff --git a/media/java/android/media/ClosedCaptionRenderer.java b/media/java/android/media/ClosedCaptionRenderer.java
index 86f8ffe..ec33c5c 100644
--- a/media/java/android/media/ClosedCaptionRenderer.java
+++ b/media/java/android/media/ClosedCaptionRenderer.java
@@ -17,9 +17,22 @@
package android.media;
import android.content.Context;
+import android.content.res.Resources;
+import android.graphics.Canvas;
import android.graphics.Color;
+import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.Typeface;
+import android.os.Parcel;
+import android.text.ParcelableSpan;
+import android.text.Spannable;
+import android.text.SpannableStringBuilder;
+import android.text.TextPaint;
+import android.text.TextUtils;
+import android.text.style.CharacterStyle;
+import android.text.style.StyleSpan;
+import android.text.style.UnderlineSpan;
+import android.text.style.UpdateAppearance;
import android.util.AttributeSet;
import android.util.Log;
import android.util.TypedValue;
@@ -36,11 +49,6 @@
import java.util.Arrays;
import java.util.Vector;
-import android.text.SpannableStringBuilder;
-import android.text.Spannable;
-import android.text.style.BackgroundColorSpan;
-import android.text.style.StyleSpan;
-
/** @hide */
public class ClosedCaptionRenderer extends SubtitleController.Renderer {
private final Context mContext;
@@ -384,6 +392,10 @@
return (mStyle & STYLE_ITALICS) != 0;
}
+ boolean isUnderline() {
+ return (mStyle & STYLE_UNDERLINE) != 0;
+ }
+
int getColor() {
return mColor;
}
@@ -504,6 +516,11 @@
new StyleSpan(android.graphics.Typeface.ITALIC),
start, end, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
}
+ if (s.isUnderline()) {
+ styledText.setSpan(
+ new UnderlineSpan(),
+ start, end, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
+ }
}
SpannableStringBuilder getStyledText(CaptionStyle captionStyle) {
@@ -539,7 +556,7 @@
int expandedStart = mDisplayChars.charAt(start) == ' ' ? start : start - 1;
int expandedEnd = mDisplayChars.charAt(next - 1) == ' ' ? next : next + 1;
styledText.setSpan(
- new BackgroundColorSpan(captionStyle.backgroundColor),
+ new MutableBackgroundColorSpan(captionStyle.backgroundColor),
expandedStart, expandedEnd,
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
if (styleStart >= 0) {
@@ -1017,6 +1034,49 @@
}
/**
+ * @hide
+ *
+ * MutableBackgroundColorSpan
+ *
+ * This is a mutable version of BackgroundSpan to facilitate text
+ * rendering with edge styles.
+ *
+ */
+class MutableBackgroundColorSpan extends CharacterStyle
+ implements UpdateAppearance, ParcelableSpan {
+ private int mColor;
+
+ public MutableBackgroundColorSpan(int color) {
+ mColor = color;
+ }
+ public MutableBackgroundColorSpan(Parcel src) {
+ mColor = src.readInt();
+ }
+ public void setBackgroundColor(int color) {
+ mColor = color;
+ }
+ public int getBackgroundColor() {
+ return mColor;
+ }
+ @Override
+ public int getSpanTypeId() {
+ return TextUtils.BACKGROUND_COLOR_SPAN;
+ }
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+ @Override
+ public void writeToParcel(Parcel dest, int flags) {
+ dest.writeInt(mColor);
+ }
+ @Override
+ public void updateDrawState(TextPaint ds) {
+ ds.bgColor = mColor;
+ }
+}
+
+/**
* Widget capable of rendering CEA-608 closed captions.
*
* @hide
@@ -1159,6 +1219,16 @@
private static class CCLineBox extends TextView {
private static final float FONT_PADDING_RATIO = 0.75f;
+ private static final float EDGE_OUTLINE_RATIO = 0.1f;
+ private static final float EDGE_SHADOW_RATIO = 0.05f;
+ private float mOutlineWidth;
+ private float mShadowRadius;
+ private float mShadowOffset;
+
+ private int mTextColor = Color.WHITE;
+ private int mBgColor = Color.BLACK;
+ private int mEdgeType = CaptionStyle.EDGE_TYPE_NONE;
+ private int mEdgeColor = Color.TRANSPARENT;
CCLineBox(Context context) {
super(context);
@@ -1167,11 +1237,31 @@
setTextColor(Color.WHITE);
setTypeface(Typeface.MONOSPACE);
setVisibility(View.INVISIBLE);
+
+ final Resources res = getContext().getResources();
+
+ // get the default (will be updated later during measure)
+ mOutlineWidth = res.getDimensionPixelSize(
+ com.android.internal.R.dimen.subtitle_outline_width);
+ mShadowRadius = res.getDimensionPixelSize(
+ com.android.internal.R.dimen.subtitle_shadow_radius);
+ mShadowOffset = res.getDimensionPixelSize(
+ com.android.internal.R.dimen.subtitle_shadow_offset);
}
void setCaptionStyle(CaptionStyle captionStyle) {
- setTextColor(captionStyle.foregroundColor);
- // TODO: edge color?
+ mTextColor = captionStyle.foregroundColor;
+ mBgColor = captionStyle.backgroundColor;
+ mEdgeType = captionStyle.edgeType;
+ mEdgeColor = captionStyle.edgeColor;
+
+ setTextColor(mTextColor);
+ if (mEdgeType == CaptionStyle.EDGE_TYPE_DROP_SHADOW) {
+ setShadowLayer(mShadowRadius, mShadowOffset, mShadowOffset, mEdgeColor);
+ } else {
+ setShadowLayer(0, 0, 0, 0);
+ }
+ invalidate();
}
@Override
@@ -1180,6 +1270,10 @@
* FONT_PADDING_RATIO;
setTextSize(TypedValue.COMPLEX_UNIT_PX, fontSize);
+ mOutlineWidth = EDGE_OUTLINE_RATIO * fontSize + 1.0f;
+ mShadowRadius = EDGE_SHADOW_RATIO * fontSize + 1.0f;;
+ mShadowOffset = mShadowRadius;
+
// set font scale in the X direction to match the required width
setScaleX(1.0f);
getPaint().getTextBounds(mDummyText, 0, mDummyText.length(), mTextBounds);
@@ -1189,6 +1283,94 @@
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
+
+ @Override
+ protected void onDraw(Canvas c) {
+ if (mEdgeType == CaptionStyle.EDGE_TYPE_UNSPECIFIED
+ || mEdgeType == CaptionStyle.EDGE_TYPE_NONE
+ || mEdgeType == CaptionStyle.EDGE_TYPE_DROP_SHADOW) {
+ // these edge styles don't require a second pass
+ super.onDraw(c);
+ return;
+ }
+
+ if (mEdgeType == CaptionStyle.EDGE_TYPE_OUTLINE) {
+ drawEdgeOutline(c);
+ } else {
+ // Raised or depressed
+ drawEdgeRaisedOrDepressed(c);
+ }
+ }
+
+ private void drawEdgeOutline(Canvas c) {
+ TextPaint textPaint = getPaint();
+
+ Paint.Style previousStyle = textPaint.getStyle();
+ Paint.Join previousJoin = textPaint.getStrokeJoin();
+ float previousWidth = textPaint.getStrokeWidth();
+
+ setTextColor(mEdgeColor);
+ textPaint.setStyle(Paint.Style.FILL_AND_STROKE);
+ textPaint.setStrokeJoin(Paint.Join.ROUND);
+ textPaint.setStrokeWidth(mOutlineWidth);
+
+ // Draw outline and background only.
+ super.onDraw(c);
+
+ // Restore original settings.
+ setTextColor(mTextColor);
+ textPaint.setStyle(previousStyle);
+ textPaint.setStrokeJoin(previousJoin);
+ textPaint.setStrokeWidth(previousWidth);
+
+ // Remove the background.
+ setBackgroundSpans(Color.TRANSPARENT);
+ // Draw foreground only.
+ super.onDraw(c);
+ // Restore the background.
+ setBackgroundSpans(mBgColor);
+ }
+
+ private void drawEdgeRaisedOrDepressed(Canvas c) {
+ TextPaint textPaint = getPaint();
+
+ Paint.Style previousStyle = textPaint.getStyle();
+ textPaint.setStyle(Paint.Style.FILL);
+
+ final boolean raised = mEdgeType == CaptionStyle.EDGE_TYPE_RAISED;
+ final int colorUp = raised ? Color.WHITE : mEdgeColor;
+ final int colorDown = raised ? mEdgeColor : Color.WHITE;
+ final float offset = mShadowRadius / 2f;
+
+ // Draw background and text with shadow up
+ setShadowLayer(mShadowRadius, -offset, -offset, colorUp);
+ super.onDraw(c);
+
+ // Remove the background.
+ setBackgroundSpans(Color.TRANSPARENT);
+
+ // Draw text with shadow down
+ setShadowLayer(mShadowRadius, +offset, +offset, colorDown);
+ super.onDraw(c);
+
+ // Restore settings
+ textPaint.setStyle(previousStyle);
+
+ // Restore the background.
+ setBackgroundSpans(mBgColor);
+ }
+
+ private void setBackgroundSpans(int color) {
+ CharSequence text = getText();
+ if (text instanceof Spannable) {
+ Spannable spannable = (Spannable) text;
+ MutableBackgroundColorSpan[] bgSpans = spannable.getSpans(
+ 0, spannable.length(), MutableBackgroundColorSpan.class);
+ for (int i = 0; i < bgSpans.length; i++) {
+ bgSpans[i].setBackgroundColor(color);
+ }
+ }
+ }
}
private static class CCLayout extends LinearLayout {
@@ -1216,7 +1398,7 @@
void update(SpannableStringBuilder[] textBuffer) {
for (int i = 0; i < MAX_ROWS; i++) {
if (textBuffer[i] != null) {
- mLineBoxes[i].setText(textBuffer[i]);
+ mLineBoxes[i].setText(textBuffer[i], TextView.BufferType.SPANNABLE);
mLineBoxes[i].setVisibility(View.VISIBLE);
} else {
mLineBoxes[i].setVisibility(View.INVISIBLE);
diff --git a/media/java/android/media/MediaRouter.java b/media/java/android/media/MediaRouter.java
index 1da0215..ddd5b72 100644
--- a/media/java/android/media/MediaRouter.java
+++ b/media/java/android/media/MediaRouter.java
@@ -60,7 +60,6 @@
public class MediaRouter {
private static final String TAG = "MediaRouter";
private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
- private static final boolean USE_SESSIONS = true;
static class Static implements DisplayManager.DisplayListener {
final Context mAppContext;
@@ -2104,11 +2103,7 @@
public void setPlaybackType(int type) {
if (mPlaybackType != type) {
mPlaybackType = type;
- if (USE_SESSIONS) {
- configureSessionVolume();
- } else {
- setPlaybackInfoOnRcc(RemoteControlClient.PLAYBACKINFO_PLAYBACK_TYPE, type);
- }
+ configureSessionVolume();
}
}
@@ -2121,12 +2116,7 @@
public void setVolumeHandling(int volumeHandling) {
if (mVolumeHandling != volumeHandling) {
mVolumeHandling = volumeHandling;
- if (USE_SESSIONS) {
- configureSessionVolume();
- } else {
- setPlaybackInfoOnRcc(
- RemoteControlClient.PLAYBACKINFO_VOLUME_HANDLING, volumeHandling);
- }
+ configureSessionVolume();
}
}
@@ -2139,12 +2129,8 @@
volume = Math.max(0, Math.min(volume, getVolumeMax()));
if (mVolume != volume) {
mVolume = volume;
- if (USE_SESSIONS) {
- if (mSvp != null) {
- mSvp.notifyVolumeChanged();
- }
- } else {
- setPlaybackInfoOnRcc(RemoteControlClient.PLAYBACKINFO_VOLUME, volume);
+ if (mSvp != null) {
+ mSvp.notifyVolumeChanged();
}
dispatchRouteVolumeChanged(this);
if (mGroup != null) {
@@ -2184,11 +2170,7 @@
public void setVolumeMax(int volumeMax) {
if (mVolumeMax != volumeMax) {
mVolumeMax = volumeMax;
- if (USE_SESSIONS) {
- configureSessionVolume();
- } else {
- setPlaybackInfoOnRcc(RemoteControlClient.PLAYBACKINFO_VOLUME_MAX, volumeMax);
- }
+ configureSessionVolume();
}
}
@@ -2199,40 +2181,12 @@
public void setPlaybackStream(int stream) {
if (mPlaybackStream != stream) {
mPlaybackStream = stream;
- if (USE_SESSIONS) {
- configureSessionVolume();
- } else {
- setPlaybackInfoOnRcc(RemoteControlClient.PLAYBACKINFO_USES_STREAM, stream);
- }
+ configureSessionVolume();
}
}
private void updatePlaybackInfoOnRcc() {
- if (USE_SESSIONS) {
- configureSessionVolume();
- } else {
- if ((mRcc != null)
- && (mRcc.getRcseId() != RemoteControlClient.RCSE_ID_UNREGISTERED)) {
- mRcc.setPlaybackInformation(
- RemoteControlClient.PLAYBACKINFO_VOLUME_MAX, mVolumeMax);
- mRcc.setPlaybackInformation(
- RemoteControlClient.PLAYBACKINFO_VOLUME, mVolume);
- mRcc.setPlaybackInformation(
- RemoteControlClient.PLAYBACKINFO_VOLUME_HANDLING, mVolumeHandling);
- mRcc.setPlaybackInformation(
- RemoteControlClient.PLAYBACKINFO_USES_STREAM, mPlaybackStream);
- mRcc.setPlaybackInformation(
- RemoteControlClient.PLAYBACKINFO_PLAYBACK_TYPE, mPlaybackType);
- // let AudioService know whom to call when remote volume
- // needs to be updated
- try {
- sStatic.mAudioService.registerRemoteVolumeObserverForRcc(
- mRcc.getRcseId() /* rccId */, mRemoteVolObserver /* rvo */);
- } catch (RemoteException e) {
- Log.e(TAG, "Error registering remote volume observer", e);
- }
- }
- }
+ configureSessionVolume();
}
private void configureSessionVolume() {
@@ -2272,12 +2226,6 @@
}
}
- private void setPlaybackInfoOnRcc(int what, int value) {
- if (mRcc != null) {
- mRcc.setPlaybackInformation(what, value);
- }
- }
-
class SessionVolumeProvider extends RemoteVolumeProvider {
public SessionVolumeProvider(int volumeControl, int maxVolume) {
diff --git a/media/java/android/media/PlayerRecord.java b/media/java/android/media/PlayerRecord.java
index f9708c3..664ddcf 100644
--- a/media/java/android/media/PlayerRecord.java
+++ b/media/java/android/media/PlayerRecord.java
@@ -56,7 +56,7 @@
*/
final private ComponentName mReceiverComponent;
- private int mRccId = RemoteControlClient.RCSE_ID_UNREGISTERED;
+ private int mRccId = -1;
/**
* A non-null token implies this record tracks a "live" player whose death is being monitored.
diff --git a/media/java/android/media/RemoteControlClient.java b/media/java/android/media/RemoteControlClient.java
index 0caea5f..73bc61a 100644
--- a/media/java/android/media/RemoteControlClient.java
+++ b/media/java/android/media/RemoteControlClient.java
@@ -561,6 +561,8 @@
return;
}
synchronized (mCacheLock) {
+ // Still build the old metadata so when creating a new editor
+ // you get the expected values.
// assign the edited data
mMetadata = new Bundle(mEditorMetadata);
// add the information about editable keys
@@ -570,16 +572,6 @@
}
mOriginalArtwork = mEditorArtwork;
mEditorArtwork = null;
- if (mMetadataChanged & mArtworkChanged) {
- // send to remote control display if conditions are met
- sendMetadataWithArtwork_syncCacheLock(null, 0, 0);
- } else if (mMetadataChanged) {
- // send to remote control display if conditions are met
- sendMetadata_syncCacheLock(null);
- } else if (mArtworkChanged) {
- // send to remote control display if conditions are met
- sendArtwork_syncCacheLock(null, 0, 0);
- }
// USE_SESSIONS
if (mSession != null && mMetadataBuilder != null) {
@@ -687,14 +679,6 @@
// keep track of when the state change occurred
mPlaybackStateChangeTimeMs = SystemClock.elapsedRealtime();
- // send to remote control display if conditions are met
- sendPlaybackState_syncCacheLock(null);
- // update AudioService
- sendAudioServiceNewPlaybackState_syncCacheLock();
-
- // handle automatic playback position refreshes
- initiateCheckForDrift_syncCacheLock();
-
// USE_SESSIONS
if (mSession != null) {
int pbState = PlaybackState.getStateFromRccState(state);
@@ -707,29 +691,7 @@
}
}
- private void initiateCheckForDrift_syncCacheLock() {
- if (mEventHandler == null) {
- return;
- }
- mEventHandler.removeMessages(MSG_POSITION_DRIFT_CHECK);
- if (!mNeedsPositionSync) {
- return;
- }
- if (mPlaybackPositionMs < 0) {
- // the current playback state has no known playback position, it's no use
- // trying to see if there is any drift at this point
- // (this also bypasses this mechanism for older apps that use the old
- // setPlaybackState(int) API)
- return;
- }
- if (playbackPositionShouldMove(mPlaybackState)) {
- // playback position moving, schedule next position drift check
- mEventHandler.sendMessageDelayed(
- mEventHandler.obtainMessage(MSG_POSITION_DRIFT_CHECK),
- getCheckPeriodFromSpeed(mPlaybackSpeed));
- }
- }
-
+ // TODO investigate if we still need position drift checking
private void onPositionDriftCheck() {
if (DEBUG) { Log.d(TAG, "onPositionDriftCheck()"); }
synchronized(mCacheLock) {
@@ -781,9 +743,6 @@
// store locally
mTransportControlFlags = transportControlFlags;
- // send to remote control display if conditions are met
- sendTransportControlInfo_syncCacheLock(null);
-
// USE_SESSIONS
if (mSession != null) {
mSessionPlaybackState.setActions(PlaybackState
@@ -866,17 +825,7 @@
*/
public void setPlaybackPositionUpdateListener(OnPlaybackPositionUpdateListener l) {
synchronized(mCacheLock) {
- int oldCapa = mPlaybackPositionCapabilities;
- if (l != null) {
- mPlaybackPositionCapabilities |= MEDIA_POSITION_WRITABLE;
- } else {
- mPlaybackPositionCapabilities &= ~MEDIA_POSITION_WRITABLE;
- }
mPositionUpdateListener = l;
- if (oldCapa != mPlaybackPositionCapabilities) {
- // tell RCDs that this RCC's playback position capabilities have changed
- sendTransportControlInfo_syncCacheLock(null);
- }
}
}
@@ -888,17 +837,7 @@
*/
public void setOnGetPlaybackPositionListener(OnGetPlaybackPositionListener l) {
synchronized(mCacheLock) {
- int oldCapa = mPlaybackPositionCapabilities;
- if (l != null) {
- mPlaybackPositionCapabilities |= MEDIA_POSITION_READABLE;
- } else {
- mPlaybackPositionCapabilities &= ~MEDIA_POSITION_READABLE;
- }
mPositionProvider = l;
- if (oldCapa != mPlaybackPositionCapabilities) {
- // tell RCDs that this RCC's playback position capabilities have changed
- sendTransportControlInfo_syncCacheLock(null);
- }
if ((mPositionProvider != null) && (mEventHandler != null)
&& playbackPositionShouldMove(mPlaybackState)) {
// playback position is already moving, but now we have a position provider,
@@ -925,124 +864,12 @@
*/
public static int MEDIA_POSITION_WRITABLE = 1 << 1;
- private int mPlaybackPositionCapabilities = 0;
-
/** @hide */
public final static int DEFAULT_PLAYBACK_VOLUME_HANDLING = PLAYBACK_VOLUME_VARIABLE;
/** @hide */
// hard-coded to the same number of steps as AudioService.MAX_STREAM_VOLUME[STREAM_MUSIC]
public final static int DEFAULT_PLAYBACK_VOLUME = 15;
- private int mPlaybackType = PLAYBACK_TYPE_LOCAL;
- private int mPlaybackVolumeMax = DEFAULT_PLAYBACK_VOLUME;
- private int mPlaybackVolume = DEFAULT_PLAYBACK_VOLUME;
- private int mPlaybackVolumeHandling = DEFAULT_PLAYBACK_VOLUME_HANDLING;
- private int mPlaybackStream = AudioManager.STREAM_MUSIC;
-
- /**
- * @hide
- * Set information describing information related to the playback of media so the system
- * can implement additional behavior to handle non-local playback usecases.
- * @param what a key to specify the type of information to set. Valid keys are
- * {@link #PLAYBACKINFO_PLAYBACK_TYPE},
- * {@link #PLAYBACKINFO_USES_STREAM},
- * {@link #PLAYBACKINFO_VOLUME},
- * {@link #PLAYBACKINFO_VOLUME_MAX},
- * and {@link #PLAYBACKINFO_VOLUME_HANDLING}.
- * @param value the value for the supplied information to set.
- */
- public void setPlaybackInformation(int what, int value) {
- synchronized(mCacheLock) {
- switch (what) {
- case PLAYBACKINFO_PLAYBACK_TYPE:
- if ((value >= PLAYBACK_TYPE_MIN) && (value <= PLAYBACK_TYPE_MAX)) {
- if (mPlaybackType != value) {
- mPlaybackType = value;
- sendAudioServiceNewPlaybackInfo_syncCacheLock(what, value);
- }
- } else {
- Log.w(TAG, "using invalid value for PLAYBACKINFO_PLAYBACK_TYPE");
- }
- break;
- case PLAYBACKINFO_VOLUME:
- if ((value > -1) && (value <= mPlaybackVolumeMax)) {
- if (mPlaybackVolume != value) {
- mPlaybackVolume = value;
- sendAudioServiceNewPlaybackInfo_syncCacheLock(what, value);
- }
- } else {
- Log.w(TAG, "using invalid value for PLAYBACKINFO_VOLUME");
- }
- break;
- case PLAYBACKINFO_VOLUME_MAX:
- if (value > 0) {
- if (mPlaybackVolumeMax != value) {
- mPlaybackVolumeMax = value;
- sendAudioServiceNewPlaybackInfo_syncCacheLock(what, value);
- }
- } else {
- Log.w(TAG, "using invalid value for PLAYBACKINFO_VOLUME_MAX");
- }
- break;
- case PLAYBACKINFO_USES_STREAM:
- if ((value >= 0) && (value < AudioSystem.getNumStreamTypes())) {
- mPlaybackStream = value;
- } else {
- Log.w(TAG, "using invalid value for PLAYBACKINFO_USES_STREAM");
- }
- break;
- case PLAYBACKINFO_VOLUME_HANDLING:
- if ((value >= PLAYBACK_VOLUME_FIXED) && (value <= PLAYBACK_VOLUME_VARIABLE)) {
- if (mPlaybackVolumeHandling != value) {
- mPlaybackVolumeHandling = value;
- sendAudioServiceNewPlaybackInfo_syncCacheLock(what, value);
- }
- } else {
- Log.w(TAG, "using invalid value for PLAYBACKINFO_VOLUME_HANDLING");
- }
- break;
- default:
- // not throwing an exception or returning an error if more keys are to be
- // supported in the future
- Log.w(TAG, "setPlaybackInformation() ignoring unknown key " + what);
- break;
- }
- }
- }
-
- /**
- * @hide
- * Return playback information represented as an integer value.
- * @param what a key to specify the type of information to retrieve. Valid keys are
- * {@link #PLAYBACKINFO_PLAYBACK_TYPE},
- * {@link #PLAYBACKINFO_USES_STREAM},
- * {@link #PLAYBACKINFO_VOLUME},
- * {@link #PLAYBACKINFO_VOLUME_MAX},
- * and {@link #PLAYBACKINFO_VOLUME_HANDLING}.
- * @return the current value for the given information type, or
- * {@link #PLAYBACKINFO_INVALID_VALUE} if an error occurred or the request is invalid, or
- * the value is unknown.
- */
- public int getIntPlaybackInformation(int what) {
- synchronized(mCacheLock) {
- switch (what) {
- case PLAYBACKINFO_PLAYBACK_TYPE:
- return mPlaybackType;
- case PLAYBACKINFO_VOLUME:
- return mPlaybackVolume;
- case PLAYBACKINFO_VOLUME_MAX:
- return mPlaybackVolumeMax;
- case PLAYBACKINFO_USES_STREAM:
- return mPlaybackStream;
- case PLAYBACKINFO_VOLUME_HANDLING:
- return mPlaybackVolumeHandling;
- default:
- Log.e(TAG, "getIntPlaybackInformation() unknown key " + what);
- return PLAYBACKINFO_INVALID_VALUE;
- }
- }
- }
-
/**
* Lock for all cached data
*/
@@ -1102,13 +929,6 @@
* The current remote control client generation ID across the system, as known by this object
*/
private int mCurrentClientGenId = -1;
- /**
- * The remote control client generation ID, the last time it was told it was the current RC.
- * If (mCurrentClientGenId == mInternalClientGenId) is true, it means that this remote control
- * client is the "focused" one, and that whenever this client's info is updated, it needs to
- * send it to the known IRemoteControlDisplay interfaces.
- */
- private int mInternalClientGenId = -2;
/**
* The media button intent description associated with this remote control client
@@ -1134,186 +954,18 @@
private MediaMetadata mMediaMetadata;
/**
- * A class to encapsulate all the information about a remote control display.
- * A RemoteControlClient's metadata and state may be displayed on multiple IRemoteControlDisplay
- */
- private class DisplayInfoForClient {
- /** may never be null */
- private IRemoteControlDisplay mRcDisplay;
- private int mArtworkExpectedWidth;
- private int mArtworkExpectedHeight;
- private boolean mWantsPositionSync = false;
- private boolean mEnabled = true;
-
- DisplayInfoForClient(IRemoteControlDisplay rcd, int w, int h) {
- mRcDisplay = rcd;
- mArtworkExpectedWidth = w;
- mArtworkExpectedHeight = h;
- }
- }
-
- /**
- * The list of remote control displays to which this client will send information.
- * Accessed and modified synchronized on mCacheLock
- */
- private ArrayList<DisplayInfoForClient> mRcDisplays = new ArrayList<DisplayInfoForClient>(1);
-
- /**
* @hide
* Accessor to media button intent description (includes target component)
*/
public PendingIntent getRcMediaIntent() {
return mRcMediaIntent;
}
- /**
- * @hide
- * Accessor to IRemoteControlClient
- */
- public IRemoteControlClient getIRemoteControlClient() {
- return mIRCC;
- }
-
- /**
- * The IRemoteControlClient implementation
- */
- private final IRemoteControlClient mIRCC = new IRemoteControlClient.Stub() {
-
- //TODO change name to informationRequestForAllDisplays()
- public void onInformationRequested(int generationId, int infoFlags) {
- // only post messages, we can't block here
- if (mEventHandler != null) {
- // signal new client
- mEventHandler.removeMessages(MSG_NEW_INTERNAL_CLIENT_GEN);
- mEventHandler.sendMessage(
- mEventHandler.obtainMessage(MSG_NEW_INTERNAL_CLIENT_GEN,
- /*arg1*/ generationId, /*arg2, ignored*/ 0));
- // send the information
- mEventHandler.removeMessages(MSG_REQUEST_PLAYBACK_STATE);
- mEventHandler.removeMessages(MSG_REQUEST_METADATA);
- mEventHandler.removeMessages(MSG_REQUEST_TRANSPORTCONTROL);
- mEventHandler.removeMessages(MSG_REQUEST_ARTWORK);
- mEventHandler.removeMessages(MSG_REQUEST_METADATA_ARTWORK);
- mEventHandler.sendMessage(
- mEventHandler.obtainMessage(MSG_REQUEST_PLAYBACK_STATE, null));
- mEventHandler.sendMessage(
- mEventHandler.obtainMessage(MSG_REQUEST_TRANSPORTCONTROL, null));
- mEventHandler.sendMessage(mEventHandler.obtainMessage(MSG_REQUEST_METADATA_ARTWORK,
- 0, 0, null));
- }
- }
-
- public void informationRequestForDisplay(IRemoteControlDisplay rcd, int w, int h) {
- // only post messages, we can't block here
- if (mEventHandler != null) {
- mEventHandler.sendMessage(
- mEventHandler.obtainMessage(MSG_REQUEST_TRANSPORTCONTROL, rcd));
- mEventHandler.sendMessage(
- mEventHandler.obtainMessage(MSG_REQUEST_PLAYBACK_STATE, rcd));
- if ((w > 0) && (h > 0)) {
- mEventHandler.sendMessage(
- mEventHandler.obtainMessage(MSG_REQUEST_METADATA_ARTWORK, w, h, rcd));
- } else {
- mEventHandler.sendMessage(
- mEventHandler.obtainMessage(MSG_REQUEST_METADATA, rcd));
- }
- }
- }
-
- public void setCurrentClientGenerationId(int clientGeneration) {
- // only post messages, we can't block here
- if (mEventHandler != null) {
- mEventHandler.removeMessages(MSG_NEW_CURRENT_CLIENT_GEN);
- mEventHandler.sendMessage(mEventHandler.obtainMessage(
- MSG_NEW_CURRENT_CLIENT_GEN, clientGeneration, 0/*ignored*/));
- }
- }
-
- public void plugRemoteControlDisplay(IRemoteControlDisplay rcd, int w, int h) {
- // only post messages, we can't block here
- if ((mEventHandler != null) && (rcd != null)) {
- mEventHandler.sendMessage(mEventHandler.obtainMessage(
- MSG_PLUG_DISPLAY, w, h, rcd));
- }
- }
-
- public void unplugRemoteControlDisplay(IRemoteControlDisplay rcd) {
- // only post messages, we can't block here
- if ((mEventHandler != null) && (rcd != null)) {
- mEventHandler.sendMessage(mEventHandler.obtainMessage(
- MSG_UNPLUG_DISPLAY, rcd));
- }
- }
-
- public void setBitmapSizeForDisplay(IRemoteControlDisplay rcd, int w, int h) {
- // only post messages, we can't block here
- if ((mEventHandler != null) && (rcd != null)) {
- mEventHandler.sendMessage(mEventHandler.obtainMessage(
- MSG_UPDATE_DISPLAY_ARTWORK_SIZE, w, h, rcd));
- }
- }
-
- public void setWantsSyncForDisplay(IRemoteControlDisplay rcd, boolean wantsSync) {
- // only post messages, we can't block here
- if ((mEventHandler != null) && (rcd != null)) {
- mEventHandler.sendMessage(mEventHandler.obtainMessage(
- MSG_DISPLAY_WANTS_POS_SYNC, wantsSync ? 1 : 0, 0/*arg2 ignored*/, rcd));
- }
- }
-
- public void enableRemoteControlDisplay(IRemoteControlDisplay rcd, boolean enabled) {
- // only post messages, we can't block here
- if ((mEventHandler != null) && (rcd != null)) {
- mEventHandler.sendMessage(mEventHandler.obtainMessage(
- MSG_DISPLAY_ENABLE, enabled ? 1 : 0, 0/*arg2 ignored*/, rcd));
- }
- }
-
- public void seekTo(int generationId, long timeMs) {
- // only post messages, we can't block here
- if (mEventHandler != null) {
- mEventHandler.removeMessages(MSG_SEEK_TO);
- mEventHandler.sendMessage(mEventHandler.obtainMessage(
- MSG_SEEK_TO, generationId /* arg1 */, 0 /* arg2, ignored */,
- new Long(timeMs)));
- }
- }
-
- public void updateMetadata(int generationId, int key, Rating value) {
- // only post messages, we can't block here
- if (mEventHandler != null) {
- mEventHandler.sendMessage(mEventHandler.obtainMessage(
- MSG_UPDATE_METADATA, generationId /* arg1 */, key /* arg2*/, value));
- }
- }
- };
/**
* @hide
* Default value for the unique identifier
*/
public final static int RCSE_ID_UNREGISTERED = -1;
- /**
- * Unique identifier of the RemoteControlStackEntry in AudioService with which
- * this RemoteControlClient is associated.
- */
- private int mRcseId = RCSE_ID_UNREGISTERED;
- /**
- * @hide
- * To be only used by AudioManager after it has received the unique id from
- * IAudioService.registerRemoteControlClient()
- * @param id the unique identifier of the RemoteControlStackEntry in AudioService with which
- * this RemoteControlClient is associated.
- */
- public void setRcseId(int id) {
- mRcseId = id;
- }
-
- /**
- * @hide
- */
- public int getRcseId() {
- return mRcseId;
- }
// USE_SESSIONS
private MediaSession.TransportControlsCallback mTransportListener
@@ -1327,31 +979,13 @@
@Override
public void onSetRating(Rating rating) {
if ((mTransportControlFlags & FLAG_KEY_MEDIA_RATING) != 0) {
- if (mEventHandler != null) {
- mEventHandler.sendMessage(mEventHandler.obtainMessage(
- MSG_UPDATE_METADATA, mCurrentClientGenId,
- MetadataEditor.RATING_KEY_BY_USER, rating));
- }
+ onUpdateMetadata(mCurrentClientGenId, MetadataEditor.RATING_KEY_BY_USER, rating);
}
}
};
private EventHandler mEventHandler;
- private final static int MSG_REQUEST_PLAYBACK_STATE = 1;
- private final static int MSG_REQUEST_METADATA = 2;
- private final static int MSG_REQUEST_TRANSPORTCONTROL = 3;
- private final static int MSG_REQUEST_ARTWORK = 4;
- private final static int MSG_NEW_INTERNAL_CLIENT_GEN = 5;
- private final static int MSG_NEW_CURRENT_CLIENT_GEN = 6;
- private final static int MSG_PLUG_DISPLAY = 7;
- private final static int MSG_UNPLUG_DISPLAY = 8;
- private final static int MSG_UPDATE_DISPLAY_ARTWORK_SIZE = 9;
- private final static int MSG_SEEK_TO = 10;
private final static int MSG_POSITION_DRIFT_CHECK = 11;
- private final static int MSG_DISPLAY_WANTS_POS_SYNC = 12;
- private final static int MSG_UPDATE_METADATA = 13;
- private final static int MSG_REQUEST_METADATA_ARTWORK = 14;
- private final static int MSG_DISPLAY_ENABLE = 15;
private class EventHandler extends Handler {
public EventHandler(RemoteControlClient rcc, Looper looper) {
@@ -1361,63 +995,9 @@
@Override
public void handleMessage(Message msg) {
switch(msg.what) {
- case MSG_REQUEST_PLAYBACK_STATE:
- synchronized (mCacheLock) {
- sendPlaybackState_syncCacheLock((IRemoteControlDisplay)msg.obj);
- }
- break;
- case MSG_REQUEST_METADATA:
- synchronized (mCacheLock) {
- sendMetadata_syncCacheLock((IRemoteControlDisplay)msg.obj);
- }
- break;
- case MSG_REQUEST_TRANSPORTCONTROL:
- synchronized (mCacheLock) {
- sendTransportControlInfo_syncCacheLock((IRemoteControlDisplay)msg.obj);
- }
- break;
- case MSG_REQUEST_ARTWORK:
- synchronized (mCacheLock) {
- sendArtwork_syncCacheLock((IRemoteControlDisplay)msg.obj,
- msg.arg1, msg.arg2);
- }
- break;
- case MSG_REQUEST_METADATA_ARTWORK:
- synchronized (mCacheLock) {
- sendMetadataWithArtwork_syncCacheLock((IRemoteControlDisplay)msg.obj,
- msg.arg1, msg.arg2);
- }
- break;
- case MSG_NEW_INTERNAL_CLIENT_GEN:
- onNewInternalClientGen(msg.arg1);
- break;
- case MSG_NEW_CURRENT_CLIENT_GEN:
- onNewCurrentClientGen(msg.arg1);
- break;
- case MSG_PLUG_DISPLAY:
- onPlugDisplay((IRemoteControlDisplay)msg.obj, msg.arg1, msg.arg2);
- break;
- case MSG_UNPLUG_DISPLAY:
- onUnplugDisplay((IRemoteControlDisplay)msg.obj);
- break;
- case MSG_UPDATE_DISPLAY_ARTWORK_SIZE:
- onUpdateDisplayArtworkSize((IRemoteControlDisplay)msg.obj, msg.arg1, msg.arg2);
- break;
- case MSG_SEEK_TO:
- onSeekTo(msg.arg1, ((Long)msg.obj).longValue());
- break;
case MSG_POSITION_DRIFT_CHECK:
onPositionDriftCheck();
break;
- case MSG_DISPLAY_WANTS_POS_SYNC:
- onDisplayWantsSync((IRemoteControlDisplay)msg.obj, msg.arg1 == 1);
- break;
- case MSG_UPDATE_METADATA:
- onUpdateMetadata(msg.arg1, msg.arg2, msg.obj);
- break;
- case MSG_DISPLAY_ENABLE:
- onDisplayEnable((IRemoteControlDisplay)msg.obj, msg.arg1 == 1);
- break;
default:
Log.e(TAG, "Unknown event " + msg.what + " in RemoteControlClient handler");
}
@@ -1425,346 +1005,8 @@
}
//===========================================================
- // Communication with the IRemoteControlDisplay (the displays known to the system)
-
- private void sendPlaybackState_syncCacheLock(IRemoteControlDisplay target) {
- if (mCurrentClientGenId == mInternalClientGenId) {
- if (target != null) {
- try {
- target.setPlaybackState(mInternalClientGenId,
- mPlaybackState, mPlaybackStateChangeTimeMs, mPlaybackPositionMs,
- mPlaybackSpeed);
- } catch (RemoteException e) {
- Log.e(TAG, "Error in setPlaybackState() for dead display " + target, e);
- }
- return;
- }
- // target == null implies all displays must be updated
- final Iterator<DisplayInfoForClient> displayIterator = mRcDisplays.iterator();
- while (displayIterator.hasNext()) {
- final DisplayInfoForClient di = displayIterator.next();
- if (di.mEnabled) {
- try {
- di.mRcDisplay.setPlaybackState(mInternalClientGenId,
- mPlaybackState, mPlaybackStateChangeTimeMs, mPlaybackPositionMs,
- mPlaybackSpeed);
- } catch (RemoteException e) {
- Log.e(TAG, "Error in setPlaybackState(), dead display " + di.mRcDisplay, e);
- displayIterator.remove();
- }
- }
- }
- }
- }
-
- private void sendMetadata_syncCacheLock(IRemoteControlDisplay target) {
- if (mCurrentClientGenId == mInternalClientGenId) {
- if (target != null) {
- try {
- target.setMetadata(mInternalClientGenId, mMetadata);
- } catch (RemoteException e) {
- Log.e(TAG, "Error in setMetadata() for dead display " + target, e);
- }
- return;
- }
- // target == null implies all displays must be updated
- final Iterator<DisplayInfoForClient> displayIterator = mRcDisplays.iterator();
- while (displayIterator.hasNext()) {
- final DisplayInfoForClient di = displayIterator.next();
- if (di.mEnabled) {
- try {
- di.mRcDisplay.setMetadata(mInternalClientGenId, mMetadata);
- } catch (RemoteException e) {
- Log.e(TAG, "Error in setMetadata(), dead display " + di.mRcDisplay, e);
- displayIterator.remove();
- }
- }
- }
- }
- }
-
- private void sendTransportControlInfo_syncCacheLock(IRemoteControlDisplay target) {
- if (mCurrentClientGenId == mInternalClientGenId) {
- if (target != null) {
- try {
- target.setTransportControlInfo(mInternalClientGenId,
- mTransportControlFlags, mPlaybackPositionCapabilities);
- } catch (RemoteException e) {
- Log.e(TAG, "Error in setTransportControlFlags() for dead display " + target,
- e);
- }
- return;
- }
- // target == null implies all displays must be updated
- final Iterator<DisplayInfoForClient> displayIterator = mRcDisplays.iterator();
- while (displayIterator.hasNext()) {
- final DisplayInfoForClient di = displayIterator.next();
- if (di.mEnabled) {
- try {
- di.mRcDisplay.setTransportControlInfo(mInternalClientGenId,
- mTransportControlFlags, mPlaybackPositionCapabilities);
- } catch (RemoteException e) {
- Log.e(TAG, "Error in setTransportControlFlags(), dead display " + di.mRcDisplay,
- e);
- displayIterator.remove();
- }
- }
- }
- }
- }
-
- private void sendArtwork_syncCacheLock(IRemoteControlDisplay target, int w, int h) {
- // FIXME modify to cache all requested sizes?
- if (mCurrentClientGenId == mInternalClientGenId) {
- if (target != null) {
- final DisplayInfoForClient di = new DisplayInfoForClient(target, w, h);
- sendArtworkToDisplay(di);
- return;
- }
- // target == null implies all displays must be updated
- final Iterator<DisplayInfoForClient> displayIterator = mRcDisplays.iterator();
- while (displayIterator.hasNext()) {
- if (!sendArtworkToDisplay(displayIterator.next())) {
- displayIterator.remove();
- }
- }
- }
- }
-
- /**
- * Send artwork to an IRemoteControlDisplay.
- * @param di encapsulates the IRemoteControlDisplay that will receive the artwork, and its
- * dimension requirements.
- * @return false if there was an error communicating with the IRemoteControlDisplay.
- */
- private boolean sendArtworkToDisplay(DisplayInfoForClient di) {
- if ((di.mArtworkExpectedWidth > 0) && (di.mArtworkExpectedHeight > 0)) {
- Bitmap artwork = scaleBitmapIfTooBig(mOriginalArtwork,
- di.mArtworkExpectedWidth, di.mArtworkExpectedHeight);
- try {
- di.mRcDisplay.setArtwork(mInternalClientGenId, artwork);
- } catch (RemoteException e) {
- Log.e(TAG, "Error in sendArtworkToDisplay(), dead display " + di.mRcDisplay, e);
- return false;
- }
- }
- return true;
- }
-
- private void sendMetadataWithArtwork_syncCacheLock(IRemoteControlDisplay target, int w, int h) {
- // FIXME modify to cache all requested sizes?
- if (mCurrentClientGenId == mInternalClientGenId) {
- if (target != null) {
- try {
- if ((w > 0) && (h > 0)) {
- Bitmap artwork = scaleBitmapIfTooBig(mOriginalArtwork, w, h);
- target.setAllMetadata(mInternalClientGenId, mMetadata, artwork);
- } else {
- target.setMetadata(mInternalClientGenId, mMetadata);
- }
- } catch (RemoteException e) {
- Log.e(TAG, "Error in set(All)Metadata() for dead display " + target, e);
- }
- return;
- }
- // target == null implies all displays must be updated
- final Iterator<DisplayInfoForClient> displayIterator = mRcDisplays.iterator();
- while (displayIterator.hasNext()) {
- final DisplayInfoForClient di = displayIterator.next();
- try {
- if (di.mEnabled) {
- if ((di.mArtworkExpectedWidth > 0) && (di.mArtworkExpectedHeight > 0)) {
- Bitmap artwork = scaleBitmapIfTooBig(mOriginalArtwork,
- di.mArtworkExpectedWidth, di.mArtworkExpectedHeight);
- di.mRcDisplay.setAllMetadata(mInternalClientGenId, mMetadata, artwork);
- } else {
- di.mRcDisplay.setMetadata(mInternalClientGenId, mMetadata);
- }
- }
- } catch (RemoteException e) {
- Log.e(TAG, "Error when setting metadata, dead display " + di.mRcDisplay, e);
- displayIterator.remove();
- }
- }
- }
- }
-
- //===========================================================
- // Communication with AudioService
-
- private static IAudioService sService;
-
- private static IAudioService getService()
- {
- if (sService != null) {
- return sService;
- }
- IBinder b = ServiceManager.getService(Context.AUDIO_SERVICE);
- sService = IAudioService.Stub.asInterface(b);
- return sService;
- }
-
- private void sendAudioServiceNewPlaybackInfo_syncCacheLock(int what, int value) {
- if (mRcseId == RCSE_ID_UNREGISTERED) {
- return;
- }
- //Log.d(TAG, "sending to AudioService key=" + what + ", value=" + value);
- IAudioService service = getService();
- try {
- service.setPlaybackInfoForRcc(mRcseId, what, value);
- } catch (RemoteException e) {
- Log.e(TAG, "Dead object in setPlaybackInfoForRcc", e);
- }
- }
-
- private void sendAudioServiceNewPlaybackState_syncCacheLock() {
- if (mRcseId == RCSE_ID_UNREGISTERED) {
- return;
- }
- IAudioService service = getService();
- try {
- service.setPlaybackStateForRcc(mRcseId,
- mPlaybackState, mPlaybackPositionMs, mPlaybackSpeed);
- } catch (RemoteException e) {
- Log.e(TAG, "Dead object in setPlaybackStateForRcc", e);
- }
- }
-
- //===========================================================
// Message handlers
- private void onNewInternalClientGen(int clientGeneration) {
- synchronized (mCacheLock) {
- // this remote control client is told it is the "focused" one:
- // it implies that now (mCurrentClientGenId == mInternalClientGenId) is true
- mInternalClientGenId = clientGeneration;
- }
- }
-
- private void onNewCurrentClientGen(int clientGeneration) {
- synchronized (mCacheLock) {
- mCurrentClientGenId = clientGeneration;
- }
- }
-
- /** pre-condition rcd != null */
- private void onPlugDisplay(IRemoteControlDisplay rcd, int w, int h) {
- synchronized(mCacheLock) {
- // do we have this display already?
- boolean displayKnown = false;
- final Iterator<DisplayInfoForClient> displayIterator = mRcDisplays.iterator();
- while (displayIterator.hasNext() && !displayKnown) {
- final DisplayInfoForClient di = displayIterator.next();
- displayKnown = di.mRcDisplay.asBinder().equals(rcd.asBinder());
- if (displayKnown) {
- // this display was known but the change in artwork size will cause the
- // artwork to be refreshed
- if ((di.mArtworkExpectedWidth != w) || (di.mArtworkExpectedHeight != h)) {
- di.mArtworkExpectedWidth = w;
- di.mArtworkExpectedHeight = h;
- if (!sendArtworkToDisplay(di)) {
- displayIterator.remove();
- }
- }
- }
- }
- if (!displayKnown) {
- mRcDisplays.add(new DisplayInfoForClient(rcd, w, h));
- }
- }
- }
-
- /** pre-condition rcd != null */
- private void onUnplugDisplay(IRemoteControlDisplay rcd) {
- synchronized(mCacheLock) {
- Iterator<DisplayInfoForClient> displayIterator = mRcDisplays.iterator();
- while (displayIterator.hasNext()) {
- final DisplayInfoForClient di = displayIterator.next();
- if (di.mRcDisplay.asBinder().equals(rcd.asBinder())) {
- displayIterator.remove();
- break;
- }
- }
- // list of RCDs has changed, reevaluate whether position check is still needed
- boolean oldNeedsPositionSync = mNeedsPositionSync;
- boolean newNeedsPositionSync = false;
- displayIterator = mRcDisplays.iterator();
- while (displayIterator.hasNext()) {
- final DisplayInfoForClient di = displayIterator.next();
- if (di.mWantsPositionSync) {
- newNeedsPositionSync = true;
- break;
- }
- }
- mNeedsPositionSync = newNeedsPositionSync;
- if (oldNeedsPositionSync != mNeedsPositionSync) {
- // update needed?
- initiateCheckForDrift_syncCacheLock();
- }
- }
- }
-
- /** pre-condition rcd != null */
- private void onUpdateDisplayArtworkSize(IRemoteControlDisplay rcd, int w, int h) {
- synchronized(mCacheLock) {
- final Iterator<DisplayInfoForClient> displayIterator = mRcDisplays.iterator();
- while (displayIterator.hasNext()) {
- final DisplayInfoForClient di = displayIterator.next();
- if (di.mRcDisplay.asBinder().equals(rcd.asBinder()) &&
- ((di.mArtworkExpectedWidth != w) || (di.mArtworkExpectedHeight != h))) {
- di.mArtworkExpectedWidth = w;
- di.mArtworkExpectedHeight = h;
- if (di.mEnabled) {
- if (!sendArtworkToDisplay(di)) {
- displayIterator.remove();
- }
- }
- break;
- }
- }
- }
- }
-
- /** pre-condition rcd != null */
- private void onDisplayWantsSync(IRemoteControlDisplay rcd, boolean wantsSync) {
- synchronized(mCacheLock) {
- boolean oldNeedsPositionSync = mNeedsPositionSync;
- boolean newNeedsPositionSync = false;
- final Iterator<DisplayInfoForClient> displayIterator = mRcDisplays.iterator();
- // go through the list of RCDs and for each entry, check both whether this is the RCD
- // that gets upated, and whether the list has one entry that wants position sync
- while (displayIterator.hasNext()) {
- final DisplayInfoForClient di = displayIterator.next();
- if (di.mEnabled) {
- if (di.mRcDisplay.asBinder().equals(rcd.asBinder())) {
- di.mWantsPositionSync = wantsSync;
- }
- if (di.mWantsPositionSync) {
- newNeedsPositionSync = true;
- }
- }
- }
- mNeedsPositionSync = newNeedsPositionSync;
- if (oldNeedsPositionSync != mNeedsPositionSync) {
- // update needed?
- initiateCheckForDrift_syncCacheLock();
- }
- }
- }
-
- /** pre-condition rcd != null */
- private void onDisplayEnable(IRemoteControlDisplay rcd, boolean enable) {
- synchronized(mCacheLock) {
- final Iterator<DisplayInfoForClient> displayIterator = mRcDisplays.iterator();
- while (displayIterator.hasNext()) {
- final DisplayInfoForClient di = displayIterator.next();
- if (di.mRcDisplay.asBinder().equals(rcd.asBinder())) {
- di.mEnabled = enable;
- }
- }
- }
- }
-
private void onSeekTo(int generationId, long timeMs) {
synchronized (mCacheLock) {
if ((mCurrentClientGenId == generationId) && (mPositionUpdateListener != null)) {
@@ -1785,42 +1027,6 @@
// Internal utilities
/**
- * Scale a bitmap to fit the smallest dimension by uniformly scaling the incoming bitmap.
- * If the bitmap fits, then do nothing and return the original.
- *
- * @param bitmap
- * @param maxWidth
- * @param maxHeight
- * @return
- */
-
- private Bitmap scaleBitmapIfTooBig(Bitmap bitmap, int maxWidth, int maxHeight) {
- if (bitmap != null) {
- final int width = bitmap.getWidth();
- final int height = bitmap.getHeight();
- if (width > maxWidth || height > maxHeight) {
- float scale = Math.min((float) maxWidth / width, (float) maxHeight / height);
- int newWidth = Math.round(scale * width);
- int newHeight = Math.round(scale * height);
- Bitmap.Config newConfig = bitmap.getConfig();
- if (newConfig == null) {
- newConfig = Bitmap.Config.ARGB_8888;
- }
- Bitmap outBitmap = Bitmap.createBitmap(newWidth, newHeight, newConfig);
- Canvas canvas = new Canvas(outBitmap);
- Paint paint = new Paint();
- paint.setAntiAlias(true);
- paint.setFilterBitmap(true);
- canvas.drawBitmap(bitmap, null,
- new RectF(0, 0, outBitmap.getWidth(), outBitmap.getHeight()), paint);
- bitmap = outBitmap;
- }
- }
- return bitmap;
- }
-
-
- /**
* Returns whether, for the given playback state, the playback position is expected to
* be changing.
* @param playstate the playback state to evaluate
diff --git a/policy/src/com/android/internal/policy/impl/PhoneFallbackEventHandler.java b/policy/src/com/android/internal/policy/impl/PhoneFallbackEventHandler.java
index b2ecb61..4ad45a8 100644
--- a/policy/src/com/android/internal/policy/impl/PhoneFallbackEventHandler.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneFallbackEventHandler.java
@@ -40,9 +40,6 @@
private static String TAG = "PhoneFallbackEventHandler";
private static final boolean DEBUG = false;
- // Use the new sessions APIs
- private static final boolean USE_SESSIONS = true;
-
Context mContext;
View mView;
@@ -294,21 +291,7 @@
}
private void handleMediaKeyEvent(KeyEvent keyEvent) {
- if (USE_SESSIONS) {
- MediaSessionLegacyHelper.getHelper(mContext).sendMediaButtonEvent(keyEvent, false);
- } else {
- IAudioService audioService = IAudioService.Stub.asInterface(
- ServiceManager.checkService(Context.AUDIO_SERVICE));
- if (audioService != null) {
- try {
- audioService.dispatchMediaKeyEvent(keyEvent);
- } catch (RemoteException e) {
- Log.e(TAG, "dispatchMediaKeyEvent threw exception " + e);
- }
- } else {
- Slog.w(TAG, "Unable to find IAudioService for media key event.");
- }
- }
+ MediaSessionLegacyHelper.getHelper(mContext).sendMediaButtonEvent(keyEvent, false);
}
}
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
index 5598972..bc2671011 100644
--- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -144,9 +144,6 @@
static final boolean ENABLE_CAR_DOCK_HOME_CAPTURE = true;
static final boolean ENABLE_DESK_DOCK_HOME_CAPTURE = false;
- // Whether to use the new Session APIs
- static final boolean USE_SESSIONS = true;
-
static final int SHORT_PRESS_POWER_NOTHING = 0;
static final int SHORT_PRESS_POWER_GO_TO_SLEEP = 1;
static final int SHORT_PRESS_POWER_REALLY_GO_TO_SLEEP = 2;
@@ -3974,6 +3971,7 @@
* controlled by this device, or through remote submix).
*/
boolean isMusicActive() {
+
final AudioManager am = (AudioManager)mContext.getSystemService(Context.AUDIO_SERVICE);
if (am == null) {
Log.w(TAG, "isMusicActive: couldn't get AudioManager reference");
@@ -3982,43 +3980,6 @@
return am.isLocalOrRemoteMusicActive();
}
- /**
- * Tell the audio service to adjust the volume appropriate to the event.
- * @param keycode
- */
- void handleVolumeKey(int stream, int keycode) {
- IAudioService audioService = getAudioService();
- if (audioService == null) {
- return;
- }
- try {
- // when audio is playing locally, we shouldn't have to hold a wake lock
- // during the call, but we do it as a precaution for the rare possibility
- // that the music stops right before we call this.
- // Otherwise we might also be in a remote playback case.
- // TODO: Actually handle MUTE.
- mBroadcastWakeLock.acquire();
- if (stream == AudioSystem.STREAM_MUSIC) {
- audioService.adjustLocalOrRemoteStreamVolume(stream,
- keycode == KeyEvent.KEYCODE_VOLUME_UP
- ? AudioManager.ADJUST_RAISE
- : AudioManager.ADJUST_LOWER,
- mContext.getOpPackageName());
- } else {
- audioService.adjustStreamVolume(stream,
- keycode == KeyEvent.KEYCODE_VOLUME_UP
- ? AudioManager.ADJUST_RAISE
- : AudioManager.ADJUST_LOWER,
- 0,
- mContext.getOpPackageName());
- }
- } catch (RemoteException e) {
- Log.w(TAG, "IAudioService.adjust*StreamVolume() threw RemoteException " + e);
- } finally {
- mBroadcastWakeLock.release();
- }
- }
-
final Object mScreenshotLock = new Object();
ServiceConnection mScreenshotConnection = null;
@@ -4201,16 +4162,20 @@
if (telephonyManager.isOffhook()
&& (result & ACTION_PASS_TO_USER) == 0) {
// If we are in call but we decided not to pass the key to
- // the application, handle the volume change here.
- handleVolumeKey(AudioManager.STREAM_VOICE_CALL, keyCode);
+ // the application, just pass it to the session service.
+
+ MediaSessionLegacyHelper.getHelper(mContext)
+ .sendMediaButtonEvent(event, true);
break;
}
}
- if (isMusicActive() && (result & ACTION_PASS_TO_USER) == 0) {
- // If music is playing but we decided not to pass the key to the
- // application, handle the volume change here.
- handleVolumeKey(AudioManager.STREAM_MUSIC, keyCode);
+ if ((result & ACTION_PASS_TO_USER) == 0) {
+ // If we aren't passing to the user and no one else
+ // handled it send it to the session manager to figure
+ // out.
+ MediaSessionLegacyHelper.getHelper(mContext)
+ .sendMediaButtonEvent(event, true);
break;
}
}
@@ -4459,18 +4424,7 @@
void dispatchMediaKeyWithWakeLockToAudioService(KeyEvent event) {
if (ActivityManagerNative.isSystemReady()) {
- if (USE_SESSIONS) {
- MediaSessionLegacyHelper.getHelper(mContext).sendMediaButtonEvent(event, true);
- } else {
- IAudioService audioService = getAudioService();
- if (audioService != null) {
- try {
- audioService.dispatchMediaKeyEventUnderWakelock(event);
- } catch (RemoteException e) {
- Log.e(TAG, "dispatchMediaKeyEvent threw exception " + e);
- }
- }
- }
+ MediaSessionLegacyHelper.getHelper(mContext).sendMediaButtonEvent(event, true);
}
}