Merge "Document thrown IllegalArgumentException."
diff --git a/CleanSpec.mk b/CleanSpec.mk
index d48904c..6ae887b 100644
--- a/CleanSpec.mk
+++ b/CleanSpec.mk
@@ -111,6 +111,8 @@
$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/framework_intermediates/src/wifi/java)
$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/framework_intermediates/src/wifi/java)
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/media/audio/)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/fonts/Lohit_Hindi.ttf)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/media/audio/)
# ************************************************
# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
# ************************************************
diff --git a/cmds/stagefright/sf2.cpp b/cmds/stagefright/sf2.cpp
index 6fa66cf..263ecd1 100644
--- a/cmds/stagefright/sf2.cpp
+++ b/cmds/stagefright/sf2.cpp
@@ -569,12 +569,16 @@
CHECK(control->isValid());
SurfaceComposerClient::openGlobalTransaction();
- CHECK_EQ(control->setLayer(30000), (status_t)OK);
+ CHECK_EQ(control->setLayer(INT_MAX), (status_t)OK);
CHECK_EQ(control->show(), (status_t)OK);
SurfaceComposerClient::closeGlobalTransaction();
surface = control->getSurface();
CHECK(surface != NULL);
+
+ CHECK_EQ((status_t)OK,
+ native_window_api_connect(
+ surface.get(), NATIVE_WINDOW_API_MEDIA));
}
sp<Controller> controller =
@@ -589,6 +593,10 @@
looper->unregisterHandler(controller->id());
if (!decodeAudio && useSurface) {
+ CHECK_EQ((status_t)OK,
+ native_window_api_disconnect(
+ surface.get(), NATIVE_WINDOW_API_MEDIA));
+
composerClient->dispose();
}
diff --git a/cmds/stagefright/stagefright.cpp b/cmds/stagefright/stagefright.cpp
index 34f0a64..528d197 100644
--- a/cmds/stagefright/stagefright.cpp
+++ b/cmds/stagefright/stagefright.cpp
@@ -133,6 +133,39 @@
}
}
+static void dumpSource(const sp<MediaSource> &source, const String8 &filename) {
+ FILE *out = fopen(filename.string(), "wb");
+
+ CHECK_EQ((status_t)OK, source->start());
+
+ status_t err;
+ for (;;) {
+ MediaBuffer *mbuf;
+ err = source->read(&mbuf);
+
+ if (err == INFO_FORMAT_CHANGED) {
+ continue;
+ } else if (err != OK) {
+ break;
+ }
+
+ CHECK_EQ(
+ fwrite((const uint8_t *)mbuf->data() + mbuf->range_offset(),
+ 1,
+ mbuf->range_length(),
+ out),
+ (ssize_t)mbuf->range_length());
+
+ mbuf->release();
+ mbuf = NULL;
+ }
+
+ CHECK_EQ((status_t)OK, source->stop());
+
+ fclose(out);
+ out = NULL;
+}
+
static void playSource(OMXClient *client, sp<MediaSource> &source) {
sp<MetaData> meta = source->getFormat();
@@ -578,6 +611,7 @@
"(video only)\n");
fprintf(stderr, " -S allocate buffers from a surface\n");
fprintf(stderr, " -T allocate buffers from a surface texture\n");
+ fprintf(stderr, " -d(ump) filename (raw stream data to a file)\n");
}
int main(int argc, char **argv) {
@@ -590,6 +624,8 @@
bool seekTest = false;
bool useSurfaceAlloc = false;
bool useSurfaceTexAlloc = false;
+ bool dumpStream = false;
+ String8 dumpStreamFilename;
gNumRepetitions = 1;
gMaxNumFrames = 0;
gReproduceBug = -1;
@@ -604,7 +640,7 @@
sp<LiveSession> liveSession;
int res;
- while ((res = getopt(argc, argv, "han:lm:b:ptsrow:kxST")) >= 0) {
+ while ((res = getopt(argc, argv, "han:lm:b:ptsrow:kxSTd:")) >= 0) {
switch (res) {
case 'a':
{
@@ -612,6 +648,13 @@
break;
}
+ case 'd':
+ {
+ dumpStream = true;
+ dumpStreamFilename.setTo(optarg);
+ break;
+ }
+
case 'l':
{
listComponents = true;
@@ -874,7 +917,7 @@
CHECK(control->isValid());
SurfaceComposerClient::openGlobalTransaction();
- CHECK_EQ(control->setLayer(30000), (status_t)OK);
+ CHECK_EQ(control->setLayer(INT_MAX), (status_t)OK);
CHECK_EQ(control->show(), (status_t)OK);
SurfaceComposerClient::closeGlobalTransaction();
@@ -886,6 +929,10 @@
sp<SurfaceTexture> texture = new SurfaceTexture(0 /* tex */);
gSurface = new SurfaceTextureClient(texture);
}
+
+ CHECK_EQ((status_t)OK,
+ native_window_api_connect(
+ gSurface.get(), NATIVE_WINDOW_API_MEDIA));
}
DataSource::RegisterDefaultSniffers();
@@ -1062,6 +1109,8 @@
if (gWriteMP4) {
writeSourcesToMP4(mediaSources, syncInfoPresent);
+ } else if (dumpStream) {
+ dumpSource(mediaSource, dumpStreamFilename);
} else if (seekTest) {
performSeekTest(mediaSource);
} else {
@@ -1077,6 +1126,10 @@
}
if ((useSurfaceAlloc || useSurfaceTexAlloc) && !audioOnly) {
+ CHECK_EQ((status_t)OK,
+ native_window_api_disconnect(
+ gSurface.get(), NATIVE_WINDOW_API_MEDIA));
+
gSurface.clear();
if (useSurfaceAlloc) {
diff --git a/cmds/stagefright/stream.cpp b/cmds/stagefright/stream.cpp
index b13236a..2378345 100644
--- a/cmds/stagefright/stream.cpp
+++ b/cmds/stagefright/stream.cpp
@@ -323,7 +323,7 @@
CHECK(control->isValid());
SurfaceComposerClient::openGlobalTransaction();
- CHECK_EQ(control->setLayer(30000), (status_t)OK);
+ CHECK_EQ(control->setLayer(INT_MAX), (status_t)OK);
CHECK_EQ(control->show(), (status_t)OK);
SurfaceComposerClient::closeGlobalTransaction();
diff --git a/core/java/android/app/ActionBar.java b/core/java/android/app/ActionBar.java
index be00aa5..51c6f3a 100644
--- a/core/java/android/app/ActionBar.java
+++ b/core/java/android/app/ActionBar.java
@@ -29,16 +29,29 @@
import android.widget.SpinnerAdapter;
/**
- * Acts as a replacement for the title bar in Activities.
- * The action bar provides facilities for creating toolbar actions as well as
- * methods of navigating the application.
- * <p>By default, the action bar appears at the top of every activity, with the application icon on
- * the left, followed by the activity title. Items from the activity's options menu are also
- * accessible from the action bar.</p>
+ * A window feature at the top of the activity that may display the activity title, navigation
+ * modes, and other interactive items.
+ * <p>Beginning with Android 3.0 (API level 11), the action bar appears at the top of an
+ * activity's window when the activity uses the system's {@link
+ * android.R.style#Theme_Holo Holo} theme (or one of its descendant themes), which is the default.
+ * You may otherwise add the action bar by calling {@link
+ * android.view.Window#requestFeature requestFeature(FEATURE_ACTION_BAR)} or by declaring it in a
+ * custom theme with the {@link android.R.styleable#Theme_windowActionBar windowActionBar} property.
+ * <p>By default, the action bar shows the application icon on
+ * the left, followed by the activity title. If your activity has an options menu, you can make
+ * select items accessible directly from the action bar as "action items". You can also
+ * modify various characteristics of the action bar or remove it completely.</p>
* <p>From your activity, you can retrieve an instance of {@link ActionBar} by calling {@link
* android.app.Activity#getActionBar getActionBar()}.</p>
- * <p>For more information, read the <a href="{@docRoot}guide/topics/ui/actionbar.html">Action
+ * <p>For information about how to use the action bar, including how to add action items, navigation
+ * modes and more, read the <a href="{@docRoot}guide/topics/ui/actionbar.html">Action
* Bar</a> developer guide.</p>
+ * <p>In some cases, the action bar may be overlayed by another bar that enables contextual actions,
+ * using an {@link android.view.ActionMode}. For example, when the user selects one or more items in
+ * your activity, you can enable an action mode that offers actions specific to the selected
+ * items, with a UI that temporarily replaces the action bar. Although the UI may occupy the
+ * same space, the {@link android.view.ActionMode} APIs are distinct and independent from those for
+ * {@link ActionBar}.
*/
public abstract class ActionBar {
/**
@@ -423,6 +436,7 @@
* Set the ActionBar's split background. This will appear in
* the split action bar containing menu-provided action buttons
* on some devices and configurations.
+ * <p>You can enable split action bar with {@link android.R.attr#uiOptions}
*
* @param d Background drawable for the split bar
*/
@@ -460,13 +474,6 @@
* </ul>
*
* @return The current navigation mode.
- *
- * @see #setStandardNavigationMode()
- * @see #setStandardNavigationMode(CharSequence)
- * @see #setStandardNavigationMode(CharSequence, CharSequence)
- * @see #setDropdownNavigationMode(SpinnerAdapter)
- * @see #setTabNavigationMode()
- * @see #setCustomNavigationMode(View)
*/
public abstract int getNavigationMode();
@@ -498,7 +505,6 @@
* @return A new Tab
*
* @see #addTab(Tab)
- * @see #insertTab(Tab, int)
*/
public abstract Tab newTab();
@@ -606,7 +612,7 @@
public abstract void show();
/**
- * Hide the ActionBar if it is not currently showing.
+ * Hide the ActionBar if it is currently showing.
* If the window hosting the ActionBar does not have the feature
* {@link Window#FEATURE_ACTION_BAR_OVERLAY} it will resize application
* content to fit the new space available.
diff --git a/core/java/android/app/ActivityManagerNative.java b/core/java/android/app/ActivityManagerNative.java
index 7799779..b4471f0 100644
--- a/core/java/android/app/ActivityManagerNative.java
+++ b/core/java/android/app/ActivityManagerNative.java
@@ -1550,6 +1550,13 @@
return true;
}
+ case DISMISS_KEYGUARD_ON_NEXT_ACTIVITY_TRANSACTION: {
+ data.enforceInterface(IActivityManager.descriptor);
+ dismissKeyguardOnNextActivity();
+ reply.writeNoException();
+ return true;
+ }
+
}
return super.onTransact(code, data, reply, flags);
@@ -3504,5 +3511,15 @@
reply.recycle();
}
+ public void dismissKeyguardOnNextActivity() throws RemoteException {
+ Parcel data = Parcel.obtain();
+ Parcel reply = Parcel.obtain();
+ data.writeInterfaceToken(IActivityManager.descriptor);
+ mRemote.transact(DISMISS_KEYGUARD_ON_NEXT_ACTIVITY_TRANSACTION, data, reply, 0);
+ reply.readException();
+ data.recycle();
+ reply.recycle();
+ }
+
private IBinder mRemote;
}
diff --git a/core/java/android/app/IActivityManager.java b/core/java/android/app/IActivityManager.java
index 27dd691..26813bf 100644
--- a/core/java/android/app/IActivityManager.java
+++ b/core/java/android/app/IActivityManager.java
@@ -372,6 +372,8 @@
public void showBootMessage(CharSequence msg, boolean always) throws RemoteException;
+ public void dismissKeyguardOnNextActivity() throws RemoteException;
+
/*
* Private non-Binder interfaces
*/
@@ -602,4 +604,5 @@
int UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+135;
int GET_PROCESS_PSS_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+136;
int SHOW_BOOT_MESSAGE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+137;
+ int DISMISS_KEYGUARD_ON_NEXT_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+138;
}
diff --git a/core/java/android/bluetooth/BluetoothAdapter.java b/core/java/android/bluetooth/BluetoothAdapter.java
index 254c98f..ea5c3db 100644
--- a/core/java/android/bluetooth/BluetoothAdapter.java
+++ b/core/java/android/bluetooth/BluetoothAdapter.java
@@ -781,7 +781,7 @@
* Get the current connection state of a profile.
* This function can be used to check whether the local Bluetooth adapter
* is connected to any remote device for a specific profile.
- * Profile can be one of {@link BluetoothProfile#HEADSET},
+ * Profile can be one of {@link BluetoothProfile#HEALTH}, {@link BluetoothProfile#HEADSET},
* {@link BluetoothProfile#A2DP}.
*
* <p>Requires {@link android.Manifest.permission#BLUETOOTH}.
@@ -1132,15 +1132,15 @@
/**
* Get the profile proxy object associated with the profile.
*
- * <p>Profile can be one of {@link BluetoothProfile#HEADSET} or
+ * <p>Profile can be one of {@link BluetoothProfile#HEALTH}, {@link BluetoothProfile#HEADSET} or
* {@link BluetoothProfile#A2DP}. Clients must implements
* {@link BluetoothProfile.ServiceListener} to get notified of
* the connection status and to get the proxy object.
*
* @param context Context of the application
* @param listener The service Listener for connection callbacks.
- * @param profile The Bluetooth profile; either {@link BluetoothProfile#HEADSET}
- * or {@link BluetoothProfile#A2DP}.
+ * @param profile The Bluetooth profile; either {@link BluetoothProfile#HEALTH},
+ * {@link BluetoothProfile#HEADSET} or {@link BluetoothProfile#A2DP}.
* @return true on success, false on error
*/
public boolean getProfileProxy(Context context, BluetoothProfile.ServiceListener listener,
@@ -1172,7 +1172,7 @@
*
* <p> Clients should call this when they are no longer using
* the proxy obtained from {@link #getProfileProxy}.
- * Profile can be one of {@link BluetoothProfile#HEADSET} or
+ * Profile can be one of {@link BluetoothProfile#HEALTH}, {@link BluetoothProfile#HEADSET} or
* {@link BluetoothProfile#A2DP}
*
* @param profile
diff --git a/core/java/android/bluetooth/BluetoothProfile.java b/core/java/android/bluetooth/BluetoothProfile.java
index f7ccfbd..1920efa 100644
--- a/core/java/android/bluetooth/BluetoothProfile.java
+++ b/core/java/android/bluetooth/BluetoothProfile.java
@@ -161,9 +161,9 @@
/**
* Called to notify the client when the proxy object has been
* connected to the service.
- * @param profile - One of {@link #HEADSET} or
+ * @param profile - One of {@link #HEALTH}, {@link #HEADSET} or
* {@link #A2DP}
- * @param proxy - One of {@link BluetoothHeadset} or
+ * @param proxy - One of {@link BluetoothHealth}, {@link BluetoothHeadset} or
* {@link BluetoothA2dp}
*/
public void onServiceConnected(int profile, BluetoothProfile proxy);
@@ -171,7 +171,7 @@
/**
* Called to notify the client that this proxy object has been
* disconnected from the service.
- * @param profile - One of {@link #HEADSET} or
+ * @param profile - One of {@link #HEALTH}, {@link #HEADSET} or
* {@link #A2DP}
*/
public void onServiceDisconnected(int profile);
diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java
index 72cf26a..f44d038 100644
--- a/core/java/android/content/Intent.java
+++ b/core/java/android/content/Intent.java
@@ -5577,24 +5577,35 @@
@Override
public String toString() {
- StringBuilder b = new StringBuilder(128);
+ StringBuilder b = new StringBuilder(128);
b.append("Intent { ");
- toShortString(b, true, true);
+ toShortString(b, true, true, true);
b.append(" }");
return b.toString();
}
/** @hide */
- public String toShortString(boolean comp, boolean extras) {
- StringBuilder b = new StringBuilder(128);
- toShortString(b, comp, extras);
+ public String toInsecureString() {
+ StringBuilder b = new StringBuilder(128);
+
+ b.append("Intent { ");
+ toShortString(b, false, true, true);
+ b.append(" }");
+
return b.toString();
}
/** @hide */
- public void toShortString(StringBuilder b, boolean comp, boolean extras) {
+ public String toShortString(boolean secure, boolean comp, boolean extras) {
+ StringBuilder b = new StringBuilder(128);
+ toShortString(b, secure, comp, extras);
+ return b.toString();
+ }
+
+ /** @hide */
+ public void toShortString(StringBuilder b, boolean secure, boolean comp, boolean extras) {
boolean first = true;
if (mAction != null) {
b.append("act=").append(mAction);
@@ -5621,19 +5632,8 @@
}
first = false;
b.append("dat=");
- String scheme = mData.getScheme();
- if (scheme != null) {
- if (scheme.equalsIgnoreCase("tel")) {
- b.append("tel:xxx-xxx-xxxx");
- } else if (scheme.equalsIgnoreCase("sip")) {
- b.append("sip:xxxxxxxxxx");
- } else if (scheme.equalsIgnoreCase("sms")) {
- b.append("sms:xxx-xxx-xxxx");
- } else if (scheme.equalsIgnoreCase("smsto")) {
- b.append("smsto:xxx-xxx-xxxx");
- } else {
- b.append(mData);
- }
+ if (secure) {
+ b.append(mData.toSafeString());
} else {
b.append(mData);
}
diff --git a/core/java/android/content/SyncManager.java b/core/java/android/content/SyncManager.java
index 684c4fe..127efa2 100644
--- a/core/java/android/content/SyncManager.java
+++ b/core/java/android/content/SyncManager.java
@@ -16,6 +16,26 @@
package android.content;
+import com.android.internal.R;
+import com.android.internal.util.ArrayUtils;
+import com.google.android.collect.Lists;
+import com.google.android.collect.Maps;
+
+import android.accounts.Account;
+import android.accounts.AccountManager;
+import android.accounts.OnAccountsUpdateListener;
+import android.app.AlarmManager;
+import android.app.Notification;
+import android.app.NotificationManager;
+import android.app.PendingIntent;
+import android.content.pm.ApplicationInfo;
+import android.content.pm.PackageManager;
+import android.content.pm.ProviderInfo;
+import android.content.pm.RegisteredServicesCache;
+import android.content.pm.RegisteredServicesCacheListener;
+import android.content.pm.ResolveInfo;
+import android.net.ConnectivityManager;
+import android.net.NetworkInfo;
import android.os.Bundle;
import android.os.Handler;
import android.os.HandlerThread;
@@ -27,27 +47,6 @@
import android.os.RemoteException;
import android.os.SystemClock;
import android.os.SystemProperties;
-import com.google.android.collect.Lists;
-import com.google.android.collect.Maps;
-
-import com.android.internal.R;
-import com.android.internal.util.ArrayUtils;
-
-import android.accounts.Account;
-import android.accounts.AccountManager;
-import android.accounts.OnAccountsUpdateListener;
-import android.app.AlarmManager;
-import android.app.Notification;
-import android.app.NotificationManager;
-import android.app.PendingIntent;
-import android.content.pm.ApplicationInfo;
-import android.content.pm.PackageManager;
-import android.content.pm.ResolveInfo;
-import android.content.pm.RegisteredServicesCache;
-import android.content.pm.ProviderInfo;
-import android.content.pm.RegisteredServicesCacheListener;
-import android.net.ConnectivityManager;
-import android.net.NetworkInfo;
import android.os.WorkSource;
import android.provider.Settings;
import android.text.format.DateUtils;
@@ -59,12 +58,15 @@
import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
+import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
+import java.util.Map;
import java.util.Random;
import java.util.concurrent.CountDownLatch;
@@ -1006,9 +1008,8 @@
}
protected void dump(FileDescriptor fd, PrintWriter pw) {
- StringBuilder sb = new StringBuilder();
- dumpSyncState(pw, sb);
- dumpSyncHistory(pw, sb);
+ dumpSyncState(pw);
+ dumpSyncHistory(pw);
pw.println();
pw.println("SyncAdapters:");
@@ -1023,7 +1024,7 @@
return tobj.format("%Y-%m-%d %H:%M:%S");
}
- protected void dumpSyncState(PrintWriter pw, StringBuilder sb) {
+ protected void dumpSyncState(PrintWriter pw) {
pw.print("data connected: "); pw.println(mDataConnectionIsConnected);
pw.print("memory low: "); pw.println(mStorageIsLow);
@@ -1055,7 +1056,7 @@
}
pw.print("notification info: ");
- sb.setLength(0);
+ final StringBuilder sb = new StringBuilder();
mSyncHandler.mSyncNotificationInfo.toString(sb);
pw.println(sb.toString());
@@ -1204,7 +1205,197 @@
pw.println(")");
}
- protected void dumpSyncHistory(PrintWriter pw, StringBuilder sb) {
+ protected void dumpSyncHistory(PrintWriter pw) {
+ dumpRecentHistory(pw);
+ dumpDayStatistics(pw);
+ }
+
+ private void dumpRecentHistory(PrintWriter pw) {
+ final ArrayList<SyncStorageEngine.SyncHistoryItem> items
+ = mSyncStorageEngine.getSyncHistory();
+ if (items != null && items.size() > 0) {
+ final Map<String, AuthoritySyncStats> authorityMap = Maps.newHashMap();
+ long totalElapsedTime = 0;
+ long totalTimes = 0;
+ final int N = items.size();
+
+ int maxAuthority = 0;
+ int maxAccount = 0;
+ for (SyncStorageEngine.SyncHistoryItem item : items) {
+ SyncStorageEngine.AuthorityInfo authority
+ = mSyncStorageEngine.getAuthority(item.authorityId);
+ final String authorityName;
+ final String accountKey;
+ if (authority != null) {
+ authorityName = authority.authority;
+ accountKey = authority.account.name + "/" + authority.account.type;
+ } else {
+ authorityName = "Unknown";
+ accountKey = "Unknown";
+ }
+
+ int length = authorityName.length();
+ if (length > maxAuthority) {
+ maxAuthority = length;
+ }
+ length = accountKey.length();
+ if (length > maxAccount) {
+ maxAccount = length;
+ }
+
+ final long elapsedTime = item.elapsedTime;
+ totalElapsedTime += elapsedTime;
+ totalTimes++;
+ AuthoritySyncStats authoritySyncStats = authorityMap.get(authorityName);
+ if (authoritySyncStats == null) {
+ authoritySyncStats = new AuthoritySyncStats(authorityName);
+ authorityMap.put(authorityName, authoritySyncStats);
+ }
+ authoritySyncStats.elapsedTime += elapsedTime;
+ authoritySyncStats.times++;
+ final Map<String, AccountSyncStats> accountMap = authoritySyncStats.accountMap;
+ AccountSyncStats accountSyncStats = accountMap.get(accountKey);
+ if (accountSyncStats == null) {
+ accountSyncStats = new AccountSyncStats(accountKey);
+ accountMap.put(accountKey, accountSyncStats);
+ }
+ accountSyncStats.elapsedTime += elapsedTime;
+ accountSyncStats.times++;
+
+ }
+
+ pw.println();
+ pw.printf("Detailed Statistics (Recent history): %d (# of times) %ds (sync time)\n",
+ totalTimes, totalElapsedTime / 1000);
+
+ final List<AuthoritySyncStats> sortedAuthorities =
+ new ArrayList<AuthoritySyncStats>(authorityMap.values());
+ Collections.sort(sortedAuthorities, new Comparator<AuthoritySyncStats>() {
+ @Override
+ public int compare(AuthoritySyncStats lhs, AuthoritySyncStats rhs) {
+ // reverse order
+ int compare = Integer.compare(rhs.times, lhs.times);
+ if (compare == 0) {
+ compare = Long.compare(rhs.elapsedTime, lhs.elapsedTime);
+ }
+ return compare;
+ }
+ });
+
+ final int maxLength = Math.max(maxAuthority, maxAccount + 3);
+ final int padLength = 2 + 2 + maxLength + 2 + 10 + 11;
+ final char chars[] = new char[padLength];
+ Arrays.fill(chars, '-');
+ final String separator = new String(chars);
+
+ final String authorityFormat = String.format(" %%-%ds: %%-9s %%-11s\n", maxLength + 2);
+ final String accountFormat = String.format(" %%-%ds: %%-9s %%-11s\n", maxLength);
+
+ pw.println(separator);
+ for (AuthoritySyncStats authoritySyncStats : sortedAuthorities) {
+ String name = authoritySyncStats.name;
+ long elapsedTime;
+ int times;
+ String timeStr;
+ String timesStr;
+
+ elapsedTime = authoritySyncStats.elapsedTime;
+ times = authoritySyncStats.times;
+ timeStr = String.format("%d/%d%%",
+ elapsedTime / 1000,
+ elapsedTime * 100 / totalElapsedTime);
+ timesStr = String.format("%d/%d%%",
+ times,
+ times * 100 / totalTimes);
+ pw.printf(authorityFormat, name, timesStr, timeStr);
+
+ if (authoritySyncStats.accountMap.size() > 1) {
+ final List<AccountSyncStats> sortedAccounts =
+ new ArrayList<AccountSyncStats>(
+ authoritySyncStats.accountMap.values());
+ Collections.sort(sortedAccounts, new Comparator<AccountSyncStats>() {
+ @Override
+ public int compare(AccountSyncStats lhs, AccountSyncStats rhs) {
+ // reverse order
+ int compare = Integer.compare(rhs.times, lhs.times);
+ if (compare == 0) {
+ compare = Long.compare(rhs.elapsedTime, lhs.elapsedTime);
+ }
+ return compare;
+ }
+ });
+ for (AccountSyncStats stats: sortedAccounts) {
+ elapsedTime = stats.elapsedTime;
+ times = stats.times;
+ timeStr = String.format("%d/%d%%",
+ elapsedTime / 1000,
+ elapsedTime * 100 / totalElapsedTime);
+ timesStr = String.format("%d/%d%%",
+ times,
+ times * 100 / totalTimes);
+ pw.printf(accountFormat, stats.name, timesStr, timeStr);
+ }
+ }
+ pw.println(separator);
+ }
+
+ pw.println();
+ pw.println("Recent Sync History");
+ final String format = " %-" + maxAccount + "s %s\n";
+ String lastAuthorityName = null;
+ String lastAccountKey = null;
+ long lastEventTime = 0;
+ for (int i = 0; i < N; i++) {
+ SyncStorageEngine.SyncHistoryItem item = items.get(i);
+ SyncStorageEngine.AuthorityInfo authority
+ = mSyncStorageEngine.getAuthority(item.authorityId);
+ final String authorityName;
+ final String accountKey;
+ if (authority != null) {
+ authorityName = authority.authority;
+ accountKey = authority.account.name + "/" + authority.account.type;
+ } else {
+ authorityName = "Unknown";
+ accountKey = "Unknown";
+ }
+ final long elapsedTime = item.elapsedTime;
+ final Time time = new Time();
+ final long eventTime = item.eventTime;
+ time.set(eventTime);
+
+ pw.printf(" #%-3d: %s %8s %5.1fs",
+ i + 1,
+ formatTime(eventTime),
+ SyncStorageEngine.SOURCES[item.source],
+ ((float) elapsedTime) / 1000);
+ if (authorityName.equals(lastAuthorityName) && accountKey.equals(lastAccountKey)) {
+ final long span = (lastEventTime - eventTime) / 1000;
+ pw.printf(" %02d:%02d\n", span / 60, span % 60);
+ } else {
+ pw.printf(format, accountKey, authorityName);
+ }
+
+ lastAuthorityName = authorityName;
+ lastAccountKey = accountKey;
+ lastEventTime = eventTime;
+
+ if (item.event != SyncStorageEngine.EVENT_STOP
+ || item.upstreamActivity != 0
+ || item.downstreamActivity != 0) {
+ pw.printf(" event=%d upstreamActivity=%d downstreamActivity=%d\n",
+ item.event,
+ item.upstreamActivity,
+ item.downstreamActivity);
+ }
+ if (item.mesg != null
+ && !SyncStorageEngine.MESG_SUCCESS.equals(item.mesg)) {
+ pw.printf(" mesg=%s\n", item.mesg);
+ }
+ }
+ }
+ }
+
+ private void dumpDayStatistics(PrintWriter pw) {
SyncStorageEngine.DayStats dses[] = mSyncStorageEngine.getDayStatistics();
if (dses != null && dses[0] != null) {
pw.println();
@@ -1254,47 +1445,26 @@
}
}
}
+ }
- ArrayList<SyncStorageEngine.SyncHistoryItem> items
- = mSyncStorageEngine.getSyncHistory();
- if (items != null && items.size() > 0) {
- pw.println();
- pw.println("Recent Sync History");
- final int N = items.size();
- for (int i=0; i<N; i++) {
- SyncStorageEngine.SyncHistoryItem item = items.get(i);
- SyncStorageEngine.AuthorityInfo authority
- = mSyncStorageEngine.getAuthority(item.authorityId);
- pw.print(" #"); pw.print(i+1); pw.print(": ");
- if (authority != null) {
- pw.print(authority.account.name);
- pw.print(":");
- pw.print(authority.account.type);
- pw.print(" ");
- pw.print(authority.authority);
- } else {
- pw.print("<no account>");
- }
- Time time = new Time();
- time.set(item.eventTime);
- pw.print(" "); pw.print(SyncStorageEngine.SOURCES[item.source]);
- pw.print(" @ ");
- pw.print(formatTime(item.eventTime));
- pw.print(" for ");
- dumpTimeSec(pw, item.elapsedTime);
- pw.println();
- if (item.event != SyncStorageEngine.EVENT_STOP
- || item.upstreamActivity !=0
- || item.downstreamActivity != 0) {
- pw.print(" event="); pw.print(item.event);
- pw.print(" upstreamActivity="); pw.print(item.upstreamActivity);
- pw.print(" downstreamActivity="); pw.println(item.downstreamActivity);
- }
- if (item.mesg != null
- && !SyncStorageEngine.MESG_SUCCESS.equals(item.mesg)) {
- pw.print(" mesg="); pw.println(item.mesg);
- }
- }
+ private static class AuthoritySyncStats {
+ String name;
+ long elapsedTime;
+ int times;
+ Map<String, AccountSyncStats> accountMap = Maps.newHashMap();
+
+ private AuthoritySyncStats(String name) {
+ this.name = name;
+ }
+ }
+
+ private static class AccountSyncStats {
+ String name;
+ long elapsedTime;
+ int times;
+
+ private AccountSyncStats(String name) {
+ this.name = name;
}
}
diff --git a/core/java/android/content/pm/ActivityInfo.java b/core/java/android/content/pm/ActivityInfo.java
index bba329d..0e6694de 100644
--- a/core/java/android/content/pm/ActivityInfo.java
+++ b/core/java/android/content/pm/ActivityInfo.java
@@ -442,7 +442,11 @@
public int uiOptions = 0;
/**
- * Flag for use with uiOptions.
+ * Flag for use with {@link #uiOptions}.
+ * Indicates that the action bar should put all action items in a separate bar when
+ * the screen is narrow.
+ * <p>This value corresponds to "splitActionBarWhenNarrow" for the {@link #uiOptions} XML
+ * attribute.
*/
public static final int UIOPTION_SPLIT_ACTION_BAR_WHEN_NARROW = 1;
diff --git a/core/java/android/content/pm/PackageInfoLite.java b/core/java/android/content/pm/PackageInfoLite.java
index da97fde0..9625944 100644
--- a/core/java/android/content/pm/PackageInfoLite.java
+++ b/core/java/android/content/pm/PackageInfoLite.java
@@ -41,6 +41,8 @@
public int recommendedInstallLocation;
public int installLocation;
+ public VerifierInfo[] verifiers;
+
public PackageInfoLite() {
}
@@ -58,6 +60,13 @@
dest.writeString(packageName);
dest.writeInt(recommendedInstallLocation);
dest.writeInt(installLocation);
+
+ if (verifiers == null || verifiers.length == 0) {
+ dest.writeInt(0);
+ } else {
+ dest.writeInt(verifiers.length);
+ dest.writeTypedArray(verifiers, parcelableFlags);
+ }
}
public static final Parcelable.Creator<PackageInfoLite> CREATOR
@@ -75,5 +84,13 @@
packageName = source.readString();
recommendedInstallLocation = source.readInt();
installLocation = source.readInt();
+
+ final int verifiersLength = source.readInt();
+ if (verifiersLength == 0) {
+ verifiers = new VerifierInfo[0];
+ } else {
+ verifiers = new VerifierInfo[verifiersLength];
+ source.readTypedArray(verifiers, VerifierInfo.CREATOR);
+ }
}
}
diff --git a/core/java/android/content/pm/PackageManager.java b/core/java/android/content/pm/PackageManager.java
index f732cb8..7a7e4f4 100644
--- a/core/java/android/content/pm/PackageManager.java
+++ b/core/java/android/content/pm/PackageManager.java
@@ -725,6 +725,16 @@
public static final int MOVE_EXTERNAL_MEDIA = 0x00000002;
/**
+ * Usable by the required verifier as the {@code verificationCode} argument
+ * for {@link PackageManager#verifyPendingInstall} to indicate that it will
+ * allow the installation to proceed without any of the optional verifiers
+ * needing to vote.
+ *
+ * @hide
+ */
+ public static final int VERIFICATION_ALLOW_WITHOUT_SUFFICIENT = 2;
+
+ /**
* Used as the {@code verificationCode} argument for
* {@link PackageManager#verifyPendingInstall} to indicate that the calling
* package verifier allows the installation to proceed.
diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java
index e7b844c..c30675b 100644
--- a/core/java/android/content/pm/PackageParser.java
+++ b/core/java/android/content/pm/PackageParser.java
@@ -28,7 +28,9 @@
import android.os.Bundle;
import android.os.PatternMatcher;
import android.util.AttributeSet;
+import android.util.Base64;
import android.util.DisplayMetrics;
+import android.util.Log;
import android.util.Slog;
import android.util.TypedValue;
import com.android.internal.util.XmlUtils;
@@ -40,11 +42,18 @@
import java.io.IOException;
import java.io.InputStream;
import java.lang.ref.WeakReference;
+import java.security.KeyFactory;
+import java.security.NoSuchAlgorithmException;
+import java.security.PublicKey;
import java.security.cert.Certificate;
import java.security.cert.CertificateEncodingException;
+import java.security.spec.EncodedKeySpec;
+import java.security.spec.InvalidKeySpecException;
+import java.security.spec.X509EncodedKeySpec;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.Iterator;
+import java.util.List;
import java.util.jar.Attributes;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
@@ -150,12 +159,14 @@
* @hide
*/
public static class PackageLite {
- public String packageName;
- public int installLocation;
- public String mScanPath;
- public PackageLite(String packageName, int installLocation) {
+ public final String packageName;
+ public final int installLocation;
+ public final VerifierInfo[] verifiers;
+
+ public PackageLite(String packageName, int installLocation, List<VerifierInfo> verifiers) {
this.packageName = packageName;
this.installLocation = installLocation;
+ this.verifiers = verifiers.toArray(new VerifierInfo[verifiers.size()]);
}
}
@@ -619,8 +630,9 @@
* @return PackageLite object with package information or null on failure.
*/
public static PackageLite parsePackageLite(String packageFilePath, int flags) {
- XmlResourceParser parser = null;
AssetManager assmgr = null;
+ final XmlResourceParser parser;
+ final Resources res;
try {
assmgr = new AssetManager();
assmgr.setConfiguration(0, 0, null, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -631,6 +643,9 @@
return null;
}
+ final DisplayMetrics metrics = new DisplayMetrics();
+ metrics.setToDefaults();
+ res = new Resources(assmgr, metrics, null);
parser = assmgr.openXmlResourceParser(cookie, ANDROID_MANIFEST_FILENAME);
} catch (Exception e) {
if (assmgr != null) assmgr.close();
@@ -638,11 +653,12 @@
+ packageFilePath, e);
return null;
}
- AttributeSet attrs = parser;
- String errors[] = new String[1];
+
+ final AttributeSet attrs = parser;
+ final String errors[] = new String[1];
PackageLite packageLite = null;
try {
- packageLite = parsePackageLite(parser, attrs, flags, errors);
+ packageLite = parsePackageLite(res, parser, attrs, flags, errors);
} catch (IOException e) {
Slog.w(TAG, packageFilePath, e);
} catch (XmlPullParserException e) {
@@ -719,9 +735,9 @@
return pkgName.intern();
}
- private static PackageLite parsePackageLite(XmlPullParser parser,
- AttributeSet attrs, int flags, String[] outError)
- throws IOException, XmlPullParserException {
+ private static PackageLite parsePackageLite(Resources res, XmlPullParser parser,
+ AttributeSet attrs, int flags, String[] outError) throws IOException,
+ XmlPullParserException {
int type;
while ((type = parser.next()) != XmlPullParser.START_TAG
@@ -759,7 +775,26 @@
break;
}
}
- return new PackageLite(pkgName.intern(), installLocation);
+
+ // Only search the tree when the tag is directly below <manifest>
+ final int searchDepth = parser.getDepth() + 1;
+
+ final List<VerifierInfo> verifiers = new ArrayList<VerifierInfo>();
+ while ((type = parser.next()) != XmlPullParser.END_DOCUMENT
+ && (type != XmlPullParser.END_TAG || parser.getDepth() >= searchDepth)) {
+ if (type == XmlPullParser.END_TAG || type == XmlPullParser.TEXT) {
+ continue;
+ }
+
+ if (parser.getDepth() == searchDepth && "package-verifier".equals(parser.getName())) {
+ final VerifierInfo verifier = parseVerifier(res, parser, attrs, flags, outError);
+ if (verifier != null) {
+ verifiers.add(verifier);
+ }
+ }
+ }
+
+ return new PackageLite(pkgName.intern(), installLocation, verifiers);
}
/**
@@ -2691,6 +2726,63 @@
return data;
}
+ private static VerifierInfo parseVerifier(Resources res, XmlPullParser parser,
+ AttributeSet attrs, int flags, String[] outError) throws XmlPullParserException,
+ IOException {
+ final TypedArray sa = res.obtainAttributes(attrs,
+ com.android.internal.R.styleable.AndroidManifestPackageVerifier);
+
+ final String packageName = sa.getNonResourceString(
+ com.android.internal.R.styleable.AndroidManifestPackageVerifier_name);
+
+ final String encodedPublicKey = sa.getNonResourceString(
+ com.android.internal.R.styleable.AndroidManifestPackageVerifier_publicKey);
+
+ sa.recycle();
+
+ if (packageName == null || packageName.length() == 0) {
+ Slog.i(TAG, "verifier package name was null; skipping");
+ return null;
+ } else if (encodedPublicKey == null) {
+ Slog.i(TAG, "verifier " + packageName + " public key was null; skipping");
+ }
+
+ EncodedKeySpec keySpec;
+ try {
+ final byte[] encoded = Base64.decode(encodedPublicKey, Base64.DEFAULT);
+ keySpec = new X509EncodedKeySpec(encoded);
+ } catch (IllegalArgumentException e) {
+ Slog.i(TAG, "Could not parse verifier " + packageName + " public key; invalid Base64");
+ return null;
+ }
+
+ /* First try the key as an RSA key. */
+ try {
+ final KeyFactory keyFactory = KeyFactory.getInstance("RSA");
+ final PublicKey publicKey = keyFactory.generatePublic(keySpec);
+ return new VerifierInfo(packageName, publicKey);
+ } catch (NoSuchAlgorithmException e) {
+ Log.wtf(TAG, "Could not parse public key because RSA isn't included in build");
+ return null;
+ } catch (InvalidKeySpecException e) {
+ // Not a RSA public key.
+ }
+
+ /* Now try it as a DSA key. */
+ try {
+ final KeyFactory keyFactory = KeyFactory.getInstance("DSA");
+ final PublicKey publicKey = keyFactory.generatePublic(keySpec);
+ return new VerifierInfo(packageName, publicKey);
+ } catch (NoSuchAlgorithmException e) {
+ Log.wtf(TAG, "Could not parse public key because DSA isn't included in build");
+ return null;
+ } catch (InvalidKeySpecException e) {
+ // Not a DSA public key.
+ }
+
+ return null;
+ }
+
private static final String ANDROID_RESOURCES
= "http://schemas.android.com/apk/res/android";
diff --git a/core/java/android/content/pm/Signature.java b/core/java/android/content/pm/Signature.java
index c6aefb8..9c9340d 100644
--- a/core/java/android/content/pm/Signature.java
+++ b/core/java/android/content/pm/Signature.java
@@ -19,7 +19,12 @@
import android.os.Parcel;
import android.os.Parcelable;
+import java.io.ByteArrayInputStream;
import java.lang.ref.SoftReference;
+import java.security.PublicKey;
+import java.security.cert.Certificate;
+import java.security.cert.CertificateException;
+import java.security.cert.CertificateFactory;
import java.util.Arrays;
/**
@@ -135,6 +140,20 @@
return bytes;
}
+ /**
+ * Returns the public key for this signature.
+ *
+ * @throws CertificateException when Signature isn't a valid X.509
+ * certificate; shouldn't happen.
+ * @hide
+ */
+ public PublicKey getPublicKey() throws CertificateException {
+ final CertificateFactory certFactory = CertificateFactory.getInstance("X.509");
+ final ByteArrayInputStream bais = new ByteArrayInputStream(mSignature);
+ final Certificate cert = certFactory.generateCertificate(bais);
+ return cert.getPublicKey();
+ }
+
@Override
public boolean equals(Object obj) {
try {
diff --git a/core/java/android/content/pm/VerifierInfo.aidl b/core/java/android/content/pm/VerifierInfo.aidl
new file mode 100644
index 0000000..7702d38
--- /dev/null
+++ b/core/java/android/content/pm/VerifierInfo.aidl
@@ -0,0 +1,19 @@
+/*
+ * Copyright 2011, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.content.pm;
+
+parcelable VerifierInfo;
diff --git a/core/java/android/content/pm/VerifierInfo.java b/core/java/android/content/pm/VerifierInfo.java
new file mode 100644
index 0000000..0a2b283
--- /dev/null
+++ b/core/java/android/content/pm/VerifierInfo.java
@@ -0,0 +1,83 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.content.pm;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+import java.security.PublicKey;
+
+/**
+ * Contains information about a package verifier as used by
+ * {@code PackageManagerService} during package verification.
+ *
+ * @hide
+ */
+public class VerifierInfo implements Parcelable {
+ /** Package name of the verifier. */
+ public final String packageName;
+
+ /** Signatures used to sign the package verifier's package. */
+ public final PublicKey publicKey;
+
+ /**
+ * Creates an object that represents a verifier info object.
+ *
+ * @param packageName the package name in Java-style. Must not be {@code
+ * null} or empty.
+ * @param publicKey the public key for the signer encoded in Base64. Must
+ * not be {@code null} or empty.
+ * @throws IllegalArgumentException if either argument is null or empty.
+ */
+ public VerifierInfo(String packageName, PublicKey publicKey) {
+ if (packageName == null || packageName.length() == 0) {
+ throw new IllegalArgumentException("packageName must not be null or empty");
+ } else if (publicKey == null) {
+ throw new IllegalArgumentException("publicKey must not be null");
+ }
+
+ this.packageName = packageName;
+ this.publicKey = publicKey;
+ }
+
+ private VerifierInfo(Parcel source) {
+ packageName = source.readString();
+ publicKey = (PublicKey) source.readSerializable();
+ }
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
+ public void writeToParcel(Parcel dest, int flags) {
+ dest.writeString(packageName);
+ dest.writeSerializable(publicKey);
+ }
+
+ public static final Parcelable.Creator<VerifierInfo> CREATOR
+ = new Parcelable.Creator<VerifierInfo>() {
+ public VerifierInfo createFromParcel(Parcel source) {
+ return new VerifierInfo(source);
+ }
+
+ public VerifierInfo[] newArray(int size) {
+ return new VerifierInfo[size];
+ }
+ };
+}
\ No newline at end of file
diff --git a/core/java/android/hardware/Camera.java b/core/java/android/hardware/Camera.java
index 58f7869..e40de26 100644
--- a/core/java/android/hardware/Camera.java
+++ b/core/java/android/hardware/Camera.java
@@ -480,6 +480,12 @@
public final void stopPreview() {
_stopPreview();
mFaceDetectionRunning = false;
+
+ mShutterCallback = null;
+ mRawImageCallback = null;
+ mPostviewCallback = null;
+ mJpegCallback = null;
+ mAutoFocusCallback = null;
}
private native final void _stopPreview();
@@ -766,15 +772,8 @@
* onAutoFocus will be called immediately with a fake value of
* <code>success</code> set to <code>true</code>.
*
- * The auto-focus routine may lock auto-exposure and auto-white balance
- * after it completes. To check for the state of these locks, use the
- * {@link android.hardware.Camera.Parameters#getAutoExposureLock()} and
- * {@link android.hardware.Camera.Parameters#getAutoWhiteBalanceLock()}
- * methods. If such locking is undesirable, use
- * {@link android.hardware.Camera.Parameters#setAutoExposureLock(boolean)}
- * and
- * {@link android.hardware.Camera.Parameters#setAutoWhiteBalanceLock(boolean)}
- * to release the locks.
+ * The auto-focus routine does not lock auto-exposure and auto-white
+ * balance after it completes.
*
* @param success true if focus was successful, false if otherwise
* @param camera the Camera service object
@@ -805,16 +804,10 @@
* {@link android.hardware.Camera.Parameters#FLASH_MODE_OFF}, flash may be
* fired during auto-focus, depending on the driver and camera hardware.<p>
*
- * The auto-focus routine may lock auto-exposure and auto-white balance
- * after it completes. To check for the state of these locks, use the
- * {@link android.hardware.Camera.Parameters#getAutoExposureLock()} and
- * {@link android.hardware.Camera.Parameters#getAutoWhiteBalanceLock()}
- * methods after the {@link AutoFocusCallback#onAutoFocus(boolean, Camera)}
- * callback is invoked. If such locking is undesirable, use
- * {@link android.hardware.Camera.Parameters#setAutoExposureLock(boolean)}
- * and
- * {@link android.hardware.Camera.Parameters#setAutoWhiteBalanceLock(boolean)}
- * to release the locks.
+ * Auto-exposure lock {@link android.hardware.Camera.Parameters#getAutoExposureLock()}
+ * and auto-white balance locks {@link android.hardware.Camera.Parameters#getAutoWhiteBalanceLock()}
+ * do not change during and after autofocus. But auto-focus routine may stop
+ * auto-exposure and auto-white balance transiently during focusing.
*
* @param cb the callback to run
* @see #cancelAutoFocus()
@@ -834,13 +827,7 @@
* this function will return the focus position to the default.
* If the camera does not support auto-focus, this is a no-op.
*
- * Canceling auto-focus will return the auto-exposure lock and auto-white
- * balance lock to their state before {@link #autoFocus(AutoFocusCallback)}
- * was called.
- *
* @see #autoFocus(Camera.AutoFocusCallback)
- * @see android.hardware.Camera.Parameters#setAutoExposureLock(boolean)
- * @see android.hardware.Camera.Parameters#setAutoWhiteBalanceLock(boolean)
*/
public final void cancelAutoFocus()
{
@@ -2778,13 +2765,12 @@
*
* <p>Stopping preview with {@link #stopPreview()}, or triggering still
* image capture with {@link #takePicture(Camera.ShutterCallback,
- * Camera.PictureCallback, Camera.PictureCallback)}, will automatically
- * set the lock to false. However, the lock can be re-enabled before
- * preview is re-started to keep the same AE parameters.</p>
+ * Camera.PictureCallback, Camera.PictureCallback)}, will not change the
+ * lock.</p>
*
- * <p>Exposure compensation, in conjunction with re-enabling the AE and
- * AWB locks after each still capture, can be used to capture an
- * exposure-bracketed burst of images, for example.</p>
+ * <p>Exposure compensation, auto-exposure lock, and auto-white balance
+ * lock can be used to capture an exposure-bracketed burst of images,
+ * for example.</p>
*
* <p>Auto-exposure state, including the lock state, will not be
* maintained after camera {@link #release()} is called. Locking
@@ -2793,14 +2779,6 @@
* run at all, and may result in severely over- or under-exposed
* images.</p>
*
- * <p>The driver may also independently lock auto-exposure after
- * auto-focus completes. If this is undesirable, be sure to always set
- * the auto-exposure lock to false after the
- * {@link AutoFocusCallback#onAutoFocus(boolean, Camera)} callback is
- * received. The {@link #getAutoExposureLock()} method can be used after
- * the callback to determine if the camera has locked auto-exposure
- * independently.</p>
- *
* @param toggle new state of the auto-exposure lock. True means that
* auto-exposure is locked, false means that the auto-exposure
* routine is free to run normally.
@@ -2817,11 +2795,7 @@
* {@link #setAutoExposureLock} for details about the lock.
*
* @return State of the auto-exposure lock. Returns true if
- * auto-exposure is currently locked, and false otherwise. The
- * auto-exposure lock may be independently enabled by the camera
- * subsystem when auto-focus has completed. This method can be
- * used after the {@link AutoFocusCallback#onAutoFocus(boolean,
- * Camera)} callback to determine if the camera has locked AE.
+ * auto-exposure is currently locked, and false otherwise.
*
* @see #setAutoExposureLock(boolean)
*
@@ -2859,29 +2833,20 @@
*
* <p>Stopping preview with {@link #stopPreview()}, or triggering still
* image capture with {@link #takePicture(Camera.ShutterCallback,
- * Camera.PictureCallback, Camera.PictureCallback)}, will automatically
- * set the lock to false. However, the lock can be re-enabled before
- * preview is re-started to keep the same white balance parameters.</p>
+ * Camera.PictureCallback, Camera.PictureCallback)}, will not change the
+ * the lock.</p>
*
* <p> Changing the white balance mode with {@link #setWhiteBalance}
* will release the auto-white balance lock if it is set.</p>
*
- * <p>Exposure compensation, in conjunction with re-enabling the AE and
- * AWB locks after each still capture, can be used to capture an
- * exposure-bracketed burst of images, for example. Auto-white balance
- * state, including the lock state, will not be maintained after camera
- * {@link #release()} is called. Locking auto-white balance after
- * {@link #open()} but before the first call to {@link #startPreview()}
- * will not allow the auto-white balance routine to run at all, and may
- * result in severely incorrect color in captured images.</p>
- *
- * <p>The driver may also independently lock auto-white balance after
- * auto-focus completes. If this is undesirable, be sure to always set
- * the auto-white balance lock to false after the
- * {@link AutoFocusCallback#onAutoFocus(boolean, Camera)} callback is
- * received. The {@link #getAutoWhiteBalanceLock()} method can be used
- * after the callback to determine if the camera has locked auto-white
- * balance independently.</p>
+ * <p>Exposure compensation, AE lock, and AWB lock can be used to
+ * capture an exposure-bracketed burst of images, for example.
+ * Auto-white balance state, including the lock state, will not be
+ * maintained after camera {@link #release()} is called. Locking
+ * auto-white balance after {@link #open()} but before the first call to
+ * {@link #startPreview()} will not allow the auto-white balance routine
+ * to run at all, and may result in severely incorrect color in captured
+ * images.</p>
*
* @param toggle new state of the auto-white balance lock. True means
* that auto-white balance is locked, false means that the
@@ -2902,11 +2867,7 @@
*
* @return State of the auto-white balance lock. Returns true if
* auto-white balance is currently locked, and false
- * otherwise. The auto-white balance lock may be independently
- * enabled by the camera subsystem when auto-focus has
- * completed. This method can be used after the
- * {@link AutoFocusCallback#onAutoFocus(boolean, Camera)}
- * callback to determine if the camera has locked AWB.
+ * otherwise.
*
* @see #setAutoWhiteBalanceLock(boolean)
*
diff --git a/core/java/android/net/DnsPinger.java b/core/java/android/net/DnsPinger.java
index 3e27b0d..3291e6b 100644
--- a/core/java/android/net/DnsPinger.java
+++ b/core/java/android/net/DnsPinger.java
@@ -53,7 +53,7 @@
public final class DnsPinger extends Handler {
private static final boolean V = true;
- private static final int RECEIVE_POLL_INTERVAL_MS = 30;
+ private static final int RECEIVE_POLL_INTERVAL_MS = 200;
private static final int DNS_PORT = 53;
/** Short socket timeout so we don't block one any 'receive' call */
@@ -70,6 +70,9 @@
private final ArrayList<InetAddress> mDefaultDns;
private String TAG;
+ //Invalidates old dns requests upon a cancel
+ private AtomicInteger mCurrentToken = new AtomicInteger();
+
private static final int BASE = Protocol.BASE_DNS_PINGER;
/**
@@ -102,6 +105,17 @@
long start = SystemClock.elapsedRealtime();
}
+ /* Message argument for ACTION_PING_DNS */
+ private class DnsArg {
+ InetAddress dns;
+ int seq;
+
+ DnsArg(InetAddress d, int s) {
+ dns = d;
+ seq = s;
+ }
+ }
+
public DnsPinger(Context context, String TAG, Looper looper,
Handler target, int connectionType) {
super(looper);
@@ -122,9 +136,13 @@
public void handleMessage(Message msg) {
switch (msg.what) {
case ACTION_PING_DNS:
+ DnsArg dnsArg = (DnsArg) msg.obj;
+ if (dnsArg.seq != mCurrentToken.get()) {
+ break;
+ }
try {
ActivePing newActivePing = new ActivePing();
- InetAddress dnsAddress = (InetAddress) msg.obj;
+ InetAddress dnsAddress = dnsArg.dns;
newActivePing.internalId = msg.arg1;
newActivePing.timeout = msg.arg2;
newActivePing.socket = new DatagramSocket();
@@ -248,11 +266,13 @@
*/
public int pingDnsAsync(InetAddress dns, int timeout, int delay) {
int id = sCounter.incrementAndGet();
- sendMessageDelayed(obtainMessage(ACTION_PING_DNS, id, timeout, dns), delay);
+ sendMessageDelayed(obtainMessage(ACTION_PING_DNS, id, timeout,
+ new DnsArg(dns, mCurrentToken.get())), delay);
return id;
}
public void cancelPings() {
+ mCurrentToken.incrementAndGet();
obtainMessage(ACTION_CANCEL_ALL_PINGS).sendToTarget();
}
diff --git a/core/java/android/net/NetworkStatsHistory.java b/core/java/android/net/NetworkStatsHistory.java
index a5cdf70..a6635be 100644
--- a/core/java/android/net/NetworkStatsHistory.java
+++ b/core/java/android/net/NetworkStatsHistory.java
@@ -270,6 +270,11 @@
|| entry.operations < 0) {
throw new IllegalArgumentException("tried recording negative data");
}
+ if (entry.rxBytes == 0 && entry.rxPackets == 0 && entry.txBytes == 0 && entry.txPackets == 0
+ && entry.operations == 0) {
+ // nothing to record; skip
+ return;
+ }
// create any buckets needed by this range
ensureBuckets(start, end);
diff --git a/core/java/android/net/NetworkTemplate.java b/core/java/android/net/NetworkTemplate.java
index cd49023..418b82f 100644
--- a/core/java/android/net/NetworkTemplate.java
+++ b/core/java/android/net/NetworkTemplate.java
@@ -19,14 +19,15 @@
import static android.net.ConnectivityManager.TYPE_ETHERNET;
import static android.net.ConnectivityManager.TYPE_WIFI;
import static android.net.ConnectivityManager.TYPE_WIMAX;
-import static android.net.ConnectivityManager.isNetworkTypeMobile;
import static android.net.NetworkIdentity.scrubSubscriberId;
import static android.telephony.TelephonyManager.NETWORK_CLASS_2_G;
import static android.telephony.TelephonyManager.NETWORK_CLASS_3_G;
import static android.telephony.TelephonyManager.NETWORK_CLASS_4_G;
import static android.telephony.TelephonyManager.NETWORK_CLASS_UNKNOWN;
import static android.telephony.TelephonyManager.getNetworkClass;
+import static com.android.internal.util.ArrayUtils.contains;
+import android.content.res.Resources;
import android.os.Parcel;
import android.os.Parcelable;
@@ -52,6 +53,16 @@
public static final int MATCH_ETHERNET = 5;
/**
+ * Set of {@link NetworkInfo#getType()} that reflect data usage.
+ */
+ private static final int[] DATA_USAGE_NETWORK_TYPES;
+
+ static {
+ DATA_USAGE_NETWORK_TYPES = Resources.getSystem().getIntArray(
+ com.android.internal.R.array.config_data_usage_network_types);
+ }
+
+ /**
* Template to combine all {@link ConnectivityManager#TYPE_MOBILE} style
* networks together. Only uses statistics for requested IMSI.
*/
@@ -151,7 +162,7 @@
}
/**
- * Test if this network matches the given template and IMSI.
+ * Test if given {@link NetworkIdentity} matches this template.
*/
public boolean matches(NetworkIdentity ident) {
switch (mMatchRule) {
@@ -171,23 +182,25 @@
}
/**
- * Check if mobile network with matching IMSI. Also matches
- * {@link #TYPE_WIMAX}.
+ * Check if mobile network with matching IMSI.
*/
private boolean matchesMobile(NetworkIdentity ident) {
- if (isNetworkTypeMobile(ident.mType) && Objects.equal(mSubscriberId, ident.mSubscriberId)) {
+ if (ident.mType == TYPE_WIMAX) {
+ // TODO: consider matching against WiMAX subscriber identity
return true;
- } else if (ident.mType == TYPE_WIMAX) {
- return true;
+ } else {
+ return (contains(DATA_USAGE_NETWORK_TYPES, ident.mType)
+ && Objects.equal(mSubscriberId, ident.mSubscriberId));
}
- return false;
}
/**
* Check if mobile network classified 3G or lower with matching IMSI.
*/
private boolean matchesMobile3gLower(NetworkIdentity ident) {
- if (isNetworkTypeMobile(ident.mType) && Objects.equal(mSubscriberId, ident.mSubscriberId)) {
+ if (ident.mType == TYPE_WIMAX) {
+ return false;
+ } else if (matchesMobile(ident)) {
switch (getNetworkClass(ident.mSubType)) {
case NETWORK_CLASS_UNKNOWN:
case NETWORK_CLASS_2_G:
@@ -199,17 +212,17 @@
}
/**
- * Check if mobile network classified 4G with matching IMSI. Also matches
- * {@link #TYPE_WIMAX}.
+ * Check if mobile network classified 4G with matching IMSI.
*/
private boolean matchesMobile4g(NetworkIdentity ident) {
- if (isNetworkTypeMobile(ident.mType) && Objects.equal(mSubscriberId, ident.mSubscriberId)) {
+ if (ident.mType == TYPE_WIMAX) {
+ // TODO: consider matching against WiMAX subscriber identity
+ return true;
+ } else if (matchesMobile(ident)) {
switch (getNetworkClass(ident.mSubType)) {
case NETWORK_CLASS_4_G:
return true;
}
- } else if (ident.mType == TYPE_WIMAX) {
- return true;
}
return false;
}
diff --git a/core/java/android/net/Uri.java b/core/java/android/net/Uri.java
index 2c875c8..9d28eff 100644
--- a/core/java/android/net/Uri.java
+++ b/core/java/android/net/Uri.java
@@ -353,6 +353,48 @@
public abstract String toString();
/**
+ * Return a string representation of the URI that is safe to print
+ * to logs and other places where PII should be avoided.
+ * @hide
+ */
+ public String toSafeString() {
+ String scheme = getScheme();
+ String ssp = getSchemeSpecificPart();
+ if (scheme != null) {
+ if (scheme.equalsIgnoreCase("tel") || scheme.equalsIgnoreCase("sip")
+ || scheme.equalsIgnoreCase("sms") || scheme.equalsIgnoreCase("smsto")
+ || scheme.equalsIgnoreCase("mailto")) {
+ StringBuilder builder = new StringBuilder(64);
+ builder.append(scheme);
+ builder.append(':');
+ if (ssp != null) {
+ for (int i=0; i<ssp.length(); i++) {
+ char c = ssp.charAt(i);
+ if (c == '-' || c == '@' || c == '.') {
+ builder.append(c);
+ } else {
+ builder.append('x');
+ }
+ }
+ }
+ return builder.toString();
+ }
+ }
+ // Not a sensitive scheme, but let's still be conservative about
+ // the data we include -- only the ssp, not the query params or
+ // fragment, because those can often have sensitive info.
+ StringBuilder builder = new StringBuilder(64);
+ if (scheme != null) {
+ builder.append(scheme);
+ builder.append(':');
+ }
+ if (ssp != null) {
+ builder.append(ssp);
+ }
+ return builder.toString();
+ }
+
+ /**
* Constructs a new builder, copying the attributes from this Uri.
*/
public abstract Builder buildUpon();
diff --git a/core/java/android/nfc/NfcAdapter.java b/core/java/android/nfc/NfcAdapter.java
index e392bca..fe0106d 100644
--- a/core/java/android/nfc/NfcAdapter.java
+++ b/core/java/android/nfc/NfcAdapter.java
@@ -208,7 +208,9 @@
final NfcActivityManager mNfcActivityManager;
/**
- * @see {@link #setNdefPushMessageCallback}
+ * A callback to be invoked when the system successfully delivers your {@link NdefMessage}
+ * to another device.
+ * @see #setOnNdefPushCompleteCallback
*/
public interface OnNdefPushCompleteCallback {
/**
@@ -217,13 +219,21 @@
* <p>This callback is usually made on a binder thread (not the UI thread).
*
* @param event {@link NfcEvent} with the {@link NfcEvent#nfcAdapter} field set
- * @see {@link #setNdefPushMessageCallback}
+ * @see #setNdefPushMessageCallback
*/
public void onNdefPushComplete(NfcEvent event);
}
/**
- * @see {@link #setCeateNdefMessageCallback}
+ * A callback to be invoked when another NFC device capable of NDEF push (Android Beam)
+ * is within range.
+ * <p>Implement this interface and pass it to {@link
+ * NfcAdapter#setNdefPushMessageCallback setNdefPushMessageCallback()} in order to create an
+ * {@link NdefMessage} at the moment that another device is within range for NFC. Using this
+ * callback allows you to create a message with data that might vary based on the
+ * content currently visible to the user. Alternatively, you can call {@link
+ * #setNdefPushMessage setNdefPushMessage()} if the {@link NdefMessage} always contains the
+ * same data.
*/
public interface CreateNdefMessageCallback {
/**
@@ -507,13 +517,15 @@
* <p>Pass a null NDEF message to disable foreground NDEF push in the
* specified activities.
*
- * <p>One or more activities must be specified.
+ * <p>At least one activity must be specified, and usually only one is necessary.
*
* <p class="note">Requires the {@link android.Manifest.permission#NFC} permission.
*
* @param message NDEF message to push over NFC, or null to disable
- * @param activity an activity to enable for NDEF push (at least one is required)
- * @param activities zero or more additional activities to enable for NDEF Push
+ * @param activity an activity in which NDEF push should be enabled to share the provided
+ * NDEF message
+ * @param activities optional additional activities that should also enable NDEF push with
+ * the provided NDEF message
*/
public void setNdefPushMessage(NdefMessage message, Activity activity,
Activity ... activities) {
@@ -544,13 +556,15 @@
* <p>Pass a null callback to disable the callback in the
* specified activities.
*
- * <p>One or more activities must be specified.
+ * <p>At least one activity must be specified, and usually only one is necessary.
*
* <p class="note">Requires the {@link android.Manifest.permission#NFC} permission.
*
* @param callback callback, or null to disable
- * @param activity an activity to enable for NDEF push (at least one is required)
- * @param activities zero or more additional activities to enable for NDEF Push
+ * @param activity an activity in which NDEF push should be enabled to share an NDEF message
+ * that's retrieved from the provided callback
+ * @param activities optional additional activities that should also enable NDEF push using
+ * the provided callback
*/
public void setNdefPushMessageCallback(CreateNdefMessageCallback callback, Activity activity,
Activity ... activities) {
diff --git a/core/java/android/nfc/NfcEvent.java b/core/java/android/nfc/NfcEvent.java
index b00d8b7..860700a 100644
--- a/core/java/android/nfc/NfcEvent.java
+++ b/core/java/android/nfc/NfcEvent.java
@@ -29,8 +29,8 @@
* in the callback) because it allows new fields to be added without breaking
* API compatibility.
*
- * @see {@link NfcAdapter.OnNdefPushCompleteCallback#onNdefPushComplete}
- * @see {@link NfcAdapter.CreateNdefMessageCallback#createNdefMessage}
+ * @see NfcAdapter.OnNdefPushCompleteCallback#onNdefPushComplete
+ * @see NfcAdapter.CreateNdefMessageCallback#createNdefMessage
*/
public final class NfcEvent {
/**
diff --git a/core/java/android/preference/PreferenceScreen.java b/core/java/android/preference/PreferenceScreen.java
index 45e3a4c..dd9dd25 100644
--- a/core/java/android/preference/PreferenceScreen.java
+++ b/core/java/android/preference/PreferenceScreen.java
@@ -25,6 +25,7 @@
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.View;
+import android.view.Window;
import android.widget.Adapter;
import android.widget.AdapterView;
import android.widget.ListAdapter;
@@ -156,13 +157,13 @@
// Set the title bar if title is available, else no title bar
final CharSequence title = getTitle();
- Dialog dialog = mDialog = new Dialog(context, TextUtils.isEmpty(title)
- ? com.android.internal.R.style.Theme_NoTitleBar
- : com.android.internal.R.style.Theme);
- dialog.setContentView(mListView);
- if (!TextUtils.isEmpty(title)) {
+ Dialog dialog = mDialog = new Dialog(context, context.getThemeResId());
+ if (TextUtils.isEmpty(title)) {
+ dialog.getWindow().requestFeature(Window.FEATURE_NO_TITLE);
+ } else {
dialog.setTitle(title);
}
+ dialog.setContentView(mListView);
dialog.setOnDismissListener(this);
if (state != null) {
dialog.onRestoreInstanceState(state);
diff --git a/core/java/android/provider/ContactsContract.java b/core/java/android/provider/ContactsContract.java
index ca1d0d9..fb119b3 100644
--- a/core/java/android/provider/ContactsContract.java
+++ b/core/java/android/provider/ContactsContract.java
@@ -2983,8 +2983,9 @@
* long streamItemId = ContentUris.parseId(streamItemUri);
* </pre>
* </dd>
- * <dt>Via the {@link StreamItems#CONTENT_URI} URI:</dt>
+ * <dt>Via {@link StreamItems#CONTENT_URI}:</dt>
* <dd>
+ *<pre>
* ContentValues values = new ContentValues();
* values.put(StreamItems.RAW_CONTACT_ID, rawContactId);
* values.put(StreamItems.TEXT, "Breakfasted at Tiffanys");
@@ -2992,6 +2993,7 @@
* values.put(StreamItems.COMMENTS, "3 people reshared this");
* Uri streamItemUri = getContentResolver().insert(StreamItems.CONTENT_URI, values);
* long streamItemId = ContentUris.parseId(streamItemUri);
+ *</pre>
* </dd>
* </dl>
* </dd>
@@ -3012,7 +3014,7 @@
* StreamItems.StreamItemPhotos.CONTENT_DIRECTORY), values);
* </pre>
* </dd>
- * <dt>Via {@link ContactsContract.StreamItems#CONTENT_PHOTO_URI}</dt>
+ * <dt>Via {@link ContactsContract.StreamItems#CONTENT_PHOTO_URI}:</dt>
* <dd>
* <pre>
* values.clear();
@@ -3021,7 +3023,7 @@
* values.put(StreamItemPhotos.PHOTO, photoData);
* getContentResolver().insert(StreamItems.CONTENT_PHOTO_URI, values);
* </pre>
- * Note that this latter form allows the insertion of a stream item and its
+ * <p>Note that this latter form allows the insertion of a stream item and its
* photos in a single transaction, by using {@link ContentProviderOperation} with
* back references to populate the stream item ID in the {@link ContentValues}.
* </dd>
diff --git a/core/java/android/text/DynamicLayout.java b/core/java/android/text/DynamicLayout.java
index 2f9852d..f82c9c4 100644
--- a/core/java/android/text/DynamicLayout.java
+++ b/core/java/android/text/DynamicLayout.java
@@ -275,7 +275,7 @@
}
if (reflowed == null) {
- reflowed = new StaticLayout(getText());
+ reflowed = new StaticLayout(null);
} else {
reflowed.prepare();
}
@@ -488,7 +488,7 @@
private int mTopPadding, mBottomPadding;
- private static StaticLayout sStaticLayout = null;
+ private static StaticLayout sStaticLayout = new StaticLayout(null);
private static final Object[] sLock = new Object[0];
diff --git a/core/java/android/text/SpannableStringBuilder.java b/core/java/android/text/SpannableStringBuilder.java
index 5fed775..fdbec20 100644
--- a/core/java/android/text/SpannableStringBuilder.java
+++ b/core/java/android/text/SpannableStringBuilder.java
@@ -709,8 +709,6 @@
T ret1 = null;
for (int i = 0; i < spanCount; i++) {
- if (!kind.isInstance(spans[i])) continue;
-
int spanStart = starts[i];
int spanEnd = ends[i];
@@ -735,6 +733,9 @@
continue;
}
+ // Expensive test, should be performed after the previous tests
+ if (!kind.isInstance(spans[i])) continue;
+
if (count == 0) {
// Safe conversion thanks to the isInstance test above
ret1 = (T) spans[i];
diff --git a/core/java/android/text/StaticLayout.java b/core/java/android/text/StaticLayout.java
index e8b2045..583cbe6 100644
--- a/core/java/android/text/StaticLayout.java
+++ b/core/java/android/text/StaticLayout.java
@@ -763,7 +763,8 @@
return;
}
- float ellipsisWidth = paint.measureText(HORIZONTAL_ELLIPSIS);
+ float ellipsisWidth = paint.measureText(
+ (where == TextUtils.TruncateAt.END_SMALL) ? ELLIPSIS_TWO_DOTS : ELLIPSIS_NORMAL);
int ellipsisStart = 0;
int ellipsisCount = 0;
int len = lineEnd - lineStart;
@@ -791,7 +792,8 @@
Log.w(TAG, "Start Ellipsis only supported with one line");
}
}
- } else if (where == TextUtils.TruncateAt.END || where == TextUtils.TruncateAt.MARQUEE) {
+ } else if (where == TextUtils.TruncateAt.END || where == TextUtils.TruncateAt.MARQUEE ||
+ where == TextUtils.TruncateAt.END_SMALL) {
float sum = 0;
int i;
@@ -1001,7 +1003,9 @@
private static final char CHAR_HYPHEN = '-';
private static final double EXTRA_ROUNDING = 0.5;
- private static final String HORIZONTAL_ELLIPSIS = "\u2026"; // this is "..."
+
+ private static final String ELLIPSIS_NORMAL = "\u2026"; // this is "..."
+ private static final String ELLIPSIS_TWO_DOTS = "\u2025"; // this is ".."
private static final int CHAR_FIRST_HIGH_SURROGATE = 0xD800;
private static final int CHAR_LAST_LOW_SURROGATE = 0xDFFF;
diff --git a/core/java/android/text/TextLine.java b/core/java/android/text/TextLine.java
index a52d48e..68fea19 100644
--- a/core/java/android/text/TextLine.java
+++ b/core/java/android/text/TextLine.java
@@ -30,6 +30,8 @@
import com.android.internal.util.ArrayUtils;
+import java.lang.reflect.Array;
+
/**
* Represents a line of styled text, for measuring in visual order and
* for rendering.
@@ -679,6 +681,12 @@
wp.getFontMetricsInt(fmi);
+ updateMetrics(fmi, previousTop, previousAscent, previousDescent, previousBottom,
+ previousLeading);
+ }
+
+ static void updateMetrics(FontMetricsInt fmi, int previousTop, int previousAscent,
+ int previousDescent, int previousBottom, int previousLeading) {
fmi.top = Math.min(fmi.top, previousTop);
fmi.ascent = Math.min(fmi.ascent, previousAscent);
fmi.descent = Math.max(fmi.descent, previousDescent);
@@ -809,7 +817,28 @@
int textLimit = mStart + limit;
if (needWidth || (c != null && runIsRtl)) {
+ int previousTop = 0;
+ int previousAscent = 0;
+ int previousDescent = 0;
+ int previousBottom = 0;
+ int previousLeading = 0;
+
+ boolean needUpdateMetrics = (fmi != null);
+
+ if (needUpdateMetrics) {
+ previousTop = fmi.top;
+ previousAscent = fmi.ascent;
+ previousDescent = fmi.descent;
+ previousBottom = fmi.bottom;
+ previousLeading = fmi.leading;
+ }
+
ret = replacement.getSize(wp, mText, textStart, textLimit, fmi);
+
+ if (needUpdateMetrics) {
+ updateMetrics(fmi, previousTop, previousAscent, previousDescent, previousBottom,
+ previousLeading);
+ }
}
if (c != null) {
@@ -823,6 +852,73 @@
return runIsRtl ? -ret : ret;
}
+ private static class SpanSet<E> {
+ final int numberOfSpans;
+ final E[] spans;
+ final int[] spanStarts;
+ final int[] spanEnds;
+ final int[] spanFlags;
+
+ @SuppressWarnings("unchecked")
+ SpanSet(Spanned spanned, int start, int limit, Class<? extends E> type) {
+ final E[] allSpans = spanned.getSpans(start, limit, type);
+ final int length = allSpans.length;
+ // These arrays may end up being too large because of empty spans
+ spans = (E[]) Array.newInstance(type, length);
+ spanStarts = new int[length];
+ spanEnds = new int[length];
+ spanFlags = new int[length];
+
+ int count = 0;
+ for (int i = 0; i < length; i++) {
+ final E span = allSpans[i];
+
+ final int spanStart = spanned.getSpanStart(span);
+ final int spanEnd = spanned.getSpanEnd(span);
+ if (spanStart == spanEnd) continue;
+
+ final int spanFlag = spanned.getSpanFlags(span);
+ final int priority = spanFlag & Spanned.SPAN_PRIORITY;
+ if (priority != 0 && count != 0) {
+ int j;
+
+ for (j = 0; j < count; j++) {
+ final int otherPriority = spanFlags[j] & Spanned.SPAN_PRIORITY;
+ if (priority > otherPriority) break;
+ }
+
+ System.arraycopy(spans, j, spans, j + 1, count - j);
+ System.arraycopy(spanStarts, j, spanStarts, j + 1, count - j);
+ System.arraycopy(spanEnds, j, spanEnds, j + 1, count - j);
+ System.arraycopy(spanFlags, j, spanFlags, j + 1, count - j);
+
+ spans[j] = span;
+ spanStarts[j] = spanStart;
+ spanEnds[j] = spanEnd;
+ spanFlags[j] = spanFlag;
+ } else {
+ spans[i] = span;
+ spanStarts[i] = spanStart;
+ spanEnds[i] = spanEnd;
+ spanFlags[i] = spanFlag;
+ }
+
+ count++;
+ }
+ numberOfSpans = count;
+ }
+
+ int getNextTransition(int start, int limit) {
+ for (int i = 0; i < numberOfSpans; i++) {
+ final int spanStart = spanStarts[i];
+ final int spanEnd = spanEnds[i];
+ if (spanStart > start && spanStart < limit) limit = spanStart;
+ if (spanEnd > start && spanEnd < limit) limit = spanEnd;
+ }
+ return limit;
+ }
+ }
+
/**
* Utility function for handling a unidirectional run. The run must not
* contain tabs or emoji but can contain styles.
@@ -856,66 +952,70 @@
return 0f;
}
+ if (mSpanned == null) {
+ TextPaint wp = mWorkPaint;
+ wp.set(mPaint);
+ final int mlimit = measureLimit;
+ return handleText(wp, start, mlimit, start, limit, runIsRtl, c, x, top,
+ y, bottom, fmi, needWidth || mlimit < measureLimit);
+ }
+
+ final SpanSet<MetricAffectingSpan> metricAffectingSpans = new SpanSet<MetricAffectingSpan>(
+ mSpanned, mStart + start, mStart + limit, MetricAffectingSpan.class);
+ final SpanSet<CharacterStyle> characterStyleSpans = new SpanSet<CharacterStyle>(
+ mSpanned, mStart + start, mStart + limit, CharacterStyle.class);
+
// Shaping needs to take into account context up to metric boundaries,
// but rendering needs to take into account character style boundaries.
// So we iterate through metric runs to get metric bounds,
// then within each metric run iterate through character style runs
// for the run bounds.
- float ox = x;
+ final float originalX = x;
for (int i = start, inext; i < measureLimit; i = inext) {
TextPaint wp = mWorkPaint;
wp.set(mPaint);
- int mlimit;
- if (mSpanned == null) {
- inext = limit;
- mlimit = measureLimit;
- } else {
- inext = mSpanned.nextSpanTransition(mStart + i, mStart + limit,
- MetricAffectingSpan.class) - mStart;
+ inext = metricAffectingSpans.getNextTransition(mStart + i, mStart + limit) - mStart;
+ int mlimit = Math.min(inext, measureLimit);
- mlimit = inext < measureLimit ? inext : measureLimit;
- MetricAffectingSpan[] spans = mSpanned.getSpans(mStart + i,
- mStart + mlimit, MetricAffectingSpan.class);
- spans = TextUtils.removeEmptySpans(spans, mSpanned, MetricAffectingSpan.class);
+ ReplacementSpan replacement = null;
- if (spans.length > 0) {
- ReplacementSpan replacement = null;
- for (int j = 0; j < spans.length; j++) {
- MetricAffectingSpan span = spans[j];
- if (span instanceof ReplacementSpan) {
- replacement = (ReplacementSpan)span;
- } else {
- // We might have a replacement that uses the draw
- // state, otherwise measure state would suffice.
- span.updateDrawState(wp);
- }
- }
-
- if (replacement != null) {
- x += handleReplacement(replacement, wp, i,
- mlimit, runIsRtl, c, x, top, y, bottom, fmi,
- needWidth || mlimit < measureLimit);
- continue;
- }
+ for (int j = 0; j < metricAffectingSpans.numberOfSpans; j++) {
+ // Both intervals [spanStarts..spanEnds] and [mStart + i..mStart + mlimit] are NOT
+ // empty by construction. This special case in getSpans() explains the >= & <= tests
+ if ((metricAffectingSpans.spanStarts[j] >= mStart + mlimit) ||
+ (metricAffectingSpans.spanEnds[j] <= mStart + i)) continue;
+ MetricAffectingSpan span = metricAffectingSpans.spans[j];
+ if (span instanceof ReplacementSpan) {
+ replacement = (ReplacementSpan)span;
+ } else {
+ // We might have a replacement that uses the draw
+ // state, otherwise measure state would suffice.
+ span.updateDrawState(wp);
}
}
- if (mSpanned == null || c == null) {
+ if (replacement != null) {
+ x += handleReplacement(replacement, wp, i, mlimit, runIsRtl, c, x, top, y,
+ bottom, fmi, needWidth || mlimit < measureLimit);
+ continue;
+ }
+
+ if (c == null) {
x += handleText(wp, i, mlimit, i, inext, runIsRtl, c, x, top,
y, bottom, fmi, needWidth || mlimit < measureLimit);
} else {
for (int j = i, jnext; j < mlimit; j = jnext) {
- jnext = mSpanned.nextSpanTransition(mStart + j,
- mStart + mlimit, CharacterStyle.class) - mStart;
-
- CharacterStyle[] spans = mSpanned.getSpans(mStart + j,
- mStart + jnext, CharacterStyle.class);
- spans = TextUtils.removeEmptySpans(spans, mSpanned, CharacterStyle.class);
+ jnext = characterStyleSpans.getNextTransition(mStart + j, mStart + mlimit) -
+ mStart;
wp.set(mPaint);
- for (int k = 0; k < spans.length; k++) {
- CharacterStyle span = spans[k];
+ for (int k = 0; k < characterStyleSpans.numberOfSpans; k++) {
+ // Intentionally using >= and <= as explained above
+ if ((characterStyleSpans.spanStarts[k] >= mStart + jnext) ||
+ (characterStyleSpans.spanEnds[k] <= mStart + j)) continue;
+
+ CharacterStyle span = characterStyleSpans.spans[k];
span.updateDrawState(wp);
}
@@ -925,7 +1025,7 @@
}
}
- return x - ox;
+ return x - originalX;
}
/**
@@ -970,8 +1070,7 @@
}
pos += mStart;
- MetricAffectingSpan[] spans = mSpanned.getSpans(pos, pos + 1,
- MetricAffectingSpan.class);
+ MetricAffectingSpan[] spans = mSpanned.getSpans(pos, pos + 1, MetricAffectingSpan.class);
if (spans.length == 0) {
return mPaint.ascent();
}
diff --git a/core/java/android/text/TextUtils.java b/core/java/android/text/TextUtils.java
index 894afbd..95a3cdc 100644
--- a/core/java/android/text/TextUtils.java
+++ b/core/java/android/text/TextUtils.java
@@ -53,9 +53,8 @@
import java.util.regex.Pattern;
public class TextUtils {
- private TextUtils() { /* cannot be instantiated */ }
- private static String[] EMPTY_STRING_ARRAY = new String[]{};
+ private TextUtils() { /* cannot be instantiated */ }
public static void getChars(CharSequence s, int start, int end,
char[] dest, int destoff) {
@@ -1000,6 +999,10 @@
MIDDLE,
END,
MARQUEE,
+ /**
+ * @hide
+ */
+ END_SMALL
}
public interface EllipsizeCallback {
@@ -1010,8 +1013,6 @@
public void ellipsized(int start, int end);
}
- private static String sEllipsis = null;
-
/**
* Returns the original text if it fits in the specified width
* given the properties of the specified Paint,
@@ -1042,7 +1043,8 @@
boolean preserveLength,
EllipsizeCallback callback) {
return ellipsize(text, paint, avail, where, preserveLength, callback,
- TextDirectionHeuristics.FIRSTSTRONG_LTR);
+ TextDirectionHeuristics.FIRSTSTRONG_LTR,
+ (where == TruncateAt.END_SMALL) ? ELLIPSIS_TWO_DOTS : ELLIPSIS_NORMAL);
}
/**
@@ -1063,11 +1065,7 @@
float avail, TruncateAt where,
boolean preserveLength,
EllipsizeCallback callback,
- TextDirectionHeuristic textDir) {
- if (sEllipsis == null) {
- Resources r = Resources.getSystem();
- sEllipsis = r.getString(R.string.ellipsis);
- }
+ TextDirectionHeuristic textDir, String ellipsis) {
int len = text.length();
@@ -1085,7 +1083,7 @@
// XXX assumes ellipsis string does not require shaping and
// is unaffected by style
- float ellipsiswid = paint.measureText(sEllipsis);
+ float ellipsiswid = paint.measureText(ellipsis);
avail -= ellipsiswid;
int left = 0;
@@ -1094,7 +1092,7 @@
// it all goes
} else if (where == TruncateAt.START) {
right = len - mt.breakText(0, len, false, avail);
- } else if (where == TruncateAt.END) {
+ } else if (where == TruncateAt.END || where == TruncateAt.END_SMALL) {
left = mt.breakText(0, len, true, avail);
} else {
right = len - mt.breakText(0, len, false, avail / 2);
@@ -1112,10 +1110,10 @@
int remaining = len - (right - left);
if (preserveLength) {
if (remaining > 0) { // else eliminate the ellipsis too
- buf[left++] = '\u2026';
+ buf[left++] = ellipsis.charAt(0);
}
for (int i = left; i < right; i++) {
- buf[i] = '\uFEFF';
+ buf[i] = ZWNBS_CHAR;
}
String s = new String(buf, 0, len);
if (sp == null) {
@@ -1131,16 +1129,16 @@
}
if (sp == null) {
- StringBuilder sb = new StringBuilder(remaining + sEllipsis.length());
+ StringBuilder sb = new StringBuilder(remaining + ellipsis.length());
sb.append(buf, 0, left);
- sb.append(sEllipsis);
+ sb.append(ellipsis);
sb.append(buf, right, len - right);
return sb.toString();
}
SpannableStringBuilder ssb = new SpannableStringBuilder();
ssb.append(text, 0, left);
- ssb.append(sEllipsis);
+ ssb.append(ellipsis);
ssb.append(text, right, len);
return ssb;
} finally {
@@ -1664,4 +1662,13 @@
private static Object sLock = new Object();
private static char[] sTemp = null;
+
+ private static String[] EMPTY_STRING_ARRAY = new String[]{};
+
+ private static final char ZWNBS_CHAR = '\uFEFF';
+
+ private static final String ELLIPSIS_NORMAL = Resources.getSystem().getString(
+ R.string.ellipsis);
+ private static final String ELLIPSIS_TWO_DOTS = Resources.getSystem().getString(
+ R.string.ellipsis_two_dots);
}
diff --git a/core/java/android/view/IWindowManager.aidl b/core/java/android/view/IWindowManager.aidl
index 55c821d..45f9da2 100644
--- a/core/java/android/view/IWindowManager.aidl
+++ b/core/java/android/view/IWindowManager.aidl
@@ -116,6 +116,7 @@
boolean isKeyguardLocked();
boolean isKeyguardSecure();
boolean inKeyguardRestrictedInputMode();
+ void dismissKeyguard();
void closeSystemDialogs(String reason);
diff --git a/core/java/android/view/TextureView.java b/core/java/android/view/TextureView.java
index c735d6b..c974ba1 100644
--- a/core/java/android/view/TextureView.java
+++ b/core/java/android/view/TextureView.java
@@ -93,6 +93,11 @@
* been invoked.) It is therefore highly recommended you use a listener to
* be notified when the SurfaceTexture becomes available.</p>
*
+ * <p>It is important to note that only one producer can use the TextureView.
+ * For instance, if you use a TextureView to display the camera preview, you
+ * cannot use {@link #lockCanvas()} to draw onto the TextureView at the same
+ * time.</p>
+ *
* @see SurfaceView
* @see SurfaceTexture
*/
@@ -523,6 +528,10 @@
* rectangle is specified, in which case, non-dirty pixels will be
* preserved.</p>
*
+ * <p>This method can only be used if the underlying surface is not already
+ * owned by another producer. For instance, if the TextureView is being used
+ * to render the camera's preview you cannot invoke this method.</p>
+ *
* @return A Canvas used to draw into the surface.
*
* @see #lockCanvas(android.graphics.Rect)
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index f993160..3c67521 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -81,7 +81,6 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Locale;
-import java.util.WeakHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
/**
@@ -1497,12 +1496,7 @@
/**
* Map used to store views' tags.
*/
- private static WeakHashMap<View, SparseArray<Object>> sTags;
-
- /**
- * Lock used to access sTags.
- */
- private static final Object sTagsLock = new Object();
+ private SparseArray<Object> mKeyedTags;
/**
* The next available accessiiblity id.
@@ -3900,6 +3894,12 @@
* Note: Called from the default {@link AccessibilityDelegate}.
*/
boolean dispatchPopulateAccessibilityEventInternal(AccessibilityEvent event) {
+ // Do not populate text to scroll events. They describe position change
+ // and usually come from container with a lot of text which is not very
+ // informative for accessibility purposes. Also they are fired frequently.
+ if (event.getEventType() == AccessibilityEvent.TYPE_VIEW_SCROLLED) {
+ return true;
+ }
onPopulateAccessibilityEvent(event);
return false;
}
@@ -12236,14 +12236,7 @@
* @see #getTag()
*/
public Object getTag(int key) {
- SparseArray<Object> tags = null;
- synchronized (sTagsLock) {
- if (sTags != null) {
- tags = sTags.get(this);
- }
- }
-
- if (tags != null) return tags.get(key);
+ if (mKeyedTags != null) return mKeyedTags.get(key);
return null;
}
@@ -12276,7 +12269,7 @@
+ "resource id.");
}
- setTagInternal(this, key, tag);
+ setKeyedTag(key, tag);
}
/**
@@ -12291,27 +12284,15 @@
+ "resource id.");
}
- setTagInternal(this, key, tag);
+ setKeyedTag(key, tag);
}
- private static void setTagInternal(View view, int key, Object tag) {
- SparseArray<Object> tags = null;
- synchronized (sTagsLock) {
- if (sTags == null) {
- sTags = new WeakHashMap<View, SparseArray<Object>>();
- } else {
- tags = sTags.get(view);
- }
+ private void setKeyedTag(int key, Object tag) {
+ if (mKeyedTags == null) {
+ mKeyedTags = new SparseArray<Object>();
}
- if (tags == null) {
- tags = new SparseArray<Object>(2);
- synchronized (sTagsLock) {
- sTags.put(view, tags);
- }
- }
-
- tags.put(key, tag);
+ mKeyedTags.put(key, tag);
}
/**
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java
index b678c7d..28e4485 100644
--- a/core/java/android/view/ViewGroup.java
+++ b/core/java/android/view/ViewGroup.java
@@ -2176,13 +2176,15 @@
@Override
boolean dispatchPopulateAccessibilityEventInternal(AccessibilityEvent event) {
- // We first get a chance to populate the event.
- super.dispatchPopulateAccessibilityEventInternal(event);
+ boolean handled = super.dispatchPopulateAccessibilityEventInternal(event);
+ if (handled) {
+ return handled;
+ }
// Let our children have a shot in populating the event.
for (int i = 0, count = getChildCount(); i < count; i++) {
View child = getChildAt(i);
if ((child.mViewFlags & VISIBILITY_MASK) == VISIBLE) {
- boolean handled = getChildAt(i).dispatchPopulateAccessibilityEvent(event);
+ handled = getChildAt(i).dispatchPopulateAccessibilityEvent(event);
if (handled) {
return handled;
}
@@ -2822,6 +2824,13 @@
if (hasDisplayList) {
displayList = child.getDisplayList();
+ if (!displayList.isValid()) {
+ // Uncommon, but possible. If a view is removed from the hierarchy during the call
+ // to getDisplayList(), the display list will be marked invalid and we should not
+ // try to use it again.
+ displayList = null;
+ hasDisplayList = false;
+ }
}
if (hasNoCache) {
diff --git a/core/java/android/view/WindowManagerPolicy.java b/core/java/android/view/WindowManagerPolicy.java
index 1dbb083..4f67675 100644
--- a/core/java/android/view/WindowManagerPolicy.java
+++ b/core/java/android/view/WindowManagerPolicy.java
@@ -850,6 +850,11 @@
public boolean inKeyguardRestrictedKeyInputMode();
/**
+ * Ask the policy to dismiss the keyguard, if it is currently shown.
+ */
+ public void dismissKeyguardLw();
+
+ /**
* Given an orientation constant, returns the appropriate surface rotation,
* taking into account sensors, docking mode, rotation lock, and other factors.
*
@@ -876,6 +881,13 @@
public boolean rotationHasCompatibleMetricsLw(int orientation, int rotation);
/**
+ * Called by the window manager when the rotation changes.
+ *
+ * @param rotation The new rotation.
+ */
+ public void setRotationLw(int rotation);
+
+ /**
* Called when the system is mostly done booting to determine whether
* the system should go into safe mode.
*/
diff --git a/core/java/android/view/WindowOrientationListener.java b/core/java/android/view/WindowOrientationListener.java
index 726bf4a..c3c74a7 100755
--- a/core/java/android/view/WindowOrientationListener.java
+++ b/core/java/android/view/WindowOrientationListener.java
@@ -26,7 +26,7 @@
/**
* A special helper class used by the WindowManager
- * for receiving notifications from the SensorManager when
+ * for receiving notifications from the SensorManager when
* the orientation of the device has changed.
*
* NOTE: If changing anything here, please run the API demo
@@ -54,6 +54,7 @@
private Sensor mSensor;
private SensorEventListenerImpl mSensorEventListener;
boolean mLogEnabled;
+ int mCurrentRotation = -1;
/**
* Creates a new WindowOrientationListener.
@@ -117,12 +118,25 @@
}
/**
- * Gets the current orientation.
- * @return The current rotation, or -1 if unknown.
+ * Sets the current rotation.
+ *
+ * @param rotation The current rotation.
*/
- public int getCurrentRotation() {
+ public void setCurrentRotation(int rotation) {
+ mCurrentRotation = rotation;
+ }
+
+ /**
+ * Gets the proposed rotation.
+ *
+ * This method only returns a rotation if the orientation listener is certain
+ * of its proposal. If the rotation is indeterminate, returns -1.
+ *
+ * @return The proposed rotation, or -1 if unknown.
+ */
+ public int getProposedRotation() {
if (mEnabled) {
- return mSensorEventListener.getCurrentRotation();
+ return mSensorEventListener.getProposedRotation();
}
return -1;
}
@@ -137,10 +151,14 @@
/**
* Called when the rotation view of the device has changed.
*
+ * This method is called whenever the orientation becomes certain of an orientation.
+ * It is called each time the orientation determination transitions from being
+ * uncertain to being certain again, even if it is the same orientation as before.
+ *
* @param rotation The new orientation of the device, one of the Surface.ROTATION_* constants.
* @see Surface
*/
- public abstract void onOrientationChanged(int rotation);
+ public abstract void onProposedRotationChanged(int rotation);
/**
* Enables or disables the window orientation listener logging for use with
@@ -182,23 +200,8 @@
* to the corresponding orientation. These thresholds have some hysteresis built-in
* to avoid oscillations between adjacent orientations.
*
- * - Use the magnitude to judge the confidence of the orientation.
- * Under ideal conditions, the magnitude should equal to that of gravity. When it
- * differs significantly, we know the device is under external acceleration and
- * we can't trust the data.
- *
- * - Use the tilt angle to judge the confidence of the orientation.
- * When the tilt angle is high in absolute value then the device is nearly flat
- * so small physical movements produce large changes in orientation angle.
- * This can be the case when the device is being picked up from a table.
- *
- * - Use the orientation angle to judge the confidence of the orientation.
- * The close the orientation angle is to the canonical orientation angle, the better.
- *
- * - Based on the aggregate confidence, we determine how long we want to wait for
- * the new orientation to settle. This is accomplished by integrating the confidence
- * for each orientation over time. When a threshold integration sum is reached
- * then we actually change orientations.
+ * - Wait for the device to settle for a little bit. Once that happens, issue the
+ * new orientation proposal.
*
* Details are explained inline.
*/
@@ -211,22 +214,8 @@
private static final int ACCELEROMETER_DATA_Y = 1;
private static final int ACCELEROMETER_DATA_Z = 2;
- // Rotation constants.
- // These are the same as Surface rotation constants with the addition of a 5th
- // unknown state when we are not confident about the proporsed orientation.
- // One important property of these constants is that they are equal to the
- // orientation angle itself divided by 90. We use this fact to map
- // back and forth between orientation angles and rotation values.
- private static final int ROTATION_UNKNOWN = -1;
- //private static final int ROTATION_0 = Surface.ROTATION_0; // 0
- //private static final int ROTATION_90 = Surface.ROTATION_90; // 1
- //private static final int ROTATION_180 = Surface.ROTATION_180; // 2
- //private static final int ROTATION_270 = Surface.ROTATION_270; // 3
-
private final WindowOrientationListener mOrientationListener;
- private int mRotation = ROTATION_UNKNOWN;
-
/* State for first order low-pass filtering of accelerometer data.
* See http://en.wikipedia.org/wiki/Low-pass_filter#Discrete-time_realization for
* signal processing background.
@@ -235,6 +224,24 @@
private long mLastTimestamp = Long.MAX_VALUE; // in nanoseconds
private float mLastFilteredX, mLastFilteredY, mLastFilteredZ;
+ // The current proposal. We wait for the proposal to be stable for a
+ // certain amount of time before accepting it.
+ //
+ // The basic idea is to ignore intermediate poses of the device while the
+ // user is picking up, putting down or turning the device.
+ private int mProposalRotation;
+ private long mProposalAgeMS;
+
+ // A historical trace of tilt and orientation angles. Used to determine whether
+ // the device posture has settled down.
+ private static final int HISTORY_SIZE = 20;
+ private int mHistoryIndex; // index of most recent sample
+ private int mHistoryLength; // length of historical trace
+ private final long[] mHistoryTimestampMS = new long[HISTORY_SIZE];
+ private final float[] mHistoryMagnitudes = new float[HISTORY_SIZE];
+ private final int[] mHistoryTiltAngles = new int[HISTORY_SIZE];
+ private final int[] mHistoryOrientationAngles = new int[HISTORY_SIZE];
+
// The maximum sample inter-arrival time in milliseconds.
// If the acceleration samples are further apart than this amount in time, we reset the
// state of the low-pass filter and orientation properties. This helps to handle
@@ -242,24 +249,26 @@
// a significant gap in samples.
private static final float MAX_FILTER_DELTA_TIME_MS = 1000;
- // The acceleration filter cutoff frequency.
- // This is the frequency at which signals are attenuated by 3dB (half the passband power).
+ // The acceleration filter time constant.
+ //
+ // This time constant is used to tune the acceleration filter such that
+ // impulses and vibrational noise (think car dock) is suppressed before we
+ // try to calculate the tilt and orientation angles.
+ //
+ // The filter time constant is related to the filter cutoff frequency, which is the
+ // frequency at which signals are attenuated by 3dB (half the passband power).
// Each successive octave beyond this frequency is attenuated by an additional 6dB.
//
- // We choose the cutoff frequency such that impulses and vibrational noise
- // (think car dock) is suppressed. However, this filtering does not eliminate
- // all possible sources of orientation ambiguity so we also rely on a dynamic
- // settle time for establishing a new orientation. Filtering adds latency
- // inversely proportional to the cutoff frequency so we don't want to make
- // it too small or we can lose hundreds of milliseconds of responsiveness.
- private static final float FILTER_CUTOFF_FREQUENCY_HZ = 1f;
- private static final float FILTER_TIME_CONSTANT_MS = (float)(500.0f
- / (Math.PI * FILTER_CUTOFF_FREQUENCY_HZ)); // t = 1 / (2pi * Fc) * 1000ms
-
- // The filter gain.
- // We choose a value slightly less than unity to avoid numerical instabilities due
- // to floating-point error accumulation.
- private static final float FILTER_GAIN = 0.999f;
+ // Given a time constant t in seconds, the filter cutoff frequency Fc in Hertz
+ // is given by Fc = 1 / (2pi * t).
+ //
+ // The higher the time constant, the lower the cutoff frequency, so more noise
+ // will be suppressed.
+ //
+ // Filtering adds latency proportional the time constant (inversely proportional
+ // to the cutoff frequency) so we don't want to make the time constant too
+ // large or we can lose responsiveness.
+ private static final float FILTER_TIME_CONSTANT_MS = 100.0f;
/* State for orientation detection. */
@@ -297,10 +306,10 @@
// The ideal tilt angle is 0 (when the device is vertical) so the limits establish
// how close to vertical the device must be in order to change orientation.
private static final int[][] TILT_TOLERANCE = new int[][] {
- /* ROTATION_0 */ { -20, 75 },
- /* ROTATION_90 */ { -20, 70 },
- /* ROTATION_180 */ { -20, 65 },
- /* ROTATION_270 */ { -20, 70 }
+ /* ROTATION_0 */ { -20, 70 },
+ /* ROTATION_90 */ { -20, 60 },
+ /* ROTATION_180 */ { -20, 50 },
+ /* ROTATION_270 */ { -20, 60 }
};
// The gap angle in degrees between adjacent orientation angles for hysteresis.
@@ -308,41 +317,31 @@
// adjacent orientation. No orientation proposal is made when the orientation
// angle is within the gap between the current orientation and the adjacent
// orientation.
- private static final int ADJACENT_ORIENTATION_ANGLE_GAP = 30;
+ private static final int ADJACENT_ORIENTATION_ANGLE_GAP = 45;
- // The confidence scale factors for angle, tilt and magnitude.
- // When the distance between the actual value and the ideal value is the
- // specified delta, orientation transitions will take twice as long as they would
- // in the ideal case. Increasing or decreasing the delta has an exponential effect
- // on each factor's influence over the transition time.
+ // The number of milliseconds for which the device posture must be stable
+ // before we perform an orientation change. If the device appears to be rotating
+ // (being picked up, put down) then we keep waiting until it settles.
+ private static final int SETTLE_TIME_MS = 200;
- // Transition takes 2x longer when angle is 30 degrees from ideal orientation angle.
- private static final float ORIENTATION_ANGLE_CONFIDENCE_SCALE =
- confidenceScaleFromDelta(30);
+ // The maximum change in magnitude that can occur during the settle time.
+ // Tuning this constant particularly helps to filter out situations where the
+ // device is being picked up or put down by the user.
+ private static final float SETTLE_MAGNITUDE_MAX_DELTA =
+ SensorManager.STANDARD_GRAVITY * 0.2f;
- // Transition takes 2x longer when tilt is 60 degrees from vertical.
- private static final float TILT_ANGLE_CONFIDENCE_SCALE = confidenceScaleFromDelta(60);
+ // The maximum change in tilt angle that can occur during the settle time.
+ private static final int SETTLE_TILT_ANGLE_MAX_DELTA = 5;
- // Transition takes 2x longer when acceleration is 0.5 Gs.
- private static final float MAGNITUDE_CONFIDENCE_SCALE = confidenceScaleFromDelta(
- SensorManager.STANDARD_GRAVITY * 0.5f);
-
- // The number of milliseconds for which a new orientation must be stable before
- // we perform an orientation change under ideal conditions. It will take
- // proportionally longer than this to effect an orientation change when
- // the proposed orientation confidence is low.
- private static final float ORIENTATION_SETTLE_TIME_MS = 250;
-
- // The confidence that we have abount effecting each orientation change.
- // When one of these values exceeds 1.0, we have determined our new orientation!
- private float mConfidence[] = new float[4];
+ // The maximum change in orientation angle that can occur during the settle time.
+ private static final int SETTLE_ORIENTATION_ANGLE_MAX_DELTA = 5;
public SensorEventListenerImpl(WindowOrientationListener orientationListener) {
mOrientationListener = orientationListener;
}
- public int getCurrentRotation() {
- return mRotation; // may be -1, if unknown
+ public int getProposedRotation() {
+ return mProposalAgeMS >= SETTLE_TIME_MS ? mProposalRotation : -1;
}
@Override
@@ -368,20 +367,18 @@
// Reset the orientation listener state if the samples are too far apart in time
// or when we see values of (0, 0, 0) which indicates that we polled the
// accelerometer too soon after turning it on and we don't have any data yet.
- final float timeDeltaMS = (event.timestamp - mLastTimestamp) * 0.000001f;
+ final long now = event.timestamp;
+ final float timeDeltaMS = (now - mLastTimestamp) * 0.000001f;
boolean skipSample;
if (timeDeltaMS <= 0 || timeDeltaMS > MAX_FILTER_DELTA_TIME_MS
|| (x == 0 && y == 0 && z == 0)) {
if (log) {
Slog.v(TAG, "Resetting orientation listener.");
}
- for (int i = 0; i < 4; i++) {
- mConfidence[i] = 0;
- }
+ clearProposal();
skipSample = true;
} else {
- final float alpha = timeDeltaMS
- / (FILTER_TIME_CONSTANT_MS + timeDeltaMS) * FILTER_GAIN;
+ final float alpha = timeDeltaMS / (FILTER_TIME_CONSTANT_MS + timeDeltaMS);
x = alpha * (x - mLastFilteredX) + mLastFilteredX;
y = alpha * (y - mLastFilteredY) + mLastFilteredY;
z = alpha * (z - mLastFilteredZ) + mLastFilteredZ;
@@ -391,17 +388,13 @@
}
skipSample = false;
}
- mLastTimestamp = event.timestamp;
+ mLastTimestamp = now;
mLastFilteredX = x;
mLastFilteredY = y;
mLastFilteredZ = z;
- boolean orientationChanged = false;
+ final int oldProposedRotation = getProposedRotation();
if (!skipSample) {
- // Determine a proposed orientation based on the currently available data.
- int proposedOrientation = ROTATION_UNKNOWN;
- float combinedConfidence = 1.0f;
-
// Calculate the magnitude of the acceleration vector.
final float magnitude = (float) Math.sqrt(x * x + y * y + z * z);
if (magnitude < MIN_ACCELERATION_MAGNITUDE
@@ -410,6 +403,7 @@
Slog.v(TAG, "Ignoring sensor data, magnitude out of range: "
+ "magnitude=" + magnitude);
}
+ clearProposal();
} else {
// Calculate the tilt angle.
// This is the angle between the up vector and the x-y plane (the plane of
@@ -417,123 +411,82 @@
// -90 degrees: screen horizontal and facing the ground (overhead)
// 0 degrees: screen vertical
// 90 degrees: screen horizontal and facing the sky (on table)
- final int tiltAngle = (int) Math.round(
- Math.asin(z / magnitude) * RADIANS_TO_DEGREES);
+ final int tiltAngle = (int) Math.round(
+ Math.asin(z / magnitude) * RADIANS_TO_DEGREES);
- // If the tilt angle is too close to horizontal then we cannot determine
- // the orientation angle of the screen.
- if (Math.abs(tiltAngle) > MAX_TILT) {
- if (log) {
- Slog.v(TAG, "Ignoring sensor data, tilt angle too high: "
- + "magnitude=" + magnitude + ", tiltAngle=" + tiltAngle);
- }
- } else {
- // Calculate the orientation angle.
- // This is the angle between the x-y projection of the up vector onto
- // the +y-axis, increasing clockwise in a range of [0, 360] degrees.
- int orientationAngle = (int) Math.round(
- -Math.atan2(-x, y) * RADIANS_TO_DEGREES);
- if (orientationAngle < 0) {
- // atan2 returns [-180, 180]; normalize to [0, 360]
- orientationAngle += 360;
- }
-
- // Find the nearest orientation.
- // An orientation of 0 can have a nearest angle of 0 or 360 depending
- // on which is closer to the measured orientation angle. We leave the
- // nearest angle at 360 in that case since it makes the delta calculation
- // for orientation angle confidence easier below.
- int nearestOrientation = (orientationAngle + 45) / 90;
- int nearestOrientationAngle = nearestOrientation * 90;
- if (nearestOrientation == 4) {
- nearestOrientation = 0;
- }
-
- // Determine the proposed orientation.
- // The confidence of the proposal is 1.0 when it is ideal and it
- // decays exponentially as the proposal moves further from the ideal
- // angle, tilt and magnitude of the proposed orientation.
- if (isTiltAngleAcceptable(nearestOrientation, tiltAngle)
- && isOrientationAngleAcceptable(nearestOrientation,
- orientationAngle)) {
- proposedOrientation = nearestOrientation;
-
- final float idealOrientationAngle = nearestOrientationAngle;
- final float orientationConfidence = confidence(orientationAngle,
- idealOrientationAngle, ORIENTATION_ANGLE_CONFIDENCE_SCALE);
-
- final float idealTiltAngle = 0;
- final float tiltConfidence = confidence(tiltAngle,
- idealTiltAngle, TILT_ANGLE_CONFIDENCE_SCALE);
-
- final float idealMagnitude = SensorManager.STANDARD_GRAVITY;
- final float magnitudeConfidence = confidence(magnitude,
- idealMagnitude, MAGNITUDE_CONFIDENCE_SCALE);
-
- combinedConfidence = orientationConfidence
- * tiltConfidence * magnitudeConfidence;
-
- if (log) {
- Slog.v(TAG, "Proposal: "
- + "magnitude=" + magnitude
- + ", tiltAngle=" + tiltAngle
- + ", orientationAngle=" + orientationAngle
- + ", proposedOrientation=" + proposedOrientation
- + ", combinedConfidence=" + combinedConfidence
- + ", orientationConfidence=" + orientationConfidence
- + ", tiltConfidence=" + tiltConfidence
- + ", magnitudeConfidence=" + magnitudeConfidence);
- }
- } else {
- if (log) {
- Slog.v(TAG, "Ignoring sensor data, no proposal: "
- + "magnitude=" + magnitude + ", tiltAngle=" + tiltAngle
- + ", orientationAngle=" + orientationAngle);
- }
- }
- }
- }
-
- // Sum up the orientation confidence weights.
- // Detect an orientation change when the sum reaches 1.0.
- final float confidenceAmount = combinedConfidence * timeDeltaMS
- / ORIENTATION_SETTLE_TIME_MS;
- for (int i = 0; i < 4; i++) {
- if (i == proposedOrientation) {
- mConfidence[i] += confidenceAmount;
- if (mConfidence[i] >= 1.0f) {
- mConfidence[i] = 1.0f;
-
- if (i != mRotation) {
- if (log) {
- Slog.v(TAG, "Orientation changed! rotation=" + i);
- }
- mRotation = i;
- orientationChanged = true;
- }
+ // If the tilt angle is too close to horizontal then we cannot determine
+ // the orientation angle of the screen.
+ if (Math.abs(tiltAngle) > MAX_TILT) {
+ if (log) {
+ Slog.v(TAG, "Ignoring sensor data, tilt angle too high: "
+ + "magnitude=" + magnitude + ", tiltAngle=" + tiltAngle);
}
+ clearProposal();
} else {
- mConfidence[i] -= confidenceAmount;
- if (mConfidence[i] < 0.0f) {
- mConfidence[i] = 0.0f;
+ // Calculate the orientation angle.
+ // This is the angle between the x-y projection of the up vector onto
+ // the +y-axis, increasing clockwise in a range of [0, 360] degrees.
+ int orientationAngle = (int) Math.round(
+ -Math.atan2(-x, y) * RADIANS_TO_DEGREES);
+ if (orientationAngle < 0) {
+ // atan2 returns [-180, 180]; normalize to [0, 360]
+ orientationAngle += 360;
+ }
+
+ // Find the nearest rotation.
+ int nearestRotation = (orientationAngle + 45) / 90;
+ if (nearestRotation == 4) {
+ nearestRotation = 0;
+ }
+
+ // Determine the proposed orientation.
+ // The confidence of the proposal is 1.0 when it is ideal and it
+ // decays exponentially as the proposal moves further from the ideal
+ // angle, tilt and magnitude of the proposed orientation.
+ if (!isTiltAngleAcceptable(nearestRotation, tiltAngle)
+ || !isOrientationAngleAcceptable(nearestRotation,
+ orientationAngle)) {
+ if (log) {
+ Slog.v(TAG, "Ignoring sensor data, no proposal: "
+ + "magnitude=" + magnitude + ", tiltAngle=" + tiltAngle
+ + ", orientationAngle=" + orientationAngle);
+ }
+ clearProposal();
+ } else {
+ if (log) {
+ Slog.v(TAG, "Proposal: "
+ + "magnitude=" + magnitude
+ + ", tiltAngle=" + tiltAngle
+ + ", orientationAngle=" + orientationAngle
+ + ", proposalRotation=" + mProposalRotation);
+ }
+ updateProposal(nearestRotation, now / 1000000L,
+ magnitude, tiltAngle, orientationAngle);
}
}
}
}
// Write final statistics about where we are in the orientation detection process.
+ final int proposedRotation = getProposedRotation();
if (log) {
- Slog.v(TAG, "Result: rotation=" + mRotation
- + ", confidence=["
- + mConfidence[0] + ", "
- + mConfidence[1] + ", "
- + mConfidence[2] + ", "
- + mConfidence[3] + "], timeDeltaMS=" + timeDeltaMS);
+ final float proposalConfidence = Math.min(
+ mProposalAgeMS * 1.0f / SETTLE_TIME_MS, 1.0f);
+ Slog.v(TAG, "Result: currentRotation=" + mOrientationListener.mCurrentRotation
+ + ", proposedRotation=" + proposedRotation
+ + ", timeDeltaMS=" + timeDeltaMS
+ + ", proposalRotation=" + mProposalRotation
+ + ", proposalAgeMS=" + mProposalAgeMS
+ + ", proposalConfidence=" + proposalConfidence);
}
// Tell the listener.
- if (orientationChanged) {
- mOrientationListener.onOrientationChanged(mRotation);
+ if (proposedRotation != oldProposedRotation && proposedRotation >= 0) {
+ if (log) {
+ Slog.v(TAG, "Proposed rotation changed! proposedRotation=" + proposedRotation
+ + ", oldProposedRotation=" + oldProposedRotation);
+ }
+ mOrientationListener.onProposedRotationChanged(proposedRotation);
}
}
@@ -541,33 +494,34 @@
* Returns true if the tilt angle is acceptable for a proposed
* orientation transition.
*/
- private boolean isTiltAngleAcceptable(int proposedOrientation,
+ private boolean isTiltAngleAcceptable(int proposedRotation,
int tiltAngle) {
- return tiltAngle >= TILT_TOLERANCE[proposedOrientation][0]
- && tiltAngle <= TILT_TOLERANCE[proposedOrientation][1];
+ return tiltAngle >= TILT_TOLERANCE[proposedRotation][0]
+ && tiltAngle <= TILT_TOLERANCE[proposedRotation][1];
}
/**
* Returns true if the orientation angle is acceptable for a proposed
* orientation transition.
+ *
* This function takes into account the gap between adjacent orientations
* for hysteresis.
*/
- private boolean isOrientationAngleAcceptable(int proposedOrientation,
- int orientationAngle) {
- final int currentOrientation = mRotation;
-
+ private boolean isOrientationAngleAcceptable(int proposedRotation, int orientationAngle) {
// If there is no current rotation, then there is no gap.
- if (currentOrientation != ROTATION_UNKNOWN) {
- // If the proposed orientation is the same or is counter-clockwise adjacent,
+ // The gap is used only to introduce hysteresis among advertised orientation
+ // changes to avoid flapping.
+ final int currentRotation = mOrientationListener.mCurrentRotation;
+ if (currentRotation >= 0) {
+ // If the proposed rotation is the same or is counter-clockwise adjacent,
// then we set a lower bound on the orientation angle.
- // For example, if currentOrientation is ROTATION_0 and proposed is ROTATION_90,
+ // For example, if currentRotation is ROTATION_0 and proposed is ROTATION_90,
// then we want to check orientationAngle > 45 + GAP / 2.
- if (proposedOrientation == currentOrientation
- || proposedOrientation == (currentOrientation + 1) % 4) {
- int lowerBound = proposedOrientation * 90 - 45
+ if (proposedRotation == currentRotation
+ || proposedRotation == (currentRotation + 1) % 4) {
+ int lowerBound = proposedRotation * 90 - 45
+ ADJACENT_ORIENTATION_ANGLE_GAP / 2;
- if (proposedOrientation == 0) {
+ if (proposedRotation == 0) {
if (orientationAngle >= 315 && orientationAngle < lowerBound + 360) {
return false;
}
@@ -578,15 +532,15 @@
}
}
- // If the proposed orientation is the same or is clockwise adjacent,
+ // If the proposed rotation is the same or is clockwise adjacent,
// then we set an upper bound on the orientation angle.
- // For example, if currentOrientation is ROTATION_0 and proposed is ROTATION_270,
+ // For example, if currentRotation is ROTATION_0 and proposed is ROTATION_270,
// then we want to check orientationAngle < 315 - GAP / 2.
- if (proposedOrientation == currentOrientation
- || proposedOrientation == (currentOrientation + 3) % 4) {
- int upperBound = proposedOrientation * 90 + 45
+ if (proposedRotation == currentRotation
+ || proposedRotation == (currentRotation + 3) % 4) {
+ int upperBound = proposedRotation * 90 + 45
- ADJACENT_ORIENTATION_ANGLE_GAP / 2;
- if (proposedOrientation == 0) {
+ if (proposedRotation == 0) {
if (orientationAngle <= 45 && orientationAngle > upperBound) {
return false;
}
@@ -600,21 +554,58 @@
return true;
}
- /**
- * Calculate an exponentially weighted confidence value in the range [0.0, 1.0].
- * The further the value is from the target, the more the confidence trends to 0.
- */
- private static float confidence(float value, float target, float scale) {
- return (float) Math.exp(-Math.abs(value - target) * scale);
+ private void clearProposal() {
+ mProposalRotation = -1;
+ mProposalAgeMS = 0;
}
- /**
- * Calculate a scale factor for the confidence weight exponent.
- * The scale value is chosen such that confidence(value, target, scale) == 0.5
- * whenever abs(value - target) == cutoffDelta.
- */
- private static float confidenceScaleFromDelta(float cutoffDelta) {
- return (float) -Math.log(0.5) / cutoffDelta;
+ private void updateProposal(int rotation, long timestampMS,
+ float magnitude, int tiltAngle, int orientationAngle) {
+ if (mProposalRotation != rotation) {
+ mProposalRotation = rotation;
+ mHistoryIndex = 0;
+ mHistoryLength = 0;
+ }
+
+ final int index = mHistoryIndex;
+ mHistoryTimestampMS[index] = timestampMS;
+ mHistoryMagnitudes[index] = magnitude;
+ mHistoryTiltAngles[index] = tiltAngle;
+ mHistoryOrientationAngles[index] = orientationAngle;
+ mHistoryIndex = (index + 1) % HISTORY_SIZE;
+ if (mHistoryLength < HISTORY_SIZE) {
+ mHistoryLength += 1;
+ }
+
+ long age = 0;
+ for (int i = 1; i < mHistoryLength; i++) {
+ final int olderIndex = (index + HISTORY_SIZE - i) % HISTORY_SIZE;
+ if (Math.abs(mHistoryMagnitudes[olderIndex] - magnitude)
+ > SETTLE_MAGNITUDE_MAX_DELTA) {
+ break;
+ }
+ if (angleAbsoluteDelta(mHistoryTiltAngles[olderIndex],
+ tiltAngle) > SETTLE_TILT_ANGLE_MAX_DELTA) {
+ break;
+ }
+ if (angleAbsoluteDelta(mHistoryOrientationAngles[olderIndex],
+ orientationAngle) > SETTLE_ORIENTATION_ANGLE_MAX_DELTA) {
+ break;
+ }
+ age = timestampMS - mHistoryTimestampMS[olderIndex];
+ if (age >= SETTLE_TIME_MS) {
+ break;
+ }
+ }
+ mProposalAgeMS = age;
+ }
+
+ private static int angleAbsoluteDelta(int a, int b) {
+ int delta = Math.abs(a - b);
+ if (delta > 180) {
+ delta = 360 - delta;
+ }
+ return delta;
}
}
}
diff --git a/core/java/android/webkit/BrowserFrame.java b/core/java/android/webkit/BrowserFrame.java
index 309857d..28f54aa 100644
--- a/core/java/android/webkit/BrowserFrame.java
+++ b/core/java/android/webkit/BrowserFrame.java
@@ -1159,51 +1159,49 @@
}
/**
- * Called by JNI when the native HTTPS stack gets an invalid cert chain.
+ * Called by JNI when the Chromium HTTP stack gets an invalid certificate chain.
*
* We delegate the request to CallbackProxy, and route its response to
* {@link #nativeSslCertErrorProceed(int)} or
* {@link #nativeSslCertErrorCancel(int, int)}.
*/
- private void reportSslCertError(
- final int handle, final int cert_error, byte cert_der[], String url) {
- final SslError ssl_error;
+ private void reportSslCertError(final int handle, final int certError, byte certDER[],
+ String url) {
+ final SslError sslError;
try {
- X509Certificate cert = new X509CertImpl(cert_der);
+ X509Certificate cert = new X509CertImpl(certDER);
SslCertificate sslCert = new SslCertificate(cert);
if (JniUtil.useChromiumHttpStack()) {
- ssl_error = SslError.SslErrorFromChromiumErrorCode(cert_error, sslCert,
+ sslError = SslError.SslErrorFromChromiumErrorCode(certError, sslCert,
new URL(url).getHost());
} else {
- ssl_error = new SslError(cert_error, cert, url);
+ sslError = new SslError(certError, cert, url);
}
} catch (IOException e) {
// Can't get the certificate, not much to do.
Log.e(LOGTAG, "Can't get the certificate from WebKit, canceling");
- nativeSslCertErrorCancel(handle, cert_error);
+ nativeSslCertErrorCancel(handle, certError);
+ return;
+ }
+
+ if (SslCertLookupTable.getInstance().isAllowed(sslError)) {
+ nativeSslCertErrorProceed(handle);
return;
}
SslErrorHandler handler = new SslErrorHandler() {
-
@Override
public void proceed() {
- SslCertLookupTable.getInstance().Allow(ssl_error);
+ SslCertLookupTable.getInstance().setIsAllowed(sslError, true);
nativeSslCertErrorProceed(handle);
}
-
@Override
public void cancel() {
- SslCertLookupTable.getInstance().Deny(ssl_error);
- nativeSslCertErrorCancel(handle, cert_error);
+ SslCertLookupTable.getInstance().setIsAllowed(sslError, false);
+ nativeSslCertErrorCancel(handle, certError);
}
};
-
- if (SslCertLookupTable.getInstance().IsAllowed(ssl_error)) {
- nativeSslCertErrorProceed(handle);
- } else {
- mCallbackProxy.onReceivedSslError(handler, ssl_error);
- }
+ mCallbackProxy.onReceivedSslError(handler, sslError);
}
/**
@@ -1416,7 +1414,7 @@
private native void nativeAuthenticationCancel(int handle);
private native void nativeSslCertErrorProceed(int handle);
- private native void nativeSslCertErrorCancel(int handle, int cert_error);
+ private native void nativeSslCertErrorCancel(int handle, int certError);
native void nativeSslClientCert(int handle,
byte[] pkcs8EncodedPrivateKey,
diff --git a/core/java/android/webkit/CallbackProxy.java b/core/java/android/webkit/CallbackProxy.java
index 88583df..c9fcf0c 100644
--- a/core/java/android/webkit/CallbackProxy.java
+++ b/core/java/android/webkit/CallbackProxy.java
@@ -165,8 +165,6 @@
/**
* Get the WebViewClient.
* @return the current WebViewClient instance.
- *
- *@hide pending API council approval.
*/
public WebViewClient getWebViewClient() {
return mWebViewClient;
@@ -1013,10 +1011,6 @@
sendMessage(msg);
}
- /**
- * @hide - hide this because it contains a parameter of type SslError.
- * SslError is located in a hidden package.
- */
public void onReceivedSslError(SslErrorHandler handler, SslError error) {
// Do an unsynchronized quick check to avoid posting if no callback has
// been set.
@@ -1031,9 +1025,7 @@
msg.obj = map;
sendMessage(msg);
}
- /**
- * @hide
- */
+
public void onReceivedClientCertRequest(ClientCertRequestHandler handler, String host_and_port) {
// Do an unsynchronized quick check to avoid posting if no callback has
// been set.
@@ -1048,17 +1040,8 @@
msg.obj = map;
sendMessage(msg);
}
- /**
- * @hide - hide this because it contains a parameter of type SslCertificate,
- * which is located in a hidden package.
- */
public void onReceivedCertificate(SslCertificate certificate) {
- // Do an unsynchronized quick check to avoid posting if no callback has
- // been set.
- if (mWebViewClient == null) {
- return;
- }
// here, certificate can be null (if the site is not secure)
sendMessage(obtainMessage(RECEIVED_CERTIFICATE, certificate));
}
diff --git a/core/java/android/webkit/HTML5VideoInline.java b/core/java/android/webkit/HTML5VideoInline.java
index 97dc291..42581c2 100644
--- a/core/java/android/webkit/HTML5VideoInline.java
+++ b/core/java/android/webkit/HTML5VideoInline.java
@@ -1,6 +1,8 @@
package android.webkit;
+import android.Manifest.permission;
+import android.content.pm.PackageManager;
import android.graphics.SurfaceTexture;
import android.media.MediaPlayer;
import android.webkit.HTML5VideoView;
@@ -52,7 +54,12 @@
public void prepareDataAndDisplayMode(HTML5VideoViewProxy proxy) {
super.prepareDataAndDisplayMode(proxy);
setFrameAvailableListener(proxy);
- mPlayer.setWakeMode(proxy.getContext(), PowerManager.FULL_WAKE_LOCK);
+ // TODO: This is a workaround, after b/5375681 fixed, we should switch
+ // to the better way.
+ if (mProxy.getContext().checkCallingOrSelfPermission(permission.WAKE_LOCK)
+ == PackageManager.PERMISSION_GRANTED) {
+ mPlayer.setWakeMode(proxy.getContext(), PowerManager.FULL_WAKE_LOCK);
+ }
}
// Pause the play and update the play/pause button
diff --git a/core/java/android/webkit/SslCertLookupTable.java b/core/java/android/webkit/SslCertLookupTable.java
index faff110..048a3cf 100644
--- a/core/java/android/webkit/SslCertLookupTable.java
+++ b/core/java/android/webkit/SslCertLookupTable.java
@@ -20,14 +20,15 @@
import android.net.http.SslError;
/**
- * A simple class to store the wrong certificates that user is aware but
- * chose to proceed.
+ * Stores the user's decision of whether to allow or deny an invalid certificate.
+ *
+ * This class is not threadsafe. It is used only on the WebCore thread.
*/
final class SslCertLookupTable {
private static SslCertLookupTable sTable;
private final Bundle table;
- public static synchronized SslCertLookupTable getInstance() {
+ public static SslCertLookupTable getInstance() {
if (sTable == null) {
sTable = new SslCertLookupTable();
}
@@ -38,15 +39,11 @@
table = new Bundle();
}
- public void Allow(SslError ssl_error) {
- table.putBoolean(ssl_error.toString(), true);
+ public void setIsAllowed(SslError sslError, boolean allow) {
+ table.putBoolean(sslError.toString(), allow);
}
- public void Deny(SslError ssl_error) {
- table.putBoolean(ssl_error.toString(), false);
- }
-
- public boolean IsAllowed(SslError ssl_error) {
- return table.getBoolean(ssl_error.toString());
+ public boolean isAllowed(SslError sslError) {
+ return table.getBoolean(sslError.toString());
}
}
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index 47629c4..139f9f3 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -1808,6 +1808,8 @@
/**
* Restore the display data that was save in {@link #savePicture}. Used in
* conjunction with {@link #restoreState}.
+ *
+ * Note that this will not work if the WebView is hardware accelerated.
* @param b A Bundle containing the saved display data.
* @param src The file where the picture data was stored.
* @return True if the picture was successfully restored.
@@ -4300,6 +4302,7 @@
selectionDone();
}
mOrientation = newConfig.orientation;
+ contentInvalidateAll();
}
/**
@@ -9280,13 +9283,13 @@
private static void checkThread() {
if (Looper.myLooper() != Looper.getMainLooper()) {
- RuntimeException exception = new RuntimeException(
- "A WebView method was called on thread '" +
+ Throwable throwable = new Throwable(
+ "Warning: A WebView method was called on thread '" +
Thread.currentThread().getName() + "'. " +
"All WebView methods must be called on the UI thread. " +
"Future versions of WebView may not support use on other threads.");
- Log.e(LOGTAG, Log.getStackTraceString(exception));
- StrictMode.onWebViewMethodCalledOnWrongThread(exception);
+ Log.w(LOGTAG, Log.getStackTraceString(throwable));
+ StrictMode.onWebViewMethodCalledOnWrongThread(throwable);
}
}
diff --git a/core/java/android/widget/AbsListView.java b/core/java/android/widget/AbsListView.java
index ba89ef3..7b8c7f2 100644
--- a/core/java/android/widget/AbsListView.java
+++ b/core/java/android/widget/AbsListView.java
@@ -1304,16 +1304,6 @@
}
}
- @Override
- public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) {
- // Do not append text content to scroll events they are fired frequently
- // and the client has already received another event type with the text.
- if (event.getEventType() != AccessibilityEvent.TYPE_VIEW_SCROLLED) {
- super.dispatchPopulateAccessibilityEvent(event);
- }
- return false;
- }
-
/**
* Indicates whether the children's drawing cache is used during a scroll.
* By default, the drawing cache is enabled but this will consume more memory.
diff --git a/core/java/android/widget/AdapterView.java b/core/java/android/widget/AdapterView.java
index 5392c2e..a4b4e78 100644
--- a/core/java/android/widget/AdapterView.java
+++ b/core/java/android/widget/AdapterView.java
@@ -881,31 +881,30 @@
@Override
public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) {
- // This is an exceptional case which occurs when a window gets the
- // focus and sends a focus event via its focused child to announce
- // current focus/selection. AdapterView fires selection but not focus
- // events so we change the event type here.
- if (event.getEventType() == AccessibilityEvent.TYPE_VIEW_FOCUSED) {
- event.setEventType(AccessibilityEvent.TYPE_VIEW_SELECTED);
+ final int eventType = event.getEventType();
+ switch (eventType) {
+ case AccessibilityEvent.TYPE_VIEW_SCROLLED:
+ // Do not populate the text of scroll events.
+ return true;
+ case AccessibilityEvent.TYPE_VIEW_FOCUSED:
+ // This is an exceptional case which occurs when a window gets the
+ // focus and sends a focus event via its focused child to announce
+ // current focus/selection. AdapterView fires selection but not focus
+ // events so we change the event type here.
+ if (event.getEventType() == AccessibilityEvent.TYPE_VIEW_FOCUSED) {
+ event.setEventType(AccessibilityEvent.TYPE_VIEW_SELECTED);
+ }
+ break;
}
View selectedView = getSelectedView();
if (selectedView != null && selectedView.getVisibility() == VISIBLE) {
- // We first get a chance to populate the event.
- onPopulateAccessibilityEvent(event);
+ getSelectedView().dispatchPopulateAccessibilityEvent(event);
}
return false;
}
@Override
- public void onPopulateAccessibilityEvent(AccessibilityEvent event) {
- super.onPopulateAccessibilityEvent(event);
- // We send selection events only from AdapterView to avoid
- // generation of such event for each child.
- getSelectedView().dispatchPopulateAccessibilityEvent(event);
- }
-
- @Override
public boolean onRequestSendAccessibilityEvent(View child, AccessibilityEvent event) {
if (super.onRequestSendAccessibilityEvent(child, event)) {
// Add a record for ourselves as well.
diff --git a/core/java/android/widget/BaseAdapter.java b/core/java/android/widget/BaseAdapter.java
index 532fd76..401fcb8 100644
--- a/core/java/android/widget/BaseAdapter.java
+++ b/core/java/android/widget/BaseAdapter.java
@@ -43,13 +43,18 @@
}
/**
- * Notifies the attached View that the underlying data has been changed
- * and it should refresh itself.
+ * Notifies the attached observers that the underlying data has been changed
+ * and any View reflecting the data set should refresh itself.
*/
public void notifyDataSetChanged() {
mDataSetObservable.notifyChanged();
}
-
+
+ /**
+ * Notifies the attached observers that the underlying data is no longer valid
+ * or available. Once invoked this adapter is no longer valid and should
+ * not report further data set changes.
+ */
public void notifyDataSetInvalidated() {
mDataSetObservable.notifyInvalidated();
}
diff --git a/core/java/android/widget/SearchView.java b/core/java/android/widget/SearchView.java
index f230031..adf2b7b 100644
--- a/core/java/android/widget/SearchView.java
+++ b/core/java/android/widget/SearchView.java
@@ -120,6 +120,7 @@
private CharSequence mOldQueryText;
private CharSequence mUserQuery;
private boolean mExpandedInActionView;
+ private int mCollapsedImeOptions;
private SearchableInfo mSearchable;
private Bundle mAppSearchData;
@@ -1166,6 +1167,7 @@
clearFocus();
updateViewsVisibility(true);
mQueryTextView.setText("");
+ mQueryTextView.setImeOptions(mCollapsedImeOptions);
mExpandedInActionView = false;
}
@@ -1175,6 +1177,8 @@
@Override
public void onActionViewExpanded() {
mExpandedInActionView = true;
+ mCollapsedImeOptions = mQueryTextView.getImeOptions();
+ mQueryTextView.setImeOptions(mCollapsedImeOptions | EditorInfo.IME_FLAG_NO_FULLSCREEN);
setIconified(false);
}
diff --git a/core/java/android/widget/SpellChecker.java b/core/java/android/widget/SpellChecker.java
index 14cbf6f..6b2f3e4 100644
--- a/core/java/android/widget/SpellChecker.java
+++ b/core/java/android/widget/SpellChecker.java
@@ -75,6 +75,20 @@
mLength = 0;
}
+ /**
+ * @return true if a spell checker session has successfully been created. Returns false if not,
+ * for instance when spell checking has been disabled in settings.
+ */
+ public boolean isSessionActive() {
+ return mSpellCheckerSession != null;
+ }
+
+ public void closeSession() {
+ if (mSpellCheckerSession != null) {
+ mSpellCheckerSession.close();
+ }
+ }
+
public void addSpellCheckSpan(SpellCheckSpan spellCheckSpan) {
int length = mIds.length;
if (mLength >= length) {
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index 8db6592..8ea55c6 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -3250,7 +3250,8 @@
sendOnTextChanged(text, 0, oldlen, textLength);
onTextChanged(text, 0, oldlen, textLength);
- if (startSpellCheck) {
+ if (startSpellCheck && mSpellChecker != null) {
+ // This view has to have been previously attached for mSpellChecker to exist
updateSpellCheckSpans(0, textLength);
}
@@ -4412,6 +4413,8 @@
// Resolve drawables as the layout direction has been resolved
resolveDrawables();
+
+ updateSpellCheckSpans(0, mText.length());
}
@Override
@@ -4443,6 +4446,14 @@
hideControllers();
resetResolvedDrawables();
+
+ if (mSpellChecker != null) {
+ mSpellChecker.closeSession();
+ removeMisspelledSpans();
+ // Forces the creation of a new SpellChecker next time this window is created.
+ // Will handle the cases where the settings has been changed in the meantime.
+ mSpellChecker = null;
+ }
}
@Override
@@ -6130,7 +6141,7 @@
TruncateAt effectiveEllipsize = mEllipsize;
if (mEllipsize == TruncateAt.MARQUEE &&
mMarqueeFadeMode == MARQUEE_FADE_SWITCH_SHOW_ELLIPSIS) {
- effectiveEllipsize = TruncateAt.END;
+ effectiveEllipsize = TruncateAt.END_SMALL;
}
if (mTextDir == null) {
@@ -7595,7 +7606,7 @@
}
ims.mChangedDelta += after-before;
}
-
+
sendOnTextChanged(buffer, start, before, after);
onTextChanged(buffer, start, before, after);
@@ -7737,7 +7748,8 @@
* Create new SpellCheckSpans on the modified region.
*/
private void updateSpellCheckSpans(int start, int end) {
- if (!(mText instanceof Editable) || !isSuggestionsEnabled()) return;
+ if (!isTextEditable() || !isSuggestionsEnabled() || !getSpellChecker().isSessionActive())
+ return;
Editable text = (Editable) mText;
WordIterator wordIterator = getWordIterator();
@@ -8427,13 +8439,31 @@
int flags = suggestionSpans[i].getFlags();
if ((flags & SuggestionSpan.FLAG_EASY_CORRECT) != 0
&& (flags & SuggestionSpan.FLAG_MISSPELLED) == 0) {
- flags = flags & ~SuggestionSpan.FLAG_EASY_CORRECT;
+ flags &= ~SuggestionSpan.FLAG_EASY_CORRECT;
suggestionSpans[i].setFlags(flags);
}
}
}
}
+ /**
+ * Removes the suggestion spans for misspelled words.
+ */
+ private void removeMisspelledSpans() {
+ if (mText instanceof Spannable) {
+ Spannable spannable = (Spannable) mText;
+ SuggestionSpan[] suggestionSpans = spannable.getSpans(0,
+ spannable.length(), SuggestionSpan.class);
+ for (int i = 0; i < suggestionSpans.length; i++) {
+ int flags = suggestionSpans[i].getFlags();
+ if ((flags & SuggestionSpan.FLAG_EASY_CORRECT) != 0
+ && (flags & SuggestionSpan.FLAG_MISSPELLED) != 0) {
+ spannable.removeSpan(suggestionSpans[i]);
+ }
+ }
+ }
+ }
+
@Override
public boolean onGenericMotionEvent(MotionEvent event) {
if (mMovement != null && mText instanceof Spannable && mLayout != null) {
@@ -9573,7 +9603,6 @@
private final Comparator<SuggestionSpan> mSuggestionSpanComparator;
private final HashMap<SuggestionSpan, Integer> mSpansLengths;
-
private class CustomPopupWindow extends PopupWindow {
public CustomPopupWindow(Context context, int defStyle) {
super(context, null, defStyle);
@@ -9585,9 +9614,8 @@
TextView.this.getPositionListener().removeSubscriber(SuggestionsPopupWindow.this);
- if ((mText instanceof Spannable)) {
- ((Spannable) mText).removeSpan(mSuggestionRangeSpan);
- }
+ // Safe cast since show() checks that mText is an Editable
+ ((Spannable) mText).removeSpan(mSuggestionRangeSpan);
setCursorVisible(mCursorWasVisibleBeforeSuggestions);
if (hasInsertionController()) {
@@ -9637,8 +9665,8 @@
void removeMisspelledFlag() {
int suggestionSpanFlags = suggestionSpan.getFlags();
if ((suggestionSpanFlags & SuggestionSpan.FLAG_MISSPELLED) > 0) {
- suggestionSpanFlags &= ~(SuggestionSpan.FLAG_MISSPELLED);
- suggestionSpanFlags &= ~(SuggestionSpan.FLAG_EASY_CORRECT);
+ suggestionSpanFlags &= ~SuggestionSpan.FLAG_MISSPELLED;
+ suggestionSpanFlags &= ~SuggestionSpan.FLAG_EASY_CORRECT;
suggestionSpan.setFlags(suggestionSpanFlags);
}
}
@@ -9887,6 +9915,8 @@
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
+ hide();
+
if (view instanceof TextView) {
TextView textView = (TextView) view;
Editable editable = (Editable) mText;
@@ -9894,6 +9924,7 @@
SuggestionInfo suggestionInfo = mSuggestionInfos[position];
final int spanStart = editable.getSpanStart(suggestionInfo.suggestionSpan);
final int spanEnd = editable.getSpanEnd(suggestionInfo.suggestionSpan);
+ if (spanStart < 0 || spanEnd < 0) return; // Span has been removed
final String originalText = mText.subSequence(spanStart, spanEnd).toString();
if (suggestionInfo.suggestionIndex < 0) {
@@ -9955,7 +9986,6 @@
Selection.setSelection(editable, spanEnd + lengthDifference);
}
}
- hide();
}
}
@@ -10520,9 +10550,7 @@
public abstract int getCurrentCursorOffset();
- protected void updateSelection(int offset) {
- updateDrawable();
- }
+ protected abstract void updateSelection(int offset);
public abstract void updatePosition(float x, float y);
@@ -10796,8 +10824,8 @@
@Override
public void updateSelection(int offset) {
- super.updateSelection(offset);
Selection.setSelection((Spannable) mText, offset, getSelectionEnd());
+ updateDrawable();
}
@Override
@@ -10838,8 +10866,8 @@
@Override
public void updateSelection(int offset) {
- super.updateSelection(offset);
Selection.setSelection((Spannable) mText, getSelectionStart(), offset);
+ updateDrawable();
}
@Override
diff --git a/core/java/com/android/internal/util/ArrayUtils.java b/core/java/com/android/internal/util/ArrayUtils.java
index 159929b..3d22929 100644
--- a/core/java/com/android/internal/util/ArrayUtils.java
+++ b/core/java/com/android/internal/util/ArrayUtils.java
@@ -133,4 +133,13 @@
}
return false;
}
+
+ public static boolean contains(int[] array, int value) {
+ for (int element : array) {
+ if (element == value) {
+ return true;
+ }
+ }
+ return false;
+ }
}
diff --git a/core/java/com/android/internal/view/menu/ActionMenuPresenter.java b/core/java/com/android/internal/view/menu/ActionMenuPresenter.java
index 0db1ccc..aabea2c 100644
--- a/core/java/com/android/internal/view/menu/ActionMenuPresenter.java
+++ b/core/java/com/android/internal/view/menu/ActionMenuPresenter.java
@@ -200,8 +200,19 @@
}
}
- final boolean hasOverflow = mReserveOverflow && mMenu != null &&
- mMenu.getNonActionItems().size() > 0;
+ final ArrayList<MenuItemImpl> nonActionItems = mMenu != null ?
+ mMenu.getNonActionItems() : null;
+
+ boolean hasOverflow = false;
+ if (mReserveOverflow && nonActionItems != null) {
+ final int count = nonActionItems.size();
+ if (count == 1) {
+ hasOverflow = !nonActionItems.get(0).isActionViewExpanded();
+ } else {
+ hasOverflow = count > 0;
+ }
+ }
+
if (hasOverflow) {
if (mOverflowButton == null) {
mOverflowButton = new OverflowMenuButton(mContext);
diff --git a/core/java/com/android/internal/view/menu/ListMenuPresenter.java b/core/java/com/android/internal/view/menu/ListMenuPresenter.java
index 0141427..a331bec 100644
--- a/core/java/com/android/internal/view/menu/ListMenuPresenter.java
+++ b/core/java/com/android/internal/view/menu/ListMenuPresenter.java
@@ -17,6 +17,7 @@
package com.android.internal.view.menu;
import android.content.Context;
+import android.database.DataSetObserver;
import android.os.Bundle;
import android.os.Parcelable;
import android.util.SparseArray;
@@ -47,7 +48,7 @@
int mItemLayoutRes;
private Callback mCallback;
- private MenuAdapter mAdapter;
+ MenuAdapter mAdapter;
private int mId;
@@ -216,14 +217,29 @@
}
private class MenuAdapter extends BaseAdapter {
+ private int mExpandedIndex = -1;
+
+ public MenuAdapter() {
+ registerDataSetObserver(new ExpandedIndexObserver());
+ findExpandedIndex();
+ }
+
public int getCount() {
ArrayList<MenuItemImpl> items = mMenu.getNonActionItems();
- return items.size() - mItemIndexOffset;
+ int count = items.size() - mItemIndexOffset;
+ if (mExpandedIndex < 0) {
+ return count;
+ }
+ return count - 1;
}
public MenuItemImpl getItem(int position) {
ArrayList<MenuItemImpl> items = mMenu.getNonActionItems();
- return items.get(position + mItemIndexOffset);
+ position += mItemIndexOffset;
+ if (mExpandedIndex >= 0 && position >= mExpandedIndex) {
+ position++;
+ }
+ return items.get(position);
}
public long getItemId(int position) {
@@ -241,5 +257,28 @@
itemView.initialize(getItem(position), 0);
return convertView;
}
+
+ void findExpandedIndex() {
+ final MenuItemImpl expandedItem = mMenu.getExpandedItem();
+ if (expandedItem != null) {
+ final ArrayList<MenuItemImpl> items = mMenu.getNonActionItems();
+ final int count = items.size();
+ for (int i = 0; i < count; i++) {
+ final MenuItemImpl item = items.get(i);
+ if (item == expandedItem) {
+ mExpandedIndex = i;
+ return;
+ }
+ }
+ }
+ mExpandedIndex = -1;
+ }
+ }
+
+ private class ExpandedIndexObserver extends DataSetObserver {
+ @Override
+ public void onChanged() {
+ mAdapter.findExpandedIndex();
+ }
}
}
diff --git a/core/java/com/android/internal/view/menu/MenuBuilder.java b/core/java/com/android/internal/view/menu/MenuBuilder.java
index c30e83b..9fbca82 100644
--- a/core/java/com/android/internal/view/menu/MenuBuilder.java
+++ b/core/java/com/android/internal/view/menu/MenuBuilder.java
@@ -1258,4 +1258,8 @@
}
return collapsed;
}
+
+ public MenuItemImpl getExpandedItem() {
+ return mExpandedItem;
+ }
}
diff --git a/core/java/com/android/internal/view/menu/MenuPopupHelper.java b/core/java/com/android/internal/view/menu/MenuPopupHelper.java
index 6265618..329b457 100644
--- a/core/java/com/android/internal/view/menu/MenuPopupHelper.java
+++ b/core/java/com/android/internal/view/menu/MenuPopupHelper.java
@@ -18,6 +18,7 @@
import android.content.Context;
import android.content.res.Resources;
+import android.database.DataSetObserver;
import android.os.Parcelable;
import android.view.KeyEvent;
import android.view.LayoutInflater;
@@ -286,22 +287,45 @@
return false;
}
+ @Override
+ public int getId() {
+ return 0;
+ }
+
+ @Override
+ public Parcelable onSaveInstanceState() {
+ return null;
+ }
+
+ @Override
+ public void onRestoreInstanceState(Parcelable state) {
+ }
+
private class MenuAdapter extends BaseAdapter {
private MenuBuilder mAdapterMenu;
+ private int mExpandedIndex = -1;
public MenuAdapter(MenuBuilder menu) {
mAdapterMenu = menu;
+ registerDataSetObserver(new ExpandedIndexObserver());
+ findExpandedIndex();
}
public int getCount() {
ArrayList<MenuItemImpl> items = mOverflowOnly ?
mAdapterMenu.getNonActionItems() : mAdapterMenu.getVisibleItems();
- return items.size();
+ if (mExpandedIndex < 0) {
+ return items.size();
+ }
+ return items.size() - 1;
}
public MenuItemImpl getItem(int position) {
ArrayList<MenuItemImpl> items = mOverflowOnly ?
mAdapterMenu.getNonActionItems() : mAdapterMenu.getVisibleItems();
+ if (mExpandedIndex >= 0 && position >= mExpandedIndex) {
+ position++;
+ }
return items.get(position);
}
@@ -323,19 +347,28 @@
itemView.initialize(getItem(position), 0);
return convertView;
}
+
+ void findExpandedIndex() {
+ final MenuItemImpl expandedItem = mMenu.getExpandedItem();
+ if (expandedItem != null) {
+ final ArrayList<MenuItemImpl> items = mMenu.getNonActionItems();
+ final int count = items.size();
+ for (int i = 0; i < count; i++) {
+ final MenuItemImpl item = items.get(i);
+ if (item == expandedItem) {
+ mExpandedIndex = i;
+ return;
+ }
+ }
+ }
+ mExpandedIndex = -1;
+ }
}
- @Override
- public int getId() {
- return 0;
- }
-
- @Override
- public Parcelable onSaveInstanceState() {
- return null;
- }
-
- @Override
- public void onRestoreInstanceState(Parcelable state) {
+ private class ExpandedIndexObserver extends DataSetObserver {
+ @Override
+ public void onChanged() {
+ mAdapter.findExpandedIndex();
+ }
}
}
diff --git a/core/java/com/android/internal/widget/AbsActionBarView.java b/core/java/com/android/internal/widget/AbsActionBarView.java
index 6c11288..06f5158 100644
--- a/core/java/com/android/internal/widget/AbsActionBarView.java
+++ b/core/java/com/android/internal/widget/AbsActionBarView.java
@@ -35,6 +35,8 @@
protected ActionMenuView mMenuView;
protected ActionMenuPresenter mActionMenuPresenter;
protected ActionBarContainer mSplitView;
+ protected boolean mSplitActionBar;
+ protected boolean mSplitWhenNarrow;
protected int mContentHeight;
protected Animator mVisibilityAnim;
@@ -66,11 +68,31 @@
com.android.internal.R.attr.actionBarStyle, 0);
setContentHeight(a.getLayoutDimension(R.styleable.ActionBar_height, 0));
a.recycle();
+ if (mSplitWhenNarrow) {
+ setSplitActionBar(getContext().getResources().getBoolean(
+ com.android.internal.R.bool.split_action_bar_is_narrow));
+ }
if (mActionMenuPresenter != null) {
mActionMenuPresenter.onConfigurationChanged(newConfig);
}
}
+ /**
+ * Sets whether the bar should be split right now, no questions asked.
+ * @param split true if the bar should split
+ */
+ public void setSplitActionBar(boolean split) {
+ mSplitActionBar = split;
+ }
+
+ /**
+ * Sets whether the bar should split if we enter a narrow screen configuration.
+ * @param splitWhenNarrow true if the bar should check to split after a config change
+ */
+ public void setSplitWhenNarrow(boolean splitWhenNarrow) {
+ mSplitWhenNarrow = splitWhenNarrow;
+ }
+
public void setContentHeight(int height) {
mContentHeight = height;
requestLayout();
diff --git a/core/java/com/android/internal/widget/ActionBarContextView.java b/core/java/com/android/internal/widget/ActionBarContextView.java
index 7bc33c7..acffa5c 100644
--- a/core/java/com/android/internal/widget/ActionBarContextView.java
+++ b/core/java/com/android/internal/widget/ActionBarContextView.java
@@ -93,6 +93,39 @@
a.recycle();
}
+ @Override
+ public void setSplitActionBar(boolean split) {
+ if (mSplitActionBar != split) {
+ if (mActionMenuPresenter != null) {
+ // Mode is already active; move everything over and adjust the menu itself.
+ final LayoutParams layoutParams = new LayoutParams(LayoutParams.WRAP_CONTENT,
+ LayoutParams.MATCH_PARENT);
+ if (!split) {
+ mMenuView = (ActionMenuView) mActionMenuPresenter.getMenuView(this);
+ mMenuView.setBackgroundDrawable(null);
+ final ViewGroup oldParent = (ViewGroup) mMenuView.getParent();
+ if (oldParent != null) oldParent.removeView(mMenuView);
+ addView(mMenuView, layoutParams);
+ } else {
+ // Allow full screen width in split mode.
+ mActionMenuPresenter.setWidthLimit(
+ getContext().getResources().getDisplayMetrics().widthPixels, true);
+ // No limit to the item count; use whatever will fit.
+ mActionMenuPresenter.setItemLimit(Integer.MAX_VALUE);
+ // Span the whole width
+ layoutParams.width = LayoutParams.MATCH_PARENT;
+ layoutParams.height = mContentHeight;
+ mMenuView = (ActionMenuView) mActionMenuPresenter.getMenuView(this);
+ mMenuView.setBackgroundDrawable(mSplitBackground);
+ final ViewGroup oldParent = (ViewGroup) mMenuView.getParent();
+ if (oldParent != null) oldParent.removeView(mMenuView);
+ mSplitView.addView(mMenuView, layoutParams);
+ }
+ }
+ super.setSplitActionBar(split);
+ }
+ }
+
public void setContentHeight(int height) {
mContentHeight = height;
}
@@ -179,7 +212,7 @@
final LayoutParams layoutParams = new LayoutParams(LayoutParams.WRAP_CONTENT,
LayoutParams.MATCH_PARENT);
- if (mSplitView == null) {
+ if (!mSplitActionBar) {
menu.addMenuPresenter(mActionMenuPresenter);
mMenuView = (ActionMenuView) mActionMenuPresenter.getMenuView(this);
mMenuView.setBackgroundDrawable(null);
diff --git a/core/java/com/android/internal/widget/ActionBarView.java b/core/java/com/android/internal/widget/ActionBarView.java
index bbecb6c..dc8feea 100644
--- a/core/java/com/android/internal/widget/ActionBarView.java
+++ b/core/java/com/android/internal/widget/ActionBarView.java
@@ -113,7 +113,6 @@
private int mProgressStyle;
private int mIndeterminateProgressStyle;
- private boolean mSplitActionBar;
private boolean mUserTitle;
private boolean mIncludeTabs;
private boolean mIsCollapsable;
@@ -301,6 +300,7 @@
addView(mIndeterminateProgressView);
}
+ @Override
public void setSplitActionBar(boolean splitActionBar) {
if (mSplitActionBar != splitActionBar) {
if (mMenuView != null) {
@@ -316,7 +316,10 @@
addView(mMenuView);
}
}
- mSplitActionBar = splitActionBar;
+ if (mSplitView != null) {
+ mSplitView.setVisibility(splitActionBar ? VISIBLE : GONE);
+ }
+ super.setSplitActionBar(splitActionBar);
}
}
diff --git a/core/java/com/android/internal/widget/LockPatternUtils.java b/core/java/com/android/internal/widget/LockPatternUtils.java
index 19dc42b..81e7c34 100644
--- a/core/java/com/android/internal/widget/LockPatternUtils.java
+++ b/core/java/com/android/internal/widget/LockPatternUtils.java
@@ -947,10 +947,15 @@
*
* If there's currently a call in progress, the button will take them to the call
* @param button the button to update
+ * @param the phone state:
+ * {@link TelephonyManager#CALL_STATE_IDLE}
+ * {@link TelephonyManager#CALL_STATE_RINGING}
+ * {@link TelephonyManager#CALL_STATE_OFFHOOK}
* @param showIfCapable indicates whether the button should be shown if emergency calls are
* possible on the device
*/
- public void updateEmergencyCallButtonState(Button button, boolean showIfCapable) {
+ public void updateEmergencyCallButtonState(Button button, int phoneState,
+ boolean showIfCapable) {
if (isEmergencyCallCapable() && showIfCapable) {
button.setVisibility(View.VISIBLE);
} else {
@@ -958,9 +963,8 @@
return;
}
- int newState = TelephonyManager.getDefault().getCallState();
int textId;
- if (newState == TelephonyManager.CALL_STATE_OFFHOOK) {
+ if (phoneState == TelephonyManager.CALL_STATE_OFFHOOK) {
// show "return to call" text and show phone icon
textId = R.string.lockscreen_return_to_call;
int phoneCallIcon = R.drawable.stat_sys_phone_call;
@@ -990,22 +994,4 @@
}
return false;
}
-
- /**
- * Performs concentenation of PLMN/SPN
- * @param plmn
- * @param spn
- * @return
- */
- public static CharSequence getCarrierString(CharSequence plmn, CharSequence spn) {
- if (plmn != null && spn == null) {
- return plmn;
- } else if (plmn != null && spn != null) {
- return plmn + "|" + spn;
- } else if (plmn == null && spn != null) {
- return spn;
- } else {
- return "";
- }
- }
}
diff --git a/core/java/com/android/internal/widget/multiwaveview/MultiWaveView.java b/core/java/com/android/internal/widget/multiwaveview/MultiWaveView.java
index c03f91c..ebd355a 100644
--- a/core/java/com/android/internal/widget/multiwaveview/MultiWaveView.java
+++ b/core/java/com/android/internal/widget/multiwaveview/MultiWaveView.java
@@ -114,6 +114,13 @@
}
};
+ private AnimatorListener mResetListenerWithPing = new AnimatorListenerAdapter() {
+ public void onAnimationEnd(Animator animator) {
+ ping();
+ switchToState(STATE_IDLE, mWaveCenterX, mWaveCenterY);
+ }
+ };
+
private AnimatorUpdateListener mUpdateListener = new AnimatorUpdateListener() {
public void onAnimationUpdate(ValueAnimator animation) {
invalidateGlobalRegion(mHandleDrawable);
@@ -421,7 +428,7 @@
"x", mWaveCenterX,
"y", mWaveCenterY,
"onUpdate", mUpdateListener,
- "onComplete", mResetListener);
+ "onComplete", mDragging ? mResetListenerWithPing : mResetListener);
}
setGrabbedState(OnTriggerListener.NO_HANDLE);
diff --git a/core/jni/android/graphics/Canvas.cpp b/core/jni/android/graphics/Canvas.cpp
index 9313d0a..02c5bb3 100644
--- a/core/jni/android/graphics/Canvas.cpp
+++ b/core/jni/android/graphics/Canvas.cpp
@@ -758,21 +758,7 @@
jfloat x, jfloat y, int flags, SkPaint* paint) {
jint count = end - start;
- sp<TextLayoutCacheValue> value;
-#if USE_TEXT_LAYOUT_CACHE
- value = TextLayoutCache::getInstance().getValue(paint, textArray, start, count,
- end, flags);
- if (value == NULL) {
- LOGE("Cannot get TextLayoutCache value");
- return ;
- }
-#else
- value = new TextLayoutCacheValue();
- value->computeValues(paint, textArray, start, count, end, flags);
-#endif
-
- doDrawGlyphs(canvas, value->getGlyphs(), 0, value->getGlyphsCount(),
- x, y, flags, paint);
+ drawTextWithGlyphs(canvas, textArray + start, 0, count, count, x, y, flags, paint);
}
static void drawTextWithGlyphs(SkCanvas* canvas, const jchar* textArray,
@@ -781,19 +767,20 @@
sp<TextLayoutCacheValue> value;
#if USE_TEXT_LAYOUT_CACHE
- value = TextLayoutCache::getInstance().getValue(paint, textArray, start, count,
- contextCount, flags);
+ value = TextLayoutCache::getInstance().getValue(paint, textArray, contextCount, flags);
if (value == NULL) {
LOGE("Cannot get TextLayoutCache value");
return ;
}
#else
value = new TextLayoutCacheValue();
- value->computeValues(paint, textArray, start, count, contextCount, flags);
+ value->computeValues(paint, textArray, contextCount, flags);
#endif
-
- doDrawGlyphs(canvas, value->getGlyphs(), 0, value->getGlyphsCount(),
- x, y, flags, paint);
+ size_t startIndex = 0;
+ size_t glyphsCount = 0;
+ value->getGlyphsIndexAndCount(start, count, &startIndex, &glyphsCount);
+ const jchar* glyphs = value->getGlyphs(startIndex, glyphsCount);
+ doDrawGlyphs(canvas, glyphs, 0, glyphsCount, x, y, flags, paint);
}
static void doDrawGlyphs(SkCanvas* canvas, const jchar* glyphArray, int index, int count,
diff --git a/core/jni/android/graphics/Paint.cpp b/core/jni/android/graphics/Paint.cpp
index 7d222f6..3daf7d0 100644
--- a/core/jni/android/graphics/Paint.cpp
+++ b/core/jni/android/graphics/Paint.cpp
@@ -352,7 +352,7 @@
jfloat result = 0;
#if RTL_USE_HARFBUZZ
TextLayout::getTextRunAdvances(paint, textArray, index, count, textLength,
- paint->getFlags(), NULL /* dont need all advances */, result);
+ paint->getFlags(), NULL /* dont need all advances */, &result);
#else
// we double count, since measureText wants a byteLength
SkScalar width = paint->measureText(textArray + index, count << 1);
@@ -382,7 +382,7 @@
#if RTL_USE_HARFBUZZ
TextLayout::getTextRunAdvances(paint, textArray, start, count, textLength,
- paint->getFlags(), NULL /* dont need all advances */, width);
+ paint->getFlags(), NULL /* dont need all advances */, &width);
#else
width = SkScalarToFloat(paint->measureText(textArray + start, count << 1));
@@ -406,7 +406,7 @@
#if RTL_USE_HARFBUZZ
TextLayout::getTextRunAdvances(paint, textArray, 0, textLength, textLength,
- paint->getFlags(), NULL /* dont need all advances */, width);
+ paint->getFlags(), NULL /* dont need all advances */, &width);
#else
width = SkScalarToFloat(paint->measureText(textArray, textLength << 1));
#endif
@@ -435,10 +435,8 @@
jfloat* widthsArray = autoWidths.ptr();
#if RTL_USE_HARFBUZZ
- jfloat totalAdvance;
-
TextLayout::getTextRunAdvances(paint, text, 0, count, count,
- paint->getFlags(), widthsArray, totalAdvance);
+ paint->getFlags(), widthsArray, NULL /* dont need totalAdvance */);
#else
SkScalar* scalarArray = (SkScalar*)widthsArray;
@@ -533,7 +531,7 @@
jfloat totalAdvance = 0;
TextLayout::getTextRunAdvances(paint, text, start, count, contextCount, flags,
- advancesArray, totalAdvance);
+ advancesArray, &totalAdvance);
if (advances != NULL) {
env->SetFloatArrayRegion(advances, advancesIndex, count, advancesArray);
@@ -604,10 +602,9 @@
jint count, jint flags, jint offset, jint opt) {
#if RTL_USE_HARFBUZZ
jfloat scalarArray[count];
- jfloat totalAdvance = 0;
TextLayout::getTextRunAdvances(paint, text, start, count, count, flags,
- scalarArray, totalAdvance);
+ scalarArray, NULL /* dont need totalAdvance */);
#else
SkScalar scalarArray[count];
jchar buffer[count];
diff --git a/core/jni/android/graphics/TextLayout.cpp b/core/jni/android/graphics/TextLayout.cpp
index a2d6efb..ae17aed 100644
--- a/core/jni/android/graphics/TextLayout.cpp
+++ b/core/jni/android/graphics/TextLayout.cpp
@@ -253,21 +253,22 @@
void TextLayout::getTextRunAdvances(SkPaint* paint, const jchar* chars, jint start,
jint count, jint contextCount, jint dirFlags,
- jfloat* resultAdvances, jfloat& resultTotalAdvance) {
+ jfloat* resultAdvances, jfloat* resultTotalAdvance) {
sp<TextLayoutCacheValue> value;
#if USE_TEXT_LAYOUT_CACHE
// Return advances from the cache. Compute them if needed
- value = TextLayoutCache::getInstance().getValue(
- paint, chars, start, count, contextCount, dirFlags);
+ value = TextLayoutCache::getInstance().getValue(paint, chars, contextCount, dirFlags);
#else
value = new TextLayoutCacheValue();
- value->computeValues(paint, chars, start, count, contextCount, dirFlags);
+ value->computeValues(paint, chars, contextCount, dirFlags);
#endif
if (value != NULL) {
if (resultAdvances != NULL) {
- memcpy(resultAdvances, value->getAdvances(), value->getAdvancesCount() * sizeof(jfloat));
+ value->getAdvances(start, count, resultAdvances);
}
- resultTotalAdvance = value->getTotalAdvance();
+ if (resultTotalAdvance) {
+ *resultTotalAdvance = value->getTotalAdvance(start, count);
+ }
}
}
diff --git a/core/jni/android/graphics/TextLayout.h b/core/jni/android/graphics/TextLayout.h
index 9d8913c..9df3829 100644
--- a/core/jni/android/graphics/TextLayout.h
+++ b/core/jni/android/graphics/TextLayout.h
@@ -71,7 +71,7 @@
static void getTextRunAdvances(SkPaint* paint, const jchar* chars, jint start,
jint count, jint contextCount, jint dirFlags,
- jfloat* resultAdvances, jfloat& resultTotalAdvance);
+ jfloat* resultAdvances, jfloat* resultTotalAdvance);
static void getTextRunAdvancesICU(SkPaint* paint, const jchar* chars, jint start,
jint count, jint contextCount, jint dirFlags,
diff --git a/core/jni/android/graphics/TextLayoutCache.cpp b/core/jni/android/graphics/TextLayoutCache.cpp
index e4eeec8..86ae7d2 100644
--- a/core/jni/android/graphics/TextLayoutCache.cpp
+++ b/core/jni/android/graphics/TextLayoutCache.cpp
@@ -106,7 +106,7 @@
* Caching
*/
sp<TextLayoutCacheValue> TextLayoutCache::getValue(SkPaint* paint,
- const jchar* text, jint start, jint count, jint contextCount, jint dirFlags) {
+ const jchar* text, jint count, jint dirFlags) {
AutoMutex _l(mLock);
nsecs_t startTime = 0;
if (mDebugEnabled) {
@@ -114,7 +114,7 @@
}
// Create the key
- TextLayoutCacheKey key(paint, text, start, count, contextCount, dirFlags);
+ TextLayoutCacheKey key(paint, text, count, dirFlags);
// Get value from cache if possible
sp<TextLayoutCacheValue> value = mCache.get(key);
@@ -128,7 +128,7 @@
value = new TextLayoutCacheValue();
// Compute advances and store them
- value->computeValues(paint, text, start, count, contextCount, dirFlags);
+ value->computeValues(paint, text, count, dirFlags);
nsecs_t endTime = systemTime(SYSTEM_TIME_MONOTONIC);
@@ -157,20 +157,20 @@
// Update timing information for statistics
value->setElapsedTime(endTime - startTime);
- LOGD("CACHE MISS: Added entry with start=%d, count=%d, "
- "contextCount=%d, entry size %d bytes, remaining space %d bytes"
+ LOGD("CACHE MISS: Added entry with "
+ "count=%d, entry size %d bytes, remaining space %d bytes"
" - Compute time in nanos: %d - Text='%s' ",
- start, count, contextCount, size, mMaxSize - mSize, value->getElapsedTime(),
- String8(text, contextCount).string());
+ count, size, mMaxSize - mSize, value->getElapsedTime(),
+ String8(text, count).string());
}
} else {
if (mDebugEnabled) {
LOGD("CACHE MISS: Calculated but not storing entry because it is too big "
- "with start=%d, count=%d, contextCount=%d, "
+ "with count=%d, "
"entry size %d bytes, remaining space %d bytes"
" - Compute time in nanos: %lld - Text='%s'",
- start, count, contextCount, size, mMaxSize - mSize, endTime,
- String8(text, contextCount).string());
+ count, size, mMaxSize - mSize, endTime,
+ String8(text, count).string());
}
value.clear();
}
@@ -184,12 +184,12 @@
if (value->getElapsedTime() > 0) {
float deltaPercent = 100 * ((value->getElapsedTime() - elapsedTimeThruCacheGet)
/ ((float)value->getElapsedTime()));
- LOGD("CACHE HIT #%d with start=%d, count=%d, contextCount=%d "
+ LOGD("CACHE HIT #%d with count=%d "
"- Compute time in nanos: %d - "
"Cache get time in nanos: %lld - Gain in percent: %2.2f - Text='%s' ",
- mCacheHitCount, start, count, contextCount,
+ mCacheHitCount, count,
value->getElapsedTime(), elapsedTimeThruCacheGet, deltaPercent,
- String8(text, contextCount).string());
+ String8(text, count).string());
}
if (mCacheHitCount % DEFAULT_DUMP_STATS_CACHE_HIT_INTERVAL == 0) {
dumpCacheStats();
@@ -218,15 +218,14 @@
/**
* TextLayoutCacheKey
*/
-TextLayoutCacheKey::TextLayoutCacheKey(): text(NULL), start(0), count(0), contextCount(0),
+TextLayoutCacheKey::TextLayoutCacheKey(): text(NULL), count(0),
dirFlags(0), typeface(NULL), textSize(0), textSkewX(0), textScaleX(0), flags(0),
hinting(SkPaint::kNo_Hinting) {
}
TextLayoutCacheKey::TextLayoutCacheKey(const SkPaint* paint,
- const UChar* text, size_t start, size_t count,
- size_t contextCount, int dirFlags) :
- text(text), start(start), count(count), contextCount(contextCount),
+ const UChar* text, size_t count, int dirFlags) :
+ text(text), count(count),
dirFlags(dirFlags) {
typeface = paint->getTypeface();
textSize = paint->getTextSize();
@@ -239,9 +238,7 @@
TextLayoutCacheKey::TextLayoutCacheKey(const TextLayoutCacheKey& other) :
text(NULL),
textCopy(other.textCopy),
- start(other.start),
count(other.count),
- contextCount(other.contextCount),
dirFlags(other.dirFlags),
typeface(other.typeface),
textSize(other.textSize),
@@ -256,18 +253,15 @@
bool TextLayoutCacheKey::operator<(const TextLayoutCacheKey& rhs) const {
LTE_INT(count) {
- LTE_INT(contextCount) {
- LTE_INT(start) {
- LTE_INT(typeface) {
- LTE_FLOAT(textSize) {
- LTE_FLOAT(textSkewX) {
- LTE_FLOAT(textScaleX) {
- LTE_INT(flags) {
- LTE_INT(hinting) {
- LTE_INT(dirFlags) {
- return strncmp16(getText(), rhs.getText(), contextCount) < 0;
- }
- }
+ LTE_INT(typeface) {
+ LTE_FLOAT(textSize) {
+ LTE_FLOAT(textSkewX) {
+ LTE_FLOAT(textScaleX) {
+ LTE_INT(flags) {
+ LTE_INT(hinting) {
+ LTE_INT(dirFlags) {
+ return memcmp(getText(), rhs.getText(),
+ count * sizeof(UChar)) < 0;
}
}
}
@@ -280,12 +274,12 @@
}
void TextLayoutCacheKey::internalTextCopy() {
- textCopy.setTo(text, contextCount);
+ textCopy.setTo(text, count);
text = NULL;
}
size_t TextLayoutCacheKey::getSize() {
- return sizeof(TextLayoutCacheKey) + sizeof(UChar) * contextCount;
+ return sizeof(TextLayoutCacheKey) + sizeof(UChar) * count;
}
/**
@@ -303,23 +297,23 @@
return mElapsedTime;
}
-void TextLayoutCacheValue::computeValues(SkPaint* paint, const UChar* chars, size_t start,
- size_t count, size_t contextCount, int dirFlags) {
- // Give a hint for advances and glyphs vectors size
- mAdvances.setCapacity(count);
- mGlyphs.setCapacity(count);
- computeValuesWithHarfbuzz(paint, chars, start, count, contextCount, dirFlags,
- &mAdvances, &mTotalAdvance, &mGlyphs);
+void TextLayoutCacheValue::computeValues(SkPaint* paint, const UChar* chars,
+ size_t contextCount, int dirFlags) {
+ // Give a hint for advances, glyphs and log clusters vectors size
+ mAdvances.setCapacity(contextCount);
+ mGlyphs.setCapacity(contextCount);
+ mLogClusters.setCapacity(contextCount);
+
+ computeValuesWithHarfbuzz(paint, chars, contextCount, dirFlags,
+ &mAdvances, &mTotalAdvance, &mGlyphs, &mLogClusters);
#if DEBUG_ADVANCES
- LOGD("Advances - count=%d - countextCount=%d - totalAdvance=%f - "
- "adv[0]=%f adv[1]=%f adv[2]=%f adv[3]=%f", count, contextCount, mTotalAdvance,
- mAdvances[0], mAdvances[1], mAdvances[2], mAdvances[3]);
+ LOGD("Advances - countextCount=%d - totalAdvance=%f", contextCount, mTotalAdvance);
#endif
}
size_t TextLayoutCacheValue::getSize() {
return sizeof(TextLayoutCacheValue) + sizeof(jfloat) * mAdvances.capacity() +
- sizeof(jchar) * mGlyphs.capacity();
+ sizeof(jchar) * mGlyphs.capacity() + sizeof(unsigned short) * mLogClusters.capacity();
}
void TextLayoutCacheValue::setupShaperItem(HB_ShaperItem* shaperItem, HB_FontRec* font,
@@ -391,9 +385,9 @@
}
void TextLayoutCacheValue::computeValuesWithHarfbuzz(SkPaint* paint, const UChar* chars,
- size_t start, size_t count, size_t contextCount, int dirFlags,
+ size_t contextCount, int dirFlags,
Vector<jfloat>* const outAdvances, jfloat* outTotalAdvance,
- Vector<jchar>* const outGlyphs) {
+ Vector<jchar>* const outGlyphs, Vector<unsigned short>* const outLogClusters) {
UBiDiLevel bidiReq = 0;
bool forceLTR = false;
@@ -413,8 +407,8 @@
LOGD("computeValuesWithHarfbuzz -- forcing run with LTR=%d RTL=%d",
forceLTR, forceRTL);
#endif
- computeRunValuesWithHarfbuzz(paint, chars, start, count, contextCount, forceRTL,
- outAdvances, outTotalAdvance, outGlyphs);
+ computeRunValuesWithHarfbuzz(paint, chars, 0, contextCount, contextCount, forceRTL,
+ outAdvances, outTotalAdvance, outGlyphs, outLogClusters);
} else {
UBiDi* bidi = ubidi_open();
if (bidi) {
@@ -433,35 +427,16 @@
bool isRTL = (paraDir == 1);
#if DEBUG_GLYPHS
LOGD("computeValuesWithHarfbuzz -- processing SINGLE run "
- "-- run-start=%d run-len=%d isRTL=%d", start, count, isRTL);
+ "-- run-start=%d run-len=%d isRTL=%d", 0, contextCount, isRTL);
#endif
- computeRunValuesWithHarfbuzz(paint, chars, start, count, contextCount,
- isRTL, outAdvances, outTotalAdvance, outGlyphs);
+ computeRunValuesWithHarfbuzz(paint, chars, 0, contextCount, contextCount,
+ isRTL, outAdvances, outTotalAdvance, outGlyphs, outLogClusters);
} else {
- int32_t end = start + count;
for (size_t i = 0; i < rc; ++i) {
int32_t startRun;
int32_t lengthRun;
UBiDiDirection runDir = ubidi_getVisualRun(bidi, i, &startRun, &lengthRun);
- if (startRun >= end) {
- break;
- }
-
- int32_t endRun = startRun + lengthRun;
- if (endRun <= start) {
- continue;
- }
-
- if (startRun < start) {
- startRun = start;
- }
- if (endRun > end) {
- endRun = end;
- }
-
- lengthRun = endRun - startRun;
-
bool isRTL = (runDir == UBIDI_RTL);
jfloat runTotalAdvance = 0;
#if DEBUG_GLYPHS
@@ -471,7 +446,7 @@
computeRunValuesWithHarfbuzz(paint, chars, startRun,
lengthRun, contextCount, isRTL,
outAdvances, &runTotalAdvance,
- outGlyphs);
+ outGlyphs, outLogClusters);
*outTotalAdvance += runTotalAdvance;
}
@@ -483,10 +458,10 @@
bool isRTL = (bidiReq = 1) || (bidiReq = UBIDI_DEFAULT_RTL);
#if DEBUG_GLYPHS
LOGD("computeValuesWithHarfbuzz -- cannot run BiDi, considering a SINGLE Run "
- "-- run-start=%d run-len=%d isRTL=%d", start, count, isRTL);
+ "-- run-start=%d run-len=%d isRTL=%d", 0, contextCount, isRTL);
#endif
- computeRunValuesWithHarfbuzz(paint, chars, start, count, contextCount, isRTL,
- outAdvances, outTotalAdvance, outGlyphs);
+ computeRunValuesWithHarfbuzz(paint, chars, 0, contextCount, contextCount, isRTL,
+ outAdvances, outTotalAdvance, outGlyphs, outLogClusters);
}
}
#if DEBUG_GLYPHS
@@ -506,7 +481,7 @@
void TextLayoutCacheValue::computeRunValuesWithHarfbuzz(SkPaint* paint, const UChar* chars,
size_t start, size_t count, size_t contextCount, bool isRTL,
Vector<jfloat>* const outAdvances, jfloat* outTotalAdvance,
- Vector<jchar>* const outGlyphs) {
+ Vector<jchar>* const outGlyphs, Vector<unsigned short>* const outLogClusters) {
HB_ShaperItem shaperItem;
HB_FontRec font;
@@ -557,15 +532,15 @@
#if DEBUG_ADVANCES
for (size_t i = 0; i < count; i++) {
LOGD("hb-adv[%d] = %f - log_clusters = %d - total = %f", i,
- outAdvances[i], shaperItem.log_clusters[i], totalAdvance);
+ (*outAdvances)[i], shaperItem.log_clusters[i], totalAdvance);
}
#endif
// Get Glyphs and reverse them in place if RTL
if (outGlyphs) {
- size_t count = shaperItem.num_glyphs;
- for (size_t i = 0; i < count; i++) {
- jchar glyph = (jchar) shaperItem.glyphs[(!isRTL) ? i : count - 1 - i];
+ size_t countGlyphs = shaperItem.num_glyphs;
+ for (size_t i = 0; i < countGlyphs; i++) {
+ jchar glyph = (jchar) shaperItem.glyphs[(!isRTL) ? i : countGlyphs - 1 - i];
#if DEBUG_GLYPHS
LOGD("HARFBUZZ -- glyph[%d]=%d", i, glyph);
#endif
@@ -573,6 +548,19 @@
}
}
+ // Get LogClusters
+ if (outLogClusters) {
+ size_t countLogClusters = outLogClusters->size();
+ for (size_t i = 0; i < count; i++) {
+ // As there may be successive runs, we need to shift the log clusters
+ unsigned short logCluster = shaperItem.log_clusters[i] + countLogClusters;
+#if DEBUG_GLYPHS
+ LOGD("HARFBUZZ -- logCluster[%d] relative=%d - absolute=%d", i, shaperItem.log_clusters[i], logCluster);
+#endif
+ outLogClusters->add(logCluster);
+ }
+ }
+
// Cleaning
deleteGlyphArrays(&shaperItem);
HB_FreeFace(shaperItem.face);
@@ -603,5 +591,57 @@
memset(shaperItem->offsets, 0, size * sizeof(shaperItem->offsets[0]));
}
+void TextLayoutCacheValue::getAdvances(size_t start, size_t count, jfloat* outAdvances) const {
+ memcpy(outAdvances, mAdvances.array() + start, count * sizeof(jfloat));
+#if DEBUG_ADVANCES
+ LOGD("getAdvances - start=%d count=%d", start, count);
+ for (size_t i = 0; i < count; i++) {
+ LOGD(" adv[%d] = %f", i, outAdvances[i]);
+ }
+#endif
+}
+
+jfloat TextLayoutCacheValue::getTotalAdvance(size_t start, size_t count) const {
+ jfloat outTotalAdvance = 0;
+ for (size_t i = start; i < start + count; i++) {
+ outTotalAdvance += mAdvances[i];
+ }
+#if DEBUG_ADVANCES
+ LOGD("getTotalAdvance - start=%d count=%d - total=%f", start, count, outTotalAdvance);
+#endif
+ return outTotalAdvance;
+}
+
+void TextLayoutCacheValue::getGlyphsIndexAndCount(size_t start, size_t count, size_t* outStartIndex,
+ size_t* outGlyphsCount) const {
+ *outStartIndex = 0;
+ if (count == 0) {
+ *outGlyphsCount = 0;
+ return;
+ }
+ *outStartIndex = mLogClusters[start];
+ *outGlyphsCount = mLogClusters[start + count - 1] - mLogClusters[start] + 1;
+#if DEBUG_GLYPHS
+ LOGD("getGlyphsIndexes - start=%d count=%d - startIndex=%d count=%d", start, count,
+ *outStartIndex, *outGlyphsCount);
+ for(size_t i = 0; i < mGlyphs.size(); i++) {
+ LOGD("getGlyphs - all - glyph[%d] = %d", i, mGlyphs[i]);
+ }
+ for(size_t i = 0; i < mAdvances.size(); i++) {
+ LOGD("getGlyphs - all - logcl[%d] = %d", i, mLogClusters[i]);
+ }
+#endif
+}
+
+const jchar* TextLayoutCacheValue::getGlyphs(size_t startIndex, size_t count) {
+ const jchar* glyphs = mGlyphs.array() + startIndex;
+#if DEBUG_GLYPHS
+ LOGD("getGlyphs - with startIndex = %d count = %d", startIndex, count);
+ for (size_t i = 0; i < count; i++) {
+ LOGD("getGlyphs - result - glyph[%d] = %d", i, glyphs[i]);
+ }
+#endif
+ return glyphs;
+}
} // namespace android
diff --git a/core/jni/android/graphics/TextLayoutCache.h b/core/jni/android/graphics/TextLayoutCache.h
index 1f08bda..35dd6fd 100644
--- a/core/jni/android/graphics/TextLayoutCache.h
+++ b/core/jni/android/graphics/TextLayoutCache.h
@@ -68,9 +68,7 @@
public:
TextLayoutCacheKey();
- TextLayoutCacheKey(const SkPaint* paint,
- const UChar* text, size_t start, size_t count,
- size_t contextCount, int dirFlags);
+ TextLayoutCacheKey(const SkPaint* paint, const UChar* text, size_t count, int dirFlags);
TextLayoutCacheKey(const TextLayoutCacheKey& other);
@@ -90,9 +88,7 @@
private:
const UChar* text; // if text is NULL, use textCopy
String16 textCopy;
- size_t start;
size_t count;
- size_t contextCount;
int dirFlags;
SkTypeface* typeface;
SkScalar textSize;
@@ -116,14 +112,13 @@
void setElapsedTime(uint32_t time);
uint32_t getElapsedTime();
- void computeValues(SkPaint* paint, const UChar* chars, size_t start, size_t count,
- size_t contextCount, int dirFlags);
+ void computeValues(SkPaint* paint, const UChar* chars, size_t contextCount, int dirFlags);
- inline const jfloat* getAdvances() const { return mAdvances.array(); }
- inline size_t getAdvancesCount() const { return mAdvances.size(); }
- inline jfloat getTotalAdvance() const { return mTotalAdvance; }
- inline const jchar* getGlyphs() const { return mGlyphs.array(); }
- inline size_t getGlyphsCount() const { return mGlyphs.size(); }
+ void getAdvances(size_t start, size_t count, jfloat* outAdvances) const;
+ jfloat getTotalAdvance(size_t start, size_t count) const;
+ void getGlyphsIndexAndCount(size_t start, size_t count, size_t* outStartIndex,
+ size_t* outGlyphsCount) const;
+ const jchar* getGlyphs(size_t startIndex, size_t count);
/**
* Get the size of the Cache entry
@@ -138,14 +133,10 @@
SkPaint* paint, const UChar* chars, size_t start, size_t count, size_t contextCount,
bool isRTL);
- static void computeValuesWithHarfbuzz(SkPaint* paint, const UChar* chars, size_t start,
- size_t count, size_t contextCount, int dirFlags,
+ static void computeValuesWithHarfbuzz(SkPaint* paint, const UChar* chars,
+ size_t contextCount, int dirFlags,
Vector<jfloat>* const outAdvances, jfloat* outTotalAdvance,
- Vector<jchar>* const outGlyphs);
-
- static void computeAdvancesWithICU(SkPaint* paint, const UChar* chars, size_t start,
- size_t count, size_t contextCount, int dirFlags,
- jfloat* outAdvances, jfloat* outTotalAdvance);
+ Vector<jchar>* const outGlyphs, Vector<unsigned short>* const outLogClusters);
private:
/**
@@ -164,6 +155,11 @@
Vector<jchar> mGlyphs;
/**
+ * Harfbuzz Log Clusters
+ */
+ Vector<unsigned short> mLogClusters;
+
+ /**
* Time for computing the values (in milliseconds)
*/
uint32_t mElapsedTime;
@@ -175,7 +171,7 @@
static void computeRunValuesWithHarfbuzz(SkPaint* paint, const UChar* chars, size_t start,
size_t count, size_t contextCount, bool isRTL,
Vector<jfloat>* const outAdvances, jfloat* outTotalAdvance,
- Vector<jchar>* const outGlyphs);
+ Vector<jchar>* const outGlyphs, Vector<unsigned short>* const outLogClusters);
}; // TextLayoutCacheValue
/**
@@ -199,8 +195,8 @@
*/
void operator()(TextLayoutCacheKey& text, sp<TextLayoutCacheValue>& desc);
- sp<TextLayoutCacheValue> getValue(SkPaint* paint,
- const jchar* text, jint start, jint count, jint contextCount, jint dirFlags);
+ sp<TextLayoutCacheValue> getValue(SkPaint* paint, const jchar* text, jint count,
+ jint dirFlags);
/**
* Clear the cache
diff --git a/core/jni/android_app_backup_FullBackup.cpp b/core/jni/android_app_backup_FullBackup.cpp
index b36fa3e..6ef62a9 100644
--- a/core/jni/android_app_backup_FullBackup.cpp
+++ b/core/jni/android_app_backup_FullBackup.cpp
@@ -76,10 +76,10 @@
int ret;
// Extract the various strings, allowing for null object pointers
- const char* packagenamechars = env->GetStringUTFChars(packageNameObj, NULL);
- const char* rootchars = env->GetStringUTFChars(rootpathObj, NULL);
- const char* pathchars = env->GetStringUTFChars(pathObj, NULL);
- const char* domainchars = env->GetStringUTFChars(domainObj, NULL);
+ const char* packagenamechars = (packageNameObj) ? env->GetStringUTFChars(packageNameObj, NULL) : NULL;
+ const char* rootchars = (rootpathObj) ? env->GetStringUTFChars(rootpathObj, NULL) : NULL;
+ const char* pathchars = (pathObj) ? env->GetStringUTFChars(pathObj, NULL) : NULL;
+ const char* domainchars = (domainObj) ? env->GetStringUTFChars(domainObj, NULL) : NULL;
String8 packageName(packagenamechars ? packagenamechars : "");
String8 rootpath(rootchars ? rootchars : "");
diff --git a/core/jni/android_net_wifi_Wifi.cpp b/core/jni/android_net_wifi_Wifi.cpp
index 84a50f0..84c636b 100644
--- a/core/jni/android_net_wifi_Wifi.cpp
+++ b/core/jni/android_net_wifi_Wifi.cpp
@@ -402,30 +402,6 @@
return (jint)rssi;
}
-static jint android_net_wifi_getRssiCommand(JNIEnv* env, jobject)
-{
- return android_net_wifi_getRssiHelper("DRIVER RSSI");
-}
-
-static jint android_net_wifi_getRssiApproxCommand(JNIEnv* env, jobject)
-{
- return android_net_wifi_getRssiHelper("DRIVER RSSI-APPROX");
-}
-
-static jint android_net_wifi_getLinkSpeedCommand(JNIEnv* env, jobject)
-{
- char reply[BUF_SIZE];
- int linkspeed;
-
- if (doCommand("DRIVER LINKSPEED", reply, sizeof(reply)) != 0) {
- return (jint)-1;
- }
- // reply comes back in the form "LinkSpeed XX" where XX is the
- // number we're interested in.
- sscanf(reply, "%*s %u", &linkspeed);
- return (jint)linkspeed;
-}
-
static jstring android_net_wifi_getMacAddressCommand(JNIEnv* env, jobject)
{
char reply[BUF_SIZE];
@@ -625,10 +601,6 @@
(void*) android_net_wifi_setBluetoothCoexistenceModeCommand },
{ "setBluetoothCoexistenceScanModeCommand", "(Z)Z",
(void*) android_net_wifi_setBluetoothCoexistenceScanModeCommand },
- { "getRssiCommand", "()I", (void*) android_net_wifi_getRssiCommand },
- { "getRssiApproxCommand", "()I",
- (void*) android_net_wifi_getRssiApproxCommand},
- { "getLinkSpeedCommand", "()I", (void*) android_net_wifi_getLinkSpeedCommand },
{ "getMacAddressCommand", "()Ljava/lang/String;", (void*) android_net_wifi_getMacAddressCommand },
{ "saveConfigCommand", "()Z", (void*) android_net_wifi_saveConfigCommand },
{ "reloadConfigCommand", "()Z", (void*) android_net_wifi_reloadConfigCommand },
diff --git a/core/jni/android_view_GLES20Canvas.cpp b/core/jni/android_view_GLES20Canvas.cpp
index 395e417..e542a47 100644
--- a/core/jni/android_view_GLES20Canvas.cpp
+++ b/core/jni/android_view_GLES20Canvas.cpp
@@ -477,19 +477,21 @@
#if RTL_USE_HARFBUZZ
sp<TextLayoutCacheValue> value;
#if USE_TEXT_LAYOUT_CACHE
- value = TextLayoutCache::getInstance().getValue(paint, text, 0, count, count, flags);
+ value = TextLayoutCache::getInstance().getValue(paint, text, count, flags);
if (value == NULL) {
LOGE("Cannot get TextLayoutCache value");
return ;
}
#else
value = new TextLayoutCacheValue();
- value->computeValues(paint, text, 0, count, count, flags);
+ value->computeValues(paint, text, count, flags);
#endif
- const jchar* glyphArray = value->getGlyphs();
- int glyphCount = value->getGlyphsCount();
- int bytesCount = glyphCount * sizeof(jchar);
- renderer->drawText((const char*) glyphArray, bytesCount, glyphCount, x, y, paint);
+ size_t startIndex = 0;
+ size_t glyphsCount = 0;
+ value->getGlyphsIndexAndCount(0, count, &startIndex, &glyphsCount);
+ const jchar* glyphs = value->getGlyphs(startIndex, glyphsCount);
+ int bytesCount = glyphsCount * sizeof(jchar);
+ renderer->drawText((const char*) glyphs, bytesCount, glyphsCount, x, y, paint);
#else
const jchar *workText;
jchar* buffer = NULL;
@@ -507,19 +509,21 @@
#if RTL_USE_HARFBUZZ
sp<TextLayoutCacheValue> value;
#if USE_TEXT_LAYOUT_CACHE
- value = TextLayoutCache::getInstance().getValue(paint, text, start, count, contextCount, flags);
+ value = TextLayoutCache::getInstance().getValue(paint, text, contextCount, flags);
if (value == NULL) {
LOGE("Cannot get TextLayoutCache value");
return ;
}
#else
value = new TextLayoutCacheValue();
- value->computeValues(paint, text, start, count, contextCount, flags);
+ value->computeValues(paint, text, contextCount, flags);
#endif
- const jchar* glyphArray = value->getGlyphs();
- int glyphCount = value->getGlyphsCount();
- int bytesCount = glyphCount * sizeof(jchar);
- renderer->drawText((const char*) glyphArray, bytesCount, glyphCount, x, y, paint);
+ size_t startIndex = 0;
+ size_t glyphsCount = 0;
+ value->getGlyphsIndexAndCount(start, count, &startIndex, &glyphsCount);
+ const jchar* glyphs = value->getGlyphs(startIndex, glyphsCount);
+ int bytesCount = glyphsCount * sizeof(jchar);
+ renderer->drawText((const char*) glyphs, bytesCount, glyphsCount, x, y, paint);
#else
uint8_t rtl = flags & 0x1;
if (rtl) {
diff --git a/core/res/res/drawable-hdpi/btn_code_lock_default_holo.png b/core/res/res/drawable-hdpi/btn_code_lock_default_holo.png
index 9409890..28b2578 100644
--- a/core/res/res/drawable-hdpi/btn_code_lock_default_holo.png
+++ b/core/res/res/drawable-hdpi/btn_code_lock_default_holo.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/btn_code_lock_touched_holo.png b/core/res/res/drawable-hdpi/btn_code_lock_touched_holo.png
index 55acc9a..66cb1ec 100644
--- a/core/res/res/drawable-hdpi/btn_code_lock_touched_holo.png
+++ b/core/res/res/drawable-hdpi/btn_code_lock_touched_holo.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_lockscreen_handle_normal.png b/core/res/res/drawable-hdpi/ic_lockscreen_handle_normal.png
index 1b7f499..5f8a7d1 100644
--- a/core/res/res/drawable-hdpi/ic_lockscreen_handle_normal.png
+++ b/core/res/res/drawable-hdpi/ic_lockscreen_handle_normal.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_lockscreen_unlock_focused.png b/core/res/res/drawable-hdpi/ic_lockscreen_unlock_focused.png
deleted file mode 100644
index da77340..0000000
--- a/core/res/res/drawable-hdpi/ic_lockscreen_unlock_focused.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-hdpi/indicator_code_lock_drag_direction_green_up.png b/core/res/res/drawable-hdpi/indicator_code_lock_drag_direction_green_up.png
deleted file mode 100644
index 6560696..0000000
--- a/core/res/res/drawable-hdpi/indicator_code_lock_drag_direction_green_up.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-hdpi/indicator_code_lock_point_area_default_holo.png b/core/res/res/drawable-hdpi/indicator_code_lock_point_area_default_holo.png
index 237011c..28b2578 100644
--- a/core/res/res/drawable-hdpi/indicator_code_lock_point_area_default_holo.png
+++ b/core/res/res/drawable-hdpi/indicator_code_lock_point_area_default_holo.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/indicator_code_lock_point_area_green_holo.png b/core/res/res/drawable-hdpi/indicator_code_lock_point_area_green_holo.png
index 2418017..545cc09 100644
--- a/core/res/res/drawable-hdpi/indicator_code_lock_point_area_green_holo.png
+++ b/core/res/res/drawable-hdpi/indicator_code_lock_point_area_green_holo.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/indicator_code_lock_point_area_red_holo.png b/core/res/res/drawable-hdpi/indicator_code_lock_point_area_red_holo.png
index 2120bad..9176b33 100644
--- a/core/res/res/drawable-hdpi/indicator_code_lock_point_area_red_holo.png
+++ b/core/res/res/drawable-hdpi/indicator_code_lock_point_area_red_holo.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/stat_notify_wifi_in_range.png b/core/res/res/drawable-hdpi/stat_notify_wifi_in_range.png
index 716ba9d..f3aaa27 100644
--- a/core/res/res/drawable-hdpi/stat_notify_wifi_in_range.png
+++ b/core/res/res/drawable-hdpi/stat_notify_wifi_in_range.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/vpn_connected.png b/core/res/res/drawable-hdpi/vpn_connected.png
index 65fc6db..c3547e8 100644
--- a/core/res/res/drawable-hdpi/vpn_connected.png
+++ b/core/res/res/drawable-hdpi/vpn_connected.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/vpn_disconnected.png b/core/res/res/drawable-hdpi/vpn_disconnected.png
index 2440c69..10a9065 100644
--- a/core/res/res/drawable-hdpi/vpn_disconnected.png
+++ b/core/res/res/drawable-hdpi/vpn_disconnected.png
Binary files differ
diff --git a/core/res/res/drawable-large-mdpi/indicator_code_lock_drag_direction_green_up.png b/core/res/res/drawable-large-mdpi/indicator_code_lock_drag_direction_green_up.png
deleted file mode 100644
index 0bc86c3..0000000
--- a/core/res/res/drawable-large-mdpi/indicator_code_lock_drag_direction_green_up.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-ldpi/indicator_code_lock_drag_direction_green_up.png b/core/res/res/drawable-ldpi/indicator_code_lock_drag_direction_green_up.png
deleted file mode 100644
index 9c8610f..0000000
--- a/core/res/res/drawable-ldpi/indicator_code_lock_drag_direction_green_up.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-mdpi/btn_code_lock_default.png b/core/res/res/drawable-mdpi/btn_code_lock_default.png
old mode 100755
new mode 100644
index f524317..206f9b3
--- a/core/res/res/drawable-mdpi/btn_code_lock_default.png
+++ b/core/res/res/drawable-mdpi/btn_code_lock_default.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/btn_code_lock_default_holo.png b/core/res/res/drawable-mdpi/btn_code_lock_default_holo.png
index 82fc3b2..4c4adf2 100644
--- a/core/res/res/drawable-mdpi/btn_code_lock_default_holo.png
+++ b/core/res/res/drawable-mdpi/btn_code_lock_default_holo.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/btn_code_lock_touched.png b/core/res/res/drawable-mdpi/btn_code_lock_touched.png
old mode 100755
new mode 100644
index 5cd436c..98a3b6d
--- a/core/res/res/drawable-mdpi/btn_code_lock_touched.png
+++ b/core/res/res/drawable-mdpi/btn_code_lock_touched.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/btn_code_lock_touched_holo.png b/core/res/res/drawable-mdpi/btn_code_lock_touched_holo.png
index d1fe1ad..ef701ed 100644
--- a/core/res/res/drawable-mdpi/btn_code_lock_touched_holo.png
+++ b/core/res/res/drawable-mdpi/btn_code_lock_touched_holo.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_lockscreen_handle_normal.png b/core/res/res/drawable-mdpi/ic_lockscreen_handle_normal.png
index 754d7bc..1d547e1 100644
--- a/core/res/res/drawable-mdpi/ic_lockscreen_handle_normal.png
+++ b/core/res/res/drawable-mdpi/ic_lockscreen_handle_normal.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_lockscreen_unlock_focused.png b/core/res/res/drawable-mdpi/ic_lockscreen_unlock_focused.png
deleted file mode 100644
index 6f51447..0000000
--- a/core/res/res/drawable-mdpi/ic_lockscreen_unlock_focused.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-mdpi/indicator_code_lock_drag_direction_green_up.png b/core/res/res/drawable-mdpi/indicator_code_lock_drag_direction_green_up.png
deleted file mode 100644
index 7ddeba5..0000000
--- a/core/res/res/drawable-mdpi/indicator_code_lock_drag_direction_green_up.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-mdpi/indicator_code_lock_point_area_default.png b/core/res/res/drawable-mdpi/indicator_code_lock_point_area_default.png
index f6d9f1b..05c194b 100644
--- a/core/res/res/drawable-mdpi/indicator_code_lock_point_area_default.png
+++ b/core/res/res/drawable-mdpi/indicator_code_lock_point_area_default.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/indicator_code_lock_point_area_default_holo.png b/core/res/res/drawable-mdpi/indicator_code_lock_point_area_default_holo.png
index a627cda..4c4adf2 100644
--- a/core/res/res/drawable-mdpi/indicator_code_lock_point_area_default_holo.png
+++ b/core/res/res/drawable-mdpi/indicator_code_lock_point_area_default_holo.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/indicator_code_lock_point_area_green.png b/core/res/res/drawable-mdpi/indicator_code_lock_point_area_green.png
index b7262d1..8f24832 100644
--- a/core/res/res/drawable-mdpi/indicator_code_lock_point_area_green.png
+++ b/core/res/res/drawable-mdpi/indicator_code_lock_point_area_green.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/indicator_code_lock_point_area_green_holo.png b/core/res/res/drawable-mdpi/indicator_code_lock_point_area_green_holo.png
index 308624b..cb5b31a 100644
--- a/core/res/res/drawable-mdpi/indicator_code_lock_point_area_green_holo.png
+++ b/core/res/res/drawable-mdpi/indicator_code_lock_point_area_green_holo.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/indicator_code_lock_point_area_red_holo.png b/core/res/res/drawable-mdpi/indicator_code_lock_point_area_red_holo.png
index 6c451ec..8434741 100644
--- a/core/res/res/drawable-mdpi/indicator_code_lock_point_area_red_holo.png
+++ b/core/res/res/drawable-mdpi/indicator_code_lock_point_area_red_holo.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/stat_notify_wifi_in_range.png b/core/res/res/drawable-mdpi/stat_notify_wifi_in_range.png
index 3bf0d35..747cb97 100644
--- a/core/res/res/drawable-mdpi/stat_notify_wifi_in_range.png
+++ b/core/res/res/drawable-mdpi/stat_notify_wifi_in_range.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/vpn_connected.png b/core/res/res/drawable-mdpi/vpn_connected.png
index 0d1a026..7e167f8 100644
--- a/core/res/res/drawable-mdpi/vpn_connected.png
+++ b/core/res/res/drawable-mdpi/vpn_connected.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/vpn_disconnected.png b/core/res/res/drawable-mdpi/vpn_disconnected.png
index d16d7fb..a08c42a 100644
--- a/core/res/res/drawable-mdpi/vpn_disconnected.png
+++ b/core/res/res/drawable-mdpi/vpn_disconnected.png
Binary files differ
diff --git a/core/res/res/drawable-nodpi/indicator_code_lock_drag_direction_green_up.png b/core/res/res/drawable-nodpi/indicator_code_lock_drag_direction_green_up.png
new file mode 100644
index 0000000..cc46f19
--- /dev/null
+++ b/core/res/res/drawable-nodpi/indicator_code_lock_drag_direction_green_up.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/btn_code_lock_default.png b/core/res/res/drawable-xhdpi/btn_code_lock_default.png
index a644014..c1358a2 100644
--- a/core/res/res/drawable-xhdpi/btn_code_lock_default.png
+++ b/core/res/res/drawable-xhdpi/btn_code_lock_default.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/btn_code_lock_default_holo.png b/core/res/res/drawable-xhdpi/btn_code_lock_default_holo.png
index f607251..db1cbe6 100644
--- a/core/res/res/drawable-xhdpi/btn_code_lock_default_holo.png
+++ b/core/res/res/drawable-xhdpi/btn_code_lock_default_holo.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/btn_code_lock_touched.png b/core/res/res/drawable-xhdpi/btn_code_lock_touched.png
index 67faad2..0fafc3e 100644
--- a/core/res/res/drawable-xhdpi/btn_code_lock_touched.png
+++ b/core/res/res/drawable-xhdpi/btn_code_lock_touched.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/btn_code_lock_touched_holo.png b/core/res/res/drawable-xhdpi/btn_code_lock_touched_holo.png
index e057cdd..073c3ac 100644
--- a/core/res/res/drawable-xhdpi/btn_code_lock_touched_holo.png
+++ b/core/res/res/drawable-xhdpi/btn_code_lock_touched_holo.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/ic_lockscreen_handle_normal.png b/core/res/res/drawable-xhdpi/ic_lockscreen_handle_normal.png
index 544924e..b09071b 100644
--- a/core/res/res/drawable-xhdpi/ic_lockscreen_handle_normal.png
+++ b/core/res/res/drawable-xhdpi/ic_lockscreen_handle_normal.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/ic_lockscreen_unlock_focused.png b/core/res/res/drawable-xhdpi/ic_lockscreen_unlock_focused.png
deleted file mode 100644
index d067ab8..0000000
--- a/core/res/res/drawable-xhdpi/ic_lockscreen_unlock_focused.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/indicator_code_lock_drag_direction_green_up.png b/core/res/res/drawable-xhdpi/indicator_code_lock_drag_direction_green_up.png
deleted file mode 100644
index a89b8d5..0000000
--- a/core/res/res/drawable-xhdpi/indicator_code_lock_drag_direction_green_up.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/indicator_code_lock_point_area_default.png b/core/res/res/drawable-xhdpi/indicator_code_lock_point_area_default.png
index 997d6a5..0812cb5 100644
--- a/core/res/res/drawable-xhdpi/indicator_code_lock_point_area_default.png
+++ b/core/res/res/drawable-xhdpi/indicator_code_lock_point_area_default.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/indicator_code_lock_point_area_default_holo.png b/core/res/res/drawable-xhdpi/indicator_code_lock_point_area_default_holo.png
index d98a126..db1cbe6 100644
--- a/core/res/res/drawable-xhdpi/indicator_code_lock_point_area_default_holo.png
+++ b/core/res/res/drawable-xhdpi/indicator_code_lock_point_area_default_holo.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/indicator_code_lock_point_area_green.png b/core/res/res/drawable-xhdpi/indicator_code_lock_point_area_green.png
index 2eb69f6..3ab2e99 100644
--- a/core/res/res/drawable-xhdpi/indicator_code_lock_point_area_green.png
+++ b/core/res/res/drawable-xhdpi/indicator_code_lock_point_area_green.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/indicator_code_lock_point_area_green_holo.png b/core/res/res/drawable-xhdpi/indicator_code_lock_point_area_green_holo.png
index 4491f02..de4ca91 100644
--- a/core/res/res/drawable-xhdpi/indicator_code_lock_point_area_green_holo.png
+++ b/core/res/res/drawable-xhdpi/indicator_code_lock_point_area_green_holo.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/indicator_code_lock_point_area_red_holo.png b/core/res/res/drawable-xhdpi/indicator_code_lock_point_area_red_holo.png
index 6e91fbc..853b0f0 100644
--- a/core/res/res/drawable-xhdpi/indicator_code_lock_point_area_red_holo.png
+++ b/core/res/res/drawable-xhdpi/indicator_code_lock_point_area_red_holo.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/stat_notify_wifi_in_range.png b/core/res/res/drawable-xhdpi/stat_notify_wifi_in_range.png
index 1909183..6bb7512 100644
--- a/core/res/res/drawable-xhdpi/stat_notify_wifi_in_range.png
+++ b/core/res/res/drawable-xhdpi/stat_notify_wifi_in_range.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/vpn_connected.png b/core/res/res/drawable-xhdpi/vpn_connected.png
index 5d37ffc..1f46be2 100644
--- a/core/res/res/drawable-xhdpi/vpn_connected.png
+++ b/core/res/res/drawable-xhdpi/vpn_connected.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/vpn_disconnected.png b/core/res/res/drawable-xhdpi/vpn_disconnected.png
index dd9ba92..847d3f5 100644
--- a/core/res/res/drawable-xhdpi/vpn_disconnected.png
+++ b/core/res/res/drawable-xhdpi/vpn_disconnected.png
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/indicator_code_lock_drag_direction_green_up.png b/core/res/res/drawable-xlarge-hdpi/indicator_code_lock_drag_direction_green_up.png
deleted file mode 100644
index c605607..0000000
--- a/core/res/res/drawable-xlarge-hdpi/indicator_code_lock_drag_direction_green_up.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/values-mcc204/strings.xml b/core/res/res/values-mcc204/strings.xml
index c3fff3d..134e9d2 100644
--- a/core/res/res/values-mcc204/strings.xml
+++ b/core/res/res/values-mcc204/strings.xml
@@ -20,6 +20,6 @@
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- A string used to replace %s in a URL to fill in the locale for countries -->
- <!-- whose locale we don't natively support. A 0 length string triggers no replacement -->
+ <!-- whose locale we don't natively support. A 0 length string triggers no replacement. Do not translate -->
<string name="locale_replacement">nl_nl</string>
</resources>
diff --git a/core/res/res/values-mcc230/strings.xml b/core/res/res/values-mcc230/strings.xml
index 559b858..3078bf8 100644
--- a/core/res/res/values-mcc230/strings.xml
+++ b/core/res/res/values-mcc230/strings.xml
@@ -20,6 +20,6 @@
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- A string used to replace %s in a URL to fill in the locale for countries -->
- <!-- whose locale we don't natively support. A 0 length string triggers no replacement -->
+ <!-- whose locale we don't natively support. A 0 length string triggers no replacement. Do not translate -->
<string name="locale_replacement">cs_cz</string>
</resources>
diff --git a/core/res/res/values-mcc232/strings.xml b/core/res/res/values-mcc232/strings.xml
index 494770f..809e4a0 100644
--- a/core/res/res/values-mcc232/strings.xml
+++ b/core/res/res/values-mcc232/strings.xml
@@ -20,6 +20,6 @@
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- A string used to replace %s in a URL to fill in the locale for countries -->
- <!-- whose locale we don't natively support. A 0 length string triggers no replacement -->
+ <!-- whose locale we don't natively support. A 0 length string triggers no replacement. Do not translate -->
<string name="locale_replacement">de_at</string>
</resources>
diff --git a/core/res/res/values-mcc234/strings.xml b/core/res/res/values-mcc234/strings.xml
index 2e6a3f3..676defe 100644
--- a/core/res/res/values-mcc234/strings.xml
+++ b/core/res/res/values-mcc234/strings.xml
@@ -20,6 +20,6 @@
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- A string used to replace %s in a URL to fill in the locale for countries -->
- <!-- whose locale we don't natively support. A 0 length string triggers no replacement -->
+ <!-- whose locale we don't natively support. A 0 length string triggers no replacement. Do not translate -->
<string name="locale_replacement">en_gb</string>
</resources>
diff --git a/core/res/res/values-mcc260/strings.xml b/core/res/res/values-mcc260/strings.xml
index 20c19dd..90f2521 100644
--- a/core/res/res/values-mcc260/strings.xml
+++ b/core/res/res/values-mcc260/strings.xml
@@ -20,6 +20,6 @@
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- A string used to replace %s in a URL to fill in the locale for countries -->
- <!-- whose locale we don't natively support. A 0 length string triggers no replacement -->
+ <!-- whose locale we don't natively support. A 0 length string triggers no replacement. Do not translate -->
<string name="locale_replacement">pl_pl</string>
</resources>
diff --git a/core/res/res/values-mcc262/strings.xml b/core/res/res/values-mcc262/strings.xml
index 8ca0e31..ae323b8 100644
--- a/core/res/res/values-mcc262/strings.xml
+++ b/core/res/res/values-mcc262/strings.xml
@@ -20,6 +20,6 @@
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- A string used to replace %s in a URL to fill in the locale for countries -->
- <!-- whose locale we don't natively support. A 0 length string triggers no replacement -->
+ <!-- whose locale we don't natively support. A 0 length string triggers no replacement. Do not translate -->
<string name="locale_replacement">de_de</string>
</resources>
diff --git a/core/res/res/values/attrs_manifest.xml b/core/res/res/values/attrs_manifest.xml
index 11531fc..727c6ea 100644
--- a/core/res/res/values/attrs_manifest.xml
+++ b/core/res/res/values/attrs_manifest.xml
@@ -710,11 +710,12 @@
<enum name="preferExternal" value="2" />
</attr>
- <!-- Extra options for an activity's UI. If specified on the application
+ <!-- Extra options for an activity's UI. Applies to either the {@code <activity>} or
+ {@code <application>} tag. If specified on the {@code <application>}
tag these will be considered defaults for all activities in the
application. -->
<attr name="uiOptions">
- <!-- No extra UI options. -->
+ <!-- No extra UI options. This is the default. -->
<flag name="none" value="0" />
<!-- Split the options menu into a separate bar at the bottom of
the screen when severely constrained for horizontal space.
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 5eb3e5a..ae39760 100755
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -138,6 +138,18 @@
<item>"0,1"</item>
</string-array>
+ <!-- Set of NetworkInfo.getType() that reflect data usage. -->
+ <integer-array translatable="false" name="config_data_usage_network_types">
+ <item>0</item> <!-- TYPE_MOBILE -->
+ <item>2</item> <!-- TYPE_MOBILE_MMS -->
+ <item>3</item> <!-- TYPE_MOBILE_SUPL -->
+ <item>4</item> <!-- TYPE_MOBILE_DUN -->
+ <item>5</item> <!-- TYPE_MOBILE_HIPRI -->
+ <item>10</item> <!-- TYPE_MOBILE_FOTA -->
+ <item>11</item> <!-- TYPE_MOBILE_IMS -->
+ <item>12</item> <!-- TYPE_MOBILE_CBS -->
+ </integer-array>
+
<!-- The maximum duration (in milliseconds) we expect a network transition to take -->
<integer name="config_networkTransitionTimeout">60000</integer>
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index e093fa9..2d5d4cc 100755
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -41,9 +41,13 @@
<string name="untitled"><untitled></string>
<!-- Used to replace a range of characters in text that is too wide
- for the space allocated to it. -->
+ for the space allocated to it (three dots). -->
<string name="ellipsis">\u2026</string>
+ <!-- Used to replace a range of characters in text that is too wide
+ for the space allocated to it (two dots). -->
+ <string name="ellipsis_two_dots">\u2025</string>
+
<!-- How to display the lack of a phone number -->
<string name="emptyPhoneNumber">(No phone number)</string>
diff --git a/core/tests/coretests/apks/install_verifier_bad/Android.mk b/core/tests/coretests/apks/install_verifier_bad/Android.mk
new file mode 100644
index 0000000..b50cfd04
--- /dev/null
+++ b/core/tests/coretests/apks/install_verifier_bad/Android.mk
@@ -0,0 +1,11 @@
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_TAGS := tests
+
+LOCAL_SRC_FILES := $(call all-subdir-java-files)
+
+LOCAL_PACKAGE_NAME := FrameworkCoreTests_install_verifier_bad
+
+include $(BUILD_PACKAGE)
+
diff --git a/core/tests/coretests/apks/install_verifier_bad/AndroidManifest.xml b/core/tests/coretests/apks/install_verifier_bad/AndroidManifest.xml
new file mode 100644
index 0000000..0170cdd
--- /dev/null
+++ b/core/tests/coretests/apks/install_verifier_bad/AndroidManifest.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.android.frameworks.coretests.install_verifier_bad">
+
+ <package-verifier android:name="com.android.frameworks.coretests.nonexistent" android:publicKey="Zm9vYmFy" />
+
+ <application android:hasCode="false">
+ </application>
+</manifest>
diff --git a/core/tests/coretests/apks/install_verifier_bad/res/values/strings.xml b/core/tests/coretests/apks/install_verifier_bad/res/values/strings.xml
new file mode 100644
index 0000000..3b8b3b1
--- /dev/null
+++ b/core/tests/coretests/apks/install_verifier_bad/res/values/strings.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!-- Just need this dummy file to have something to build. -->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="dummy">dummy</string>
+</resources>
diff --git a/core/tests/coretests/apks/install_verifier_good/Android.mk b/core/tests/coretests/apks/install_verifier_good/Android.mk
new file mode 100644
index 0000000..a48a80e
--- /dev/null
+++ b/core/tests/coretests/apks/install_verifier_good/Android.mk
@@ -0,0 +1,10 @@
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_TAGS := tests
+
+LOCAL_SRC_FILES := $(call all-subdir-java-files)
+
+LOCAL_PACKAGE_NAME := FrameworkCoreTests_install_verifier_good
+
+include $(BUILD_PACKAGE)
diff --git a/core/tests/coretests/apks/install_verifier_good/AndroidManifest.xml b/core/tests/coretests/apks/install_verifier_good/AndroidManifest.xml
new file mode 100644
index 0000000..90135a5
--- /dev/null
+++ b/core/tests/coretests/apks/install_verifier_good/AndroidManifest.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.android.frameworks.coretests.install_verifier_bad">
+
+ <package-verifier android:name="com.android.frameworks.coretests" android:publicKey="MIIBIDANBgkqhkiG9w0BAQEFAAOCAQ0AMIIBCAKCAQEAnHgFkqwNXTgc3qpl7MimAG42SAxtcgexIBG+UIY6q+K1XQCa33FG1vIgIoDHzU172yYkO4qAbCazSxN1I6SSaCJJBNwBST58Cs8aBch09psDe2AwnZB00kKA4WutKoc0NhlR6vcqSC0JsgSxh14SrJjBqnc9aAC56v3lbVi+2OjaFvmjYAmcN6g0pt/tt7a0SgSeB6Jp/M8sVJbyzzbWTfkKO42PNKO6q0z1M3GrJ3GbO6WHVK0MU/wU4dtF1R4jT7vpPJuk7fnOVCYTUOxTVge/aaL/SqB9tffqIA0JpsG0niFAL4ntEZCJOqtakYDxUugvhaRXU89fwZBxxe7IJwIBAw==" />
+
+ <application android:hasCode="false">
+ </application>
+</manifest>
diff --git a/core/tests/coretests/apks/install_verifier_good/res/values/strings.xml b/core/tests/coretests/apks/install_verifier_good/res/values/strings.xml
new file mode 100644
index 0000000..3b8b3b1
--- /dev/null
+++ b/core/tests/coretests/apks/install_verifier_good/res/values/strings.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!-- Just need this dummy file to have something to build. -->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="dummy">dummy</string>
+</resources>
diff --git a/core/tests/coretests/src/android/net/http/AbstractProxyTest.java b/core/tests/coretests/src/android/net/http/AbstractProxyTest.java
index ee4ce95..4891232 100644
--- a/core/tests/coretests/src/android/net/http/AbstractProxyTest.java
+++ b/core/tests/coretests/src/android/net/http/AbstractProxyTest.java
@@ -219,6 +219,23 @@
assertEquals("GET /bar HTTP/1.1", recordedRequest.getRequestLine());
}
+ // http://b/5372438
+ public void testRetryWithProxy() throws Exception {
+ server.enqueue(new MockResponse()
+ .setSocketPolicy(SocketPolicy.DISCONNECT_AT_START));
+ server.play();
+
+ HttpClient httpProxyClient = newHttpClient();
+ HttpGet request = new HttpGet("http://android.com/foo");
+ ProxyConfig.REQUEST_PARAMETER.configure(server, httpProxyClient, request);
+
+ try {
+ httpProxyClient.execute(request);
+ fail();
+ } catch (IOException expected) {
+ }
+ }
+
enum ProxyConfig {
PROXY_SYSTEM_PROPERTY() {
@Override void configure(MockWebServer server, HttpClient client, HttpRequest request) {
diff --git a/data/fonts/Lohit_Hindi.ttf b/data/fonts/Lohit_Hindi.ttf
deleted file mode 100644
index 73caae3..0000000
--- a/data/fonts/Lohit_Hindi.ttf
+++ /dev/null
Binary files differ
diff --git a/data/fonts/Roboto-Bold.ttf b/data/fonts/Roboto-Bold.ttf
index c716bbb..e5d828d 100644
--- a/data/fonts/Roboto-Bold.ttf
+++ b/data/fonts/Roboto-Bold.ttf
Binary files differ
diff --git a/data/fonts/Roboto-BoldItalic.ttf b/data/fonts/Roboto-BoldItalic.ttf
index eeb5120..d8fa3ae 100644
--- a/data/fonts/Roboto-BoldItalic.ttf
+++ b/data/fonts/Roboto-BoldItalic.ttf
Binary files differ
diff --git a/data/fonts/Roboto-Italic.ttf b/data/fonts/Roboto-Italic.ttf
index 1e88d3e..6682d17 100644
--- a/data/fonts/Roboto-Italic.ttf
+++ b/data/fonts/Roboto-Italic.ttf
Binary files differ
diff --git a/data/fonts/Roboto-Regular.ttf b/data/fonts/Roboto-Regular.ttf
index 3033027..153c608 100644
--- a/data/fonts/Roboto-Regular.ttf
+++ b/data/fonts/Roboto-Regular.ttf
Binary files differ
diff --git a/data/fonts/fallback_fonts.xml b/data/fonts/fallback_fonts.xml
index e468558..881233a 100644
--- a/data/fonts/fallback_fonts.xml
+++ b/data/fonts/fallback_fonts.xml
@@ -56,7 +56,7 @@
</family>
<family>
<fileset>
- <file>Lohit_Hindi.ttf</file>
+ <file>Lohit-Devanagari.ttf</file>
</fileset>
</family>
<family>
diff --git a/data/fonts/fonts.mk b/data/fonts/fonts.mk
index 5bac8f0..67d04c9 100644
--- a/data/fonts/fonts.mk
+++ b/data/fonts/fonts.mk
@@ -30,7 +30,6 @@
frameworks/base/data/fonts/DroidSerif-Italic.ttf:system/fonts/DroidSerif-Italic.ttf \
frameworks/base/data/fonts/DroidSerif-BoldItalic.ttf:system/fonts/DroidSerif-BoldItalic.ttf \
frameworks/base/data/fonts/DroidSansMono.ttf:system/fonts/DroidSansMono.ttf \
- frameworks/base/data/fonts/Lohit_Hindi.ttf:system/fonts/Lohit_Hindi.ttf \
frameworks/base/data/fonts/DroidSansArmenian.ttf:system/fonts/DroidSansArmenian.ttf \
frameworks/base/data/fonts/DroidSansGeorgian.ttf:system/fonts/DroidSansGeorgian.ttf \
frameworks/base/data/fonts/Clockopia.ttf:system/fonts/Clockopia.ttf \
diff --git a/data/sounds/effects/ogg/Effect_Tick.ogg b/data/sounds/effects/ogg/Effect_Tick.ogg
index b379019..c8a5c36 100644
--- a/data/sounds/effects/ogg/Effect_Tick.ogg
+++ b/data/sounds/effects/ogg/Effect_Tick.ogg
Binary files differ
diff --git a/data/sounds/effects/ogg/KeypressDelete_14.ogg b/data/sounds/effects/ogg/KeypressDelete_14.ogg
index aa4349d..0baea25 100644
--- a/data/sounds/effects/ogg/KeypressDelete_14.ogg
+++ b/data/sounds/effects/ogg/KeypressDelete_14.ogg
Binary files differ
diff --git a/data/sounds/effects/ogg/KeypressDelete_49.ogg b/data/sounds/effects/ogg/KeypressDelete_49.ogg
index aa4349d..f5e9deb 100644
--- a/data/sounds/effects/ogg/KeypressDelete_49.ogg
+++ b/data/sounds/effects/ogg/KeypressDelete_49.ogg
Binary files differ
diff --git a/data/sounds/effects/ogg/KeypressReturn_14.ogg b/data/sounds/effects/ogg/KeypressReturn_14.ogg
index 2244a42..86a5a0e 100644
--- a/data/sounds/effects/ogg/KeypressReturn_14.ogg
+++ b/data/sounds/effects/ogg/KeypressReturn_14.ogg
Binary files differ
diff --git a/data/sounds/effects/ogg/KeypressReturn_49.ogg b/data/sounds/effects/ogg/KeypressReturn_49.ogg
index 2244a42..b0ddee5 100644
--- a/data/sounds/effects/ogg/KeypressReturn_49.ogg
+++ b/data/sounds/effects/ogg/KeypressReturn_49.ogg
Binary files differ
diff --git a/data/sounds/effects/ogg/KeypressSpacebar_14.ogg b/data/sounds/effects/ogg/KeypressSpacebar_14.ogg
index 56ea15e..058534a 100644
--- a/data/sounds/effects/ogg/KeypressSpacebar_14.ogg
+++ b/data/sounds/effects/ogg/KeypressSpacebar_14.ogg
Binary files differ
diff --git a/data/sounds/effects/ogg/KeypressSpacebar_49.ogg b/data/sounds/effects/ogg/KeypressSpacebar_49.ogg
index 56ea15e..3866e0e9 100644
--- a/data/sounds/effects/ogg/KeypressSpacebar_49.ogg
+++ b/data/sounds/effects/ogg/KeypressSpacebar_49.ogg
Binary files differ
diff --git a/data/sounds/effects/ogg/KeypressStandard_14.ogg b/data/sounds/effects/ogg/KeypressStandard_14.ogg
index 8df7214..317c8f3 100644
--- a/data/sounds/effects/ogg/KeypressStandard_14.ogg
+++ b/data/sounds/effects/ogg/KeypressStandard_14.ogg
Binary files differ
diff --git a/data/sounds/effects/ogg/KeypressStandard_49.ogg b/data/sounds/effects/ogg/KeypressStandard_49.ogg
index 8df7214..893bb52 100644
--- a/data/sounds/effects/ogg/KeypressStandard_49.ogg
+++ b/data/sounds/effects/ogg/KeypressStandard_49.ogg
Binary files differ
diff --git a/docs/html/guide/appendix/media-formats.jd b/docs/html/guide/appendix/media-formats.jd
index e128a1c..ccc63a2 100644
--- a/docs/html/guide/appendix/media-formats.jd
+++ b/docs/html/guide/appendix/media-formats.jd
@@ -37,11 +37,16 @@
<ul>
<li>RTSP (RTP, SDP)</li>
- <li>HTTP progressive streaming</li>
- <li>HTTP live streaming <a href="http://tools.ietf.org/html/draft-pantos-http-live-streaming-05">draft protocol</a> (Android 3.0 and above)</li>
+ <li>HTTP/HTTPS progressive streaming</li>
+ <li>HTTP/HTTPS live streaming <a href="http://tools.ietf.org/html/draft-pantos-http-live-streaming">draft protocol</a>: <ul>
+ <li>MPEG-2 TS media files only</li>
+ <li>Protocol version 3 (Android 4.0 and above)</li>
+ <li>Protocol version 2 (Android 3.x)</li>
+ <li>Not supported before Android 3.0</li>
+ </ul></li>
</ul>
-<p class="note"><strong>Note:</strong> HTTPS is not supported at this time.</p>
+<p class="note"><strong>Note:</strong> HTTPS is not supported before Android 3.1.</p>
<h2 id="core">Core Media Formats</h2>
@@ -71,7 +76,11 @@
<td style="text-align: center;"><big>•</big></td>
<td rowspan="3">Mono/Stereo content in any combination of standard bit
rates up to 160 kbps and sampling rates from 8 to 48kHz</td>
-<td rowspan="3">3GPP (.3gp), and MPEG-4 (.mp4, .m4a). ADTS raw AAC (.aac, decode only, ADIF not supported, Android 3.1+). </td>
+<td rowspan="3">
+ • 3GPP (.3gp)<br>
+ • MPEG-4 (.mp4, .m4a)<br>
+ • ADTS raw AAC (.aac, decode in Android 3.1+, encode in Android 4.0+, ADIF not supported)<br>
+ • MPEG-TS (.ts, not seekable, Android 3.0+)</td>
</tr>
<tr>
@@ -91,8 +100,8 @@
<td style="text-align: center;"><big>•</big></td>
<td style="text-align: center;"><big>•</big></td>
<td>4.75 to 12.2 kbps sampled @ 8kHz</td>
-<td>3GPP (.3gp)
-</td>
+<td>
+ 3GPP (.3gp)</td>
</tr>
<tr>
@@ -100,19 +109,21 @@
<td style="text-align: center;"><big>•</big></td>
<td style="text-align: center;"><big>•</big></td>
<td>9 rates from 6.60 kbit/s to 23.85 kbit/s sampled @ 16kHz</td>
-<td>3GPP (.3gp)</td>
+<td>
+ 3GPP (.3gp)</td>
</tr>
<tr>
<td>FLAC</td>
<td> </td>
-<td style="text-align: center;"><big>•</big><br><small>(Android 3.1+)</small></td>
+<td style="text-align: center;" nowrap><big>•</big><br><small>(Android 3.1+)</small></td>
<td>Mono/Stereo (no multichannel). Sample rates up to 48 kHz (but up to 44.1
kHz is recommended on devices with 44.1 kHz output, as the 48 to 44.1 kHz
downsampler does not include a low-pass filter). 16-bit recommended;
no dither applied for 24-bit.
</td>
-<td>FLAC (.flac) only</td>
+<td>
+ FLAC (.flac) only</td>
</tr>
<tr>
@@ -121,7 +132,8 @@
<td style="text-align: center;"><big>•</big></td>
<td>Mono/Stereo 8-320Kbps constant (CBR) or variable bit-rate (VBR)
</td>
-<td>MP3 (.mp3)</td>
+<td>
+ MP3 (.mp3)</td>
</tr>
<tr>
@@ -129,15 +141,21 @@
<td> </td>
<td style="text-align: center;"><big>•</big></td>
<td>MIDI Type 0 and 1. DLS Version 1 and 2. XMF and Mobile XMF. Support for ringtone formats RTTTL/RTX, OTA, and iMelody </td>
-<td>Type 0 and 1 (.mid, .xmf, .mxmf). Also RTTTL/RTX (.rtttl, .rtx), OTA (.ota), and iMelody (.imy)</td>
+<td>
+ • Type 0 and 1 (.mid, .xmf, .mxmf)<br>
+ • RTTTL/RTX (.rtttl, .rtx)<br>
+ • OTA (.ota)<br>
+ • iMelody (.imy)</td>
</tr>
<tr>
-<td>Ogg Vorbis</td>
+<td>Vorbis</td>
<td> </td>
<td style="text-align: center;"><big>•</big></td>
<td> </td>
-<td>Ogg (.ogg)</td>
+<td>
+ • Ogg (.ogg)<br>
+ • Matroska (.mkv, Android 4.0+)</td>
</tr>
<tr>
@@ -145,16 +163,18 @@
<td> </td>
<td style="text-align: center;"><big>•</big></td>
<td>8- and 16-bit linear PCM (rates up to limit of hardware)</td>
-<td>WAVE (.wav)</td>
+<td>
+ WAVE (.wav)</td>
</tr>
<tr>
-<td rowspan="4">Image</td>
+<td rowspan="5">Image</td>
<td>JPEG</td>
<td style="text-align: center;"><big>•</big></td>
<td style="text-align: center;"><big>•</big></td>
<td>Base+progressive</td>
-<td>JPEG (.jpg)</td>
+<td>
+ JPEG (.jpg)</td>
</tr>
<tr>
@@ -162,7 +182,8 @@
<td> </td>
<td style="text-align: center;"><big>•</big></td>
<td> </td>
-<td>GIF (.gif)</td>
+<td>
+ GIF (.gif)</td>
</tr>
<tr>
@@ -170,7 +191,8 @@
<td style="text-align: center;"><big>•</big></td>
<td style="text-align: center;"><big>•</big></td>
<td> </td>
-<td>PNG (.png)</td>
+<td>
+ PNG (.png)</td>
</tr>
<tr>
@@ -178,7 +200,17 @@
<td> </td>
<td style="text-align: center;"><big>•</big></td>
<td> </td>
-<td>BMP (.bmp)</td>
+<td>
+ BMP (.bmp)</td>
+</tr>
+
+<tr>
+<td>WEBP</td>
+<td style="text-align: center;" nowrap><big>•</big><br><small>(Android 4.0+)</small></td>
+<td style="text-align: center;" nowrap><big>•</big><br><small>(Android 4.0+)</small></td>
+<td> </td>
+<td>
+ WebP (.webp)</td>
</tr>
@@ -188,15 +220,20 @@
<td style="text-align: center;"><big>•</big></td>
<td style="text-align: center;"><big>•</big></td>
<td> </td>
-<td>3GPP (.3gp) and MPEG-4 (.mp4)</td>
+<td>
+ • 3GPP (.3gp)<br>
+ • MPEG-4 (.mp4)</td>
</tr>
<tr>
<td>H.264 AVC</td>
<td style="text-align: center;" nowrap><big>•</big><br><small>(Android 3.0+)</small></td>
-<td style="text-align: center;"><big>•</big></td>
+<td style="text-align: center;" nowrap><big>•</big></td>
<td>Baseline Profile (BP)</td>
-<td>3GPP (.3gp) and MPEG-4 (.mp4). MPEG-TS (.ts, AAC audio only, not seekable, Android 3.0+)</td>
+<td>
+ • 3GPP (.3gp)<br>
+ • MPEG-4 (.mp4)<br>
+ • MPEG-TS (.ts, AAC audio only, not seekable, Android 3.0+)</td>
</tr>
<tr>
@@ -204,15 +241,18 @@
<td> </td>
<td style="text-align: center;"><big>•</big></td>
<td> </td>
-<td>3GPP (.3gp)</td>
+<td>
+ 3GPP (.3gp)</td>
</tr>
<tr>
<td>VP8</td>
<td> </td>
-<td style="text-align: center;"><big>•</big><br><small>(Android 2.3.3+)</small></td>
-<td> </td>
-<td><a href="http://www.webmproject.org/">WebM</a> (.webm)</td>
+<td style="text-align: center;" nowrap><big>•</big><br><small>(Android 2.3.3+)</small></td>
+<td>Streamable only in Android 4.0 and above</td>
+<td>
+ • <a href="http://www.webmproject.org/">WebM</a> (.webm)<br>
+ • Matroska (.mkv, Android 4.0+)</td>
</tr>
</tbody></table>
@@ -220,7 +260,7 @@
<h2 id="recommendations">Video Encoding Recommendations</h2>
-<p>Table 2, below, lists examples of video encoding profiles and parameters that the Android media framework supports for playback. In addition to these encoding parameter recommendations, a device's available video recording profiles can be used as a proxy for media playback capabilities. These profiles can be inspected using the {@link android.media.CamcorderProfile CamcorderProfile} class, which is available since API level 8.</p>
+<p>Table 2, below, lists examples of video encoding profiles and parameters that the Android media framework supports for playback. In addition to these encoding parameter recommendations, a device's available <em>video recording</em> profiles can be used as a proxy for media playback capabilities. These profiles can be inspected using the {@link android.media.CamcorderProfile CamcorderProfile} class, which is available since API level 8.</p>
<p class="table-caption" id="encoding-recommendations-table"><strong>Table 2.</strong> Examples of supported video encoding parameters.</p>
@@ -228,45 +268,53 @@
<thead>
<tr>
<th> </th>
- <th style="background-color:#f3f3f3;font-weight:normal">Lower quality</th>
- <th style="background-color:#f3f3f3;font-weight:normal">Higher quality</th>
+ <th style="background-color:#f3f3f3;font-weight:normal"><acronym title="Standard definition">SD</a> (Low quality)</th>
+ <th style="background-color:#f3f3f3;font-weight:normal"><acronym title="Standard definition">SD</a> (High quality)</th>
+ <th style="background-color:#f3f3f3;font-weight:normal"><acronym title="High definition">HD</a> (Not available on all devices)</th>
</tr>
</thead>
<tbody>
<tr>
<th>Video codec</th>
- <td>H.264 Baseline Profile</th>
- <td>H.264 Baseline Profile</th>
+ <td>H.264 Baseline Profile</td>
+ <td>H.264 Baseline Profile</td>
+ <td>H.264 Baseline Profile</td>
</tr>
<tr>
<th>Video resolution</th>
- <td>176 x 144 px</th>
- <td>480 x 360 px</th>
+ <td>176 x 144 px</td>
+ <td>480 x 360 px</td>
+ <td>1280 x 720 px</td>
</tr>
<tr>
<th>Video frame rate</th>
- <td>12 fps</th>
- <td>30 fps</th>
+ <td>12 fps</td>
+ <td>30 fps</td>
+ <td>30 fps</td>
</tr>
<tr>
<th>Video bitrate</th>
- <td>56 Kbps</th>
- <td>500 Kbps</th>
+ <td>56 Kbps</td>
+ <td>500 Kbps</td>
+ <td>2 Mbps</td>
</tr>
<tr>
<th>Audio codec</th>
- <td>AAC-LC</th>
- <td>AAC-LC</th>
+ <td>AAC-LC</td>
+ <td>AAC-LC</td>
+ <td>AAC-LC</td>
</tr>
<tr>
<th>Audio channels</th>
- <td>1 (mono)</th>
- <td>2 (stereo)</th>
+ <td>1 (mono)</td>
+ <td>2 (stereo)</td>
+ <td>2 (stereo)</td>
</tr>
<tr>
<th>Audio bitrate</th>
- <td>24 Kbps</th>
- <td>128 Kbps</th>
+ <td>24 Kbps</td>
+ <td>128 Kbps</td>
+ <td>192 Kbps</td>
</tr>
</tbody>
</table>
@@ -274,7 +322,8 @@
<p style="margin-top: 2em">For video content that is streamed over HTTP or RTSP, there are additional requirements:</p>
<ul>
- <li>For 3GPP and MPEG-4 containers, the <code>moov</code> atom must precede any <code>mdat</code> atoms.</li>
+ <li>For 3GPP and MPEG-4 containers, the <code>moov</code> atom must precede any <code>mdat</code> atoms, but must succeed the
+ <code>ftyp</code> atom.</li>
<li>For 3GPP, MPEG-4, and WebM containers, audio and video samples corresponding to the same time offset may be no more than 500 KB apart.
To minimize this audio/video drift, consider interleaving audio and video in smaller chunk sizes.</li>
</ul>
diff --git a/docs/html/resources/resources-data.js b/docs/html/resources/resources-data.js
index f799b0c..6c5d882 100644
--- a/docs/html/resources/resources-data.js
+++ b/docs/html/resources/resources-data.js
@@ -323,6 +323,16 @@
}
},
{
+ tags: ['article', 'accountsync', 'data'],
+ path: 'articles/contacts.html',
+ title: {
+ en: 'Using the Contacts API'
+ },
+ description: {
+ en: 'Android provides a Contacts API for managing and integrating contacts from multiple accounts and data sources and allows apps to read various information about individual contacts.'
+ }
+ },
+ {
tags: ['article', 'ui', 'web'],
path: 'articles/using-webviews.html',
title: {
diff --git a/graphics/java/android/renderscript/ProgramRaster.java b/graphics/java/android/renderscript/ProgramRaster.java
index bc0d928..60d9698 100644
--- a/graphics/java/android/renderscript/ProgramRaster.java
+++ b/graphics/java/android/renderscript/ProgramRaster.java
@@ -84,14 +84,10 @@
public static class Builder {
RenderScript mRS;
boolean mPointSprite;
- boolean mPointSmooth;
- boolean mLineSmooth;
CullMode mCullMode;
public Builder(RenderScript rs) {
mRS = rs;
- mPointSmooth = false;
- mLineSmooth = false;
mPointSprite = false;
mCullMode = CullMode.BACK;
}
@@ -108,8 +104,7 @@
public ProgramRaster create() {
mRS.validate();
- int id = mRS.nProgramRasterCreate(mPointSmooth, mLineSmooth, mPointSprite,
- 1.f, mCullMode.mID);
+ int id = mRS.nProgramRasterCreate(mPointSprite, mCullMode.mID);
return new ProgramRaster(id, mRS);
}
}
diff --git a/graphics/java/android/renderscript/RenderScript.java b/graphics/java/android/renderscript/RenderScript.java
index 571b895..e2950d5e 100644
--- a/graphics/java/android/renderscript/RenderScript.java
+++ b/graphics/java/android/renderscript/RenderScript.java
@@ -522,13 +522,10 @@
dstMode, depthFunc);
}
- native int rsnProgramRasterCreate(int con, boolean pointSmooth, boolean lineSmooth,
- boolean pointSprite, float lineWidth, int cullMode);
- synchronized int nProgramRasterCreate(boolean pointSmooth, boolean lineSmooth,
- boolean pointSprite, float lineWidth, int cullMode) {
+ native int rsnProgramRasterCreate(int con, boolean pointSprite, int cullMode);
+ synchronized int nProgramRasterCreate(boolean pointSprite, int cullMode) {
validate();
- return rsnProgramRasterCreate(mContext, pointSmooth, lineSmooth, pointSprite, lineWidth,
- cullMode);
+ return rsnProgramRasterCreate(mContext, pointSprite, cullMode);
}
native void rsnProgramBindConstants(int con, int pv, int slot, int mID);
diff --git a/graphics/jni/android_renderscript_RenderScript.cpp b/graphics/jni/android_renderscript_RenderScript.cpp
index d7ac5d8..ec1f8de 100644
--- a/graphics/jni/android_renderscript_RenderScript.cpp
+++ b/graphics/jni/android_renderscript_RenderScript.cpp
@@ -1053,12 +1053,10 @@
// ---------------------------------------------------------------------------
static jint
-nProgramRasterCreate(JNIEnv *_env, jobject _this, RsContext con, jboolean pointSmooth,
- jboolean lineSmooth, jboolean pointSprite, jfloat lineWidth, jint cull)
+nProgramRasterCreate(JNIEnv *_env, jobject _this, RsContext con, jboolean pointSprite, jint cull)
{
- LOG_API("nProgramRasterCreate, con(%p), pointSmooth(%i), lineSmooth(%i), pointSprite(%i)",
- con, pointSmooth, lineSmooth, pointSprite);
- return (jint)rsProgramRasterCreate(con, pointSmooth, lineSmooth, pointSprite, lineWidth, (RsCullMode)cull);
+ LOG_API("nProgramRasterCreate, con(%p), pointSprite(%i), cull(%i)", con, pointSprite, cull);
+ return (jint)rsProgramRasterCreate(con, pointSprite, (RsCullMode)cull);
}
@@ -1295,7 +1293,7 @@
{"rsnProgramBindSampler", "(IIII)V", (void*)nProgramBindSampler },
{"rsnProgramFragmentCreate", "(ILjava/lang/String;[I)I", (void*)nProgramFragmentCreate },
-{"rsnProgramRasterCreate", "(IZZZFI)I", (void*)nProgramRasterCreate },
+{"rsnProgramRasterCreate", "(IZI)I", (void*)nProgramRasterCreate },
{"rsnProgramVertexCreate", "(ILjava/lang/String;[I)I", (void*)nProgramVertexCreate },
{"rsnContextBindRootScript", "(II)V", (void*)nContextBindRootScript },
diff --git a/include/camera/CameraParameters.h b/include/camera/CameraParameters.h
index 4a4bcfb..a520a6a 100644
--- a/include/camera/CameraParameters.h
+++ b/include/camera/CameraParameters.h
@@ -317,18 +317,13 @@
// recalculate exposure values). Changing exposure compensation
// settings will still affect the exposure settings while
// auto-exposure is locked. Stopping preview or taking a still
- // image will release the lock. However, the lock can be
- // re-enabled prior to preview being re-started, to keep the
- // exposure values from the previous lock. In conjunction with
+ // image will not change the lock. In conjunction with
// exposure compensation, this allows for capturing multi-exposure
// brackets with known relative exposure values. Locking
// auto-exposure after open but before the first call to
// startPreview may result in severely over- or under-exposed
- // images. The driver may independently enable the AE lock after
- // auto-focus completes. If it does so, this key must have its
- // value updated to reflect the lock's existence. Applications are
- // free to release such a lock, to re-enable AE without restarting
- // preview.
+ // images. The driver will not change the AE lock after
+ // auto-focus completes.
static const char KEY_AUTO_EXPOSURE_LOCK[];
// Whether locking the auto-exposure is supported. "true" means it is, and
// "false" or this key not existing means it is not supported.
@@ -339,18 +334,13 @@
// change white balance values. If auto-white balance is already
// locked, setting this to true again has no effect (the driver
// will not recalculate white balance values). Stopping preview or
- // taking a still image will release the lock. However, the lock
- // can be re-enabled prior to preview being re-started, to keep
- // the white balance values from the previous lock. In conjunction
+ // taking a still image will not change the lock. In conjunction
// with exposure compensation, this allows for capturing
// multi-exposure brackets with fixed white balance. Locking
// auto-white balance after open but before the first call to
// startPreview may result in severely incorrect color. The
- // driver may independently enable the AWB lock after auto-focus
- // completes. If it does so, this key must have its value updated
- // to reflect the lock's existence. Applications are free to
- // release such a lock, to re-enable AWB without restarting
- // preview.
+ // driver will not change the AWB lock after auto-focus
+ // completes.
static const char KEY_AUTO_WHITEBALANCE_LOCK[];
// Whether locking the auto-white balance is supported. "true"
// means it is, and "false" or this key not existing means it is
diff --git a/include/gui/SurfaceTexture.h b/include/gui/SurfaceTexture.h
index 493993d..926eb9a 100644
--- a/include/gui/SurfaceTexture.h
+++ b/include/gui/SurfaceTexture.h
@@ -25,8 +25,9 @@
#include <ui/GraphicBuffer.h>
-#include <utils/threads.h>
+#include <utils/String8.h>
#include <utils/Vector.h>
+#include <utils/threads.h>
#define ANDROID_GRAPHICS_SURFACETEXTURE_JNI_ID "mSurfaceTexture"
@@ -202,6 +203,10 @@
// by OpenGL ES as a texture) then those buffer will remain allocated.
void abandon();
+ // set the name of the SurfaceTexture that will be used to identify it in
+ // log messages.
+ void setName(const String8& name);
+
// dump our state in a String
void dump(String8& result) const;
void dump(String8& result, const char* prefix, char* buffer, size_t SIZE) const;
@@ -444,6 +449,10 @@
// all ISurfaceTexture methods capable of returning an error.
bool mAbandoned;
+ // mName is a string used to identify the SurfaceTexture in log messages.
+ // It is set by the setName method.
+ String8 mName;
+
// mMutex is the mutex used to prevent concurrent access to the member
// variables of SurfaceTexture objects. It must be locked whenever the
// member variables are accessed.
diff --git a/include/media/stagefright/ACodec.h b/include/media/stagefright/ACodec.h
index b7286e5..9da9907 100644
--- a/include/media/stagefright/ACodec.h
+++ b/include/media/stagefright/ACodec.h
@@ -113,6 +113,7 @@
Vector<BufferInfo> mBuffers[2];
bool mPortEOS[2];
+ status_t mInputEOSResult;
List<sp<AMessage> > mDeferredQueue;
diff --git a/libs/gui/SurfaceTexture.cpp b/libs/gui/SurfaceTexture.cpp
index f2bc81e..dac9418 100644
--- a/libs/gui/SurfaceTexture.cpp
+++ b/libs/gui/SurfaceTexture.cpp
@@ -39,6 +39,12 @@
#define ALLOW_DEQUEUE_CURRENT_BUFFER false
+// Macros for including the SurfaceTexture name in log messages
+#define ST_LOGV(x, ...) LOGV("[%s] "x, mName.string(), ##__VA_ARGS__)
+#define ST_LOGD(x, ...) LOGD("[%s] "x, mName.string(), ##__VA_ARGS__)
+#define ST_LOGI(x, ...) LOGI("[%s] "x, mName.string(), ##__VA_ARGS__)
+#define ST_LOGW(x, ...) LOGW("[%s] "x, mName.string(), ##__VA_ARGS__)
+#define ST_LOGE(x, ...) LOGE("[%s] "x, mName.string(), ##__VA_ARGS__)
namespace android {
@@ -82,6 +88,12 @@
static void mtxMul(float out[16], const float a[16], const float b[16]);
+// Get an ID that's unique within this process.
+static int32_t createProcessUniqueId() {
+ static volatile int32_t globalCounter = 0;
+ return android_atomic_inc(&globalCounter);
+}
+
SurfaceTexture::SurfaceTexture(GLuint tex, bool allowSynchronousMode) :
mDefaultWidth(1),
mDefaultHeight(1),
@@ -99,15 +111,19 @@
mAllowSynchronousMode(allowSynchronousMode),
mConnectedApi(NO_CONNECTED_API),
mAbandoned(false) {
- LOGV("SurfaceTexture::SurfaceTexture");
+ // Choose a name using the PID and a process-unique ID.
+ mName = String8::format("unnamed-%d-%d", getpid(), createProcessUniqueId());
+
+ ST_LOGV("SurfaceTexture::SurfaceTexture");
sp<ISurfaceComposer> composer(ComposerService::getComposerService());
mGraphicBufferAlloc = composer->createGraphicBufferAlloc();
mNextCrop.makeInvalid();
- memcpy(mCurrentTransformMatrix, mtxIdentity, sizeof(mCurrentTransformMatrix));
+ memcpy(mCurrentTransformMatrix, mtxIdentity,
+ sizeof(mCurrentTransformMatrix));
}
SurfaceTexture::~SurfaceTexture() {
- LOGV("SurfaceTexture::~SurfaceTexture");
+ ST_LOGV("SurfaceTexture::~SurfaceTexture");
freeAllBuffersLocked();
}
@@ -151,22 +167,22 @@
}
status_t SurfaceTexture::setBufferCount(int bufferCount) {
- LOGV("SurfaceTexture::setBufferCount");
+ ST_LOGV("SurfaceTexture::setBufferCount");
Mutex::Autolock lock(mMutex);
if (mAbandoned) {
- LOGE("setBufferCount: SurfaceTexture has been abandoned!");
+ ST_LOGE("setBufferCount: SurfaceTexture has been abandoned!");
return NO_INIT;
}
if (bufferCount > NUM_BUFFER_SLOTS) {
- LOGE("setBufferCount: bufferCount larger than slots available");
+ ST_LOGE("setBufferCount: bufferCount larger than slots available");
return BAD_VALUE;
}
// Error out if the user has dequeued buffers
for (int i=0 ; i<mBufferCount ; i++) {
if (mSlots[i].mBufferState == BufferSlot::DEQUEUED) {
- LOGE("setBufferCount: client owns some buffers");
+ ST_LOGE("setBufferCount: client owns some buffers");
return -EINVAL;
}
}
@@ -181,7 +197,7 @@
}
if (bufferCount < minBufferSlots) {
- LOGE("setBufferCount: requested buffer count (%d) is less than "
+ ST_LOGE("setBufferCount: requested buffer count (%d) is less than "
"minimum (%d)", bufferCount, minBufferSlots);
return BAD_VALUE;
}
@@ -200,7 +216,8 @@
status_t SurfaceTexture::setDefaultBufferSize(uint32_t w, uint32_t h)
{
if (!w || !h) {
- LOGE("setDefaultBufferSize: dimensions cannot be 0 (w=%d, h=%d)", w, h);
+ ST_LOGE("setDefaultBufferSize: dimensions cannot be 0 (w=%d, h=%d)",
+ w, h);
return BAD_VALUE;
}
@@ -211,14 +228,14 @@
}
status_t SurfaceTexture::requestBuffer(int slot, sp<GraphicBuffer>* buf) {
- LOGV("SurfaceTexture::requestBuffer");
+ ST_LOGV("SurfaceTexture::requestBuffer");
Mutex::Autolock lock(mMutex);
if (mAbandoned) {
- LOGE("requestBuffer: SurfaceTexture has been abandoned!");
+ ST_LOGE("requestBuffer: SurfaceTexture has been abandoned!");
return NO_INIT;
}
if (slot < 0 || mBufferCount <= slot) {
- LOGE("requestBuffer: slot index out of range [0, %d]: %d",
+ ST_LOGE("requestBuffer: slot index out of range [0, %d]: %d",
mBufferCount, slot);
return BAD_VALUE;
}
@@ -229,10 +246,10 @@
status_t SurfaceTexture::dequeueBuffer(int *outBuf, uint32_t w, uint32_t h,
uint32_t format, uint32_t usage) {
- LOGV("SurfaceTexture::dequeueBuffer");
+ ST_LOGV("SurfaceTexture::dequeueBuffer");
if ((w && !h) || (!w && h)) {
- LOGE("dequeueBuffer: invalid size: w=%u, h=%u", w, h);
+ ST_LOGE("dequeueBuffer: invalid size: w=%u, h=%u", w, h);
return BAD_VALUE;
}
@@ -245,7 +262,7 @@
bool tryAgain = true;
while (tryAgain) {
if (mAbandoned) {
- LOGE("dequeueBuffer: SurfaceTexture has been abandoned!");
+ ST_LOGE("dequeueBuffer: SurfaceTexture has been abandoned!");
return NO_INIT;
}
@@ -334,7 +351,8 @@
// than allowed.
const int avail = mBufferCount - (dequeuedCount+1);
if (avail < (MIN_UNDEQUEUED_BUFFERS-int(mSynchronousMode))) {
- LOGE("dequeueBuffer: MIN_UNDEQUEUED_BUFFERS=%d exceeded (dequeued=%d)",
+ ST_LOGE("dequeueBuffer: MIN_UNDEQUEUED_BUFFERS=%d exceeded "
+ "(dequeued=%d)",
MIN_UNDEQUEUED_BUFFERS-int(mSynchronousMode),
dequeuedCount);
return -EBUSY;
@@ -391,7 +409,8 @@
mGraphicBufferAlloc->createGraphicBuffer(
w, h, format, usage, &error));
if (graphicBuffer == 0) {
- LOGE("dequeueBuffer: SurfaceComposer::createGraphicBuffer failed");
+ ST_LOGE("dequeueBuffer: SurfaceComposer::createGraphicBuffer "
+ "failed");
return error;
}
if (updateFormat) {
@@ -413,7 +432,7 @@
Mutex::Autolock lock(mMutex);
if (mAbandoned) {
- LOGE("setSynchronousMode: SurfaceTexture has been abandoned!");
+ ST_LOGE("setSynchronousMode: SurfaceTexture has been abandoned!");
return NO_INIT;
}
@@ -441,29 +460,29 @@
status_t SurfaceTexture::queueBuffer(int buf, int64_t timestamp,
uint32_t* outWidth, uint32_t* outHeight, uint32_t* outTransform) {
- LOGV("SurfaceTexture::queueBuffer");
+ ST_LOGV("SurfaceTexture::queueBuffer");
sp<FrameAvailableListener> listener;
{ // scope for the lock
Mutex::Autolock lock(mMutex);
if (mAbandoned) {
- LOGE("queueBuffer: SurfaceTexture has been abandoned!");
+ ST_LOGE("queueBuffer: SurfaceTexture has been abandoned!");
return NO_INIT;
}
if (buf < 0 || buf >= mBufferCount) {
- LOGE("queueBuffer: slot index out of range [0, %d]: %d",
+ ST_LOGE("queueBuffer: slot index out of range [0, %d]: %d",
mBufferCount, buf);
return -EINVAL;
} else if (mSlots[buf].mBufferState != BufferSlot::DEQUEUED) {
- LOGE("queueBuffer: slot %d is not owned by the client (state=%d)",
- buf, mSlots[buf].mBufferState);
+ ST_LOGE("queueBuffer: slot %d is not owned by the client "
+ "(state=%d)", buf, mSlots[buf].mBufferState);
return -EINVAL;
} else if (buf == mCurrentTexture) {
- LOGE("queueBuffer: slot %d is current!", buf);
+ ST_LOGE("queueBuffer: slot %d is current!", buf);
return -EINVAL;
} else if (!mSlots[buf].mRequestBufferCalled) {
- LOGE("queueBuffer: slot %d was enqueued without requesting a "
+ ST_LOGE("queueBuffer: slot %d was enqueued without requesting a "
"buffer", buf);
return -EINVAL;
}
@@ -513,20 +532,20 @@
}
void SurfaceTexture::cancelBuffer(int buf) {
- LOGV("SurfaceTexture::cancelBuffer");
+ ST_LOGV("SurfaceTexture::cancelBuffer");
Mutex::Autolock lock(mMutex);
if (mAbandoned) {
- LOGW("cancelBuffer: SurfaceTexture has been abandoned!");
+ ST_LOGW("cancelBuffer: SurfaceTexture has been abandoned!");
return;
}
if (buf < 0 || buf >= mBufferCount) {
- LOGE("cancelBuffer: slot index out of range [0, %d]: %d",
+ ST_LOGE("cancelBuffer: slot index out of range [0, %d]: %d",
mBufferCount, buf);
return;
} else if (mSlots[buf].mBufferState != BufferSlot::DEQUEUED) {
- LOGE("cancelBuffer: slot %d is not owned by the client (state=%d)",
+ ST_LOGE("cancelBuffer: slot %d is not owned by the client (state=%d)",
buf, mSlots[buf].mBufferState);
return;
}
@@ -535,10 +554,10 @@
}
status_t SurfaceTexture::setCrop(const Rect& crop) {
- LOGV("SurfaceTexture::setCrop");
+ ST_LOGV("SurfaceTexture::setCrop");
Mutex::Autolock lock(mMutex);
if (mAbandoned) {
- LOGE("setCrop: SurfaceTexture has been abandoned!");
+ ST_LOGE("setCrop: SurfaceTexture has been abandoned!");
return NO_INIT;
}
mNextCrop = crop;
@@ -546,10 +565,10 @@
}
status_t SurfaceTexture::setTransform(uint32_t transform) {
- LOGV("SurfaceTexture::setTransform");
+ ST_LOGV("SurfaceTexture::setTransform");
Mutex::Autolock lock(mMutex);
if (mAbandoned) {
- LOGE("setTransform: SurfaceTexture has been abandoned!");
+ ST_LOGE("setTransform: SurfaceTexture has been abandoned!");
return NO_INIT;
}
mNextTransform = transform;
@@ -558,11 +577,11 @@
status_t SurfaceTexture::connect(int api,
uint32_t* outWidth, uint32_t* outHeight, uint32_t* outTransform) {
- LOGV("SurfaceTexture::connect(this=%p, %d)", this, api);
+ ST_LOGV("SurfaceTexture::connect(this=%p, %d)", this, api);
Mutex::Autolock lock(mMutex);
if (mAbandoned) {
- LOGE("connect: SurfaceTexture has been abandoned!");
+ ST_LOGE("connect: SurfaceTexture has been abandoned!");
return NO_INIT;
}
@@ -573,7 +592,7 @@
case NATIVE_WINDOW_API_MEDIA:
case NATIVE_WINDOW_API_CAMERA:
if (mConnectedApi != NO_CONNECTED_API) {
- LOGE("connect: already connected (cur=%d, req=%d)",
+ ST_LOGE("connect: already connected (cur=%d, req=%d)",
mConnectedApi, api);
err = -EINVAL;
} else {
@@ -591,11 +610,11 @@
}
status_t SurfaceTexture::disconnect(int api) {
- LOGV("SurfaceTexture::disconnect(this=%p, %d)", this, api);
+ ST_LOGV("SurfaceTexture::disconnect(this=%p, %d)", this, api);
Mutex::Autolock lock(mMutex);
if (mAbandoned) {
- LOGE("disconnect: SurfaceTexture has been abandoned!");
+ ST_LOGE("disconnect: SurfaceTexture has been abandoned!");
return NO_INIT;
}
@@ -613,7 +632,7 @@
mNextTransform = 0;
mDequeueCondition.signal();
} else {
- LOGE("disconnect: connected to another api (cur=%d, req=%d)",
+ ST_LOGE("disconnect: connected to another api (cur=%d, req=%d)",
mConnectedApi, api);
err = -EINVAL;
}
@@ -626,7 +645,7 @@
}
status_t SurfaceTexture::setScalingMode(int mode) {
- LOGV("SurfaceTexture::setScalingMode(%d)", mode);
+ ST_LOGV("SurfaceTexture::setScalingMode(%d)", mode);
switch (mode) {
case NATIVE_WINDOW_SCALING_MODE_FREEZE:
@@ -642,11 +661,11 @@
}
status_t SurfaceTexture::updateTexImage() {
- LOGV("SurfaceTexture::updateTexImage");
+ ST_LOGV("SurfaceTexture::updateTexImage");
Mutex::Autolock lock(mMutex);
if (mAbandoned) {
- LOGE("calling updateTexImage() on an abandoned SurfaceTexture");
+ ST_LOGE("calling updateTexImage() on an abandoned SurfaceTexture");
return NO_INIT;
}
@@ -661,7 +680,7 @@
if (image == EGL_NO_IMAGE_KHR) {
EGLDisplay dpy = eglGetCurrentDisplay();
if (mSlots[buf].mGraphicBuffer == 0) {
- LOGE("buffer at slot %d is null", buf);
+ ST_LOGE("buffer at slot %d is null", buf);
return BAD_VALUE;
}
image = createImage(dpy, mSlots[buf].mGraphicBuffer);
@@ -676,15 +695,16 @@
GLint error;
while ((error = glGetError()) != GL_NO_ERROR) {
- LOGW("updateTexImage: clearing GL error: %#04x", error);
+ ST_LOGW("updateTexImage: clearing GL error: %#04x", error);
}
glBindTexture(GL_TEXTURE_EXTERNAL_OES, mTexName);
- glEGLImageTargetTexture2DOES(GL_TEXTURE_EXTERNAL_OES, (GLeglImageOES)image);
+ glEGLImageTargetTexture2DOES(GL_TEXTURE_EXTERNAL_OES,
+ (GLeglImageOES)image);
bool failed = false;
while ((error = glGetError()) != GL_NO_ERROR) {
- LOGE("error binding external texture image %p (slot %d): %#04x",
+ ST_LOGE("error binding external texture image %p (slot %d): %#04x",
image, buf, error);
failed = true;
}
@@ -750,7 +770,7 @@
}
void SurfaceTexture::computeCurrentTransformMatrix() {
- LOGV("SurfaceTexture::computeCurrentTransformMatrix");
+ ST_LOGV("SurfaceTexture::computeCurrentTransformMatrix");
float xform[16];
for (int i = 0; i < 16; i++) {
@@ -841,14 +861,14 @@
}
nsecs_t SurfaceTexture::getTimestamp() {
- LOGV("SurfaceTexture::getTimestamp");
+ ST_LOGV("SurfaceTexture::getTimestamp");
Mutex::Autolock lock(mMutex);
return mCurrentTimestamp;
}
void SurfaceTexture::setFrameAvailableListener(
const sp<FrameAvailableListener>& listener) {
- LOGV("SurfaceTexture::setFrameAvailableListener");
+ ST_LOGV("SurfaceTexture::setFrameAvailableListener");
Mutex::Autolock lock(mMutex);
mFrameAvailableListener = listener;
}
@@ -892,11 +912,11 @@
while (mSynchronousMode && !mQueue.isEmpty()) {
mDequeueCondition.wait(mMutex);
if (mAbandoned) {
- LOGE("drainQueueLocked: SurfaceTexture has been abandoned!");
+ ST_LOGE("drainQueueLocked: SurfaceTexture has been abandoned!");
return NO_INIT;
}
if (mConnectedApi == NO_CONNECTED_API) {
- LOGE("drainQueueLocked: SurfaceTexture is not connected!");
+ ST_LOGE("drainQueueLocked: SurfaceTexture is not connected!");
return NO_INIT;
}
}
@@ -926,7 +946,7 @@
EGL_NATIVE_BUFFER_ANDROID, cbuf, attrs);
if (image == EGL_NO_IMAGE_KHR) {
EGLint error = eglGetError();
- LOGE("error creating EGLImage: %#x", error);
+ ST_LOGE("error creating EGLImage: %#x", error);
}
return image;
}
@@ -956,7 +976,7 @@
Mutex::Autolock lock(mMutex);
if (mAbandoned) {
- LOGE("query: SurfaceTexture has been abandoned!");
+ ST_LOGE("query: SurfaceTexture has been abandoned!");
return NO_INIT;
}
@@ -991,6 +1011,10 @@
mDequeueCondition.signal();
}
+void SurfaceTexture::setName(const String8& name) {
+ mName = name;
+}
+
void SurfaceTexture::dump(String8& result) const
{
char buffer[1024];
@@ -1004,8 +1028,8 @@
snprintf(buffer, SIZE,
"%smBufferCount=%d, mSynchronousMode=%d, default-size=[%dx%d], "
"mPixelFormat=%d, mTexName=%d\n",
- prefix, mBufferCount, mSynchronousMode, mDefaultWidth, mDefaultHeight,
- mPixelFormat, mTexName);
+ prefix, mBufferCount, mSynchronousMode, mDefaultWidth,
+ mDefaultHeight, mPixelFormat, mTexName);
result.append(buffer);
String8 fifo;
@@ -1024,8 +1048,8 @@
prefix, mCurrentCrop.left,
mCurrentCrop.top, mCurrentCrop.right, mCurrentCrop.bottom,
mCurrentTransform, mCurrentTexture,
- prefix, mNextCrop.left, mNextCrop.top, mNextCrop.right, mNextCrop.bottom,
- mNextTransform, fifoSize, fifo.string()
+ prefix, mNextCrop.left, mNextCrop.top, mNextCrop.right,
+ mNextCrop.bottom, mNextTransform, fifoSize, fifo.string()
);
result.append(buffer);
@@ -1048,8 +1072,8 @@
"transform=0x%02x, timestamp=%lld",
prefix, (i==mCurrentTexture)?">":" ", i,
stateName(slot.mBufferState),
- slot.mCrop.left, slot.mCrop.top, slot.mCrop.right, slot.mCrop.bottom,
- slot.mTransform, slot.mTimestamp
+ slot.mCrop.left, slot.mCrop.top, slot.mCrop.right,
+ slot.mCrop.bottom, slot.mTransform, slot.mTimestamp
);
result.append(buffer);
@@ -1057,7 +1081,8 @@
if (buf != NULL) {
snprintf(buffer, SIZE,
", %p [%4ux%4u:%4u,%3X]",
- buf->handle, buf->width, buf->height, buf->stride, buf->format);
+ buf->handle, buf->width, buf->height, buf->stride,
+ buf->format);
result.append(buffer);
}
result.append("\n");
diff --git a/libs/rs/rs.spec b/libs/rs/rs.spec
index f277582..20b1f52 100644
--- a/libs/rs/rs.spec
+++ b/libs/rs/rs.spec
@@ -329,10 +329,7 @@
ProgramRasterCreate {
direct
- param bool pointSmooth
- param bool lineSmooth
param bool pointSprite
- param float lineWidth
param RsCullMode cull
ret RsProgramRaster
}
diff --git a/libs/rs/rsProgramRaster.cpp b/libs/rs/rsProgramRaster.cpp
index 945b5ec..94bfe42 100644
--- a/libs/rs/rsProgramRaster.cpp
+++ b/libs/rs/rsProgramRaster.cpp
@@ -21,19 +21,12 @@
using namespace android::renderscript;
-ProgramRaster::ProgramRaster(Context *rsc, bool pointSmooth,
- bool lineSmooth, bool pointSprite,
- float lineWidth, RsCullMode cull)
+ProgramRaster::ProgramRaster(Context *rsc, bool pointSprite, RsCullMode cull)
: ProgramBase(rsc) {
memset(&mHal, 0, sizeof(mHal));
-
- mHal.state.pointSmooth = pointSmooth;
- mHal.state.lineSmooth = lineSmooth;
mHal.state.pointSprite = pointSprite;
- mHal.state.lineWidth = lineWidth;
mHal.state.cull = cull;
-
rsc->mHal.funcs.raster.init(rsc, this);
}
@@ -74,8 +67,7 @@
}
void ProgramRasterState::init(Context *rsc) {
- mDefault.set(ProgramRaster::getProgramRaster(rsc, false, false,
- false, 1.f, RS_CULL_BACK).get());
+ mDefault.set(ProgramRaster::getProgramRaster(rsc, false, RS_CULL_BACK).get());
}
void ProgramRasterState::deinit(Context *rsc) {
@@ -84,19 +76,13 @@
}
ObjectBaseRef<ProgramRaster> ProgramRaster::getProgramRaster(Context *rsc,
- bool pointSmooth,
- bool lineSmooth,
bool pointSprite,
- float lineWidth,
RsCullMode cull) {
ObjectBaseRef<ProgramRaster> returnRef;
ObjectBase::asyncLock();
for (uint32_t ct = 0; ct < rsc->mStateRaster.mRasterPrograms.size(); ct++) {
ProgramRaster *existing = rsc->mStateRaster.mRasterPrograms[ct];
- if (existing->mHal.state.pointSmooth != pointSmooth) continue;
- if (existing->mHal.state.lineSmooth != lineSmooth) continue;
if (existing->mHal.state.pointSprite != pointSprite) continue;
- if (existing->mHal.state.lineWidth != lineWidth) continue;
if (existing->mHal.state.cull != cull) continue;
returnRef.set(existing);
ObjectBase::asyncUnlock();
@@ -104,8 +90,7 @@
}
ObjectBase::asyncUnlock();
- ProgramRaster *pr = new ProgramRaster(rsc, pointSmooth,
- lineSmooth, pointSprite, lineWidth, cull);
+ ProgramRaster *pr = new ProgramRaster(rsc, pointSprite, cull);
returnRef.set(pr);
ObjectBase::asyncLock();
@@ -118,10 +103,8 @@
namespace android {
namespace renderscript {
-RsProgramRaster rsi_ProgramRasterCreate(Context * rsc, bool pointSmooth, bool lineSmooth,
- bool pointSprite, float lineWidth, RsCullMode cull) {
- ObjectBaseRef<ProgramRaster> pr = ProgramRaster::getProgramRaster(rsc, pointSmooth, lineSmooth,
- pointSprite, lineWidth, cull);
+RsProgramRaster rsi_ProgramRasterCreate(Context * rsc, bool pointSprite, RsCullMode cull) {
+ ObjectBaseRef<ProgramRaster> pr = ProgramRaster::getProgramRaster(rsc, pointSprite, cull);
pr->incUserRef();
return pr.get();
}
diff --git a/libs/rs/rsProgramRaster.h b/libs/rs/rsProgramRaster.h
index 09d7d54..20af30a 100644
--- a/libs/rs/rsProgramRaster.h
+++ b/libs/rs/rsProgramRaster.h
@@ -33,19 +33,13 @@
static ProgramRaster *createFromStream(Context *rsc, IStream *stream);
static ObjectBaseRef<ProgramRaster> getProgramRaster(Context *rsc,
- bool pointSmooth,
- bool lineSmooth,
bool pointSprite,
- float lineWidth,
RsCullMode cull);
struct Hal {
mutable void *drv;
struct State {
- bool pointSmooth;
- bool lineSmooth;
bool pointSprite;
- float lineWidth;
RsCullMode cull;
};
State state;
@@ -58,10 +52,7 @@
private:
ProgramRaster(Context *rsc,
- bool pointSmooth,
- bool lineSmooth,
bool pointSprite,
- float lineWidth,
RsCullMode cull);
};
diff --git a/libs/ui/Region.cpp b/libs/ui/Region.cpp
index 8dab291..5656088 100644
--- a/libs/ui/Region.cpp
+++ b/libs/ui/Region.cpp
@@ -482,6 +482,7 @@
if (!rhs.isValid()) {
LOGE("Region::boolean_operation(op=%d) invalid Rect={%d,%d,%d,%d}",
op, rhs.left, rhs.top, rhs.right, rhs.bottom);
+ return;
}
#if VALIDATE_WITH_CORECG || VALIDATE_REGIONS
diff --git a/media/libmediaplayerservice/MediaPlayerService.cpp b/media/libmediaplayerservice/MediaPlayerService.cpp
index 0386d4b..b5eef94 100644
--- a/media/libmediaplayerservice/MediaPlayerService.cpp
+++ b/media/libmediaplayerservice/MediaPlayerService.cpp
@@ -52,6 +52,7 @@
#include <media/Metadata.h>
#include <media/AudioTrack.h>
#include <media/MemoryLeakTrackUtil.h>
+#include <media/stagefright/MediaErrors.h>
#include <system/audio.h>
@@ -1132,7 +1133,11 @@
player->start();
LOGV("wait for playback complete");
- if (cache->wait() != NO_ERROR) goto Exit;
+ cache->wait();
+ // in case of error, return what was successfully decoded.
+ if (cache->size() == 0) {
+ goto Exit;
+ }
mem = new MemoryBase(cache->getHeap(), 0, cache->size());
*pSampleRate = cache->sampleRate();
@@ -1175,7 +1180,11 @@
player->start();
LOGV("wait for playback complete");
- if (cache->wait() != NO_ERROR) goto Exit;
+ cache->wait();
+ // in case of error, return what was successfully decoded.
+ if (cache->size() == 0) {
+ goto Exit;
+ }
mem = new MemoryBase(cache->getHeap(), 0, cache->size());
*pSampleRate = cache->sampleRate();
diff --git a/media/libmediaplayerservice/nuplayer/HTTPLiveSource.cpp b/media/libmediaplayerservice/nuplayer/HTTPLiveSource.cpp
index 605d056..079f6fa 100644
--- a/media/libmediaplayerservice/nuplayer/HTTPLiveSource.cpp
+++ b/media/libmediaplayerservice/nuplayer/HTTPLiveSource.cpp
@@ -41,7 +41,7 @@
mUIDValid(uidValid),
mUID(uid),
mFlags(0),
- mEOS(false),
+ mFinalResult(OK),
mOffset(0) {
if (headers) {
mExtraHeaders = *headers;
@@ -95,9 +95,9 @@
return source->getFormat();
}
-bool NuPlayer::HTTPLiveSource::feedMoreTSData() {
- if (mEOS) {
- return false;
+status_t NuPlayer::HTTPLiveSource::feedMoreTSData() {
+ if (mFinalResult != OK) {
+ return mFinalResult;
}
sp<LiveDataSource> source =
@@ -110,9 +110,13 @@
if (n == -EWOULDBLOCK) {
break;
} else if (n < 0) {
- LOGI("input data EOS reached.");
+ if (n != ERROR_END_OF_STREAM) {
+ LOGI("input data EOS reached, error %ld", n);
+ } else {
+ LOGI("input data EOS reached.");
+ }
mTSParser->signalEOS(n);
- mEOS = true;
+ mFinalResult = n;
break;
} else {
if (buffer[0] == 0x00) {
@@ -129,7 +133,7 @@
if (err != OK) {
LOGE("TS Parser returned error %d", err);
mTSParser->signalEOS(err);
- mEOS = true;
+ mFinalResult = err;
break;
}
}
@@ -138,7 +142,7 @@
}
}
- return true;
+ return OK;
}
status_t NuPlayer::HTTPLiveSource::dequeueAccessUnit(
@@ -168,7 +172,7 @@
status_t NuPlayer::HTTPLiveSource::seekTo(int64_t seekTimeUs) {
// We need to make sure we're not seeking until we have seen the very first
// PTS timestamp in the whole stream (from the beginning of the stream).
- while (!mTSParser->PTSTimeDeltaEstablished() && feedMoreTSData()) {
+ while (!mTSParser->PTSTimeDeltaEstablished() && feedMoreTSData() == OK) {
usleep(100000);
}
diff --git a/media/libmediaplayerservice/nuplayer/HTTPLiveSource.h b/media/libmediaplayerservice/nuplayer/HTTPLiveSource.h
index 36c67c5..f22af5b 100644
--- a/media/libmediaplayerservice/nuplayer/HTTPLiveSource.h
+++ b/media/libmediaplayerservice/nuplayer/HTTPLiveSource.h
@@ -35,8 +35,7 @@
virtual void start();
- // Returns true iff more data was available, false on EOS.
- virtual bool feedMoreTSData();
+ virtual status_t feedMoreTSData();
virtual sp<MetaData> getFormat(bool audio);
virtual status_t dequeueAccessUnit(bool audio, sp<ABuffer> *accessUnit);
@@ -59,7 +58,7 @@
bool mUIDValid;
uid_t mUID;
uint32_t mFlags;
- bool mEOS;
+ status_t mFinalResult;
off64_t mOffset;
sp<ALooper> mLiveLooper;
sp<LiveSession> mLiveSession;
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp
index 7218faf..6b40528 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp
+++ b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp
@@ -235,11 +235,17 @@
instantiateDecoder(true, &mAudioDecoder);
}
- if (!mSource->feedMoreTSData()) {
+ status_t err;
+ if ((err = mSource->feedMoreTSData()) != OK) {
if (mAudioDecoder == NULL && mVideoDecoder == NULL) {
// We're not currently decoding anything (no audio or
// video tracks found) and we just ran out of input data.
- notifyListener(MEDIA_PLAYBACK_COMPLETE, 0, 0);
+
+ if (err == ERROR_END_OF_STREAM) {
+ notifyListener(MEDIA_PLAYBACK_COMPLETE, 0, 0);
+ } else {
+ notifyListener(MEDIA_ERROR, MEDIA_ERROR_UNKNOWN, err);
+ }
}
break;
}
@@ -267,12 +273,23 @@
audio, codecRequest);
if (err == -EWOULDBLOCK) {
- if (mSource->feedMoreTSData()) {
+ if (mSource->feedMoreTSData() == OK) {
msg->post();
}
}
} else if (what == ACodec::kWhatEOS) {
- mRenderer->queueEOS(audio, ERROR_END_OF_STREAM);
+ int32_t err;
+ CHECK(codecRequest->findInt32("err", &err));
+
+ if (err == ERROR_END_OF_STREAM) {
+ LOGV("got %s decoder EOS", audio ? "audio" : "video");
+ } else {
+ LOGV("got %s decoder EOS w/ error %d",
+ audio ? "audio" : "video",
+ err);
+ }
+
+ mRenderer->queueEOS(audio, err);
} else if (what == ACodec::kWhatFlushCompleted) {
bool needShutdown;
@@ -397,7 +414,7 @@
if (finalResult == ERROR_END_OF_STREAM) {
LOGV("reached %s EOS", audio ? "audio" : "video");
} else {
- LOGE("%s track encountered an error (0x%08x)",
+ LOGE("%s track encountered an error (%d)",
audio ? "audio" : "video", finalResult);
notifyListener(
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerSource.h b/media/libmediaplayerservice/nuplayer/NuPlayerSource.h
index 5e55487..8a7eece 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayerSource.h
+++ b/media/libmediaplayerservice/nuplayer/NuPlayerSource.h
@@ -29,8 +29,9 @@
virtual void start() = 0;
- // Returns true iff more data was available, false on EOS.
- virtual bool feedMoreTSData() = 0;
+ // Returns OK iff more data was available,
+ // an error or ERROR_END_OF_STREAM if not.
+ virtual status_t feedMoreTSData() = 0;
virtual sp<MetaData> getFormat(bool audio) = 0;
diff --git a/media/libmediaplayerservice/nuplayer/StreamingSource.cpp b/media/libmediaplayerservice/nuplayer/StreamingSource.cpp
index 7319e4c..f795654 100644
--- a/media/libmediaplayerservice/nuplayer/StreamingSource.cpp
+++ b/media/libmediaplayerservice/nuplayer/StreamingSource.cpp
@@ -34,7 +34,7 @@
NuPlayer::StreamingSource::StreamingSource(const sp<IStreamSource> &source)
: mSource(source),
- mEOS(false) {
+ mFinalResult(OK) {
}
NuPlayer::StreamingSource::~StreamingSource() {
@@ -47,9 +47,9 @@
mStreamListener->start();
}
-bool NuPlayer::StreamingSource::feedMoreTSData() {
- if (mEOS) {
- return false;
+status_t NuPlayer::StreamingSource::feedMoreTSData() {
+ if (mFinalResult != OK) {
+ return mFinalResult;
}
for (int32_t i = 0; i < 50; ++i) {
@@ -60,7 +60,7 @@
if (n == 0) {
LOGI("input data EOS reached.");
mTSParser->signalEOS(ERROR_END_OF_STREAM);
- mEOS = true;
+ mFinalResult = ERROR_END_OF_STREAM;
break;
} else if (n == INFO_DISCONTINUITY) {
ATSParser::DiscontinuityType type = ATSParser::DISCONTINUITY_SEEK;
@@ -92,14 +92,14 @@
LOGE("TS Parser returned error %d", err);
mTSParser->signalEOS(err);
- mEOS = true;
+ mFinalResult = err;
break;
}
}
}
}
- return true;
+ return OK;
}
sp<MetaData> NuPlayer::StreamingSource::getFormat(bool audio) {
diff --git a/media/libmediaplayerservice/nuplayer/StreamingSource.h b/media/libmediaplayerservice/nuplayer/StreamingSource.h
index 7abce84..ca00ef9 100644
--- a/media/libmediaplayerservice/nuplayer/StreamingSource.h
+++ b/media/libmediaplayerservice/nuplayer/StreamingSource.h
@@ -31,8 +31,7 @@
virtual void start();
- // Returns true iff more data was available, false on EOS.
- virtual bool feedMoreTSData();
+ virtual status_t feedMoreTSData();
virtual sp<MetaData> getFormat(bool audio);
virtual status_t dequeueAccessUnit(bool audio, sp<ABuffer> *accessUnit);
@@ -42,7 +41,7 @@
private:
sp<IStreamSource> mSource;
- bool mEOS;
+ status_t mFinalResult;
sp<NuPlayerStreamListener> mStreamListener;
sp<ATSParser> mTSParser;
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp
index a2d9e59..a3746cd 100644
--- a/media/libstagefright/ACodec.cpp
+++ b/media/libstagefright/ACodec.cpp
@@ -323,6 +323,7 @@
mFlushingState = new FlushingState(this);
mPortEOS[kPortIndexInput] = mPortEOS[kPortIndexOutput] = false;
+ mInputEOSResult = OK;
changeState(mUninitializedState);
}
@@ -1347,7 +1348,10 @@
case KEEP_BUFFERS:
{
if (buffer == NULL) {
- mCodec->mPortEOS[kPortIndexInput] = true;
+ if (!mCodec->mPortEOS[kPortIndexInput]) {
+ mCodec->mPortEOS[kPortIndexInput] = true;
+ mCodec->mInputEOSResult = err;
+ }
}
break;
}
@@ -1398,8 +1402,14 @@
getMoreInputDataIfPossible();
} else if (!mCodec->mPortEOS[kPortIndexInput]) {
- LOGV("[%s] Signalling EOS on the input port",
- mCodec->mComponentName.c_str());
+ if (err != ERROR_END_OF_STREAM) {
+ LOGV("[%s] Signalling EOS on the input port "
+ "due to error %d",
+ mCodec->mComponentName.c_str(), err);
+ } else {
+ LOGV("[%s] Signalling EOS on the input port",
+ mCodec->mComponentName.c_str());
+ }
LOGV("[%s] calling emptyBuffer %p signalling EOS",
mCodec->mComponentName.c_str(), bufferID);
@@ -1416,6 +1426,7 @@
info->mStatus = BufferInfo::OWNED_BY_COMPONENT;
mCodec->mPortEOS[kPortIndexInput] = true;
+ mCodec->mInputEOSResult = err;
}
break;
@@ -1523,6 +1534,7 @@
if (flags & OMX_BUFFERFLAG_EOS) {
sp<AMessage> notify = mCodec->mNotify->dup();
notify->setInt32("what", ACodec::kWhatEOS);
+ notify->setInt32("err", mCodec->mInputEOSResult);
notify->post();
mCodec->mPortEOS[kPortIndexOutput] = true;
@@ -1721,6 +1733,8 @@
mCodec->mPortEOS[kPortIndexInput] =
mCodec->mPortEOS[kPortIndexOutput] = false;
+ mCodec->mInputEOSResult = OK;
+
mCodec->configureCodec(mime.c_str(), msg);
sp<RefBase> obj;
@@ -2371,6 +2385,8 @@
mCodec->mPortEOS[kPortIndexInput] =
mCodec->mPortEOS[kPortIndexOutput] = false;
+ mCodec->mInputEOSResult = OK;
+
mCodec->changeState(mCodec->mExecutingState);
}
}
diff --git a/media/libstagefright/AVIExtractor.cpp b/media/libstagefright/AVIExtractor.cpp
index d47e5d1..0be2ca4 100644
--- a/media/libstagefright/AVIExtractor.cpp
+++ b/media/libstagefright/AVIExtractor.cpp
@@ -56,11 +56,36 @@
MediaBufferGroup *mBufferGroup;
size_t mSampleIndex;
+ sp<MP3Splitter> mSplitter;
+
DISALLOW_EVIL_CONSTRUCTORS(AVISource);
};
////////////////////////////////////////////////////////////////////////////////
+struct AVIExtractor::MP3Splitter : public RefBase {
+ MP3Splitter();
+
+ void clear();
+ void append(MediaBuffer *buffer);
+ status_t read(MediaBuffer **buffer);
+
+protected:
+ virtual ~MP3Splitter();
+
+private:
+ bool mFindSync;
+ int64_t mBaseTimeUs;
+ int64_t mNumSamplesRead;
+ sp<ABuffer> mBuffer;
+
+ bool resync();
+
+ DISALLOW_EVIL_CONSTRUCTORS(MP3Splitter);
+};
+
+////////////////////////////////////////////////////////////////////////////////
+
AVIExtractor::AVISource::AVISource(
const sp<AVIExtractor> &extractor, size_t trackIndex)
: mExtractor(extractor),
@@ -84,6 +109,15 @@
mBufferGroup->add_buffer(new MediaBuffer(mTrack.mMaxSampleSize));
mSampleIndex = 0;
+ const char *mime;
+ CHECK(mTrack.mMeta->findCString(kKeyMIMEType, &mime));
+
+ if (!strcasecmp(mime, MEDIA_MIMETYPE_AUDIO_MPEG)) {
+ mSplitter = new MP3Splitter;
+ } else {
+ mSplitter.clear();
+ }
+
return OK;
}
@@ -93,6 +127,8 @@
delete mBufferGroup;
mBufferGroup = NULL;
+ mSplitter.clear();
+
return OK;
}
@@ -116,39 +152,213 @@
if (err != OK) {
return ERROR_END_OF_STREAM;
}
+
+ if (mSplitter != NULL) {
+ mSplitter->clear();
+ }
}
- off64_t offset;
- size_t size;
- bool isKey;
- int64_t timeUs;
- status_t err = mExtractor->getSampleInfo(
- mTrackIndex, mSampleIndex, &offset, &size, &isKey, &timeUs);
+ for (;;) {
+ if (mSplitter != NULL) {
+ status_t err = mSplitter->read(buffer);
- ++mSampleIndex;
+ if (err == OK) {
+ break;
+ } else if (err != -EAGAIN) {
+ return err;
+ }
+ }
- if (err != OK) {
- return ERROR_END_OF_STREAM;
+ off64_t offset;
+ size_t size;
+ bool isKey;
+ int64_t timeUs;
+ status_t err = mExtractor->getSampleInfo(
+ mTrackIndex, mSampleIndex, &offset, &size, &isKey, &timeUs);
+
+ ++mSampleIndex;
+
+ if (err != OK) {
+ return ERROR_END_OF_STREAM;
+ }
+
+ MediaBuffer *out;
+ CHECK_EQ(mBufferGroup->acquire_buffer(&out), (status_t)OK);
+
+ ssize_t n = mExtractor->mDataSource->readAt(offset, out->data(), size);
+
+ if (n < (ssize_t)size) {
+ return n < 0 ? (status_t)n : (status_t)ERROR_MALFORMED;
+ }
+
+ out->set_range(0, size);
+
+ out->meta_data()->setInt64(kKeyTime, timeUs);
+
+ if (isKey) {
+ out->meta_data()->setInt32(kKeyIsSyncFrame, 1);
+ }
+
+ if (mSplitter == NULL) {
+ *buffer = out;
+ break;
+ }
+
+ mSplitter->append(out);
+ out->release();
+ out = NULL;
}
- MediaBuffer *out;
- CHECK_EQ(mBufferGroup->acquire_buffer(&out), (status_t)OK);
+ return OK;
+}
- ssize_t n = mExtractor->mDataSource->readAt(offset, out->data(), size);
+////////////////////////////////////////////////////////////////////////////////
- if (n < (ssize_t)size) {
- return n < 0 ? (status_t)n : (status_t)ERROR_MALFORMED;
+AVIExtractor::MP3Splitter::MP3Splitter()
+ : mFindSync(true),
+ mBaseTimeUs(-1ll),
+ mNumSamplesRead(0) {
+}
+
+AVIExtractor::MP3Splitter::~MP3Splitter() {
+}
+
+void AVIExtractor::MP3Splitter::clear() {
+ mFindSync = true;
+ mBaseTimeUs = -1ll;
+ mNumSamplesRead = 0;
+
+ if (mBuffer != NULL) {
+ mBuffer->setRange(0, 0);
+ }
+}
+
+void AVIExtractor::MP3Splitter::append(MediaBuffer *buffer) {
+ size_t prevCapacity = (mBuffer != NULL) ? mBuffer->capacity() : 0;
+
+ if (mBaseTimeUs < 0) {
+ CHECK(mBuffer == NULL || mBuffer->size() == 0);
+ CHECK(buffer->meta_data()->findInt64(kKeyTime, &mBaseTimeUs));
+ mNumSamplesRead = 0;
}
- out->set_range(0, size);
-
- out->meta_data()->setInt64(kKeyTime, timeUs);
-
- if (isKey) {
- out->meta_data()->setInt32(kKeyIsSyncFrame, 1);
+ if (mBuffer != NULL && mBuffer->offset() > 0) {
+ memmove(mBuffer->base(), mBuffer->data(), mBuffer->size());
+ mBuffer->setRange(0, mBuffer->size());
}
- *buffer = out;
+ if (mBuffer == NULL
+ || mBuffer->size() + buffer->range_length() > prevCapacity) {
+ size_t newCapacity =
+ (prevCapacity + buffer->range_length() + 1023) & ~1023;
+
+ sp<ABuffer> newBuffer = new ABuffer(newCapacity);
+ if (mBuffer != NULL) {
+ memcpy(newBuffer->data(), mBuffer->data(), mBuffer->size());
+ newBuffer->setRange(0, mBuffer->size());
+ } else {
+ newBuffer->setRange(0, 0);
+ }
+ mBuffer = newBuffer;
+ }
+
+ memcpy(mBuffer->data() + mBuffer->size(),
+ (const uint8_t *)buffer->data() + buffer->range_offset(),
+ buffer->range_length());
+
+ mBuffer->setRange(0, mBuffer->size() + buffer->range_length());
+}
+
+bool AVIExtractor::MP3Splitter::resync() {
+ if (mBuffer == NULL) {
+ return false;
+ }
+
+ bool foundSync = false;
+ for (size_t offset = 0; offset + 3 < mBuffer->size(); ++offset) {
+ uint32_t firstHeader = U32_AT(mBuffer->data() + offset);
+
+ size_t frameSize;
+ if (!GetMPEGAudioFrameSize(firstHeader, &frameSize)) {
+ continue;
+ }
+
+ size_t subsequentOffset = offset + frameSize;
+ size_t i = 3;
+ while (i > 0) {
+ if (subsequentOffset + 3 >= mBuffer->size()) {
+ break;
+ }
+
+ static const uint32_t kMask = 0xfffe0c00;
+
+ uint32_t header = U32_AT(mBuffer->data() + subsequentOffset);
+ if ((header & kMask) != (firstHeader & kMask)) {
+ break;
+ }
+
+ if (!GetMPEGAudioFrameSize(header, &frameSize)) {
+ break;
+ }
+
+ subsequentOffset += frameSize;
+ --i;
+ }
+
+ if (i == 0) {
+ foundSync = true;
+ memmove(mBuffer->data(),
+ mBuffer->data() + offset,
+ mBuffer->size() - offset);
+
+ mBuffer->setRange(0, mBuffer->size() - offset);
+ break;
+ }
+ }
+
+ return foundSync;
+}
+
+status_t AVIExtractor::MP3Splitter::read(MediaBuffer **out) {
+ *out = NULL;
+
+ if (mFindSync) {
+ if (!resync()) {
+ return -EAGAIN;
+ }
+
+ mFindSync = false;
+ }
+
+ if (mBuffer->size() < 4) {
+ return -EAGAIN;
+ }
+
+ uint32_t header = U32_AT(mBuffer->data());
+ size_t frameSize;
+ int sampleRate;
+ int numSamples;
+ if (!GetMPEGAudioFrameSize(
+ header, &frameSize, &sampleRate, NULL, NULL, &numSamples)) {
+ return ERROR_MALFORMED;
+ }
+
+ if (mBuffer->size() < frameSize) {
+ return -EAGAIN;
+ }
+
+ MediaBuffer *mbuf = new MediaBuffer(frameSize);
+ memcpy(mbuf->data(), mBuffer->data(), frameSize);
+
+ int64_t timeUs = mBaseTimeUs + (mNumSamplesRead * 1000000ll) / sampleRate;
+ mNumSamplesRead += numSamples;
+
+ mbuf->meta_data()->setInt64(kKeyTime, timeUs);
+
+ mBuffer->setRange(
+ mBuffer->offset() + frameSize, mBuffer->size() - frameSize);
+
+ *out = mbuf;
return OK;
}
@@ -449,6 +659,8 @@
track->mThumbnailSampleSize = 0;
track->mThumbnailSampleIndex = -1;
track->mMaxSampleSize = 0;
+ track->mAvgChunkSize = 1.0;
+ track->mFirstChunkSize = 0;
return OK;
}
@@ -467,8 +679,8 @@
bool isVideo = (track->mKind == Track::VIDEO);
- if ((isVideo && size < 40) || (!isVideo && size < 18)) {
- // Expected a BITMAPINFO or WAVEFORMATEX structure, respectively.
+ if ((isVideo && size < 40) || (!isVideo && size < 16)) {
+ // Expected a BITMAPINFO or WAVEFORMAT(EX) structure, respectively.
return ERROR_MALFORMED;
}
@@ -651,6 +863,47 @@
for (size_t i = 0; i < mTracks.size(); ++i) {
Track *track = &mTracks.editItemAt(i);
+ if (track->mBytesPerSample > 0) {
+ // Assume all chunks are roughly the same size for now.
+
+ // Compute the avg. size of the first 128 chunks (if there are
+ // that many), but exclude the size of the first one, since
+ // it may be an outlier.
+ size_t numSamplesToAverage = track->mSamples.size();
+ if (numSamplesToAverage > 256) {
+ numSamplesToAverage = 256;
+ }
+
+ double avgChunkSize = 0;
+ size_t j;
+ for (j = 0; j <= numSamplesToAverage; ++j) {
+ off64_t offset;
+ size_t size;
+ bool isKey;
+ int64_t dummy;
+
+ status_t err =
+ getSampleInfo(
+ i, j,
+ &offset, &size, &isKey, &dummy);
+
+ if (err != OK) {
+ return err;
+ }
+
+ if (j == 0) {
+ track->mFirstChunkSize = size;
+ continue;
+ }
+
+ avgChunkSize += size;
+ }
+
+ avgChunkSize /= numSamplesToAverage;
+
+ track->mAvgChunkSize = avgChunkSize;
+ }
+
int64_t durationUs;
CHECK_EQ((status_t)OK,
getSampleTime(i, track->mSamples.size() - 1, &durationUs));
@@ -687,21 +940,6 @@
return err;
}
}
-
- if (track->mBytesPerSample != 0) {
- // Assume all chunks are the same size for now.
-
- off64_t offset;
- size_t size;
- bool isKey;
- int64_t sampleTimeUs;
- CHECK_EQ((status_t)OK,
- getSampleInfo(
- i, 0,
- &offset, &size, &isKey, &sampleTimeUs));
-
- track->mRate *= size / track->mBytesPerSample;
- }
}
mFoundIndex = true;
@@ -904,6 +1142,18 @@
*isKey = info.mIsKey;
+ if (track.mBytesPerSample > 0) {
+ size_t sampleStartInBytes;
+ if (sampleIndex == 0) {
+ sampleStartInBytes = 0;
+ } else {
+ sampleStartInBytes =
+ track.mFirstChunkSize + track.mAvgChunkSize * (sampleIndex - 1);
+ }
+
+ sampleIndex = sampleStartInBytes / track.mBytesPerSample;
+ }
+
*sampleTimeUs = (sampleIndex * 1000000ll * track.mRate) / track.mScale;
return OK;
@@ -928,8 +1178,24 @@
const Track &track = mTracks.itemAt(trackIndex);
- ssize_t closestSampleIndex =
- timeUs / track.mRate * track.mScale / 1000000ll;
+ ssize_t closestSampleIndex;
+
+ if (track.mBytesPerSample > 0) {
+ size_t closestByteOffset =
+ (timeUs * track.mBytesPerSample)
+ / track.mRate * track.mScale / 1000000ll;
+
+ if (closestByteOffset <= track.mFirstChunkSize) {
+ closestSampleIndex = 0;
+ } else {
+ closestSampleIndex =
+ (closestByteOffset - track.mFirstChunkSize)
+ / track.mAvgChunkSize;
+ }
+ } else {
+ // Each chunk contains a single sample.
+ closestSampleIndex = timeUs / track.mRate * track.mScale / 1000000ll;
+ }
ssize_t numSamples = track.mSamples.size();
diff --git a/media/libstagefright/AwesomePlayer.cpp b/media/libstagefright/AwesomePlayer.cpp
index 07a46bd..fa9417a50 100644
--- a/media/libstagefright/AwesomePlayer.cpp
+++ b/media/libstagefright/AwesomePlayer.cpp
@@ -249,7 +249,7 @@
}
void AwesomePlayer::setUID(uid_t uid) {
- LOGI("AwesomePlayer running on behalf of uid %d", uid);
+ LOGV("AwesomePlayer running on behalf of uid %d", uid);
mUID = uid;
mUIDValid = true;
@@ -362,7 +362,7 @@
if (!meta->findInt32(kKeyBitRate, &bitrate)) {
const char *mime;
CHECK(meta->findCString(kKeyMIMEType, &mime));
- LOGW("track of type '%s' does not publish bitrate", mime);
+ LOGV("track of type '%s' does not publish bitrate", mime);
totalBitRate = -1;
break;
@@ -1192,7 +1192,7 @@
usleep(1000);
}
IPCThreadState::self()->flushCommands();
- LOGI("video decoder shutdown completed");
+ LOGV("video decoder shutdown completed");
}
status_t AwesomePlayer::setNativeWindow_l(const sp<ANativeWindow> &native) {
@@ -1202,7 +1202,7 @@
return OK;
}
- LOGI("attempting to reconfigure to use new surface");
+ LOGV("attempting to reconfigure to use new surface");
bool wasPlaying = (mFlags & PLAYING) != 0;
diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp
index 6280f51..9eb1469 100755
--- a/media/libstagefright/OMXCodec.cpp
+++ b/media/libstagefright/OMXCodec.cpp
@@ -1635,7 +1635,7 @@
return err;
}
- CODEC_LOGI("allocating %lu buffers of size %lu on %s port",
+ CODEC_LOGV("allocating %lu buffers of size %lu on %s port",
def.nBufferCountActual, def.nBufferSize,
portIndex == kPortIndexInput ? "input" : "output");
@@ -1876,7 +1876,7 @@
return err;
}
- CODEC_LOGI("allocating %lu buffers from a native window of size %lu on "
+ CODEC_LOGV("allocating %lu buffers from a native window of size %lu on "
"output port", def.nBufferCountActual, def.nBufferSize);
// Dequeue buffers and send them to OMX
@@ -3654,7 +3654,7 @@
mSource->stop();
- CODEC_LOGI("stopped in state %d", mState);
+ CODEC_LOGV("stopped in state %d", mState);
return OK;
}
@@ -4219,14 +4219,14 @@
inputFormat->findInt32(kKeySampleRate, &sampleRate);
if ((OMX_U32)numChannels != params.nChannels) {
- LOGW("Codec outputs a different number of channels than "
+ LOGV("Codec outputs a different number of channels than "
"the input stream contains (contains %d channels, "
"codec outputs %ld channels).",
numChannels, params.nChannels);
}
if (sampleRate != (int32_t)params.nSamplingRate) {
- LOGW("Codec outputs at different sampling rate than "
+ LOGV("Codec outputs at different sampling rate than "
"what the input stream contains (contains data at "
"%d Hz, codec outputs %lu Hz)",
sampleRate, params.nSamplingRate);
diff --git a/media/libstagefright/SurfaceMediaSource.cpp b/media/libstagefright/SurfaceMediaSource.cpp
index 306f1f6..2b27ee2 100644
--- a/media/libstagefright/SurfaceMediaSource.cpp
+++ b/media/libstagefright/SurfaceMediaSource.cpp
@@ -764,8 +764,8 @@
// If the loop was exited as a result of stopping the recording,
// it is OK
if (mStopped) {
- LOGV("Read: SurfaceMediaSource is stopped. Returning NO_INIT;");
- return NO_INIT;
+ LOGV("Read: SurfaceMediaSource is stopped. Returning ERROR_END_OF_STREAM.");
+ return ERROR_END_OF_STREAM;
}
// Update the current buffer info
diff --git a/media/libstagefright/include/AVIExtractor.h b/media/libstagefright/include/AVIExtractor.h
index 75ce68d..ff5dcb5 100644
--- a/media/libstagefright/include/AVIExtractor.h
+++ b/media/libstagefright/include/AVIExtractor.h
@@ -42,6 +42,7 @@
private:
struct AVISource;
+ struct MP3Splitter;
struct SampleInfo {
uint32_t mOffset;
@@ -70,6 +71,10 @@
size_t mThumbnailSampleSize;
ssize_t mThumbnailSampleIndex;
size_t mMaxSampleSize;
+
+ // If mBytesPerSample > 0:
+ double mAvgChunkSize;
+ size_t mFirstChunkSize;
};
sp<DataSource> mDataSource;
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaBassBoostTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaBassBoostTest.java
index aa5c4d7..edc3e07 100644
--- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaBassBoostTest.java
+++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaBassBoostTest.java
@@ -46,6 +46,10 @@
private final static int MIN_ENERGY_RATIO_2 = 3;
private final static short TEST_STRENGTH = 500;
private final static int TEST_VOLUME = 4;
+ // Implementor UUID for volume controller effect defined in
+ // frameworks/base/media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp
+ private final static UUID VOLUME_EFFECT_UUID =
+ UUID.fromString("119341a0-8469-11df-81f9-0002a5d5c51b");
private BassBoost mBassBoost = null;
private int mSession = -1;
@@ -201,14 +205,15 @@
// creating a volume controller on output mix ensures that ro.audio.silent mutes
// audio after the effects and not before
vc = new AudioEffect(
- AudioEffect.EFFECT_TYPE_NULL,
- UUID.fromString("119341a0-8469-11df-81f9-0002a5d5c51b"),
- 0,
- 0);
+ AudioEffect.EFFECT_TYPE_NULL,
+ VOLUME_EFFECT_UUID,
+ 0,
+ 0);
vc.setEnabled(true);
mp = new MediaPlayer();
mp.setDataSource(MediaNames.SINE_200_1000);
+ mp.setLooping(true);
mp.setAudioStreamType(AudioManager.STREAM_MUSIC);
getBassBoost(mp.getAudioSessionId());
mp.prepare();
@@ -219,7 +224,7 @@
int refEnergy1000 = probe.capture(1000);
mBassBoost.setStrength((short)1000);
mBassBoost.setEnabled(true);
- Thread.sleep(500);
+ Thread.sleep(4000);
// measure energy around 1kHz with band level at min
int energy200 = probe.capture(200);
int energy1000 = probe.capture(1000);
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaEnvReverbTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaEnvReverbTest.java
index ba202a7..79b90d0 100644
--- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaEnvReverbTest.java
+++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaEnvReverbTest.java
@@ -49,6 +49,14 @@
private final static float DELAY_TOLERANCE = 1.05f;
// allow +/- 5% tolerance between set and get ratios
private final static float RATIO_TOLERANCE = 1.05f;
+ // Implementor UUID for volume controller effect defined in
+ // frameworks/base/media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp
+ private final static UUID VOLUME_EFFECT_UUID =
+ UUID.fromString("119341a0-8469-11df-81f9-0002a5d5c51b");
+ // Implementor UUID for environmental reverb effect defined in
+ // frameworks/base/media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp
+ private final static UUID ENV_REVERB_EFFECT_UUID =
+ UUID.fromString("c7a511a0-a3bb-11df-860e-0002a5d5c51b");
private EnvironmentalReverb mReverb = null;
private int mSession = -1;
@@ -354,10 +362,10 @@
// creating a volume controller on output mix ensures that ro.audio.silent mutes
// audio after the effects and not before
vc = new AudioEffect(
- AudioEffect.EFFECT_TYPE_NULL,
- UUID.fromString("119341a0-8469-11df-81f9-0002a5d5c51b"),
- 0,
- 0);
+ AudioEffect.EFFECT_TYPE_NULL,
+ VOLUME_EFFECT_UUID,
+ 0,
+ 0);
vc.setEnabled(true);
mp = new MediaPlayer();
@@ -424,10 +432,10 @@
// creating a volume controller on output mix ensures that ro.audio.silent mutes
// audio after the effects and not before
vc = new AudioEffect(
- AudioEffect.EFFECT_TYPE_NULL,
- UUID.fromString("119341a0-8469-11df-81f9-0002a5d5c51b"),
- 0,
- 0);
+ AudioEffect.EFFECT_TYPE_NULL,
+ VOLUME_EFFECT_UUID,
+ 0,
+ 0);
vc.setEnabled(true);
mp = new MediaPlayer();
@@ -438,7 +446,7 @@
// auxiliary reverb will be chosen by the effect framework as we are on session 0
rvb = new AudioEffect(
AudioEffect.EFFECT_TYPE_NULL,
- UUID.fromString("c7a511a0-a3bb-11df-860e-0002a5d5c51b"),
+ ENV_REVERB_EFFECT_UUID,
0,
0);
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaEqualizerTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaEqualizerTest.java
index 9146fb8..459f551 100644
--- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaEqualizerTest.java
+++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaEqualizerTest.java
@@ -49,6 +49,11 @@
private final static int TEST_FREQUENCY_MILLIHERTZ = 1000000;
private final static int MIN_NUMBER_OF_PRESETS = 4;
private final static int TEST_VOLUME = 4;
+ // Implementor UUID for volume controller effect defined in
+ // frameworks/base/media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp
+ private final static UUID VOLUME_EFFECT_UUID =
+ UUID.fromString("119341a0-8469-11df-81f9-0002a5d5c51b");
+
private Equalizer mEqualizer = null;
private int mSession = -1;
@@ -267,10 +272,10 @@
// creating a volume controller on output mix ensures that ro.audio.silent mutes
// audio after the effects and not before
vc = new AudioEffect(
- AudioEffect.EFFECT_TYPE_NULL,
- UUID.fromString("119341a0-8469-11df-81f9-0002a5d5c51b"),
- 0,
- 0);
+ AudioEffect.EFFECT_TYPE_NULL,
+ VOLUME_EFFECT_UUID,
+ 0,
+ 0);
vc.setEnabled(true);
mp = new MediaPlayer();
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaPresetReverbTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaPresetReverbTest.java
index 242e6bb..8cc070e 100644
--- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaPresetReverbTest.java
+++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaPresetReverbTest.java
@@ -43,6 +43,14 @@
*/
public class MediaPresetReverbTest extends ActivityInstrumentationTestCase2<MediaFrameworkTest> {
private String TAG = "MediaPresetReverbTest";
+ // Implementor UUID for volume controller effect defined in
+ // frameworks/base/media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp
+ private final static UUID VOLUME_EFFECT_UUID =
+ UUID.fromString("119341a0-8469-11df-81f9-0002a5d5c51b");
+ // Implementor UUID for preset reverb effect defined in
+ // frameworks/base/media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp
+ private final static UUID PRESET_REVERB_EFFECT_UUID =
+ UUID.fromString("172cdf00-a3bc-11df-a72f-0002a5d5c51b");
private PresetReverb mReverb = null;
private int mSession = -1;
@@ -199,10 +207,10 @@
// creating a volume controller on output mix ensures that ro.audio.silent mutes
// audio after the effects and not before
vc = new AudioEffect(
- AudioEffect.EFFECT_TYPE_NULL,
- UUID.fromString("119341a0-8469-11df-81f9-0002a5d5c51b"),
- 0,
- 0);
+ AudioEffect.EFFECT_TYPE_NULL,
+ VOLUME_EFFECT_UUID,
+ 0,
+ 0);
vc.setEnabled(true);
mp = new MediaPlayer();
@@ -267,24 +275,21 @@
// creating a volume controller on output mix ensures that ro.audio.silent mutes
// audio after the effects and not before
vc = new AudioEffect(
- AudioEffect.EFFECT_TYPE_NULL,
- UUID.fromString("119341a0-8469-11df-81f9-0002a5d5c51b"),
- 0,
- 0);
+ AudioEffect.EFFECT_TYPE_NULL,
+ VOLUME_EFFECT_UUID,
+ 0,
+ 0);
vc.setEnabled(true);
mp = new MediaPlayer();
mp.setDataSource(MediaNames.SINE_200_1000);
mp.setAudioStreamType(AudioManager.STREAM_MUSIC);
- getReverb(mp.getAudioSessionId());
- mReverb.setPreset((short)PresetReverb.PRESET_PLATE);
- mReverb.setEnabled(true);
// create reverb with UUID instead of PresetReverb constructor otherwise an auxiliary
// reverb will be chosen by the effect framework as we are on session 0
rvb = new AudioEffect(
AudioEffect.EFFECT_TYPE_NULL,
- UUID.fromString("172cdf00-a3bc-11df-a72f-0002a5d5c51b"),
+ PRESET_REVERB_EFFECT_UUID,
0,
0);
@@ -317,7 +322,6 @@
loge(msg, "sleep() interrupted");
}
finally {
- releaseReverb();
if (mp != null) {
mp.release();
}
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaVirtualizerTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaVirtualizerTest.java
index 7a35429..3d3c011 100644
--- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaVirtualizerTest.java
+++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaVirtualizerTest.java
@@ -43,9 +43,13 @@
*/
public class MediaVirtualizerTest extends ActivityInstrumentationTestCase2<MediaFrameworkTest> {
private String TAG = "MediaVirtualizerTest";
- private final static int MIN_ENERGY_RATIO_2 = 3;
+ private final static int MIN_ENERGY_RATIO_2 = 2;
private final static short TEST_STRENGTH = 500;
private final static int TEST_VOLUME = 4;
+ // Implementor UUID for volume controller effect defined in
+ // frameworks/base/media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp
+ private final static UUID VOLUME_EFFECT_UUID =
+ UUID.fromString("119341a0-8469-11df-81f9-0002a5d5c51b");
private Virtualizer mVirtualizer = null;
private int mSession = -1;
@@ -202,14 +206,15 @@
// creating a volume controller on output mix ensures that ro.audio.silent mutes
// audio after the effects and not before
vc = new AudioEffect(
- AudioEffect.EFFECT_TYPE_NULL,
- UUID.fromString("119341a0-8469-11df-81f9-0002a5d5c51b"),
- 0,
- 0);
+ AudioEffect.EFFECT_TYPE_NULL,
+ VOLUME_EFFECT_UUID,
+ 0,
+ 0);
vc.setEnabled(true);
mp = new MediaPlayer();
mp.setDataSource(MediaNames.SINE_200_1000);
+ mp.setLooping(true);
mp.setAudioStreamType(AudioManager.STREAM_MUSIC);
getVirtualizer(mp.getAudioSessionId());
mp.prepare();
@@ -220,7 +225,7 @@
int refEnergy1000 = probe.capture(1000);
mVirtualizer.setStrength((short)1000);
mVirtualizer.setEnabled(true);
- Thread.sleep(500);
+ Thread.sleep(4000);
// measure energy around 1kHz with band level at min
int energy200 = probe.capture(200);
int energy1000 = probe.capture(1000);
@@ -230,7 +235,7 @@
// audio file but is not the primary effect of the virtualizer. A better way would
// be to have a stereo PCM capture and check that a strongly paned input is centered
// when output. However, we cannot capture stereo with the visualizer.
- assertTrue(msg + ": virtiualizer has no effect",
+ assertTrue(msg + ": virtualizer has no effect",
((float)energy200/(float)energy1000) >
(MIN_ENERGY_RATIO_2 * ((float)refEnergy200/(float)refEnergy1000)));
result = true;
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaVisualizerTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaVisualizerTest.java
index 542ca8d..0d5c6b4 100644
--- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaVisualizerTest.java
+++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaVisualizerTest.java
@@ -47,6 +47,10 @@
private final static int MAX_SAMPLING_RATE = 48000000;
private final static int MIN_CAPTURE_SIZE_MAX = 1024;
private final static int MAX_CAPTURE_SIZE_MIN = 128;
+ // Implementor UUID for volume controller effect defined in
+ // frameworks/base/media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp
+ private final static UUID VOLUME_EFFECT_UUID =
+ UUID.fromString("119341a0-8469-11df-81f9-0002a5d5c51b");
private Visualizer mVisualizer = null;
private int mSession = -1;
@@ -205,10 +209,10 @@
// creating a volume controller on output mix ensures that ro.audio.silent mutes
// audio after the effects and not before
vc = new AudioEffect(
- AudioEffect.EFFECT_TYPE_NULL,
- UUID.fromString("119341a0-8469-11df-81f9-0002a5d5c51b"),
- 0,
- 0);
+ AudioEffect.EFFECT_TYPE_NULL,
+ VOLUME_EFFECT_UUID,
+ 0,
+ 0);
vc.setEnabled(true);
mp = new MediaPlayer();
@@ -281,10 +285,10 @@
// creating a volume controller on output mix ensures that ro.audio.silent mutes
// audio after the effects and not before
vc = new AudioEffect(
- AudioEffect.EFFECT_TYPE_NULL,
- UUID.fromString("119341a0-8469-11df-81f9-0002a5d5c51b"),
- 0,
- 0);
+ AudioEffect.EFFECT_TYPE_NULL,
+ VOLUME_EFFECT_UUID,
+ 0,
+ 0);
vc.setEnabled(true);
mp = new MediaPlayer();
diff --git a/packages/DefaultContainerService/src/com/android/defcontainer/DefaultContainerService.java b/packages/DefaultContainerService/src/com/android/defcontainer/DefaultContainerService.java
index 6e5f856..113f0f7 100644
--- a/packages/DefaultContainerService/src/com/android/defcontainer/DefaultContainerService.java
+++ b/packages/DefaultContainerService/src/com/android/defcontainer/DefaultContainerService.java
@@ -156,6 +156,7 @@
}
ret.packageName = pkg.packageName;
ret.installLocation = pkg.installLocation;
+ ret.verifiers = pkg.verifiers;
ret.recommendedInstallLocation = recommendAppInstallLocation(pkg.installLocation,
archiveFilePath, flags, threshold);
diff --git a/packages/SystemUI/res/drawable-hdpi/ic_sysbar_home.png b/packages/SystemUI/res/drawable-hdpi/ic_sysbar_home.png
index 3137e7e..908056f 100644
--- a/packages/SystemUI/res/drawable-hdpi/ic_sysbar_home.png
+++ b/packages/SystemUI/res/drawable-hdpi/ic_sysbar_home.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_alarm.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_alarm.png
index ffffb2d..fc8dee1 100644
--- a/packages/SystemUI/res/drawable-hdpi/stat_sys_alarm.png
+++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_alarm.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_bluetooth.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_bluetooth.png
index 2117705..4a5d001 100644
--- a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_bluetooth.png
+++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_bluetooth.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_sync.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_sync.png
index ba2d78a..ed31e8e 100644
--- a/packages/SystemUI/res/drawable-hdpi/stat_sys_sync.png
+++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_sync.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_sync_error.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_sync_error.png
index 1102846..6583878 100644
--- a/packages/SystemUI/res/drawable-hdpi/stat_sys_sync_error.png
+++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_sync_error.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/ic_sysbar_home.png b/packages/SystemUI/res/drawable-mdpi/ic_sysbar_home.png
index 5c98614..9820a79 100644
--- a/packages/SystemUI/res/drawable-mdpi/ic_sysbar_home.png
+++ b/packages/SystemUI/res/drawable-mdpi/ic_sysbar_home.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_alarm.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_alarm.png
index 4931b66..4b0a74f 100644
--- a/packages/SystemUI/res/drawable-mdpi/stat_sys_alarm.png
+++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_alarm.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_bluetooth.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_bluetooth.png
index f288d9f..53a7364 100644
--- a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_bluetooth.png
+++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_bluetooth.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_sync.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_sync.png
index 6649031..06b3913 100644
--- a/packages/SystemUI/res/drawable-mdpi/stat_sys_sync.png
+++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_sync.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_sync_error.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_sync_error.png
index 1b57936..4f23dae 100644
--- a/packages/SystemUI/res/drawable-mdpi/stat_sys_sync_error.png
+++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_sync_error.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/ic_sysbar_home.png b/packages/SystemUI/res/drawable-xhdpi/ic_sysbar_home.png
index 7c6b8e5..0b41317 100644
--- a/packages/SystemUI/res/drawable-xhdpi/ic_sysbar_home.png
+++ b/packages/SystemUI/res/drawable-xhdpi/ic_sysbar_home.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_alarm.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_alarm.png
index 6abc7c8..19ad300 100644
--- a/packages/SystemUI/res/drawable-xhdpi/stat_sys_alarm.png
+++ b/packages/SystemUI/res/drawable-xhdpi/stat_sys_alarm.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_bluetooth.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_bluetooth.png
index 738bd21..524b31b 100644
--- a/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_bluetooth.png
+++ b/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_bluetooth.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_sync.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_sync.png
index fb691fc..fdd640c 100644
--- a/packages/SystemUI/res/drawable-xhdpi/stat_sys_sync.png
+++ b/packages/SystemUI/res/drawable-xhdpi/stat_sys_sync.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_sync_error.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_sync_error.png
index 0c7ba35..a1a0646 100644
--- a/packages/SystemUI/res/drawable-xhdpi/stat_sys_sync_error.png
+++ b/packages/SystemUI/res/drawable-xhdpi/stat_sys_sync_error.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable/notification_row_bg.xml b/packages/SystemUI/res/drawable/notification_row_bg.xml
new file mode 100644
index 0000000..dc626d1
--- /dev/null
+++ b/packages/SystemUI/res/drawable/notification_row_bg.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2011 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:exitFadeDuration="@android:integer/config_mediumAnimTime">
+
+ <item android:state_pressed="true" android:drawable="@android:color/holo_blue_light" />
+ <item android:state_pressed="false" android:drawable="@drawable/notification_item_background_color" />
+</selector>
diff --git a/packages/SystemUI/res/layout/status_bar_notification_row.xml b/packages/SystemUI/res/layout/status_bar_notification_row.xml
index ff86878..3220e62 100644
--- a/packages/SystemUI/res/layout/status_bar_notification_row.xml
+++ b/packages/SystemUI/res/layout/status_bar_notification_row.xml
@@ -23,6 +23,7 @@
android:layout_alignParentLeft="true"
android:scaleType="center"
android:clickable="true"
+ android:background="@*android:drawable/notify_panel_notification_icon_bg_tile"
/>
<com.android.systemui.statusbar.LatestItemView android:id="@+id/content"
@@ -33,14 +34,14 @@
android:layout_alignParentRight="true"
android:focusable="true"
android:clickable="true"
- android:background="@drawable/notification_item_background_color"
+ android:background="@drawable/notification_row_bg"
/>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/notification_divider_height"
android:layout_alignParentBottom="true"
- android:background="@drawable/status_bar_notification_row_background_color"
+ android:background="@drawable/notification_item_background_color"
/>
</RelativeLayout>
diff --git a/packages/SystemUI/res/values-ar-xlarge/strings.xml b/packages/SystemUI/res/values-ar-xlarge/strings.xml
deleted file mode 100644
index d4fb873..0000000
--- a/packages/SystemUI/res/values-ar-xlarge/strings.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/**
- * Copyright (c) 2010, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="status_bar_clear_all_button" msgid="4722520806446512408">"محو الكل"</string>
- <string name="status_bar_settings_signal_meter_disconnected" msgid="4684094636492991496">"لا اتصال بالإنترنت"</string>
- <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi متصل"</string>
- <string name="gps_notification_searching_text" msgid="894185519046488403">"جارٍ البحث عن GPS"</string>
- <string name="gps_notification_found_text" msgid="5306445324124275852">"تم تعيين الموقع بواسطة GPS"</string>
- <string name="notifications_off_title" msgid="2297252328026582111">"إيقاف التنبيهات"</string>
- <string name="notifications_off_text" msgid="3754847213329718358">"انقر هنا لإعادة تشغيل التنبيهات."</string>
-</resources>
diff --git a/packages/SystemUI/res/values-bg-xlarge/strings.xml b/packages/SystemUI/res/values-bg-xlarge/strings.xml
deleted file mode 100644
index 4e730ae..0000000
--- a/packages/SystemUI/res/values-bg-xlarge/strings.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/**
- * Copyright (c) 2010, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="status_bar_clear_all_button" msgid="4722520806446512408">"Изчистване"</string>
- <string name="status_bar_settings_signal_meter_disconnected" msgid="4684094636492991496">"Няма връзка с интернет"</string>
- <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi: има връзка"</string>
- <string name="gps_notification_searching_text" msgid="894185519046488403">"Търси се GPS"</string>
- <string name="gps_notification_found_text" msgid="5306445324124275852">"Местоположението е зададено от GPS"</string>
- <string name="notifications_off_title" msgid="2297252328026582111">"Известията са изключени"</string>
- <string name="notifications_off_text" msgid="3754847213329718358">"Докоснете тук, за да включите отново известията."</string>
-</resources>
diff --git a/packages/SystemUI/res/values-ca-xlarge/strings.xml b/packages/SystemUI/res/values-ca-xlarge/strings.xml
deleted file mode 100644
index 9fc74d0..0000000
--- a/packages/SystemUI/res/values-ca-xlarge/strings.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/**
- * Copyright (c) 2010, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="status_bar_clear_all_button" msgid="4722520806446512408">"Esborra-ho"</string>
- <string name="status_bar_settings_signal_meter_disconnected" msgid="4684094636492991496">"No connexió Internet"</string>
- <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi: connectat"</string>
- <string name="gps_notification_searching_text" msgid="894185519046488403">"S\'està cercant un GPS"</string>
- <string name="gps_notification_found_text" msgid="5306445324124275852">"S\'ha establert la ubicació per GPS"</string>
- <string name="notifications_off_title" msgid="2297252328026582111">"Notificacions desactivades"</string>
- <string name="notifications_off_text" msgid="3754847213329718358">"Pica aquí per tornar a activar les notificacions."</string>
-</resources>
diff --git a/packages/SystemUI/res/values-cs-xlarge/strings.xml b/packages/SystemUI/res/values-cs-xlarge/strings.xml
deleted file mode 100644
index 05b1248..0000000
--- a/packages/SystemUI/res/values-cs-xlarge/strings.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/**
- * Copyright (c) 2010, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="status_bar_clear_all_button" msgid="4722520806446512408">"Vymazat vše"</string>
- <string name="status_bar_settings_signal_meter_disconnected" msgid="4684094636492991496">"Žádné připojení"</string>
- <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi: připojeno"</string>
- <string name="gps_notification_searching_text" msgid="894185519046488403">"Vyhledávání satelitů GPS"</string>
- <string name="gps_notification_found_text" msgid="5306445324124275852">"Poloha nastavena pomocí GPS"</string>
- <string name="notifications_off_title" msgid="2297252328026582111">"Oznámení jsou vypnuta"</string>
- <string name="notifications_off_text" msgid="3754847213329718358">"Chcete-li oznámení znovu zapnout, klepněte sem."</string>
-</resources>
diff --git a/packages/SystemUI/res/values-da-xlarge/strings.xml b/packages/SystemUI/res/values-da-xlarge/strings.xml
deleted file mode 100644
index dd20e64..0000000
--- a/packages/SystemUI/res/values-da-xlarge/strings.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/**
- * Copyright (c) 2010, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="status_bar_clear_all_button" msgid="4722520806446512408">"Ryd alt"</string>
- <string name="status_bar_settings_signal_meter_disconnected" msgid="4684094636492991496">"Ingen internetforb."</string>
- <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi er forbundet"</string>
- <string name="gps_notification_searching_text" msgid="894185519046488403">"Søger efter GPS"</string>
- <string name="gps_notification_found_text" msgid="5306445324124275852">"Placeringen er angivet ved hjælp af GPS"</string>
- <string name="notifications_off_title" msgid="2297252328026582111">"Meddelelser: Fra"</string>
- <string name="notifications_off_text" msgid="3754847213329718358">"Tryk her for at slå meddelelser til igen."</string>
-</resources>
diff --git a/packages/SystemUI/res/values-de-xlarge/strings.xml b/packages/SystemUI/res/values-de-xlarge/strings.xml
deleted file mode 100644
index cc782da..0000000
--- a/packages/SystemUI/res/values-de-xlarge/strings.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/**
- * Copyright (c) 2010, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="status_bar_clear_all_button" msgid="4722520806446512408">"Alle löschen"</string>
- <string name="status_bar_settings_signal_meter_disconnected" msgid="4684094636492991496">"Keine Internetverbindung"</string>
- <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Mit WLAN verbunden"</string>
- <string name="gps_notification_searching_text" msgid="894185519046488403">"Suche nach GPS"</string>
- <string name="gps_notification_found_text" msgid="5306445324124275852">"Standort durch GPS festgelegt"</string>
- <string name="notifications_off_title" msgid="2297252328026582111">"Benachrichtigungen aus"</string>
- <string name="notifications_off_text" msgid="3754847213329718358">"Tippen Sie hier, um Benachrichtigungen wieder einzuschalten."</string>
-</resources>
diff --git a/packages/SystemUI/res/values-el-xlarge/strings.xml b/packages/SystemUI/res/values-el-xlarge/strings.xml
deleted file mode 100644
index 4f7814a..0000000
--- a/packages/SystemUI/res/values-el-xlarge/strings.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/**
- * Copyright (c) 2010, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="status_bar_clear_all_button" msgid="4722520806446512408">"Διαγ. όλων"</string>
- <string name="status_bar_settings_signal_meter_disconnected" msgid="4684094636492991496">"Χωρίς σύνδ. σε Διαδ."</string>
- <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi: συνδέθηκε"</string>
- <string name="gps_notification_searching_text" msgid="894185519046488403">"Αναζήτηση για GPS"</string>
- <string name="gps_notification_found_text" msgid="5306445324124275852">"Ρύθμιση τοποθεσίας με GPS"</string>
- <string name="notifications_off_title" msgid="2297252328026582111">"Ειδοποιήσεις ανενεργές"</string>
- <string name="notifications_off_text" msgid="3754847213329718358">"Πατήστε εδώ για να ενεργοποιήσετε τις ειδοποιήσεις"</string>
-</resources>
diff --git a/packages/SystemUI/res/values-en-rGB-xlarge/strings.xml b/packages/SystemUI/res/values-en-rGB-xlarge/strings.xml
deleted file mode 100644
index 68986f0..0000000
--- a/packages/SystemUI/res/values-en-rGB-xlarge/strings.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/**
- * Copyright (c) 2010, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="status_bar_clear_all_button" msgid="4722520806446512408">"Clear all"</string>
- <string name="status_bar_settings_signal_meter_disconnected" msgid="4684094636492991496">"No Internet connection"</string>
- <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi connected"</string>
- <string name="gps_notification_searching_text" msgid="894185519046488403">"Searching for GPS"</string>
- <string name="gps_notification_found_text" msgid="5306445324124275852">"Location set by GPS"</string>
- <string name="notifications_off_title" msgid="2297252328026582111">"Notifications off"</string>
- <string name="notifications_off_text" msgid="3754847213329718358">"Tap here to turn notifications back on."</string>
-</resources>
diff --git a/packages/SystemUI/res/values-es-rUS-xlarge/strings.xml b/packages/SystemUI/res/values-es-rUS-xlarge/strings.xml
deleted file mode 100644
index fa9b762..0000000
--- a/packages/SystemUI/res/values-es-rUS-xlarge/strings.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/**
- * Copyright (c) 2010, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="status_bar_clear_all_button" msgid="4722520806446512408">"Eliminar todos"</string>
- <string name="status_bar_settings_signal_meter_disconnected" msgid="4684094636492991496">"Sin conexión a Int."</string>
- <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"WiFi conectado"</string>
- <string name="gps_notification_searching_text" msgid="894185519046488403">"Buscando GPS"</string>
- <string name="gps_notification_found_text" msgid="5306445324124275852">"La ubicación se estableció por GPS."</string>
- <string name="notifications_off_title" msgid="2297252328026582111">"Notificaciones desactivadas"</string>
- <string name="notifications_off_text" msgid="3754847213329718358">"Presiona aquí para volver a activar las notificaciones."</string>
-</resources>
diff --git a/packages/SystemUI/res/values-es-xlarge/strings.xml b/packages/SystemUI/res/values-es-xlarge/strings.xml
deleted file mode 100644
index a7588da..0000000
--- a/packages/SystemUI/res/values-es-xlarge/strings.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/**
- * Copyright (c) 2010, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="status_bar_clear_all_button" msgid="4722520806446512408">"Borrar todo"</string>
- <string name="status_bar_settings_signal_meter_disconnected" msgid="4684094636492991496">"Sin conexión a Internet"</string>
- <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Con conexión WiFi"</string>
- <string name="gps_notification_searching_text" msgid="894185519046488403">"Buscando GPS"</string>
- <string name="gps_notification_found_text" msgid="5306445324124275852">"Ubicación definida por GPS"</string>
- <string name="notifications_off_title" msgid="2297252328026582111">"Notificaciones desactivadas"</string>
- <string name="notifications_off_text" msgid="3754847213329718358">"Toca aquí para volver a activar las notificaciones."</string>
-</resources>
diff --git a/packages/SystemUI/res/values-fa-xlarge/strings.xml b/packages/SystemUI/res/values-fa-xlarge/strings.xml
deleted file mode 100644
index a8e2543..0000000
--- a/packages/SystemUI/res/values-fa-xlarge/strings.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/**
- * Copyright (c) 2010, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="status_bar_clear_all_button" msgid="4722520806446512408">"پاک کردن همه"</string>
- <string name="status_bar_settings_signal_meter_disconnected" msgid="4684094636492991496">"اتصال اینترنت موجود نیست"</string>
- <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi متصل شد"</string>
- <string name="gps_notification_searching_text" msgid="894185519046488403">"جستجوی GPS"</string>
- <string name="gps_notification_found_text" msgid="5306445324124275852">"مکان تنظیم شده توسط GPS"</string>
- <string name="notifications_off_title" msgid="2297252328026582111">"اعلان ها خاموش"</string>
- <string name="notifications_off_text" msgid="3754847213329718358">"برای روشن کردن مجدد اعلان ها، اینجا را ضربه بزنید."</string>
-</resources>
diff --git a/packages/SystemUI/res/values-fi-xlarge/strings.xml b/packages/SystemUI/res/values-fi-xlarge/strings.xml
deleted file mode 100644
index 754c577..0000000
--- a/packages/SystemUI/res/values-fi-xlarge/strings.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/**
- * Copyright (c) 2010, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="status_bar_clear_all_button" msgid="4722520806446512408">"Poista kaikki"</string>
- <string name="status_bar_settings_signal_meter_disconnected" msgid="4684094636492991496">"Ei internetyhteyttä"</string>
- <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wifi yhdistetty"</string>
- <string name="gps_notification_searching_text" msgid="894185519046488403">"Haetaan GPS-yhteyttä"</string>
- <string name="gps_notification_found_text" msgid="5306445324124275852">"Sijainti määritetty GPS:n avulla"</string>
- <string name="notifications_off_title" msgid="2297252328026582111">"Ilmoitukset pois käytöstä"</string>
- <string name="notifications_off_text" msgid="3754847213329718358">"Ota ilmoitukset uudelleen käyttöön napauttamalla tätä."</string>
-</resources>
diff --git a/packages/SystemUI/res/values-fr-xlarge/strings.xml b/packages/SystemUI/res/values-fr-xlarge/strings.xml
deleted file mode 100644
index 08f673d..0000000
--- a/packages/SystemUI/res/values-fr-xlarge/strings.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/**
- * Copyright (c) 2010, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="status_bar_clear_all_button" msgid="4722520806446512408">"Tout effacer"</string>
- <string name="status_bar_settings_signal_meter_disconnected" msgid="4684094636492991496">"Aucune connexion Internet"</string>
- <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Connecté au Wi-Fi"</string>
- <string name="gps_notification_searching_text" msgid="894185519046488403">"Recherche de GPS en cours"</string>
- <string name="gps_notification_found_text" msgid="5306445324124275852">"Position définie par GPS"</string>
- <string name="notifications_off_title" msgid="2297252328026582111">"Notifications désactivées"</string>
- <string name="notifications_off_text" msgid="3754847213329718358">"Appuyez ici pour réactiver les notifications."</string>
-</resources>
diff --git a/packages/SystemUI/res/values-hr-xlarge/strings.xml b/packages/SystemUI/res/values-hr-xlarge/strings.xml
deleted file mode 100644
index b6e15dc..0000000
--- a/packages/SystemUI/res/values-hr-xlarge/strings.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/**
- * Copyright (c) 2010, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="status_bar_clear_all_button" msgid="4722520806446512408">"Izbriši sve"</string>
- <string name="status_bar_settings_signal_meter_disconnected" msgid="4684094636492991496">"Nema int. veze"</string>
- <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi: povezano"</string>
- <string name="gps_notification_searching_text" msgid="894185519046488403">"Pretraživanje GPS-a"</string>
- <string name="gps_notification_found_text" msgid="5306445324124275852">"Lokaciju utvrdio GPS"</string>
- <string name="notifications_off_title" msgid="2297252328026582111">"Obavijesti isključene"</string>
- <string name="notifications_off_text" msgid="3754847213329718358">"Dotaknite ovdje da biste ponovo uključili obavijesti."</string>
-</resources>
diff --git a/packages/SystemUI/res/values-hu-xlarge/strings.xml b/packages/SystemUI/res/values-hu-xlarge/strings.xml
deleted file mode 100644
index fe2e5ee..0000000
--- a/packages/SystemUI/res/values-hu-xlarge/strings.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/**
- * Copyright (c) 2010, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="status_bar_clear_all_button" msgid="4722520806446512408">"Össz.törl."</string>
- <string name="status_bar_settings_signal_meter_disconnected" msgid="4684094636492991496">"Nincs internetkapcs."</string>
- <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi csatlakozva"</string>
- <string name="gps_notification_searching_text" msgid="894185519046488403">"GPS keresése"</string>
- <string name="gps_notification_found_text" msgid="5306445324124275852">"A GPS beállította a helyet"</string>
- <string name="notifications_off_title" msgid="2297252328026582111">"Értesítések kikapcsolva"</string>
- <string name="notifications_off_text" msgid="3754847213329718358">"Itt érintse meg az értesítések bekapcsolásához."</string>
-</resources>
diff --git a/packages/SystemUI/res/values-in-xlarge/strings.xml b/packages/SystemUI/res/values-in-xlarge/strings.xml
deleted file mode 100644
index a4ca341..0000000
--- a/packages/SystemUI/res/values-in-xlarge/strings.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/**
- * Copyright (c) 2010, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="status_bar_clear_all_button" msgid="4722520806446512408">"Hapus semua"</string>
- <string name="status_bar_settings_signal_meter_disconnected" msgid="4684094636492991496">"Tidak ada sambungan internet"</string>
- <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi tersambung"</string>
- <string name="gps_notification_searching_text" msgid="894185519046488403">"Menelusuri GPS"</string>
- <string name="gps_notification_found_text" msgid="5306445324124275852">"Lokasi yang disetel oleh GPS"</string>
- <string name="notifications_off_title" msgid="2297252328026582111">"Pemberitahuan mati"</string>
- <string name="notifications_off_text" msgid="3754847213329718358">"Ketuk di sini untuk menghidupkan lagi pemberitahuan."</string>
-</resources>
diff --git a/packages/SystemUI/res/values-it-xlarge/strings.xml b/packages/SystemUI/res/values-it-xlarge/strings.xml
deleted file mode 100644
index 24d88744..0000000
--- a/packages/SystemUI/res/values-it-xlarge/strings.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/**
- * Copyright (c) 2010, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="status_bar_clear_all_button" msgid="4722520806446512408">"Canc. tutto"</string>
- <string name="status_bar_settings_signal_meter_disconnected" msgid="4684094636492991496">"No connessione Internet"</string>
- <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi: connesso"</string>
- <string name="gps_notification_searching_text" msgid="894185519046488403">"Ricerca del GPS"</string>
- <string name="gps_notification_found_text" msgid="5306445324124275852">"Posizione stabilita dal GPS"</string>
- <string name="notifications_off_title" msgid="2297252328026582111">"Notifiche disattivate"</string>
- <string name="notifications_off_text" msgid="3754847213329718358">"Tocca qui per riattivare le notifiche."</string>
-</resources>
diff --git a/packages/SystemUI/res/values-iw-xlarge/strings.xml b/packages/SystemUI/res/values-iw-xlarge/strings.xml
deleted file mode 100644
index 97172b8..0000000
--- a/packages/SystemUI/res/values-iw-xlarge/strings.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/**
- * Copyright (c) 2010, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="status_bar_clear_all_button" msgid="4722520806446512408">"נקה הכל"</string>
- <string name="status_bar_settings_signal_meter_disconnected" msgid="4684094636492991496">"אין חיבור לאינטרנט"</string>
- <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi מחובר"</string>
- <string name="gps_notification_searching_text" msgid="894185519046488403">"מחפש GPS"</string>
- <string name="gps_notification_found_text" msgid="5306445324124275852">"מיקום מוגדר על ידי GPS"</string>
- <string name="notifications_off_title" msgid="2297252328026582111">"מצב התראות כבוי"</string>
- <string name="notifications_off_text" msgid="3754847213329718358">"הקש כאן כדי להפעיל מחדש את ההתראות."</string>
-</resources>
diff --git a/packages/SystemUI/res/values-ja-xlarge/strings.xml b/packages/SystemUI/res/values-ja-xlarge/strings.xml
deleted file mode 100644
index e67e0e1..0000000
--- a/packages/SystemUI/res/values-ja-xlarge/strings.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/**
- * Copyright (c) 2010, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="status_bar_clear_all_button" msgid="4722520806446512408">"すべて消去"</string>
- <string name="status_bar_settings_signal_meter_disconnected" msgid="4684094636492991496">"インターネット未接続"</string>
- <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi接続済み"</string>
- <string name="gps_notification_searching_text" msgid="894185519046488403">"GPSで検索中"</string>
- <string name="gps_notification_found_text" msgid="5306445324124275852">"GPSにより現在地が設定されました"</string>
- <string name="notifications_off_title" msgid="2297252328026582111">"通知OFF"</string>
- <string name="notifications_off_text" msgid="3754847213329718358">"通知を有効にするにはここをタップします。"</string>
-</resources>
diff --git a/packages/SystemUI/res/values-ko-xlarge/strings.xml b/packages/SystemUI/res/values-ko-xlarge/strings.xml
deleted file mode 100644
index e28ac63..0000000
--- a/packages/SystemUI/res/values-ko-xlarge/strings.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/**
- * Copyright (c) 2010, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="status_bar_clear_all_button" msgid="4722520806446512408">"모두 지우기"</string>
- <string name="status_bar_settings_signal_meter_disconnected" msgid="4684094636492991496">"인터넷에 연결되지 않음"</string>
- <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi 연결됨"</string>
- <string name="gps_notification_searching_text" msgid="894185519046488403">"GPS 검색"</string>
- <string name="gps_notification_found_text" msgid="5306445324124275852">"GPS에서 설정한 위치"</string>
- <string name="notifications_off_title" msgid="2297252328026582111">"알림 사용 안함"</string>
- <string name="notifications_off_text" msgid="3754847213329718358">"알림을 다시 사용하려면 여기를 누르세요."</string>
-</resources>
diff --git a/packages/SystemUI/res/values-lt-xlarge/strings.xml b/packages/SystemUI/res/values-lt-xlarge/strings.xml
deleted file mode 100644
index 12e8bb3..0000000
--- a/packages/SystemUI/res/values-lt-xlarge/strings.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/**
- * Copyright (c) 2010, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="status_bar_clear_all_button" msgid="4722520806446512408">"Išv. viską"</string>
- <string name="status_bar_settings_signal_meter_disconnected" msgid="4684094636492991496">"Nėra interneto ryšio"</string>
- <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Prisijungta prie „Wi-Fi“"</string>
- <string name="gps_notification_searching_text" msgid="894185519046488403">"Ieškoma GPS"</string>
- <string name="gps_notification_found_text" msgid="5306445324124275852">"GPS nustatyta vieta"</string>
- <string name="notifications_off_title" msgid="2297252328026582111">"Pranešimai išjungti"</string>
- <string name="notifications_off_text" msgid="3754847213329718358">"Palieskite čia, kad vėl įjungtumėte pranešimus."</string>
-</resources>
diff --git a/packages/SystemUI/res/values-lv-xlarge/strings.xml b/packages/SystemUI/res/values-lv-xlarge/strings.xml
deleted file mode 100644
index aecb471..0000000
--- a/packages/SystemUI/res/values-lv-xlarge/strings.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/**
- * Copyright (c) 2010, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="status_bar_clear_all_button" msgid="4722520806446512408">"Notīr.visu"</string>
- <string name="status_bar_settings_signal_meter_disconnected" msgid="4684094636492991496">"Nav interneta sav."</string>
- <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Izv. sav. ar Wi-Fi"</string>
- <string name="gps_notification_searching_text" msgid="894185519046488403">"Notiek GPS meklēšana..."</string>
- <string name="gps_notification_found_text" msgid="5306445324124275852">"GPS iestatītā atrašanās vieta"</string>
- <string name="notifications_off_title" msgid="2297252328026582111">"Paziņojumi ir izslēgti."</string>
- <string name="notifications_off_text" msgid="3754847213329718358">"Pieskarieties šeit, lai vēlreiz ieslēgtu paziņojumus."</string>
-</resources>
diff --git a/packages/SystemUI/res/values-nb-xlarge/strings.xml b/packages/SystemUI/res/values-nb-xlarge/strings.xml
deleted file mode 100644
index 717ee79..0000000
--- a/packages/SystemUI/res/values-nb-xlarge/strings.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/**
- * Copyright (c) 2010, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="status_bar_clear_all_button" msgid="4722520806446512408">"Tøm alt"</string>
- <string name="status_bar_settings_signal_meter_disconnected" msgid="4684094636492991496">"Ingen Int.-tilkobl."</string>
- <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi: tilkoblet"</string>
- <string name="gps_notification_searching_text" msgid="894185519046488403">"Søker etter GPS"</string>
- <string name="gps_notification_found_text" msgid="5306445324124275852">"Posisjon angitt av GPS"</string>
- <string name="notifications_off_title" msgid="2297252328026582111">"Varslinger er slått av"</string>
- <string name="notifications_off_text" msgid="3754847213329718358">"Trykk her for å slå på varslinger igjen."</string>
-</resources>
diff --git a/packages/SystemUI/res/values-nl-xlarge/strings.xml b/packages/SystemUI/res/values-nl-xlarge/strings.xml
deleted file mode 100644
index 7c84a7a..0000000
--- a/packages/SystemUI/res/values-nl-xlarge/strings.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/**
- * Copyright (c) 2010, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="status_bar_clear_all_button" msgid="4722520806446512408">"Wissen"</string>
- <string name="status_bar_settings_signal_meter_disconnected" msgid="4684094636492991496">"Geen internetverb."</string>
- <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Verbonden via Wi-Fi"</string>
- <string name="gps_notification_searching_text" msgid="894185519046488403">"Zoeken naar GPS"</string>
- <string name="gps_notification_found_text" msgid="5306445324124275852">"Locatie bepaald met GPS"</string>
- <string name="notifications_off_title" msgid="2297252328026582111">"Meldingen uit"</string>
- <string name="notifications_off_text" msgid="3754847213329718358">"Tik hier om meldingen weer in te schakelen."</string>
-</resources>
diff --git a/packages/SystemUI/res/values-pl-xlarge/strings.xml b/packages/SystemUI/res/values-pl-xlarge/strings.xml
deleted file mode 100644
index 9db1cab..0000000
--- a/packages/SystemUI/res/values-pl-xlarge/strings.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/**
- * Copyright (c) 2010, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="status_bar_clear_all_button" msgid="4722520806446512408">"Wyczyść wszystko"</string>
- <string name="status_bar_settings_signal_meter_disconnected" msgid="4684094636492991496">"Brak połączenia internetowego"</string>
- <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi: połączono"</string>
- <string name="gps_notification_searching_text" msgid="894185519046488403">"Wyszukiwanie sygnału GPS"</string>
- <string name="gps_notification_found_text" msgid="5306445324124275852">"Lokalizacja ustawiona wg GPS"</string>
- <string name="notifications_off_title" msgid="2297252328026582111">"Powiadomienia wyłączone"</string>
- <string name="notifications_off_text" msgid="3754847213329718358">"Dotknij tutaj, aby z powrotem włączyć powiadomienia."</string>
-</resources>
diff --git a/packages/SystemUI/res/values-pt-rPT-xlarge/strings.xml b/packages/SystemUI/res/values-pt-rPT-xlarge/strings.xml
deleted file mode 100644
index 7860208..0000000
--- a/packages/SystemUI/res/values-pt-rPT-xlarge/strings.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/**
- * Copyright (c) 2010, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="status_bar_clear_all_button" msgid="4722520806446512408">"Limpar tudo"</string>
- <string name="status_bar_settings_signal_meter_disconnected" msgid="4684094636492991496">"Sem ligação internet"</string>
- <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi ligado"</string>
- <string name="gps_notification_searching_text" msgid="894185519046488403">"A procurar GPS"</string>
- <string name="gps_notification_found_text" msgid="5306445324124275852">"Localização definida por GPS"</string>
- <string name="notifications_off_title" msgid="2297252328026582111">"Notificações desativadas"</string>
- <string name="notifications_off_text" msgid="3754847213329718358">"Toque aqui para voltar a ativar as notificações."</string>
-</resources>
diff --git a/packages/SystemUI/res/values-pt-xlarge/strings.xml b/packages/SystemUI/res/values-pt-xlarge/strings.xml
deleted file mode 100644
index 2a1786d..0000000
--- a/packages/SystemUI/res/values-pt-xlarge/strings.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/**
- * Copyright (c) 2010, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="status_bar_clear_all_button" msgid="4722520806446512408">"Limpar tudo"</string>
- <string name="status_bar_settings_signal_meter_disconnected" msgid="4684094636492991496">"Sem conex. à inter."</string>
- <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi conectado"</string>
- <string name="gps_notification_searching_text" msgid="894185519046488403">"Procurando GPS"</string>
- <string name="gps_notification_found_text" msgid="5306445324124275852">"Localização definida por GPS"</string>
- <string name="notifications_off_title" msgid="2297252328026582111">"Notificações desativadas"</string>
- <string name="notifications_off_text" msgid="3754847213329718358">"Toque aqui para ativar novamente as notificações."</string>
-</resources>
diff --git a/packages/SystemUI/res/values-ro-xlarge/strings.xml b/packages/SystemUI/res/values-ro-xlarge/strings.xml
deleted file mode 100644
index 21fd0ad..0000000
--- a/packages/SystemUI/res/values-ro-xlarge/strings.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/**
- * Copyright (c) 2010, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="status_bar_clear_all_button" msgid="4722520806446512408">"Şterg. tot"</string>
- <string name="status_bar_settings_signal_meter_disconnected" msgid="4684094636492991496">"Fără conex. internet"</string>
- <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi conectat"</string>
- <string name="gps_notification_searching_text" msgid="894185519046488403">"Se caută dispozitivul GPS"</string>
- <string name="gps_notification_found_text" msgid="5306445324124275852">"Locaţie setată prin GPS"</string>
- <string name="notifications_off_title" msgid="2297252328026582111">"Notificările sunt dezactivate"</string>
- <string name="notifications_off_text" msgid="3754847213329718358">"Apăsaţi aici pentru a reactiva notificările."</string>
-</resources>
diff --git a/packages/SystemUI/res/values-ru-xlarge/strings.xml b/packages/SystemUI/res/values-ru-xlarge/strings.xml
deleted file mode 100644
index bc31fb1..0000000
--- a/packages/SystemUI/res/values-ru-xlarge/strings.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/**
- * Copyright (c) 2010, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="status_bar_clear_all_button" msgid="4722520806446512408">"Удалить все"</string>
- <string name="status_bar_settings_signal_meter_disconnected" msgid="4684094636492991496">"Нет подключения"</string>
- <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi подкл."</string>
- <string name="gps_notification_searching_text" msgid="894185519046488403">"Выполняется поиск при помощи GPS"</string>
- <string name="gps_notification_found_text" msgid="5306445324124275852">"Местоположение установлено при помощи GPS"</string>
- <string name="notifications_off_title" msgid="2297252328026582111">"Показ уведомлений отключен"</string>
- <string name="notifications_off_text" msgid="3754847213329718358">"Нажмите здесь, чтобы снова включить показ уведомлений."</string>
-</resources>
diff --git a/packages/SystemUI/res/values-sk-xlarge/strings.xml b/packages/SystemUI/res/values-sk-xlarge/strings.xml
deleted file mode 100644
index ee9e613..0000000
--- a/packages/SystemUI/res/values-sk-xlarge/strings.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/**
- * Copyright (c) 2010, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="status_bar_clear_all_button" msgid="4722520806446512408">"Vymazať všetky"</string>
- <string name="status_bar_settings_signal_meter_disconnected" msgid="4684094636492991496">"Nepripoj. k Intern."</string>
- <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi: pripojené"</string>
- <string name="gps_notification_searching_text" msgid="894185519046488403">"Hľadanie signálu GPS"</string>
- <string name="gps_notification_found_text" msgid="5306445324124275852">"Poloha určená pomocou GPS"</string>
- <string name="notifications_off_title" msgid="2297252328026582111">"Upozornenia sú vypnuté"</string>
- <string name="notifications_off_text" msgid="3754847213329718358">"Klepnutím tu upozornenia znova povolíte."</string>
-</resources>
diff --git a/packages/SystemUI/res/values-sl-xlarge/strings.xml b/packages/SystemUI/res/values-sl-xlarge/strings.xml
deleted file mode 100644
index 57ed9a7..0000000
--- a/packages/SystemUI/res/values-sl-xlarge/strings.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/**
- * Copyright (c) 2010, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="status_bar_clear_all_button" msgid="4722520806446512408">"Izbriši vse"</string>
- <string name="status_bar_settings_signal_meter_disconnected" msgid="4684094636492991496">"Brez inter. povez."</string>
- <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi – povezano"</string>
- <string name="gps_notification_searching_text" msgid="894185519046488403">"Iskanje GPS-a"</string>
- <string name="gps_notification_found_text" msgid="5306445324124275852">"Lokacija nastavljena z GPS-om"</string>
- <string name="notifications_off_title" msgid="2297252328026582111">"Obvestila izklopljena"</string>
- <string name="notifications_off_text" msgid="3754847213329718358">"Tapnite tukaj, da spet vklopite obvestila."</string>
-</resources>
diff --git a/packages/SystemUI/res/values-sr-xlarge/strings.xml b/packages/SystemUI/res/values-sr-xlarge/strings.xml
deleted file mode 100644
index 95fbc2f..0000000
--- a/packages/SystemUI/res/values-sr-xlarge/strings.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/**
- * Copyright (c) 2010, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="status_bar_clear_all_button" msgid="4722520806446512408">"Обриши све"</string>
- <string name="status_bar_settings_signal_meter_disconnected" msgid="4684094636492991496">"Нема интернет везе"</string>
- <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi је повезан"</string>
- <string name="gps_notification_searching_text" msgid="894185519046488403">"Тражи се GPS"</string>
- <string name="gps_notification_found_text" msgid="5306445324124275852">"Локацију је подесио GPS"</string>
- <string name="notifications_off_title" msgid="2297252328026582111">"Обавештења су искључена"</string>
- <string name="notifications_off_text" msgid="3754847213329718358">"Додирните овде да бисте поново укључили обавештења."</string>
-</resources>
diff --git a/packages/SystemUI/res/values-sv-xlarge/strings.xml b/packages/SystemUI/res/values-sv-xlarge/strings.xml
deleted file mode 100644
index ce608c2..0000000
--- a/packages/SystemUI/res/values-sv-xlarge/strings.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/**
- * Copyright (c) 2010, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="status_bar_clear_all_button" msgid="4722520806446512408">"Ta bort alla"</string>
- <string name="status_bar_settings_signal_meter_disconnected" msgid="4684094636492991496">"Ingen Internetansl."</string>
- <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi-ansluten"</string>
- <string name="gps_notification_searching_text" msgid="894185519046488403">"Sökning efter GPS pågår"</string>
- <string name="gps_notification_found_text" msgid="5306445324124275852">"Platsen har identifierats av GPS"</string>
- <string name="notifications_off_title" msgid="2297252328026582111">"Aviseringar inaktiverade"</string>
- <string name="notifications_off_text" msgid="3754847213329718358">"Knacka lätt här om du vill aktivera aviseringar igen."</string>
-</resources>
diff --git a/packages/SystemUI/res/values-th-xlarge/strings.xml b/packages/SystemUI/res/values-th-xlarge/strings.xml
deleted file mode 100644
index 824de38..0000000
--- a/packages/SystemUI/res/values-th-xlarge/strings.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/**
- * Copyright (c) 2010, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="status_bar_clear_all_button" msgid="4722520806446512408">"ล้างหมด"</string>
- <string name="status_bar_settings_signal_meter_disconnected" msgid="4684094636492991496">"ไม่มีการเชื่อมต่ออินเทอร์เน็ต"</string>
- <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"เชื่อมต่อ Wi-Fi แล้ว"</string>
- <string name="gps_notification_searching_text" msgid="894185519046488403">"การค้นหาสำหรับ GPS"</string>
- <string name="gps_notification_found_text" msgid="5306445324124275852">"ตำแหน่งที่กำหนดโดย GPS"</string>
- <string name="notifications_off_title" msgid="2297252328026582111">"การแจ้งเตือนปิดอยู่"</string>
- <string name="notifications_off_text" msgid="3754847213329718358">"แตะที่นี่เพื่อเปิดการแจ้งเตือนอีกครั้ง"</string>
-</resources>
diff --git a/packages/SystemUI/res/values-tl-xlarge/strings.xml b/packages/SystemUI/res/values-tl-xlarge/strings.xml
deleted file mode 100644
index 582adbc..0000000
--- a/packages/SystemUI/res/values-tl-xlarge/strings.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/**
- * Copyright (c) 2010, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="status_bar_clear_all_button" msgid="4722520806446512408">"I-clear lahat"</string>
- <string name="status_bar_settings_signal_meter_disconnected" msgid="4684094636492991496">"Wala net connection"</string>
- <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Konektado ang WiFi"</string>
- <string name="gps_notification_searching_text" msgid="894185519046488403">"Naghahanap ng GPS"</string>
- <string name="gps_notification_found_text" msgid="5306445324124275852">"Lokasyon na itinatakda ng GPS"</string>
- <string name="notifications_off_title" msgid="2297252328026582111">"Naka-off ang mga notification"</string>
- <string name="notifications_off_text" msgid="3754847213329718358">"Mag-tap dito upang i-on muli ang mga notification."</string>
-</resources>
diff --git a/packages/SystemUI/res/values-tr-xlarge/strings.xml b/packages/SystemUI/res/values-tr-xlarge/strings.xml
deleted file mode 100644
index 6db515f..0000000
--- a/packages/SystemUI/res/values-tr-xlarge/strings.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/**
- * Copyright (c) 2010, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="status_bar_clear_all_button" msgid="4722520806446512408">"Tümünü temizle"</string>
- <string name="status_bar_settings_signal_meter_disconnected" msgid="4684094636492991496">"İnternet bağlnts yok"</string>
- <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Kablosuz bağlandı"</string>
- <string name="gps_notification_searching_text" msgid="894185519046488403">"GPS aranıyor"</string>
- <string name="gps_notification_found_text" msgid="5306445324124275852">"Konum GPS ile belirlendi"</string>
- <string name="notifications_off_title" msgid="2297252328026582111">"Bildirimler kapalı"</string>
- <string name="notifications_off_text" msgid="3754847213329718358">"Bildirimleri tekrar açmak için buraya hafifçe vurun."</string>
-</resources>
diff --git a/packages/SystemUI/res/values-uk-xlarge/strings.xml b/packages/SystemUI/res/values-uk-xlarge/strings.xml
deleted file mode 100644
index 81e50c0..0000000
--- a/packages/SystemUI/res/values-uk-xlarge/strings.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/**
- * Copyright (c) 2010, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="status_bar_clear_all_button" msgid="4722520806446512408">"Очист. все"</string>
- <string name="status_bar_settings_signal_meter_disconnected" msgid="4684094636492991496">"Інтернет не під\'єдн."</string>
- <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi під\'єднано"</string>
- <string name="gps_notification_searching_text" msgid="894185519046488403">"Виконується пошук за допомогою GPS"</string>
- <string name="gps_notification_found_text" msgid="5306445324124275852">"Місцезнаходження встановлено за допомогою GPS"</string>
- <string name="notifications_off_title" msgid="2297252328026582111">"Сповіщення вимкнено"</string>
- <string name="notifications_off_text" msgid="3754847213329718358">"Торкніться тут, щоб знову ввімкнути сповіщення."</string>
-</resources>
diff --git a/packages/SystemUI/res/values-vi-xlarge/strings.xml b/packages/SystemUI/res/values-vi-xlarge/strings.xml
deleted file mode 100644
index 6382fae..0000000
--- a/packages/SystemUI/res/values-vi-xlarge/strings.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/**
- * Copyright (c) 2010, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="status_bar_clear_all_button" msgid="4722520806446512408">"Xóa tất cả"</string>
- <string name="status_bar_settings_signal_meter_disconnected" msgid="4684094636492991496">"Không có kết nối Internet"</string>
- <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Đã kết nối Wi-Fi"</string>
- <string name="gps_notification_searching_text" msgid="894185519046488403">"Tìm kiếm GPS"</string>
- <string name="gps_notification_found_text" msgid="5306445324124275852">"Vị trí đặt bởi GPS"</string>
- <string name="notifications_off_title" msgid="2297252328026582111">"Tắt thông báo"</string>
- <string name="notifications_off_text" msgid="3754847213329718358">"Chạm vào đây để bật lại thông báo."</string>
-</resources>
diff --git a/packages/SystemUI/res/values-zh-rCN-xlarge/strings.xml b/packages/SystemUI/res/values-zh-rCN-xlarge/strings.xml
deleted file mode 100644
index 207ebe4..0000000
--- a/packages/SystemUI/res/values-zh-rCN-xlarge/strings.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/**
- * Copyright (c) 2010, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="status_bar_clear_all_button" msgid="4722520806446512408">"全部清除"</string>
- <string name="status_bar_settings_signal_meter_disconnected" msgid="4684094636492991496">"未连接至互联网"</string>
- <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi 已连接"</string>
- <string name="gps_notification_searching_text" msgid="894185519046488403">"正在搜索 GPS"</string>
- <string name="gps_notification_found_text" msgid="5306445324124275852">"GPS 设置的位置"</string>
- <string name="notifications_off_title" msgid="2297252328026582111">"通知已关闭"</string>
- <string name="notifications_off_text" msgid="3754847213329718358">"点按此处可以重新打开通知。"</string>
-</resources>
diff --git a/packages/SystemUI/res/values-zh-rTW-xlarge/strings.xml b/packages/SystemUI/res/values-zh-rTW-xlarge/strings.xml
deleted file mode 100644
index 14a10f2..0000000
--- a/packages/SystemUI/res/values-zh-rTW-xlarge/strings.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/**
- * Copyright (c) 2010, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="status_bar_clear_all_button" msgid="4722520806446512408">"全部清除"</string>
- <string name="status_bar_settings_signal_meter_disconnected" msgid="4684094636492991496">"沒有網路連線"</string>
- <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi 已連線"</string>
- <string name="gps_notification_searching_text" msgid="894185519046488403">"正在搜尋 GPS"</string>
- <string name="gps_notification_found_text" msgid="5306445324124275852">"GPS 已定位"</string>
- <string name="notifications_off_title" msgid="2297252328026582111">"關閉通知"</string>
- <string name="notifications_off_text" msgid="3754847213329718358">"輕觸這裡即可重新開啟通知。"</string>
-</resources>
diff --git a/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java b/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java
index 492f3c2..bf1ec25 100644
--- a/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java
+++ b/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java
@@ -26,6 +26,7 @@
import android.graphics.Rect;
import android.graphics.Region.Op;
import android.opengl.GLUtils;
+import android.os.SystemProperties;
import android.renderscript.Matrix4f;
import android.service.wallpaper.WallpaperService;
import android.util.Log;
@@ -56,6 +57,7 @@
private static final String TAG = "ImageWallpaper";
private static final String GL_LOG_TAG = "ImageWallpaperGL";
private static final boolean DEBUG = false;
+ private static final String PROPERTY_KERNEL_QEMU = "ro.kernel.qemu";
static final boolean FIXED_SIZED_SURFACE = true;
static final boolean USE_OPENGL = true;
@@ -71,12 +73,19 @@
//noinspection PointlessBooleanExpression,ConstantConditions
if (FIXED_SIZED_SURFACE && USE_OPENGL) {
- WindowManager windowManager = (WindowManager) getSystemService(Context.WINDOW_SERVICE);
- Display display = windowManager.getDefaultDisplay();
- mIsHwAccelerated = ActivityManager.isHighEndGfx(display);
+ if (!isEmulator()) {
+ WindowManager windowManager =
+ (WindowManager) getSystemService(Context.WINDOW_SERVICE);
+ Display display = windowManager.getDefaultDisplay();
+ mIsHwAccelerated = ActivityManager.isHighEndGfx(display);
+ }
}
}
+ private static boolean isEmulator() {
+ return "1".equals(SystemProperties.get(PROPERTY_KERNEL_QEMU, "0"));
+ }
+
public Engine onCreateEngine() {
return new DrawableEngine();
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBar.java
index 37c77f6..5959537 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBar.java
@@ -118,7 +118,7 @@
WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
| WindowManager.LayoutParams.FLAG_TOUCHABLE_WHEN_WAKING
| WindowManager.LayoutParams.FLAG_SPLIT_TOUCH,
- PixelFormat.RGBX_8888);
+ PixelFormat.OPAQUE);
// the status bar should be in an overlay if possible
final Display defaultDisplay
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java
index a90eb3f..6997837 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java
@@ -29,6 +29,7 @@
import android.util.Log;
import android.view.ViewDebug;
import android.view.accessibility.AccessibilityEvent;
+import android.widget.ImageView;
import java.text.NumberFormat;
@@ -70,6 +71,8 @@
final float alpha = res.getFraction(R.dimen.status_bar_icon_drawing_alpha, 1, 1);
setAlpha(alpha);
}
+
+ setScaleType(ImageView.ScaleType.CENTER);
}
private static boolean streq(String a, String b) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
index da6bcd2..e5d4d22 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -316,12 +316,7 @@
}
// figure out which pixel-format to use for the status bar.
- mPixelFormat = PixelFormat.TRANSLUCENT;
- Drawable bg = sb.getBackground();
- if (bg != null) {
- mPixelFormat = bg.getOpacity();
- }
-
+ mPixelFormat = PixelFormat.OPAQUE;
mStatusIcons = (LinearLayout)sb.findViewById(R.id.statusIcons);
mNotificationIcons = (IconMerger)sb.findViewById(R.id.notificationIcons);
mIcons = (LinearLayout)sb.findViewById(R.id.icons);
@@ -896,14 +891,6 @@
}
}
- void workAroundBadLayerDrawableOpacity(View v) {
- LayerDrawable d = (LayerDrawable)v.getBackground();
- if (d == null) return;
- v.setBackgroundDrawable(null);
- d.setOpacity(PixelFormat.TRANSLUCENT);
- v.setBackgroundDrawable(d);
- }
-
private boolean inflateViews(NotificationData.Entry entry, ViewGroup parent) {
StatusBarNotification sbn = entry.notification;
RemoteViews remoteViews = sbn.notification.contentView;
@@ -915,7 +902,6 @@
LayoutInflater inflater = (LayoutInflater)mContext.getSystemService(
Context.LAYOUT_INFLATER_SERVICE);
View row = inflater.inflate(R.layout.status_bar_notification_row, parent, false);
- workAroundBadLayerDrawableOpacity(row);
View vetoButton = row.findViewById(R.id.veto);
if (entry.notification.isClearable()) {
final String _pkg = sbn.pkg;
@@ -1608,6 +1594,9 @@
// the user switches to home. We know it is safe to do at this
// point, so make sure new activity switches are now allowed.
ActivityManagerNative.getDefault().resumeAppSwitches();
+ // Also, notifications can be launched from the lock screen,
+ // so dismiss the lock screen when the activity starts.
+ ActivityManagerNative.getDefault().dismissKeyguardOnNextActivity();
} catch (RemoteException e) {
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java
index 05e171c..9bee5df 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java
@@ -64,6 +64,8 @@
private static final int INET_CONDITION_THRESHOLD = 50;
+ private static final boolean SHOW_SYNC_ICON = false;
+
private final Context mContext;
private final StatusBarManager mService;
private final Handler mHandler = new Handler();
@@ -195,6 +197,7 @@
}
private final void updateSyncState(Intent intent) {
+ if (!SHOW_SYNC_ICON) return;
boolean isActive = intent.getBooleanExtra("active", false);
boolean isFailing = intent.getBooleanExtra("failing", false);
mService.setIconVisibility("sync_active", isActive);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
index 0dfc4f7..c83c470 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
@@ -720,28 +720,19 @@
Slog.d(TAG, "updateConnectivity: connectionStatus=" + connectionStatus);
}
- int inetCondition = (connectionStatus > INET_CONDITION_THRESHOLD ? 1 : 0);
+ mInetCondition = (connectionStatus > INET_CONDITION_THRESHOLD ? 1 : 0);
- switch (info.getType()) {
- case ConnectivityManager.TYPE_MOBILE:
- mInetCondition = inetCondition;
- updateDataNetType();
- updateDataIcon();
- updateTelephonySignalStrength(); // apply any change in connectionStatus
- break;
- case ConnectivityManager.TYPE_WIFI:
- mInetCondition = inetCondition;
- updateWifiIcons();
- break;
- case ConnectivityManager.TYPE_BLUETOOTH:
- mInetCondition = inetCondition;
- if (info != null) {
- mBluetoothTethered = info.isConnected() ? true: false;
- } else {
- mBluetoothTethered = false;
- }
- break;
+ if (info != null && info.getType() == ConnectivityManager.TYPE_BLUETOOTH) {
+ mBluetoothTethered = info.isConnected() ? true: false;
+ } else {
+ mBluetoothTethered = false;
}
+
+ // We want to update all the icons, all at once, for any condition change
+ updateDataNetType();
+ updateDataIcon();
+ updateTelephonySignalStrength();
+ updateWifiIcons();
}
@@ -1035,8 +1026,8 @@
pw.println(mWifiLevel);
pw.print(" mWifiSsid=");
pw.println(mWifiSsid);
- pw.print(" mWifiIconId=");
- pw.println(mWifiIconId);
+ pw.print(String.format(" mWifiIconId=0x%08x/%s",
+ mWifiIconId, getResourceName(mWifiIconId)));
pw.print(" mWifiActivity=");
pw.println(mWifiActivity);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
index c2f07d6..435aa8c 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
@@ -1308,6 +1308,9 @@
// the user switches to home. We know it is safe to do at this
// point, so make sure new activity switches are now allowed.
ActivityManagerNative.getDefault().resumeAppSwitches();
+ // Also, notifications can be launched from the lock screen,
+ // so dismiss the lock screen when the activity starts.
+ ActivityManagerNative.getDefault().dismissKeyguardOnNextActivity();
} catch (RemoteException e) {
}
diff --git a/packages/VpnDialogs/res/layout/confirm.xml b/packages/VpnDialogs/res/layout/confirm.xml
index 11a247a..fef00c2 100644
--- a/packages/VpnDialogs/res/layout/confirm.xml
+++ b/packages/VpnDialogs/res/layout/confirm.xml
@@ -15,46 +15,43 @@
limitations under the License.
-->
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:padding="3mm">
-
- <ImageView android:id="@+id/icon"
- android:layout_width="@android:dimen/app_icon_size"
- android:layout_height="@android:dimen/app_icon_size"
- android:layout_alignParentTop="true"
- android:layout_alignParentLeft="true"
- android:layout_marginRight="1mm"/>
-
- <TextView android:id="@+id/warning"
- android:layout_width="fill_parent"
+<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
+ <LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_alignParentLeft="true"
- android:layout_alignParentRight="true"
- android:layout_below="@id/icon"
- android:padding="3mm"
- android:text="@string/warning"
- android:textSize="18sp"/>
+ android:orientation="vertical"
+ android:padding="3mm">
- <TextView android:id="@+id/prompt"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_alignParentTop="true"
- android:layout_alignParentRight="true"
- android:layout_toRightOf="@id/icon"
- android:layout_above="@id/warning"
- android:gravity="center_vertical"
- android:textSize="20sp"/>
+ <LinearLayout android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ android:gravity="center_vertical">
- <CheckBox android:id="@+id/check"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_alignParentLeft="true"
- android:layout_alignParentRight="true"
- android:layout_below="@id/warning"
- android:text="@string/accept"
- android:textSize="20sp"
- android:checked="false"/>
+ <ImageView android:id="@+id/icon"
+ android:layout_width="@android:dimen/app_icon_size"
+ android:layout_height="@android:dimen/app_icon_size"
+ android:paddingRight="1mm"/>
-</RelativeLayout>
+ <TextView android:id="@+id/prompt"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:textSize="18sp"/>
+ </LinearLayout>
+
+ <TextView android:id="@+id/warning"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:paddingTop="1mm"
+ android:paddingBottom="1mm"
+ android:text="@string/warning"
+ android:textSize="18sp"/>
+
+ <CheckBox android:id="@+id/check"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/accept"
+ android:textSize="20sp"
+ android:checked="false"/>
+ </LinearLayout>
+</ScrollView>
diff --git a/packages/VpnDialogs/src/com/android/vpndialogs/ManageDialog.java b/packages/VpnDialogs/src/com/android/vpndialogs/ManageDialog.java
index d668e98..7fb1417 100644
--- a/packages/VpnDialogs/src/com/android/vpndialogs/ManageDialog.java
+++ b/packages/VpnDialogs/src/com/android/vpndialogs/ManageDialog.java
@@ -181,8 +181,10 @@
String line = in.readLine().trim();
if (line.startsWith(prefix)) {
String[] numbers = line.substring(prefix.length()).split(" +");
- if (numbers.length == 17) {
- return numbers;
+ for (int i = 1; i < 17; ++i) {
+ if (!numbers[i].equals("0")) {
+ return numbers;
+ }
}
break;
}
diff --git a/policy/src/com/android/internal/policy/impl/AccountUnlockScreen.java b/policy/src/com/android/internal/policy/impl/AccountUnlockScreen.java
index f7d936c..a4baeed 100644
--- a/policy/src/com/android/internal/policy/impl/AccountUnlockScreen.java
+++ b/policy/src/com/android/internal/policy/impl/AccountUnlockScreen.java
@@ -54,7 +54,7 @@
public class AccountUnlockScreen extends RelativeLayout implements KeyguardScreen,
View.OnClickListener, TextWatcher {
private static final String LOCK_PATTERN_PACKAGE = "com.android.settings";
- private static final String LOCK_PATTERN_CLASS = LOCK_PATTERN_PACKAGE + ".ChooseLockPattern";
+ private static final String LOCK_PATTERN_CLASS = LOCK_PATTERN_PACKAGE + ".ChooseLockGeneric";
/**
* The amount of millis to stay awake once this screen detects activity
diff --git a/policy/src/com/android/internal/policy/impl/KeyguardStatusViewManager.java b/policy/src/com/android/internal/policy/impl/KeyguardStatusViewManager.java
index 61e30bf..24dce1a 100644
--- a/policy/src/com/android/internal/policy/impl/KeyguardStatusViewManager.java
+++ b/policy/src/com/android/internal/policy/impl/KeyguardStatusViewManager.java
@@ -58,6 +58,7 @@
private static final int CARRIER_HELP_TEXT = 12;
private static final int HELP_MESSAGE_TEXT = 13;
private static final int OWNER_INFO = 14;
+ private static final int BATTERY_INFO = 15;
private StatusMode mStatus;
private String mDateFormatString;
@@ -84,6 +85,9 @@
// last known battery level
private int mBatteryLevel = 100;
+ // last known SIM state
+ protected State mSimState;
+
private LockPatternUtils mLockPatternUtils;
private KeyguardUpdateMonitor mUpdateMonitor;
private Button mEmergencyCallButton;
@@ -98,6 +102,8 @@
private boolean mShowingStatus;
private KeyguardScreenCallback mCallback;
private final boolean mShowEmergencyButtonByDefault;
+ private CharSequence mPlmn;
+ private CharSequence mSpn;
private class TransientTextManager {
private TextView mTextView;
@@ -151,6 +157,7 @@
public KeyguardStatusViewManager(View view, KeyguardUpdateMonitor updateMonitor,
LockPatternUtils lockPatternUtils, KeyguardScreenCallback callback,
boolean showEmergencyButtonByDefault) {
+ if (DEBUG) Log.v(TAG, "KeyguardStatusViewManager()");
mContainer = view;
mDateFormatString = getContext().getString(R.string.full_wday_month_day_no_year);
mLockPatternUtils = lockPatternUtils;
@@ -165,6 +172,12 @@
mTransportView = (TransportControlView) findViewById(R.id.transport);
mEmergencyCallButton = (Button) findViewById(R.id.emergencyCallButton);
mShowEmergencyButtonByDefault = showEmergencyButtonByDefault;
+
+ // Hide transport control view until we know we need to show it.
+ if (mTransportView != null) {
+ mTransportView.setVisibility(View.GONE);
+ }
+
if (mEmergencyCallButton != null) {
mEmergencyCallButton.setText(R.string.lockscreen_emergency_call);
mEmergencyCallButton.setOnClickListener(this);
@@ -173,8 +186,6 @@
mTransientTextManager = new TransientTextManager(mCarrierView);
- updateEmergencyCallButtonState();
-
resetStatusInfo();
refreshDate();
updateOwnerInfo();
@@ -187,10 +198,6 @@
v.setSelected(true);
}
}
-
- // until we get an update...
- setCarrierText(LockPatternUtils.getCarrierString(
- mUpdateMonitor.getTelephonyPlmn(), mUpdateMonitor.getTelephonySpn()));
}
private boolean inWidgetMode() {
@@ -248,6 +255,7 @@
case INSTRUCTION_TEXT:
case CARRIER_HELP_TEXT:
case HELP_MESSAGE_TEXT:
+ case BATTERY_INFO:
mTransientTextManager.post(string, 0, INSTRUCTION_RESET_DELAY);
break;
@@ -262,15 +270,16 @@
}
public void onPause() {
+ if (DEBUG) Log.v(TAG, "onPause()");
mUpdateMonitor.removeCallback(mInfoCallback);
mUpdateMonitor.removeCallback(mSimStateCallback);
}
/** {@inheritDoc} */
public void onResume() {
+ if (DEBUG) Log.v(TAG, "onResume()");
mUpdateMonitor.registerInfoCallback(mInfoCallback);
mUpdateMonitor.registerSimStateCallback(mSimStateCallback);
- updateEmergencyCallButtonState();
resetStatusInfo();
}
@@ -399,7 +408,12 @@
* Determine the current status of the lock screen given the sim state and other stuff.
*/
public StatusMode getStatusForIccState(IccCard.State simState) {
- boolean missingAndNotProvisioned = (!mUpdateMonitor.isDeviceProvisioned()
+ // Since reading the SIM may take a while, we assume it is present until told otherwise.
+ if (simState == null) {
+ return StatusMode.Normal;
+ }
+
+ final boolean missingAndNotProvisioned = (!mUpdateMonitor.isDeviceProvisioned()
&& (simState == IccCard.State.ABSENT || simState == IccCard.State.PERM_DISABLED));
// Assume we're NETWORK_LOCKED if not provisioned
@@ -435,22 +449,21 @@
*
* @param simState
*/
- private void updateWithSimStatus(State simState) {
- // The emergency call button no longer appears on this screen.
- if (DEBUG) Log.d(TAG, "updateLayout: status=" + mStatus);
+ private void updateCarrierTextWithSimStatus(State simState) {
+ if (DEBUG) Log.d(TAG, "updateCarrierTextWithSimStatus(), simState = " + simState);
CharSequence carrierText = null;
int carrierHelpTextId = 0;
mUnlockDisabledDueToSimState = false;
mStatus = getStatusForIccState(simState);
+ mSimState = simState;
switch (mStatus) {
case Normal:
- carrierText = LockPatternUtils.getCarrierString(mUpdateMonitor.getTelephonyPlmn(),
- mUpdateMonitor.getTelephonySpn());
+ carrierText = makeCarierString(mPlmn, mSpn);
break;
case NetworkLocked:
- carrierText = LockPatternUtils.getCarrierString(mUpdateMonitor.getTelephonyPlmn(),
+ carrierText = makeCarierString(mPlmn,
getContext().getText(R.string.lockscreen_network_locked_message));
carrierHelpTextId = R.string.lockscreen_instructions_when_pattern_disabled;
break;
@@ -467,19 +480,19 @@
break;
case SimMissingLocked:
- carrierText = LockPatternUtils.getCarrierString(mUpdateMonitor.getTelephonyPlmn(),
+ carrierText = makeCarierString(mPlmn,
getContext().getText(R.string.lockscreen_missing_sim_message_short));
carrierHelpTextId = R.string.lockscreen_missing_sim_instructions;
mUnlockDisabledDueToSimState = true;
break;
case SimLocked:
- carrierText = LockPatternUtils.getCarrierString(mUpdateMonitor.getTelephonyPlmn(),
+ carrierText = makeCarierString(mPlmn,
getContext().getText(R.string.lockscreen_sim_locked_message));
break;
case SimPukLocked:
- carrierText = LockPatternUtils.getCarrierString(mUpdateMonitor.getTelephonyPlmn(),
+ carrierText = makeCarierString(mPlmn,
getContext().getText(R.string.lockscreen_sim_puk_locked_message));
if (!mLockPatternUtils.isPukUnlockScreenEnable()) {
mUnlockDisabledDueToSimState = true;
@@ -489,7 +502,6 @@
setCarrierText(carrierText);
setCarrierHelpText(carrierHelpTextId);
- updateEmergencyCallButtonState();
}
private View findViewById(int id) {
@@ -552,10 +564,11 @@
}
}
- private void updateEmergencyCallButtonState() {
+ private void updateEmergencyCallButtonState(int phoneState) {
if (mEmergencyCallButton != null) {
boolean showIfCapable = mShowEmergencyButtonByDefault || mUnlockDisabledDueToSimState;
- mLockPatternUtils.updateEmergencyCallButtonState(mEmergencyCallButton, showIfCapable);
+ mLockPatternUtils.updateEmergencyCallButtonState(mEmergencyCallButton,
+ phoneState, showIfCapable);
}
}
@@ -567,7 +580,8 @@
mShowingBatteryInfo = showBatteryInfo;
mPluggedIn = pluggedIn;
mBatteryLevel = batteryLevel;
- updateStatusLines(true);
+ final MutableInt tmpIcon = new MutableInt(0);
+ update(BATTERY_INFO, getAltTextMessage(tmpIcon));
}
public void onTimeChanged() {
@@ -575,15 +589,17 @@
}
public void onRefreshCarrierInfo(CharSequence plmn, CharSequence spn) {
- setCarrierText(LockPatternUtils.getCarrierString(plmn, spn));
+ mPlmn = plmn;
+ mSpn = spn;
+ updateCarrierTextWithSimStatus(mSimState);
}
public void onRingerModeChanged(int state) {
}
- public void onPhoneStateChanged(String newState) {
- updateEmergencyCallButtonState();
+ public void onPhoneStateChanged(int phoneState) {
+ updateEmergencyCallButtonState(phoneState);
}
/** {@inheritDoc} */
@@ -595,7 +611,7 @@
private SimStateCallback mSimStateCallback = new SimStateCallback() {
public void onSimStateChanged(State simState) {
- updateWithSimStatus(simState);
+ updateCarrierTextWithSimStatus(simState);
}
};
@@ -604,4 +620,22 @@
mCallback.takeEmergencyCallAction();
}
}
+
+ /**
+ * Performs concentenation of PLMN/SPN
+ * @param plmn
+ * @param spn
+ * @return
+ */
+ private static CharSequence makeCarierString(CharSequence plmn, CharSequence spn) {
+ if (plmn != null && spn == null) {
+ return plmn;
+ } else if (plmn != null && spn != null) {
+ return plmn + "|" + spn;
+ } else if (plmn == null && spn != null) {
+ return spn;
+ } else {
+ return "";
+ }
+ }
}
diff --git a/policy/src/com/android/internal/policy/impl/KeyguardUpdateMonitor.java b/policy/src/com/android/internal/policy/impl/KeyguardUpdateMonitor.java
index 2a23709..ec24f97 100644
--- a/policy/src/com/android/internal/policy/impl/KeyguardUpdateMonitor.java
+++ b/policy/src/com/android/internal/policy/impl/KeyguardUpdateMonitor.java
@@ -88,6 +88,8 @@
private ArrayList<InfoCallback> mInfoCallbacks = Lists.newArrayList();
private ArrayList<SimStateCallback> mSimStateCallbacks = Lists.newArrayList();
private ContentObserver mContentObserver;
+ private int mRingMode;
+ private int mPhoneState;
// messages for the handler
private static final int MSG_TIME_UPDATE = 301;
@@ -271,13 +273,21 @@
protected void handlePhoneStateChanged(String newState) {
if (DEBUG) Log.d(TAG, "handlePhoneStateChanged(" + newState + ")");
+ if (TelephonyManager.EXTRA_STATE_IDLE.equals(newState)) {
+ mPhoneState = TelephonyManager.CALL_STATE_IDLE;
+ } else if (TelephonyManager.EXTRA_STATE_OFFHOOK.equals(newState)) {
+ mPhoneState = TelephonyManager.CALL_STATE_OFFHOOK;
+ } else if (TelephonyManager.EXTRA_STATE_RINGING.equals(newState)) {
+ mPhoneState = TelephonyManager.CALL_STATE_RINGING;
+ }
for (int i = 0; i < mInfoCallbacks.size(); i++) {
- mInfoCallbacks.get(i).onPhoneStateChanged(newState);
+ mInfoCallbacks.get(i).onPhoneStateChanged(mPhoneState);
}
}
protected void handleRingerModeChange(int mode) {
if (DEBUG) Log.d(TAG, "handleRingerModeChange(" + mode + ")");
+ mRingMode = mode;
for (int i = 0; i < mInfoCallbacks.size(); i++) {
mInfoCallbacks.get(i).onRingerModeChanged(mode);
}
@@ -459,7 +469,7 @@
* {@link TelephonyManager@EXTRA_STATE_RINGING}
* {@link TelephonyManager#EXTRA_STATE_OFFHOOK
*/
- void onPhoneStateChanged(String newState);
+ void onPhoneStateChanged(int phoneState);
/**
* Called when visibility of lockscreen clock changes, such as when
@@ -484,8 +494,12 @@
public void registerInfoCallback(InfoCallback callback) {
if (!mInfoCallbacks.contains(callback)) {
mInfoCallbacks.add(callback);
- // notify the register the current state right away
- // TODO: need call other callback methods
+ // Notify listener of the current state
+ callback.onRefreshBatteryInfo(shouldShowBatteryInfo(), isPluggedIn(mBatteryStatus),
+ mBatteryLevel);
+ callback.onTimeChanged();
+ callback.onRingerModeChanged(mRingMode);
+ callback.onPhoneStateChanged(mPhoneState);
callback.onRefreshCarrierInfo(mTelephonyPlmn, mTelephonySpn);
} else {
if (DEBUG) Log.e(TAG, "Object tried to add another INFO callback",
@@ -500,9 +514,7 @@
public void registerSimStateCallback(SimStateCallback callback) {
if (!mSimStateCallbacks.contains(callback)) {
mSimStateCallbacks.add(callback);
- // notify the register the current sim state right away,
- // otherwise the register won't receive any state until
- // sim state gets changed again.
+ // Notify listener of the current state
callback.onSimStateChanged(mSimState);
} else {
if (DEBUG) Log.e(TAG, "Object tried to add another SIM callback",
diff --git a/policy/src/com/android/internal/policy/impl/KeyguardViewMediator.java b/policy/src/com/android/internal/policy/impl/KeyguardViewMediator.java
index 0f1d633..3dae5ad 100644
--- a/policy/src/com/android/internal/policy/impl/KeyguardViewMediator.java
+++ b/policy/src/com/android/internal/policy/impl/KeyguardViewMediator.java
@@ -766,7 +766,7 @@
// Don't play lockscreen SFX if the screen went off due to
// timeout.
mSuppressNextLockSound = true;
-
+
doKeyguardLocked();
}
}
@@ -777,7 +777,7 @@
if (TelephonyManager.EXTRA_STATE_IDLE.equals(mPhoneState) // call ending
&& !mScreenOn // screen off
&& mExternallyEnabled) { // not disabled by any app
-
+
// note: this is a way to gracefully reenable the keyguard when the call
// ends and the screen is off without always reenabling the keyguard
// each time the screen turns off while in call (and having an occasional ugly
@@ -1270,7 +1270,7 @@
}
/** {@inheritDoc} */
- public void onPhoneStateChanged(String newState) {
+ public void onPhoneStateChanged(int phoneState) {
// ignored
}
diff --git a/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java b/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java
index d9bd5f2b..ffb4838 100644
--- a/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java
+++ b/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java
@@ -114,6 +114,10 @@
private final int MSG_SHOW_FACELOCK_AREA_VIEW = 0;
private final int MSG_HIDE_FACELOCK_AREA_VIEW = 1;
+ // Long enough to stay black while dialer comes up
+ // Short enough to not be black if the user goes back immediately
+ private final int FACELOCK_VIEW_AREA_EMERGENCY_HIDE_TIMEOUT = 1000;
+
/**
* The current {@link KeyguardScreen} will use this to communicate back to us.
*/
@@ -311,6 +315,13 @@
}
public void takeEmergencyCallAction() {
+ // FaceLock must be stopped if it is running when emergency call is pressed
+ stopAndUnbindFromFaceLock();
+
+ // Delay hiding FaceLock area so unlock doesn't display while dialer is coming up
+ mHandler.sendEmptyMessageDelayed(MSG_HIDE_FACELOCK_AREA_VIEW,
+ FACELOCK_VIEW_AREA_EMERGENCY_HIDE_TIMEOUT);
+
pokeWakelock(EMERGENCY_CALL_TIMEOUT);
if (TelephonyManager.getDefault().getCallState()
== TelephonyManager.CALL_STATE_OFFHOOK) {
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindow.java b/policy/src/com/android/internal/policy/impl/PhoneWindow.java
index 53b64a6..d562f15 100644
--- a/policy/src/com/android/internal/policy/impl/PhoneWindow.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindow.java
@@ -2762,28 +2762,30 @@
}
boolean splitActionBar = false;
- if ((mUiOptions & ActivityInfo.UIOPTION_SPLIT_ACTION_BAR_WHEN_NARROW) != 0) {
+ final boolean splitWhenNarrow =
+ (mUiOptions & ActivityInfo.UIOPTION_SPLIT_ACTION_BAR_WHEN_NARROW) != 0;
+ if (splitWhenNarrow) {
splitActionBar = getContext().getResources().getBoolean(
com.android.internal.R.bool.split_action_bar_is_narrow);
} else {
splitActionBar = getWindowStyle().getBoolean(
com.android.internal.R.styleable.Window_windowSplitActionBar, false);
}
- if (splitActionBar) {
- final ActionBarContainer splitView = (ActionBarContainer) findViewById(
- com.android.internal.R.id.split_action_bar);
- if (splitView != null) {
- splitView.setVisibility(View.VISIBLE);
- mActionBar.setSplitActionBar(splitActionBar);
- mActionBar.setSplitView(splitView);
+ final ActionBarContainer splitView = (ActionBarContainer) findViewById(
+ com.android.internal.R.id.split_action_bar);
+ if (splitView != null) {
+ mActionBar.setSplitView(splitView);
+ mActionBar.setSplitActionBar(splitActionBar);
+ mActionBar.setSplitWhenNarrow(splitWhenNarrow);
- final ActionBarContextView cab = (ActionBarContextView) findViewById(
- com.android.internal.R.id.action_context_bar);
- cab.setSplitView(splitView);
- } else {
- Log.e(TAG, "Requested split action bar with " +
- "incompatible window decor! Ignoring request.");
- }
+ final ActionBarContextView cab = (ActionBarContextView) findViewById(
+ com.android.internal.R.id.action_context_bar);
+ cab.setSplitView(splitView);
+ cab.setSplitActionBar(splitActionBar);
+ cab.setSplitWhenNarrow(splitWhenNarrow);
+ } else if (splitActionBar) {
+ Log.e(TAG, "Requested split action bar with " +
+ "incompatible window decor! Ignoring request.");
}
// Post the panel invalidate for later; avoid application onCreateOptionsMenu
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
index b0abd97..968180c 100755
--- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -446,9 +446,8 @@
}
@Override
- public void onOrientationChanged(int rotation) {
- // Send updates based on orientation value
- if (localLOGV) Log.v(TAG, "onOrientationChanged, rotation changed to " +rotation);
+ public void onProposedRotationChanged(int rotation) {
+ if (localLOGV) Log.v(TAG, "onProposedRotationChanged, rotation=" + rotation);
updateRotation(false);
}
}
@@ -654,6 +653,9 @@
mKeyguardMediator = new KeyguardViewMediator(context, this, powerManager);
mHandler = new Handler();
mOrientationListener = new MyOrientationListener(mContext);
+ try {
+ mOrientationListener.setCurrentRotation(windowManager.getRotation());
+ } catch (RemoteException ex) { }
SettingsObserver settingsObserver = new SettingsObserver(mHandler);
settingsObserver.observe();
mShortcutManager = new ShortcutManager(context, mHandler);
@@ -2871,6 +2873,18 @@
return mKeyguardMediator.isInputRestricted();
}
+ public void dismissKeyguardLw() {
+ if (!mKeyguardMediator.isSecure()) {
+ if (mKeyguardMediator.isShowing()) {
+ mHandler.post(new Runnable() {
+ public void run() {
+ mKeyguardMediator.keyguardDone(false, true);
+ }
+ });
+ }
+ }
+ }
+
void sendCloseSystemWindows() {
sendCloseSystemWindows(mContext, null);
}
@@ -2900,7 +2914,10 @@
}
synchronized (mLock) {
- int sensorRotation = mOrientationListener.getCurrentRotation(); // may be -1
+ int sensorRotation = mOrientationListener.getProposedRotation(); // may be -1
+ if (sensorRotation < 0) {
+ sensorRotation = lastRotation;
+ }
int preferredRotation = -1;
if (mHdmiPlugged) {
@@ -2910,20 +2927,18 @@
// Ignore sensor when lid switch is open and rotation is forced.
preferredRotation = mLidOpenRotation;
} else if (mDockMode == Intent.EXTRA_DOCK_STATE_CAR
- && ((mCarDockEnablesAccelerometer && sensorRotation >= 0)
- || mCarDockRotation >= 0)) {
+ && (mCarDockEnablesAccelerometer || mCarDockRotation >= 0)) {
// Ignore sensor when in car dock unless explicitly enabled.
// This case can override the behavior of NOSENSOR, and can also
// enable 180 degree rotation while docked.
- preferredRotation = mCarDockEnablesAccelerometer && sensorRotation >= 0
+ preferredRotation = mCarDockEnablesAccelerometer
? sensorRotation : mCarDockRotation;
} else if (mDockMode == Intent.EXTRA_DOCK_STATE_DESK
- && ((mDeskDockEnablesAccelerometer && sensorRotation >= 0)
- || mDeskDockRotation >= 0)) {
+ && (mDeskDockEnablesAccelerometer || mDeskDockRotation >= 0)) {
// Ignore sensor when in desk dock unless explicitly enabled.
// This case can override the behavior of NOSENSOR, and can also
// enable 180 degree rotation while docked.
- preferredRotation = mDeskDockEnablesAccelerometer && sensorRotation >= 0
+ preferredRotation = mDeskDockEnablesAccelerometer
? sensorRotation : mDeskDockRotation;
} else if (mUserRotationMode == WindowManagerPolicy.USER_ROTATION_LOCKED) {
// Ignore sensor when user locked rotation.
@@ -3024,6 +3039,11 @@
}
}
+ @Override
+ public void setRotationLw(int rotation) {
+ mOrientationListener.setCurrentRotation(rotation);
+ }
+
private boolean isLandscapeOrSeascape(int rotation) {
return rotation == mLandscapeRotation || rotation == mSeascapeRotation;
}
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index a58f64c..01f5a6f 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -985,6 +985,10 @@
mNewParameters.clear();
// do not lock the mutex in destructor
releaseWakeLock_l();
+ if (mPowerManager != 0) {
+ sp<IBinder> binder = mPowerManager->asBinder();
+ binder->unlinkToDeath(mDeathRecipient);
+ }
}
void AudioFlinger::ThreadBase::exit()
@@ -7440,12 +7444,21 @@
}
}
+
+// The volume effect is used for automated tests only
+#ifndef OPENSL_ES_H_
+static const effect_uuid_t SL_IID_VOLUME_ = { 0x09e8ede0, 0xddde, 0x11db, 0xb4f6,
+ { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } };
+const effect_uuid_t * const SL_IID_VOLUME = &SL_IID_VOLUME_;
+#endif //OPENSL_ES_H_
+
bool AudioFlinger::EffectChain::isEffectEligibleForSuspend(const effect_descriptor_t& desc)
{
// auxiliary effects and visualizer are never suspended on output mix
if ((mSessionId == AUDIO_SESSION_OUTPUT_MIX) &&
(((desc.flags & EFFECT_FLAG_TYPE_MASK) == EFFECT_FLAG_TYPE_AUXILIARY) ||
- (memcmp(&desc.type, SL_IID_VISUALIZATION, sizeof(effect_uuid_t)) == 0))) {
+ (memcmp(&desc.type, SL_IID_VISUALIZATION, sizeof(effect_uuid_t)) == 0) ||
+ (memcmp(&desc.type, SL_IID_VOLUME, sizeof(effect_uuid_t)) == 0))) {
return false;
}
return true;
diff --git a/services/java/com/android/server/AlarmManagerService.java b/services/java/com/android/server/AlarmManagerService.java
index 5ffcdc5..b8c44d9 100644
--- a/services/java/com/android/server/AlarmManagerService.java
+++ b/services/java/com/android/server/AlarmManagerService.java
@@ -477,7 +477,7 @@
: bs.filterStats.entrySet()) {
pw.print(" "); pw.print(fe.getValue().count);
pw.print(" alarms: ");
- pw.println(fe.getKey().getIntent().toShortString(true, false));
+ pw.println(fe.getKey().getIntent().toShortString(false, true, false));
}
}
}
diff --git a/services/java/com/android/server/BackupManagerService.java b/services/java/com/android/server/BackupManagerService.java
index 6ac6c98..e30ce72 100644
--- a/services/java/com/android/server/BackupManagerService.java
+++ b/services/java/com/android/server/BackupManagerService.java
@@ -3380,7 +3380,8 @@
Uri packageUri = Uri.fromFile(apkFile);
mInstallObserver.reset();
mPackageManager.installPackage(packageUri, mInstallObserver,
- PackageManager.INSTALL_REPLACE_EXISTING, installerPackage);
+ PackageManager.INSTALL_REPLACE_EXISTING | PackageManager.INSTALL_FROM_ADB,
+ installerPackage);
mInstallObserver.waitForCompletion();
if (mInstallObserver.getResult() != PackageManager.INSTALL_SUCCEEDED) {
@@ -4373,8 +4374,13 @@
ParcelFileDescriptor.MODE_TRUNCATE);
if (mTransport.getRestoreData(mBackupData) != BackupConstants.TRANSPORT_OK) {
+ // Transport-level failure, so we wind everything up and
+ // terminate the restore operation.
Slog.e(TAG, "Error getting restore data for " + packageName);
EventLog.writeEvent(EventLogTags.RESTORE_TRANSPORT_FAILURE);
+ mBackupData.close();
+ mBackupDataName.delete();
+ executeNextState(RestoreState.FINAL);
return;
}
diff --git a/services/java/com/android/server/ConnectivityService.java b/services/java/com/android/server/ConnectivityService.java
index 327450a..991b7da 100644
--- a/services/java/com/android/server/ConnectivityService.java
+++ b/services/java/com/android/server/ConnectivityService.java
@@ -35,6 +35,7 @@
import android.net.IConnectivityManager;
import android.net.INetworkPolicyListener;
import android.net.INetworkPolicyManager;
+import android.net.INetworkStatsService;
import android.net.LinkAddress;
import android.net.LinkProperties;
import android.net.LinkProperties.CompareResult;
@@ -306,8 +307,8 @@
// the set of network types that can only be enabled by system/sig apps
List mProtectedNetworks;
- public ConnectivityService(
- Context context, INetworkManagementService netd, INetworkPolicyManager policyManager) {
+ public ConnectivityService(Context context, INetworkManagementService netd,
+ INetworkStatsService statsService, INetworkPolicyManager policyManager) {
if (DBG) log("ConnectivityService starting up");
HandlerThread handlerThread = new HandlerThread("ConnectivityServiceThread");
@@ -496,7 +497,7 @@
IBinder b = ServiceManager.getService(Context.NETWORKMANAGEMENT_SERVICE);
INetworkManagementService nmService = INetworkManagementService.Stub.asInterface(b);
- mTethering = new Tethering(mContext, nmService, mHandler.getLooper());
+ mTethering = new Tethering(mContext, nmService, statsService, mHandler.getLooper());
mTetheringConfigValid = ((mTethering.getTetherableUsbRegexs().length != 0 ||
mTethering.getTetherableWifiRegexs().length != 0 ||
mTethering.getTetherableBluetoothRegexs().length != 0) &&
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java
index 977dd6f..5006de7 100644
--- a/services/java/com/android/server/SystemServer.java
+++ b/services/java/com/android/server/SystemServer.java
@@ -65,6 +65,7 @@
class ServerThread extends Thread {
private static final String TAG = "SystemServer";
private static final String ENCRYPTING_STATE = "trigger_restart_min_framework";
+ private static final String ENCRYPTED_STATE = "1";
ContentResolver mContentResolver;
@@ -150,10 +151,15 @@
Slog.i(TAG, "Package Manager");
// Only run "core" apps if we're encrypting the device.
String cryptState = SystemProperties.get("vold.decrypt");
- boolean onlyCore = ENCRYPTING_STATE.equals(cryptState);
- if (onlyCore) {
+ boolean onlyCore = false;
+ if (ENCRYPTING_STATE.equals(cryptState)) {
Slog.w(TAG, "Detected encryption in progress - only parsing core apps");
+ onlyCore = true;
+ } else if (ENCRYPTED_STATE.equals(cryptState)) {
+ Slog.w(TAG, "Device encrypted - only parsing core apps");
+ onlyCore = true;
}
+
pm = PackageManagerService.main(context,
factoryTest != SystemServer.FACTORY_TEST_OFF,
onlyCore);
@@ -364,7 +370,8 @@
try {
Slog.i(TAG, "Connectivity Service");
- connectivity = new ConnectivityService(context, networkManagement, networkPolicy);
+ connectivity = new ConnectivityService(
+ context, networkManagement, networkStats, networkPolicy);
ServiceManager.addService(Context.CONNECTIVITY_SERVICE, connectivity);
networkStats.bindConnectivityManager(connectivity);
networkPolicy.bindConnectivityManager(connectivity);
diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java
index ed960d6..2942c28 100644
--- a/services/java/com/android/server/am/ActivityManagerService.java
+++ b/services/java/com/android/server/am/ActivityManagerService.java
@@ -3334,6 +3334,11 @@
if ((samePackage || r.task == lastTask)
&& (r.app == null || evenPersistent || !r.app.persistent)) {
if (!doit) {
+ if (r.finishing) {
+ // If this activity is just finishing, then it is not
+ // interesting as far as something to stop.
+ continue;
+ }
return true;
}
didSomething = true;
@@ -3399,6 +3404,7 @@
}
}
mMainStack.resumeTopActivityLocked(null);
+ mMainStack.scheduleIdleLocked();
}
return didSomething;
@@ -3778,6 +3784,12 @@
mWindowManager.showBootMessage(msg, always);
}
+ public void dismissKeyguardOnNextActivity() {
+ synchronized (this) {
+ mMainStack.dismissKeyguardOnNextActivityLocked();
+ }
+ }
+
final void finishBooting() {
IntentFilter pkgFilter = new IntentFilter();
pkgFilter.addAction(Intent.ACTION_QUERY_PACKAGE_RESTART);
@@ -7901,6 +7913,8 @@
if (dumpAll) {
pw.println(" mLastPausedActivity: " + mMainStack.mLastPausedActivity);
pw.println(" mSleepTimeout: " + mMainStack.mSleepTimeout);
+ pw.println(" mDismissKeyguardOnNextActivity: "
+ + mMainStack.mDismissKeyguardOnNextActivity);
}
if (mRecentTasks.size() > 0) {
@@ -8541,7 +8555,7 @@
for (int i=0; i<N; i++) {
sb.setLength(0);
sb.append(" Intent: ");
- intents.get(i).toShortString(sb, true, false);
+ intents.get(i).toShortString(sb, false, true, false);
pw.println(sb.toString());
Bundle bundle = intents.get(i).getExtras();
if (bundle != null) {
@@ -8834,7 +8848,8 @@
} else if (complete) {
// Complete + brief == give a summary. Isn't that obvious?!?
if (lastTask.intent != null) {
- pw.print(prefix); pw.print(" "); pw.println(lastTask.intent);
+ pw.print(prefix); pw.print(" ");
+ pw.println(lastTask.intent.toInsecureString());
}
}
}
@@ -8845,7 +8860,7 @@
r.dump(pw, innerPrefix);
} else if (complete) {
// Complete + brief == give a summary. Isn't that obvious?!?
- pw.print(innerPrefix); pw.println(r.intent);
+ pw.print(innerPrefix); pw.println(r.intent.toInsecureString());
if (r.app != null) {
pw.print(innerPrefix); pw.println(r.app);
}
@@ -10047,7 +10062,7 @@
boolean created = false;
try {
mStringBuilder.setLength(0);
- r.intent.getIntent().toShortString(mStringBuilder, false, true);
+ r.intent.getIntent().toShortString(mStringBuilder, true, false, true);
EventLog.writeEvent(EventLogTags.AM_CREATE_SERVICE,
System.identityHashCode(r), r.shortName,
mStringBuilder.toString(), r.app.pid);
diff --git a/services/java/com/android/server/am/ActivityRecord.java b/services/java/com/android/server/am/ActivityRecord.java
index 73ffafb..ce45bfb1 100644
--- a/services/java/com/android/server/am/ActivityRecord.java
+++ b/services/java/com/android/server/am/ActivityRecord.java
@@ -122,7 +122,7 @@
pw.print(" processName="); pw.println(processName);
pw.print(prefix); pw.print("launchedFromUid="); pw.print(launchedFromUid);
pw.print(" app="); pw.println(app);
- pw.print(prefix); pw.println(intent);
+ pw.print(prefix); pw.println(intent.toInsecureString());
pw.print(prefix); pw.print("frontOfTask="); pw.print(frontOfTask);
pw.print(" task="); pw.println(task);
pw.print(prefix); pw.print("taskAffinity="); pw.println(taskAffinity);
diff --git a/services/java/com/android/server/am/ActivityStack.java b/services/java/com/android/server/am/ActivityStack.java
index a0aedf9..7bc19ab4 100644
--- a/services/java/com/android/server/am/ActivityStack.java
+++ b/services/java/com/android/server/am/ActivityStack.java
@@ -259,6 +259,11 @@
*/
boolean mSleepTimeout = false;
+ /**
+ * Dismiss the keyguard after the next activity is displayed?
+ */
+ boolean mDismissKeyguardOnNextActivity = false;
+
int mThumbnailWidth = -1;
int mThumbnailHeight = -1;
@@ -765,9 +770,7 @@
// Still need to tell some activities to stop; can't sleep yet.
if (DEBUG_PAUSE) Slog.v(TAG, "Sleep still need to stop "
+ mStoppingActivities.size() + " activities");
- Message msg = Message.obtain();
- msg.what = IDLE_NOW_MSG;
- mHandler.sendMessage(msg);
+ scheduleIdleLocked();
return;
}
@@ -978,9 +981,7 @@
// then give up on things going idle and start clearing
// them out.
if (DEBUG_PAUSE) Slog.v(TAG, "To many pending stops, forcing idle");
- Message msg = Message.obtain();
- msg.what = IDLE_NOW_MSG;
- mHandler.sendMessage(msg);
+ scheduleIdleLocked();
} else {
checkReadyForSleepLocked();
}
@@ -2173,7 +2174,7 @@
}
if (err == START_SUCCESS) {
- Slog.i(TAG, "Starting: " + intent + " from pid "
+ Slog.i(TAG, "START {" + intent.toShortString(true, true, true) + "} from pid "
+ (callerApp != null ? callerApp.pid : callingPid));
}
@@ -2228,6 +2229,7 @@
resultRecord, resultWho, requestCode,
Activity.RESULT_CANCELED, null);
}
+ mDismissKeyguardOnNextActivity = false;
return err;
}
@@ -2239,6 +2241,7 @@
resultRecord, resultWho, requestCode,
Activity.RESULT_CANCELED, null);
}
+ mDismissKeyguardOnNextActivity = false;
String msg;
if (!aInfo.exported) {
msg = "Permission Denial: starting " + intent.toString()
@@ -2276,6 +2279,7 @@
}
// We pretend to the caller that it was really started, but
// they will just get a cancel result.
+ mDismissKeyguardOnNextActivity = false;
return START_SUCCESS;
}
}
@@ -2299,6 +2303,7 @@
pal.grantedMode = grantedMode;
pal.onlyIfNeeded = onlyIfNeeded;
mService.mPendingActivityLaunches.add(pal);
+ mDismissKeyguardOnNextActivity = false;
return START_SWITCHES_CANCELED;
}
}
@@ -2317,8 +2322,17 @@
mService.doPendingActivityLaunchesLocked(false);
}
- return startActivityUncheckedLocked(r, sourceRecord,
+ err = startActivityUncheckedLocked(r, sourceRecord,
grantedUriPermissions, grantedMode, onlyIfNeeded, true);
+ if (mDismissKeyguardOnNextActivity && mPausingActivity == null) {
+ // Someone asked to have the keyguard dismissed on the next
+ // activity start, but we are not actually doing an activity
+ // switch... just dismiss the keyguard now, because we
+ // probably want to see whatever is behind it.
+ mDismissKeyguardOnNextActivity = false;
+ mService.mWindowManager.dismissKeyguard();
+ }
+ return err;
}
final void moveHomeToFrontFromLaunchLocked(int launchFlags) {
@@ -2987,6 +3001,11 @@
w.thisTime = w.totalTime;
}
mService.notifyAll();
+
+ if (mDismissKeyguardOnNextActivity) {
+ mDismissKeyguardOnNextActivity = false;
+ mService.mWindowManager.dismissKeyguard();
+ }
}
void sendActivityResultLocked(int callingUid, ActivityRecord r,
@@ -3103,6 +3122,12 @@
return stops;
}
+ final void scheduleIdleLocked() {
+ Message msg = Message.obtain();
+ msg.what = IDLE_NOW_MSG;
+ mHandler.sendMessage(msg);
+ }
+
final ActivityRecord activityIdleInternal(IBinder token, boolean fromTimeout,
Configuration config) {
if (localLOGV) Slog.v(TAG, "Activity idle: " + token);
@@ -3413,9 +3438,7 @@
// If we already have a few activities waiting to stop,
// then give up on things going idle and start clearing
// them out.
- Message msg = Message.obtain();
- msg.what = IDLE_NOW_MSG;
- mHandler.sendMessage(msg);
+ scheduleIdleLocked();
} else {
checkReadyForSleepLocked();
}
@@ -4126,4 +4149,8 @@
return true;
}
+
+ public void dismissKeyguardOnNextActivityLocked() {
+ mDismissKeyguardOnNextActivity = true;
+ }
}
diff --git a/services/java/com/android/server/am/IntentBindRecord.java b/services/java/com/android/server/am/IntentBindRecord.java
index 3a5ca66..2618c77 100644
--- a/services/java/com/android/server/am/IntentBindRecord.java
+++ b/services/java/com/android/server/am/IntentBindRecord.java
@@ -54,7 +54,7 @@
void dumpInService(PrintWriter pw, String prefix) {
pw.print(prefix); pw.print("intent={");
- pw.print(intent.getIntent().toShortString(true, false));
+ pw.print(intent.getIntent().toShortString(false, true, false));
pw.println('}');
pw.print(prefix); pw.print("binder="); pw.println(binder);
pw.print(prefix); pw.print("requested="); pw.print(requested);
@@ -89,7 +89,7 @@
sb.append(service.shortName);
sb.append(':');
if (intent != null) {
- intent.getIntent().toShortString(sb, false, false);
+ intent.getIntent().toShortString(sb, false, false, false);
}
sb.append('}');
return stringName = sb.toString();
diff --git a/services/java/com/android/server/am/PendingIntentRecord.java b/services/java/com/android/server/am/PendingIntentRecord.java
index 8ed0cc1..abd2a1f 100644
--- a/services/java/com/android/server/am/PendingIntentRecord.java
+++ b/services/java/com/android/server/am/PendingIntentRecord.java
@@ -150,7 +150,8 @@
public String toString() {
return "Key{" + typeName() + " pkg=" + packageName
+ " intent="
- + (requestIntent != null ? requestIntent.toShortString(true, false) : "<null>")
+ + (requestIntent != null
+ ? requestIntent.toShortString(false, true, false) : "<null>")
+ " flags=0x" + Integer.toHexString(flags) + "}";
}
@@ -317,7 +318,7 @@
}
if (key.requestIntent != null) {
pw.print(prefix); pw.print("requestIntent=");
- pw.println(key.requestIntent.toShortString(true, true));
+ pw.println(key.requestIntent.toShortString(false, true, true));
}
if (sent || canceled) {
pw.print(prefix); pw.print("sent="); pw.print(sent);
diff --git a/services/java/com/android/server/am/ServiceRecord.java b/services/java/com/android/server/am/ServiceRecord.java
index 004e963..257113b 100644
--- a/services/java/com/android/server/am/ServiceRecord.java
+++ b/services/java/com/android/server/am/ServiceRecord.java
@@ -192,7 +192,7 @@
void dump(PrintWriter pw, String prefix) {
pw.print(prefix); pw.print("intent={");
- pw.print(intent.getIntent().toShortString(true, false));
+ pw.print(intent.getIntent().toShortString(false, true, false));
pw.println('}');
pw.print(prefix); pw.print("packageName="); pw.println(packageName);
pw.print(prefix); pw.print("processName="); pw.println(processName);
diff --git a/services/java/com/android/server/am/TaskRecord.java b/services/java/com/android/server/am/TaskRecord.java
index 87129ea..a860763 100644
--- a/services/java/com/android/server/am/TaskRecord.java
+++ b/services/java/com/android/server/am/TaskRecord.java
@@ -94,14 +94,14 @@
if (intent != null) {
StringBuilder sb = new StringBuilder(128);
sb.append(prefix); sb.append("intent={");
- intent.toShortString(sb, true, false);
+ intent.toShortString(sb, false, true, false);
sb.append('}');
pw.println(sb.toString());
}
if (affinityIntent != null) {
StringBuilder sb = new StringBuilder(128);
sb.append(prefix); sb.append("affinityIntent={");
- affinityIntent.toShortString(sb, true, false);
+ affinityIntent.toShortString(sb, false, true, false);
sb.append('}');
pw.println(sb.toString());
}
diff --git a/services/java/com/android/server/connectivity/Tethering.java b/services/java/com/android/server/connectivity/Tethering.java
index 10f6d2c..6b9c088 100644
--- a/services/java/com/android/server/connectivity/Tethering.java
+++ b/services/java/com/android/server/connectivity/Tethering.java
@@ -29,6 +29,7 @@
import android.net.ConnectivityManager;
import android.net.IConnectivityManager;
import android.net.INetworkManagementEventObserver;
+import android.net.INetworkStatsService;
import android.net.InterfaceConfiguration;
import android.net.LinkAddress;
import android.net.LinkProperties;
@@ -88,7 +89,8 @@
// upstream type list and the DUN_REQUIRED secure-setting
private int mPreferredUpstreamMobileApn = ConnectivityManager.TYPE_NONE;
- private INetworkManagementService mNMService;
+ private final INetworkManagementService mNMService;
+ private final INetworkStatsService mStatsService;
private Looper mLooper;
private HandlerThread mThread;
@@ -124,9 +126,11 @@
private boolean mUsbTetherRequested; // true if USB tethering should be started
// when RNDIS is enabled
- public Tethering(Context context, INetworkManagementService nmService, Looper looper) {
+ public Tethering(Context context, INetworkManagementService nmService,
+ INetworkStatsService statsService, Looper looper) {
mContext = context;
mNMService = nmService;
+ mStatsService = statsService;
mLooper = looper;
mIfaces = new HashMap<String, TetherInterfaceSM>();
@@ -913,6 +917,9 @@
case CMD_INTERFACE_DOWN:
if (mMyUpstreamIfaceName != null) {
try {
+ // about to tear down NAT; gather remaining statistics
+ mStatsService.forceUpdate();
+
mNMService.disableNat(mIfaceName, mMyUpstreamIfaceName);
mMyUpstreamIfaceName = null;
} catch (Exception e) {
@@ -957,6 +964,9 @@
}
if (mMyUpstreamIfaceName != null) {
try {
+ // about to tear down NAT; gather remaining statistics
+ mStatsService.forceUpdate();
+
mNMService.disableNat(mIfaceName, mMyUpstreamIfaceName);
mMyUpstreamIfaceName = null;
} catch (Exception e) {
@@ -995,6 +1005,9 @@
case CMD_TETHER_MODE_DEAD:
if (mMyUpstreamIfaceName != null) {
try {
+ // about to tear down NAT; gather remaining statistics
+ mStatsService.forceUpdate();
+
mNMService.disableNat(mIfaceName, mMyUpstreamIfaceName);
mMyUpstreamIfaceName = null;
} catch (Exception e) {
diff --git a/services/java/com/android/server/net/NetworkStatsService.java b/services/java/com/android/server/net/NetworkStatsService.java
index bc65205..aa46795 100644
--- a/services/java/com/android/server/net/NetworkStatsService.java
+++ b/services/java/com/android/server/net/NetworkStatsService.java
@@ -24,8 +24,8 @@
import static android.content.Intent.ACTION_SHUTDOWN;
import static android.content.Intent.ACTION_UID_REMOVED;
import static android.content.Intent.EXTRA_UID;
-import static android.net.ConnectivityManager.CONNECTIVITY_ACTION_IMMEDIATE;
import static android.net.ConnectivityManager.ACTION_TETHER_STATE_CHANGED;
+import static android.net.ConnectivityManager.CONNECTIVITY_ACTION_IMMEDIATE;
import static android.net.NetworkStats.IFACE_ALL;
import static android.net.NetworkStats.SET_ALL;
import static android.net.NetworkStats.SET_DEFAULT;
@@ -43,9 +43,12 @@
import static android.provider.Settings.Secure.NETSTATS_TAG_MAX_HISTORY;
import static android.provider.Settings.Secure.NETSTATS_UID_BUCKET_DURATION;
import static android.provider.Settings.Secure.NETSTATS_UID_MAX_HISTORY;
+import static android.telephony.PhoneStateListener.LISTEN_DATA_CONNECTION_STATE;
+import static android.telephony.PhoneStateListener.LISTEN_NONE;
import static android.text.format.DateUtils.DAY_IN_MILLIS;
import static android.text.format.DateUtils.HOUR_IN_MILLIS;
import static android.text.format.DateUtils.MINUTE_IN_MILLIS;
+import static android.text.format.DateUtils.SECOND_IN_MILLIS;
import static com.android.internal.util.Preconditions.checkNotNull;
import static com.android.server.NetworkManagementService.LIMIT_GLOBAL_ALERT;
import static com.android.server.NetworkManagementSocketTagger.resetKernelUidStats;
@@ -80,6 +83,7 @@
import android.os.RemoteException;
import android.os.SystemClock;
import android.provider.Settings;
+import android.telephony.PhoneStateListener;
import android.telephony.TelephonyManager;
import android.util.EventLog;
import android.util.Log;
@@ -121,7 +125,7 @@
*/
public class NetworkStatsService extends INetworkStatsService.Stub {
private static final String TAG = "NetworkStats";
- private static final boolean LOGD = true;
+ private static final boolean LOGD = false;
private static final boolean LOGV = false;
/** File header magic number: "ANET" */
@@ -132,7 +136,8 @@
private static final int VERSION_UID_WITH_TAG = 3;
private static final int VERSION_UID_WITH_SET = 4;
- private static final int MSG_PERFORM_POLL = 0x1;
+ private static final int MSG_PERFORM_POLL = 1;
+ private static final int MSG_UPDATE_IFACES = 2;
/** Flags to control detail level of poll event. */
private static final int FLAG_PERSIST_NETWORK = 0x10;
@@ -144,6 +149,7 @@
private final INetworkManagementService mNetworkManager;
private final IAlarmManager mAlarmManager;
private final TrustedTime mTime;
+ private final TelephonyManager mTeleManager;
private final NetworkStatsSettings mSettings;
private final PowerManager.WakeLock mWakeLock;
@@ -227,6 +233,7 @@
mNetworkManager = checkNotNull(networkManager, "missing INetworkManagementService");
mAlarmManager = checkNotNull(alarmManager, "missing IAlarmManager");
mTime = checkNotNull(time, "missing TrustedTime");
+ mTeleManager = checkNotNull(TelephonyManager.getDefault(), "missing TelephonyManager");
mSettings = checkNotNull(settings, "missing NetworkStatsSettings");
final PowerManager powerManager = (PowerManager) context.getSystemService(
@@ -279,6 +286,10 @@
// ignored; service lives in system_server
}
+ // watch for networkType changes that aren't broadcast through
+ // CONNECTIVITY_ACTION_IMMEDIATE above.
+ mTeleManager.listen(mPhoneListener, LISTEN_DATA_CONNECTION_STATE);
+
registerPollAlarmLocked();
registerGlobalAlert();
@@ -288,10 +299,13 @@
private void shutdownLocked() {
mContext.unregisterReceiver(mConnReceiver);
+ mContext.unregisterReceiver(mTetherReceiver);
mContext.unregisterReceiver(mPollReceiver);
mContext.unregisterReceiver(mRemovedReceiver);
mContext.unregisterReceiver(mShutdownReceiver);
+ mTeleManager.listen(mPhoneListener, LISTEN_NONE);
+
writeNetworkStatsLocked();
if (mUidStatsLoaded) {
writeUidStatsLocked();
@@ -535,14 +549,7 @@
public void onReceive(Context context, Intent intent) {
// on background handler thread, and verified CONNECTIVITY_INTERNAL
// permission above.
- synchronized (mStatsLock) {
- mWakeLock.acquire();
- try {
- updateIfacesLocked();
- } finally {
- mWakeLock.release();
- }
- }
+ updateIfaces();
}
};
@@ -619,6 +626,46 @@
}
};
+ private int mLastPhoneState = TelephonyManager.DATA_UNKNOWN;
+ private int mLastPhoneNetworkType = TelephonyManager.NETWORK_TYPE_UNKNOWN;
+
+ /**
+ * Receiver that watches for {@link TelephonyManager} changes, such as
+ * transitioning between network types.
+ */
+ private PhoneStateListener mPhoneListener = new PhoneStateListener() {
+ @Override
+ public void onDataConnectionStateChanged(int state, int networkType) {
+ final boolean stateChanged = state != mLastPhoneState;
+ final boolean networkTypeChanged = networkType != mLastPhoneNetworkType;
+
+ if (networkTypeChanged && !stateChanged) {
+ // networkType changed without a state change, which means we
+ // need to roll our own update. delay long enough for
+ // ConnectivityManager to process.
+ // TODO: add direct event to ConnectivityService instead of
+ // relying on this delay.
+ if (LOGV) Slog.v(TAG, "triggering delayed updateIfaces()");
+ mHandler.sendMessageDelayed(
+ mHandler.obtainMessage(MSG_UPDATE_IFACES), SECOND_IN_MILLIS);
+ }
+
+ mLastPhoneState = state;
+ mLastPhoneNetworkType = networkType;
+ }
+ };
+
+ private void updateIfaces() {
+ synchronized (mStatsLock) {
+ mWakeLock.acquire();
+ try {
+ updateIfacesLocked();
+ } finally {
+ mWakeLock.release();
+ }
+ }
+ }
+
/**
* Inspect all current {@link NetworkState} to derive mapping from {@code
* iface} to {@link NetworkStatsHistory}. When multiple {@link NetworkInfo}
@@ -713,19 +760,6 @@
final long threshold = mSettings.getPersistThreshold();
try {
- // record network stats
- final NetworkStats networkSnapshot = mNetworkManager.getNetworkStatsSummary();
- performNetworkPollLocked(networkSnapshot, currentTime);
-
- // persist when enough network data has occurred
- final NetworkStats persistNetworkDelta = computeStatsDelta(
- mLastPersistNetworkSnapshot, networkSnapshot, true);
- final boolean networkPastThreshold = persistNetworkDelta.getTotalBytes() > threshold;
- if (persistForce || (persistNetwork && networkPastThreshold)) {
- writeNetworkStatsLocked();
- mLastPersistNetworkSnapshot = networkSnapshot;
- }
-
// record tethering stats; persisted during normal UID cycle below
final String[] ifacePairs = mConnManager.getTetheredIfacePairs();
final NetworkStats tetherSnapshot = mNetworkManager.getNetworkStatsTethering(
@@ -744,6 +778,19 @@
writeUidStatsLocked();
mLastPersistUidSnapshot = uidSnapshot;
}
+
+ // record network stats
+ final NetworkStats networkSnapshot = mNetworkManager.getNetworkStatsSummary();
+ performNetworkPollLocked(networkSnapshot, currentTime);
+
+ // persist when enough network data has occurred
+ final NetworkStats persistNetworkDelta = computeStatsDelta(
+ mLastPersistNetworkSnapshot, networkSnapshot, true);
+ final boolean networkPastThreshold = persistNetworkDelta.getTotalBytes() > threshold;
+ if (persistForce || (persistNetwork && networkPastThreshold)) {
+ writeNetworkStatsLocked();
+ mLastPersistNetworkSnapshot = networkSnapshot;
+ }
} catch (IllegalStateException e) {
Log.wtf(TAG, "problem reading network stats", e);
} catch (RemoteException e) {
@@ -1356,6 +1403,10 @@
performPoll(flags);
return true;
}
+ case MSG_UPDATE_IFACES: {
+ updateIfaces();
+ return true;
+ }
default: {
return false;
}
diff --git a/services/java/com/android/server/pm/PackageManagerService.java b/services/java/com/android/server/pm/PackageManagerService.java
index 105e603..eb135b7 100644
--- a/services/java/com/android/server/pm/PackageManagerService.java
+++ b/services/java/com/android/server/pm/PackageManagerService.java
@@ -72,6 +72,7 @@
import android.content.pm.UserInfo;
import android.content.pm.ManifestDigest;
import android.content.pm.VerifierDeviceIdentity;
+import android.content.pm.VerifierInfo;
import android.net.Uri;
import android.os.Binder;
import android.os.Build;
@@ -113,6 +114,8 @@
import java.io.InputStream;
import java.io.PrintWriter;
import java.security.NoSuchAlgorithmException;
+import java.security.PublicKey;
+import java.security.cert.CertificateException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
@@ -158,6 +161,7 @@
private static final boolean DEBUG_INTENT_MATCHING = false;
private static final boolean DEBUG_PACKAGE_SCANNING = false;
private static final boolean DEBUG_APP_DIR_OBSERVER = false;
+ private static final boolean DEBUG_VERIFY = false;
static final boolean MULTIPLE_APPLICATION_UIDS = true;
private static final int RADIO_UID = Process.PHONE_UID;
@@ -208,6 +212,8 @@
DEFAULT_CONTAINER_PACKAGE,
"com.android.defcontainer.DefaultContainerService");
+ private static final String PACKAGE_MIME_TYPE = "application/vnd.android.package-archive";
+
private static final String LIB_DIR_NAME = "lib";
static final String mTempContainerPrefix = "smdl2tmp";
@@ -349,7 +355,8 @@
final HashSet<String> mProtectedBroadcasts = new HashSet<String>();
/** List of packages waiting for verification. */
- final SparseArray<InstallArgs> mPendingVerification = new SparseArray<InstallArgs>();
+ final SparseArray<PackageVerificationState> mPendingVerification
+ = new SparseArray<PackageVerificationState>();
final ArrayList<PackageParser.Package> mDeferredDexOpt =
new ArrayList<PackageParser.Package>();
@@ -427,6 +434,8 @@
final SparseArray<PostInstallData> mRunningInstalls = new SparseArray<PostInstallData>();
int mNextInstallToken = 1; // nonzero; will be wrapped back to 1 when ++ overflows
+ private final String mRequiredVerifierPackage;
+
class PackageHandler extends Handler {
private boolean mBound = false;
final ArrayList<HandlerParams> mPendingInstalls =
@@ -740,9 +749,10 @@
} break;
case CHECK_PENDING_VERIFICATION: {
final int verificationId = msg.arg1;
- final InstallArgs args = mPendingVerification.get(verificationId);
+ final PackageVerificationState state = mPendingVerification.get(verificationId);
- if (args != null) {
+ if (state != null) {
+ final InstallArgs args = state.getInstallArgs();
Slog.i(TAG, "Validation timed out for " + args.packageURI.toString());
mPendingVerification.remove(verificationId);
@@ -756,32 +766,39 @@
}
case PACKAGE_VERIFIED: {
final int verificationId = msg.arg1;
- final boolean verified = msg.arg2 == 1 ? true : false;
- final InstallArgs args = mPendingVerification.get(verificationId);
- if (args == null) {
+ final PackageVerificationState state = mPendingVerification.get(verificationId);
+ if (state == null) {
Slog.w(TAG, "Invalid validation token " + verificationId + " received");
break;
}
- mPendingVerification.remove(verificationId);
+ final PackageVerificationResponse response = (PackageVerificationResponse) msg.obj;
- int ret;
- if (verified) {
- ret = PackageManager.INSTALL_FAILED_INTERNAL_ERROR;
- try {
- ret = args.copyApk(mContainerService, true);
- } catch (RemoteException e) {
- Slog.e(TAG, "Could not contact the ContainerService");
+ state.setVerifierResponse(response.callerUid, response.code);
+
+ if (state.isVerificationComplete()) {
+ mPendingVerification.remove(verificationId);
+
+ final InstallArgs args = state.getInstallArgs();
+
+ int ret;
+ if (state.isInstallAllowed()) {
+ ret = PackageManager.INSTALL_FAILED_INTERNAL_ERROR;
+ try {
+ ret = args.copyApk(mContainerService, true);
+ } catch (RemoteException e) {
+ Slog.e(TAG, "Could not contact the ContainerService");
+ }
+ } else {
+ ret = PackageManager.INSTALL_FAILED_VERIFICATION_FAILURE;
}
- } else {
- ret = PackageManager.INSTALL_FAILED_VERIFICATION_FAILURE;
+
+ processPendingInstall(args, ret);
+
+ mHandler.sendEmptyMessage(MCS_UNBIND);
}
- processPendingInstall(args, ret);
-
- mHandler.sendEmptyMessage(MCS_UNBIND);
-
break;
}
}
@@ -945,7 +962,8 @@
} catch (FileNotFoundException e) {
Slog.w(TAG, "Boot class path not found: " + paths[i]);
} catch (IOException e) {
- Slog.w(TAG, "Exception reading boot class path: " + paths[i], e);
+ Slog.w(TAG, "Cannot dexopt " + paths[i] + "; is it an APK or JAR? "
+ + e.getMessage());
}
}
} else {
@@ -968,7 +986,8 @@
} catch (FileNotFoundException e) {
Slog.w(TAG, "Library not found: " + lib);
} catch (IOException e) {
- Slog.w(TAG, "Exception reading library: " + lib, e);
+ Slog.w(TAG, "Cannot dexopt " + lib + "; is it an APK or JAR? "
+ + e.getMessage());
}
}
}
@@ -1132,10 +1151,49 @@
// are all flushed. Not really needed, but keeps things nice and
// tidy.
Runtime.getRuntime().gc();
+
+ mRequiredVerifierPackage = getRequiredVerifierLPr();
} // synchronized (mPackages)
} // synchronized (mInstallLock)
}
+ private String getRequiredVerifierLPr() {
+ final Intent verification = new Intent(Intent.ACTION_PACKAGE_NEEDS_VERIFICATION);
+ final List<ResolveInfo> receivers = queryIntentReceivers(verification, PACKAGE_MIME_TYPE,
+ PackageManager.GET_DISABLED_COMPONENTS);
+
+ String requiredVerifier = null;
+
+ final int N = receivers.size();
+ for (int i = 0; i < N; i++) {
+ final ResolveInfo info = receivers.get(i);
+
+ if (info.activityInfo == null) {
+ continue;
+ }
+
+ final String packageName = info.activityInfo.packageName;
+
+ final PackageSetting ps = mSettings.mPackages.get(packageName);
+ if (ps == null) {
+ continue;
+ }
+
+ if (!ps.grantedPermissions
+ .contains(android.Manifest.permission.PACKAGE_VERIFICATION_AGENT)) {
+ continue;
+ }
+
+ if (requiredVerifier != null) {
+ throw new RuntimeException("There can be only one required verifier");
+ }
+
+ requiredVerifier = packageName;
+ }
+
+ return requiredVerifier;
+ }
+
@Override
public boolean onTransact(int code, Parcel data, Parcel reply, int flags)
throws RemoteException {
@@ -4350,7 +4408,10 @@
if (p != null) {
PackageSetting ps = (PackageSetting)p.mExtras;
if (ps != null) {
- return ps.stopped;
+ // System apps are never considered stopped for purposes of
+ // filtering, because there may be no way for the user to
+ // actually re-launch them.
+ return ps.stopped && (ps.pkgFlags&ApplicationInfo.FLAG_SYSTEM) == 0;
}
}
return false;
@@ -4522,7 +4583,10 @@
if (p != null) {
PackageSetting ps = (PackageSetting)p.mExtras;
if (ps != null) {
- return ps.stopped;
+ // System apps are never considered stopped for purposes of
+ // filtering, because there may be no way for the user to
+ // actually re-launch them.
+ return ps.stopped && (ps.pkgFlags&ApplicationInfo.FLAG_SYSTEM) == 0;
}
}
return false;
@@ -4849,17 +4913,110 @@
}
@Override
- public void verifyPendingInstall(int id, int verificationCode)
- throws RemoteException {
- mContext.enforceCallingOrSelfPermission(
- android.Manifest.permission.PACKAGE_VERIFICATION_AGENT, null);
-
+ public void verifyPendingInstall(int id, int verificationCode) throws RemoteException {
final Message msg = mHandler.obtainMessage(PACKAGE_VERIFIED);
+ final PackageVerificationResponse response = new PackageVerificationResponse(
+ verificationCode, Binder.getCallingUid());
msg.arg1 = id;
- msg.arg2 = verificationCode;
+ msg.obj = response;
mHandler.sendMessage(msg);
}
+ private ComponentName matchComponentForVerifier(String packageName,
+ List<ResolveInfo> receivers) {
+ ActivityInfo targetReceiver = null;
+
+ final int NR = receivers.size();
+ for (int i = 0; i < NR; i++) {
+ final ResolveInfo info = receivers.get(i);
+ if (info.activityInfo == null) {
+ continue;
+ }
+
+ if (packageName.equals(info.activityInfo.packageName)) {
+ targetReceiver = info.activityInfo;
+ break;
+ }
+ }
+
+ if (targetReceiver == null) {
+ return null;
+ }
+
+ return new ComponentName(targetReceiver.packageName, targetReceiver.name);
+ }
+
+ private List<ComponentName> matchVerifiers(PackageInfoLite pkgInfo,
+ List<ResolveInfo> receivers, final PackageVerificationState verificationState) {
+ if (pkgInfo.verifiers.length == 0) {
+ return null;
+ }
+
+ final int N = pkgInfo.verifiers.length;
+ final List<ComponentName> sufficientVerifiers = new ArrayList<ComponentName>(N + 1);
+ for (int i = 0; i < N; i++) {
+ final VerifierInfo verifierInfo = pkgInfo.verifiers[i];
+
+ final ComponentName comp = matchComponentForVerifier(verifierInfo.packageName,
+ receivers);
+ if (comp == null) {
+ continue;
+ }
+
+ final int verifierUid = getUidForVerifier(verifierInfo);
+ if (verifierUid == -1) {
+ continue;
+ }
+
+ if (DEBUG_VERIFY) {
+ Slog.d(TAG, "Added sufficient verifier " + verifierInfo.packageName
+ + " with the correct signature");
+ }
+ sufficientVerifiers.add(comp);
+ verificationState.addSufficientVerifier(verifierUid);
+ }
+
+ return sufficientVerifiers;
+ }
+
+ private int getUidForVerifier(VerifierInfo verifierInfo) {
+ synchronized (mPackages) {
+ final PackageParser.Package pkg = mPackages.get(verifierInfo.packageName);
+ if (pkg == null) {
+ return -1;
+ } else if (pkg.mSignatures.length != 1) {
+ Slog.i(TAG, "Verifier package " + verifierInfo.packageName
+ + " has more than one signature; ignoring");
+ return -1;
+ }
+
+ /*
+ * If the public key of the package's signature does not match
+ * our expected public key, then this is a different package and
+ * we should skip.
+ */
+
+ final byte[] expectedPublicKey;
+ try {
+ final Signature verifierSig = pkg.mSignatures[0];
+ final PublicKey publicKey = verifierSig.getPublicKey();
+ expectedPublicKey = publicKey.getEncoded();
+ } catch (CertificateException e) {
+ return -1;
+ }
+
+ final byte[] actualPublicKey = verifierInfo.publicKey.getEncoded();
+
+ if (!Arrays.equals(actualPublicKey, expectedPublicKey)) {
+ Slog.i(TAG, "Verifier package " + verifierInfo.packageName
+ + " does not have the expected public key; ignoring");
+ return -1;
+ }
+
+ return pkg.applicationInfo.uid;
+ }
+ }
+
public void finishPackageInstall(int token) {
enforceSystemOrRoot("Only the system is allowed to finish installs");
@@ -5229,9 +5386,11 @@
*/
public void handleStartCopy() throws RemoteException {
int ret = PackageManager.INSTALL_SUCCEEDED;
- boolean fwdLocked = (flags & PackageManager.INSTALL_FORWARD_LOCK) != 0;
- boolean onSd = (flags & PackageManager.INSTALL_EXTERNAL) != 0;
- boolean onInt = (flags & PackageManager.INSTALL_INTERNAL) != 0;
+ final boolean fwdLocked = (flags & PackageManager.INSTALL_FORWARD_LOCK) != 0;
+ final boolean onSd = (flags & PackageManager.INSTALL_EXTERNAL) != 0;
+ final boolean onInt = (flags & PackageManager.INSTALL_INTERNAL) != 0;
+ PackageInfoLite pkgLite = null;
+
if (onInt && onSd) {
// Check if both bits are set.
Slog.w(TAG, "Conflicting flags specified for installing on both internal and external");
@@ -5253,7 +5412,6 @@
}
// Remote call to find out default install location
- final PackageInfoLite pkgLite;
try {
mContext.grantUriPermission(DEFAULT_CONTAINER_PACKAGE, packageURI,
Intent.FLAG_GRANT_READ_URI_PERMISSION);
@@ -5296,21 +5454,27 @@
}
final InstallArgs args = createInstallArgs(this);
+ mArgs = args;
+
if (ret == PackageManager.INSTALL_SUCCEEDED) {
/*
* Determine if we have any installed package verifiers. If we
* do, then we'll defer to them to verify the packages.
*/
- final Intent verification = new Intent(Intent.ACTION_PACKAGE_NEEDS_VERIFICATION,
- packageURI);
- verification.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
+ final int requiredUid = mRequiredVerifierPackage == null ? -1
+ : getPackageUid(mRequiredVerifierPackage);
+ if (requiredUid != -1 && isVerificationEnabled()) {
+ final Intent verification = new Intent(
+ Intent.ACTION_PACKAGE_NEEDS_VERIFICATION, packageURI);
+ verification.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
- final List<ResolveInfo> receivers = queryIntentReceivers(verification, null,
- PackageManager.GET_DISABLED_COMPONENTS);
- if (isVerificationEnabled() && receivers.size() > 0) {
- if (DEBUG_INSTALL) {
+ final List<ResolveInfo> receivers = queryIntentReceivers(verification, null,
+ PackageManager.GET_DISABLED_COMPONENTS);
+
+ if (DEBUG_VERIFY) {
Slog.d(TAG, "Found " + receivers.size() + " verifiers for intent "
- + verification.toString());
+ + verification.toString() + " with " + pkgLite.verifiers.length
+ + " optional verifiers");
}
final int verificationId = mPendingVerificationToken++;
@@ -5327,35 +5491,70 @@
verificationURI);
}
- mPendingVerification.append(verificationId, args);
+ final PackageVerificationState verificationState = new PackageVerificationState(
+ requiredUid, args);
+
+ mPendingVerification.append(verificationId, verificationState);
+
+ final List<ComponentName> sufficientVerifiers = matchVerifiers(pkgLite,
+ receivers, verificationState);
/*
- * Send the intent to the registered verification agents,
- * but only start the verification timeout after the target
- * BroadcastReceivers have run.
+ * If any sufficient verifiers were listed in the package
+ * manifest, attempt to ask them.
*/
- mContext.sendOrderedBroadcast(verification,
- android.Manifest.permission.PACKAGE_VERIFICATION_AGENT,
- new BroadcastReceiver() {
- @Override
- public void onReceive(Context context, Intent intent) {
- final Message msg = mHandler
- .obtainMessage(CHECK_PENDING_VERIFICATION);
- msg.arg1 = verificationId;
- mHandler.sendMessageDelayed(msg, getVerificationTimeout());
- }
- },
- null, 0, null, null);
+ if (sufficientVerifiers != null) {
+ final int N = sufficientVerifiers.size();
+ if (N == 0) {
+ Slog.i(TAG, "Additional verifiers required, but none installed.");
+ ret = PackageManager.INSTALL_FAILED_VERIFICATION_FAILURE;
+ } else {
+ for (int i = 0; i < N; i++) {
+ final ComponentName verifierComponent = sufficientVerifiers.get(i);
+
+ final Intent sufficientIntent = new Intent(verification);
+ sufficientIntent.setComponent(verifierComponent);
+
+ mContext.sendBroadcast(sufficientIntent);
+ }
+ }
+ }
+
+ final ComponentName requiredVerifierComponent = matchComponentForVerifier(
+ mRequiredVerifierPackage, receivers);
+ if (ret == PackageManager.INSTALL_SUCCEEDED
+ && mRequiredVerifierPackage != null) {
+ /*
+ * Send the intent to the required verification agent,
+ * but only start the verification timeout after the
+ * target BroadcastReceivers have run.
+ */
+ verification.setComponent(requiredVerifierComponent);
+ mContext.sendOrderedBroadcast(verification,
+ android.Manifest.permission.PACKAGE_VERIFICATION_AGENT,
+ new BroadcastReceiver() {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ final Message msg = mHandler
+ .obtainMessage(CHECK_PENDING_VERIFICATION);
+ msg.arg1 = verificationId;
+ mHandler.sendMessageDelayed(msg, getVerificationTimeout());
+ }
+ }, null, 0, null, null);
+
+ /*
+ * We don't want the copy to proceed until verification
+ * succeeds, so null out this field.
+ */
+ mArgs = null;
+ }
} else {
- // Create copy only if we are not in an erroneous state.
- // Remote call to initiate copy using temporary file
- mArgs = args;
+ /*
+ * No package verification is enabled, so immediately start
+ * the remote call to initiate copy using temporary file.
+ */
ret = args.copyApk(mContainerService, true);
}
- } else {
- // There was an error, so let the processPendingInstall() break
- // the bad news... uh, through a call in handleReturnCode()
- mArgs = args;
}
mRet = ret;
@@ -7541,6 +7740,8 @@
public static final int DUMP_PROVIDERS = 1 << 7;
+ public static final int DUMP_VERIFIERS = 1 << 8;
+
public static final int OPTION_SHOW_FILTERS = 1 << 0;
private int mTypes;
@@ -7633,6 +7834,7 @@
pw.println(" p[ackages]: dump installed packages");
pw.println(" s[hared-users]: dump shared user IDs");
pw.println(" m[essages]: print collected runtime messages");
+ pw.println(" v[erifiers]: print package verifier info");
pw.println(" <package.name>: info about given package");
return;
} else if ("-f".equals(opt)) {
@@ -7665,11 +7867,24 @@
dumpState.setDump(DumpState.DUMP_PROVIDERS);
} else if ("m".equals(cmd) || "messages".equals(cmd)) {
dumpState.setDump(DumpState.DUMP_MESSAGES);
+ } else if ("v".equals(cmd) || "verifiers".equals(cmd)) {
+ dumpState.setDump(DumpState.DUMP_VERIFIERS);
}
}
// reader
synchronized (mPackages) {
+ if (dumpState.isDumping(DumpState.DUMP_VERIFIERS) && packageName == null) {
+ if (dumpState.onTitlePrinted())
+ pw.println(" ");
+ pw.println("Verifiers:");
+ pw.print(" Required: ");
+ pw.print(mRequiredVerifierPackage);
+ pw.print(" (uid=");
+ pw.print(getPackageUid(mRequiredVerifierPackage));
+ pw.println(")");
+ }
+
if (dumpState.isDumping(DumpState.DUMP_LIBS) && packageName == null) {
if (dumpState.onTitlePrinted())
pw.println(" ");
diff --git a/services/java/com/android/server/pm/PackageVerificationResponse.java b/services/java/com/android/server/pm/PackageVerificationResponse.java
new file mode 100644
index 0000000..b2ae0dd
--- /dev/null
+++ b/services/java/com/android/server/pm/PackageVerificationResponse.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.pm;
+
+public class PackageVerificationResponse {
+ public final int code;
+
+ public final int callerUid;
+
+ public PackageVerificationResponse(int code, int callerUid) {
+ this.code = code;
+ this.callerUid = callerUid;
+ }
+}
diff --git a/services/java/com/android/server/pm/PackageVerificationState.java b/services/java/com/android/server/pm/PackageVerificationState.java
new file mode 100644
index 0000000..e5b89c1
--- /dev/null
+++ b/services/java/com/android/server/pm/PackageVerificationState.java
@@ -0,0 +1,149 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.pm;
+
+import com.android.server.pm.PackageManagerService.InstallArgs;
+
+import android.content.pm.PackageManager;
+import android.util.SparseBooleanArray;
+
+/**
+ * Tracks the package verification state for a particular package. Each package
+ * verification has a required verifier and zero or more sufficient verifiers.
+ * Only one of the sufficient verifier list must return affirmative to allow the
+ * package to be considered verified. If there are zero sufficient verifiers,
+ * then package verification is considered complete.
+ */
+class PackageVerificationState {
+ private final InstallArgs mArgs;
+
+ private final SparseBooleanArray mSufficientVerifierUids;
+
+ private final int mRequiredVerifierUid;
+
+ private boolean mSufficientVerificationComplete;
+
+ private boolean mSufficientVerificationPassed;
+
+ private boolean mRequiredVerificationComplete;
+
+ private boolean mRequiredVerificationPassed;
+
+ /**
+ * Create a new package verification state where {@code requiredVerifierUid}
+ * is the user ID for the package that must reply affirmative before things
+ * can continue.
+ *
+ * @param requiredVerifierUid user ID of required package verifier
+ * @param args
+ */
+ public PackageVerificationState(int requiredVerifierUid, InstallArgs args) {
+ mRequiredVerifierUid = requiredVerifierUid;
+ mArgs = args;
+ mSufficientVerifierUids = new SparseBooleanArray();
+ }
+
+ public InstallArgs getInstallArgs() {
+ return mArgs;
+ }
+
+ /**
+ * Add a verifier which is added to our sufficient list.
+ *
+ * @param uid user ID of sufficient verifier
+ */
+ public void addSufficientVerifier(int uid) {
+ mSufficientVerifierUids.put(uid, true);
+ }
+
+ /**
+ * Should be called when a verification is received from an agent so the
+ * state of the package verification can be tracked.
+ *
+ * @param uid user ID of the verifying agent
+ * @return {@code true} if the verifying agent actually exists in our list
+ */
+ public boolean setVerifierResponse(int uid, int code) {
+ if (uid == mRequiredVerifierUid) {
+ mRequiredVerificationComplete = true;
+ switch (code) {
+ case PackageManager.VERIFICATION_ALLOW_WITHOUT_SUFFICIENT:
+ mSufficientVerifierUids.clear();
+ // fall through
+ case PackageManager.VERIFICATION_ALLOW:
+ mRequiredVerificationPassed = true;
+ break;
+ default:
+ mRequiredVerificationPassed = false;
+ }
+ return true;
+ } else {
+ if (mSufficientVerifierUids.get(uid)) {
+ if (code == PackageManager.VERIFICATION_ALLOW) {
+ mSufficientVerificationComplete = true;
+ mSufficientVerificationPassed = true;
+ }
+
+ mSufficientVerifierUids.delete(uid);
+ if (mSufficientVerifierUids.size() == 0) {
+ mSufficientVerificationComplete = true;
+ }
+
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Returns whether verification is considered complete. This means that the
+ * required verifier and at least one of the sufficient verifiers has
+ * returned a positive verification.
+ *
+ * @return {@code true} when verification is considered complete
+ */
+ public boolean isVerificationComplete() {
+ if (!mRequiredVerificationComplete) {
+ return false;
+ }
+
+ if (mSufficientVerifierUids.size() == 0) {
+ return true;
+ }
+
+ return mSufficientVerificationComplete;
+ }
+
+ /**
+ * Returns whether installation should be allowed. This should only be
+ * called after {@link #isVerificationComplete()} returns {@code true}.
+ *
+ * @return {@code true} if installation should be allowed
+ */
+ public boolean isInstallAllowed() {
+ if (!mRequiredVerificationPassed) {
+ return false;
+ }
+
+ if (mSufficientVerificationComplete) {
+ return mSufficientVerificationPassed;
+ }
+
+ return true;
+ }
+}
diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java
index 02b246a..3ea9e81 100644
--- a/services/java/com/android/server/wm/WindowManagerService.java
+++ b/services/java/com/android/server/wm/WindowManagerService.java
@@ -4525,6 +4525,16 @@
return mPolicy.isKeyguardSecure();
}
+ public void dismissKeyguard() {
+ if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.DISABLE_KEYGUARD)
+ != PackageManager.PERMISSION_GRANTED) {
+ throw new SecurityException("Requires DISABLE_KEYGUARD permission");
+ }
+ synchronized(mWindowMap) {
+ mPolicy.dismissKeyguardLw();
+ }
+ }
+
public void closeSystemDialogs(String reason) {
synchronized(mWindowMap) {
for (int i=mWindows.size()-1; i>=0; i--) {
@@ -5183,6 +5193,7 @@
mRotation = rotation;
mAltOrientation = altOrientation;
+ mPolicy.setRotationLw(mRotation);
mWindowsFreezingScreen = true;
mH.removeMessages(H.WINDOW_FREEZE_TIMEOUT);
diff --git a/services/java/com/android/server/wm/WindowState.java b/services/java/com/android/server/wm/WindowState.java
index 455d6649..3640a15 100644
--- a/services/java/com/android/server/wm/WindowState.java
+++ b/services/java/com/android/server/wm/WindowState.java
@@ -636,7 +636,7 @@
final boolean isHwAccelerated = (mAttrs.flags &
WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED) != 0;
final int format = isHwAccelerated ? PixelFormat.TRANSLUCENT : mAttrs.format;
- if (isHwAccelerated && mAttrs.format == PixelFormat.OPAQUE) {
+ if (!PixelFormat.formatHasAlpha(mAttrs.format)) {
flags |= Surface.OPAQUE;
}
mSurface = new Surface(
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index f85ce7f..41d7a90 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -112,6 +112,11 @@
mSurfaceTexture->abandon();
}
+void Layer::setName(const String8& name) {
+ LayerBase::setName(name);
+ mSurfaceTexture->setName(name);
+}
+
sp<ISurface> Layer::createSurface()
{
class BSurface : public BnSurface, public LayerCleaner {
@@ -371,11 +376,12 @@
Layer::State& editDraw(mDrawingState);
editDraw.requested_w = temp.requested_w;
editDraw.requested_h = temp.requested_h;
-
- // record the new size, form this point on, when the client request
- // a buffer, it'll get the new size.
- mSurfaceTexture->setDefaultBufferSize(temp.requested_w, temp.requested_h);
}
+
+ // record the new size, form this point on, when the client request
+ // a buffer, it'll get the new size.
+ mSurfaceTexture->setDefaultBufferSize(temp.requested_w,
+ temp.requested_h);
}
if (temp.sequence != front.sequence) {
@@ -578,7 +584,7 @@
uint32_t Layer::getTransformHint() const {
uint32_t orientation = 0;
if (!mFlinger->mDebugDisableTransformHint) {
- orientation = getOrientation();
+ orientation = getPlaneOrientation();
if (orientation & Transform::ROT_INVALID) {
orientation = 0;
}
diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h
index ff389ae..82e3521 100644
--- a/services/surfaceflinger/Layer.h
+++ b/services/surfaceflinger/Layer.h
@@ -74,6 +74,7 @@
virtual bool isProtected() const;
virtual void onRemoved();
virtual sp<Layer> getLayer() const { return const_cast<Layer*>(this); }
+ virtual void setName(const String8& name);
// LayerBaseClient interface
virtual wp<IBinder> getSurfaceTextureBinder() const;
diff --git a/services/surfaceflinger/LayerBase.cpp b/services/surfaceflinger/LayerBase.cpp
index e5ce814..7a47f62 100644
--- a/services/surfaceflinger/LayerBase.cpp
+++ b/services/surfaceflinger/LayerBase.cpp
@@ -45,6 +45,7 @@
mFlinger(flinger), mFiltering(false),
mNeedsFiltering(false), mInOverlay(false),
mOrientation(0),
+ mPlaneOrientation(0),
mTransactionFlags(0),
mPremultipliedAlpha(true), mName("unnamed"), mDebug(false),
mInvalidate(0)
@@ -256,6 +257,7 @@
// cache a few things...
mOrientation = tr.getOrientation();
+ mPlaneOrientation = planeTransform.getOrientation();
mTransform = tr;
mTransformedBounds = tr.makeBounds(w, h);
}
diff --git a/services/surfaceflinger/LayerBase.h b/services/surfaceflinger/LayerBase.h
index a14b397..7f62145 100644
--- a/services/surfaceflinger/LayerBase.h
+++ b/services/surfaceflinger/LayerBase.h
@@ -81,7 +81,7 @@
Region transparentRegion;
};
- void setName(const String8& name);
+ virtual void setName(const String8& name);
String8 getName() const;
// modify current state
@@ -221,6 +221,7 @@
inline State& currentState() { return mCurrentState; }
int32_t getOrientation() const { return mOrientation; }
+ int32_t getPlaneOrientation() const { return mPlaneOrientation; }
protected:
const GraphicPlane& graphicPlane(int dpy) const;
@@ -254,6 +255,7 @@
protected:
// cached during validateVisibility()
int32_t mOrientation;
+ int32_t mPlaneOrientation;
Transform mTransform;
GLfloat mVertices[4][2];
Rect mTransformedBounds;
diff --git a/services/tests/servicestests/src/com/android/server/NetworkStatsServiceTest.java b/services/tests/servicestests/src/com/android/server/NetworkStatsServiceTest.java
index 99ae027..2ead254 100644
--- a/services/tests/servicestests/src/com/android/server/NetworkStatsServiceTest.java
+++ b/services/tests/servicestests/src/com/android/server/NetworkStatsServiceTest.java
@@ -776,6 +776,7 @@
private void expectNetworkStatsPoll() throws Exception {
mNetManager.setGlobalAlert(anyLong());
expectLastCall().anyTimes();
+ expect(mConnManager.getTetheredIfacePairs()).andReturn(null).anyTimes();
}
private void assertStatsFilesExist(boolean exist) {
diff --git a/services/tests/servicestests/src/com/android/server/pm/PackageVerificationStateTest.java b/services/tests/servicestests/src/com/android/server/pm/PackageVerificationStateTest.java
new file mode 100644
index 0000000..ebd3633
--- /dev/null
+++ b/services/tests/servicestests/src/com/android/server/pm/PackageVerificationStateTest.java
@@ -0,0 +1,205 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.pm;
+
+import android.content.pm.PackageManager;
+import com.android.server.pm.PackageVerificationState;
+
+import android.test.AndroidTestCase;
+
+public class PackageVerificationStateTest extends AndroidTestCase {
+ private static final int REQUIRED_UID = 1948;
+
+ private static final int SUFFICIENT_UID_1 = 1005;
+
+ private static final int SUFFICIENT_UID_2 = 8938;
+
+ public void testPackageVerificationState_OnlyRequiredVerifier_AllowedInstall() {
+ PackageVerificationState state = new PackageVerificationState(REQUIRED_UID, null);
+
+ assertFalse("Verification should not be marked as complete yet",
+ state.isVerificationComplete());
+
+ state.setVerifierResponse(REQUIRED_UID, PackageManager.VERIFICATION_ALLOW);
+
+ assertTrue("Verification should be considered complete now",
+ state.isVerificationComplete());
+
+ assertTrue("Installation should be marked as allowed",
+ state.isInstallAllowed());
+ }
+
+ public void testPackageVerificationState_OnlyRequiredVerifier_DeniedInstall() {
+ PackageVerificationState state = new PackageVerificationState(REQUIRED_UID, null);
+
+ assertFalse("Verification should not be marked as complete yet",
+ state.isVerificationComplete());
+
+ state.setVerifierResponse(REQUIRED_UID, PackageManager.VERIFICATION_REJECT);
+
+ assertTrue("Verification should be considered complete now",
+ state.isVerificationComplete());
+
+ assertFalse("Installation should be marked as allowed",
+ state.isInstallAllowed());
+ }
+
+ public void testPackageVerificationState_RequiredAndOneSufficient_RequiredDeniedInstall() {
+ PackageVerificationState state = new PackageVerificationState(REQUIRED_UID, null);
+
+ assertFalse("Verification should not be marked as complete yet",
+ state.isVerificationComplete());
+
+ state.addSufficientVerifier(SUFFICIENT_UID_1);
+
+ assertFalse("Verification should not be marked as complete yet",
+ state.isVerificationComplete());
+
+ state.setVerifierResponse(SUFFICIENT_UID_1, PackageManager.VERIFICATION_ALLOW);
+
+ assertFalse("Verification should not be marked as complete yet",
+ state.isVerificationComplete());
+
+ state.setVerifierResponse(REQUIRED_UID, PackageManager.VERIFICATION_REJECT);
+
+ assertTrue("Verification should be considered complete now",
+ state.isVerificationComplete());
+
+ assertFalse("Installation should be marked as allowed",
+ state.isInstallAllowed());
+ }
+
+ public void testPackageVerificationState_RequiredAndOneSufficient_SufficientDeniedInstall() {
+ PackageVerificationState state = new PackageVerificationState(REQUIRED_UID, null);
+
+ assertFalse("Verification should not be marked as complete yet",
+ state.isVerificationComplete());
+
+ state.addSufficientVerifier(SUFFICIENT_UID_1);
+
+ assertFalse("Verification should not be marked as complete yet",
+ state.isVerificationComplete());
+
+ state.setVerifierResponse(SUFFICIENT_UID_1, PackageManager.VERIFICATION_REJECT);
+
+ assertFalse("Verification should not be marked as complete yet",
+ state.isVerificationComplete());
+
+ state.setVerifierResponse(REQUIRED_UID, PackageManager.VERIFICATION_ALLOW);
+
+ assertTrue("Verification should be considered complete now",
+ state.isVerificationComplete());
+
+ assertFalse("Installation should be marked as allowed",
+ state.isInstallAllowed());
+ }
+
+ public void testPackageVerificationState_RequiredAndTwoSufficient_OneSufficientIsEnough() {
+ PackageVerificationState state = new PackageVerificationState(REQUIRED_UID, null);
+
+ assertFalse("Verification should not be marked as complete yet",
+ state.isVerificationComplete());
+
+ state.addSufficientVerifier(SUFFICIENT_UID_1);
+ state.addSufficientVerifier(SUFFICIENT_UID_2);
+
+ assertFalse("Verification should not be marked as complete yet",
+ state.isVerificationComplete());
+
+ state.setVerifierResponse(SUFFICIENT_UID_1, PackageManager.VERIFICATION_ALLOW);
+
+ assertFalse("Verification should not be marked as complete yet",
+ state.isVerificationComplete());
+
+ state.setVerifierResponse(REQUIRED_UID, PackageManager.VERIFICATION_ALLOW);
+
+ assertTrue("Verification should be considered complete now",
+ state.isVerificationComplete());
+
+ assertTrue("Installation should be marked as allowed",
+ state.isInstallAllowed());
+ }
+
+ public void testPackageVerificationState_RequiredAndTwoSufficient_SecondSufficientIsEnough() {
+ PackageVerificationState state = new PackageVerificationState(REQUIRED_UID, null);
+
+ assertFalse("Verification should not be marked as complete yet",
+ state.isVerificationComplete());
+
+ state.addSufficientVerifier(SUFFICIENT_UID_1);
+ state.addSufficientVerifier(SUFFICIENT_UID_2);
+
+ assertFalse("Verification should not be marked as complete yet",
+ state.isVerificationComplete());
+
+ state.setVerifierResponse(REQUIRED_UID, PackageManager.VERIFICATION_ALLOW);
+
+ assertFalse("Verification should not be marked as complete yet",
+ state.isVerificationComplete());
+
+ state.setVerifierResponse(SUFFICIENT_UID_1, PackageManager.VERIFICATION_REJECT);
+
+ assertFalse("Verification should not be marked as complete yet",
+ state.isVerificationComplete());
+
+ state.setVerifierResponse(SUFFICIENT_UID_2, PackageManager.VERIFICATION_ALLOW);
+
+ assertTrue("Verification should be considered complete now",
+ state.isVerificationComplete());
+
+ assertTrue("Installation should be marked as allowed",
+ state.isInstallAllowed());
+ }
+
+ public void testPackageVerificationState_RequiredAndTwoSufficient_RequiredOverrides() {
+ PackageVerificationState state = new PackageVerificationState(REQUIRED_UID, null);
+
+ assertFalse("Verification should not be marked as complete yet",
+ state.isVerificationComplete());
+
+ state.addSufficientVerifier(SUFFICIENT_UID_1);
+ state.addSufficientVerifier(SUFFICIENT_UID_2);
+
+ assertFalse("Verification should not be marked as complete yet",
+ state.isVerificationComplete());
+
+ state.setVerifierResponse(REQUIRED_UID,
+ PackageManager.VERIFICATION_ALLOW_WITHOUT_SUFFICIENT);
+
+ assertTrue("Verification should be marked as complete immediately",
+ state.isVerificationComplete());
+
+ assertTrue("Installation should be marked as allowed",
+ state.isInstallAllowed());
+
+ state.setVerifierResponse(SUFFICIENT_UID_1, PackageManager.VERIFICATION_REJECT);
+
+ assertTrue("Verification should still be marked as completed",
+ state.isVerificationComplete());
+
+ assertTrue("Installation should be marked as allowed still",
+ state.isInstallAllowed());
+
+ state.setVerifierResponse(SUFFICIENT_UID_2, PackageManager.VERIFICATION_ALLOW);
+
+ assertTrue("Verification should still be complete",
+ state.isVerificationComplete());
+
+ assertTrue("Installation should be marked as allowed still",
+ state.isInstallAllowed());
+ }
+}
diff --git a/telephony/java/android/telephony/PhoneNumberUtils.java b/telephony/java/android/telephony/PhoneNumberUtils.java
index 3e8d255..ea349bf 100644
--- a/telephony/java/android/telephony/PhoneNumberUtils.java
+++ b/telephony/java/android/telephony/PhoneNumberUtils.java
@@ -1567,6 +1567,14 @@
// that has been collected.
if (util.isValidNumber(pn)) {
return false;
+ } else if ("BR".equalsIgnoreCase(defaultCountryIso) && number.length() >= 8) {
+ // This is to prevent Brazilian local numbers which start with 911 being incorrectly
+ // classified as emergency numbers. 911 is not an emergency number in Brazil; it is also
+ // not possible to append additional digits to an emergency number to dial the number in
+ // Brazil - it won't connect.
+ // TODO: Clean this up once a list of country-specific known emergency numbers is
+ // collected.
+ return false;
}
} catch (NumberParseException e) {
}
diff --git a/telephony/java/com/android/internal/telephony/TelephonyProperties.java b/telephony/java/com/android/internal/telephony/TelephonyProperties.java
index 101dd55..abb4523 100644
--- a/telephony/java/com/android/internal/telephony/TelephonyProperties.java
+++ b/telephony/java/com/android/internal/telephony/TelephonyProperties.java
@@ -182,9 +182,4 @@
* in commercial configuration.
*/
static final String PROPERTY_TEST_CSIM = "persist.radio.test-csim";
-
- /**
- * Set to true to indicate a test ims registration required.
- */
- static final String PROPERTY_IMS_REG_REQUIRED = "persist.radio.imsregrequired";
}
diff --git a/telephony/tests/telephonytests/src/com/android/internal/telephony/PhoneNumberUtilsTest.java b/telephony/tests/telephonytests/src/com/android/internal/telephony/PhoneNumberUtilsTest.java
index d3e4b78..849ff48 100644
--- a/telephony/tests/telephonytests/src/com/android/internal/telephony/PhoneNumberUtilsTest.java
+++ b/telephony/tests/telephonytests/src/com/android/internal/telephony/PhoneNumberUtilsTest.java
@@ -551,5 +551,8 @@
// A valid fixed-line phone number from Brazil shouldn't be classified as an emergency number
// in Brazil, as 112 is not an emergency number there.
assertFalse(PhoneNumberUtils.isEmergencyNumber("1121234567", "BR"));
+ // A valid local phone number from Brazil shouldn't be classified as an emergency number in
+ // Brazil.
+ assertFalse(PhoneNumberUtils.isEmergencyNumber("91112345", "BR"));
}
}
diff --git a/test-runner/src/android/test/mock/MockPackageManager.java b/test-runner/src/android/test/mock/MockPackageManager.java
index 3525abe..58680ea 100644
--- a/test-runner/src/android/test/mock/MockPackageManager.java
+++ b/test-runner/src/android/test/mock/MockPackageManager.java
@@ -36,9 +36,11 @@
import android.content.pm.ProviderInfo;
import android.content.pm.ResolveInfo;
import android.content.pm.ServiceInfo;
+import android.content.pm.Signature;
import android.content.pm.UserInfo;
import android.content.pm.ManifestDigest;
import android.content.pm.VerifierDeviceIdentity;
+import android.content.pm.VerifierInfo;
import android.content.res.Resources;
import android.content.res.XmlResourceParser;
import android.graphics.drawable.Drawable;
diff --git a/tests/DataIdleTest/src/com/android/tests/dataidle/DataIdleTest.java b/tests/DataIdleTest/src/com/android/tests/dataidle/DataIdleTest.java
index b803b98..a13c0c9 100644
--- a/tests/DataIdleTest/src/com/android/tests/dataidle/DataIdleTest.java
+++ b/tests/DataIdleTest/src/com/android/tests/dataidle/DataIdleTest.java
@@ -89,18 +89,27 @@
Bundle result = new Bundle();
long rxBytes = 0;
long txBytes = 0;
+ long rxPackets = 0;
+ long txPackets = 0;
for (int i = 0; i < stats.size(); ++i) {
// Label will be iface_uid_tag_set
Entry statsEntry = stats.getValues(i, null);
+ // Debugging use.
+ /*
String labelTemplate = String.format("%s_%d_%d_%d", statsEntry.iface, statsEntry.uid,
statsEntry.tag, statsEntry.set) + "_%s";
result.putLong(String.format(labelTemplate, "rxBytes"), statsEntry.rxBytes);
result.putLong(String.format(labelTemplate, "txBytes"), statsEntry.txBytes);
+ */
+ rxPackets += statsEntry.rxPackets;
rxBytes += statsEntry.rxBytes;
+ txPackets += statsEntry.txPackets;
txBytes += statsEntry.txBytes;
}
- result.putLong("Total rxBytes", rxBytes);
- result.putLong("Total txBytes", txBytes);
+ result.putLong("Total rx Bytes", rxBytes);
+ result.putLong("Total tx Bytes", txBytes);
+ result.putLong("Total rx Packets", rxPackets);
+ result.putLong("Total tx Packets", txPackets);
getInstrumentation().sendStatus(INSTRUMENTATION_IN_PROGRESS, result);
}
diff --git a/tests/DumpRenderTree/src/com/android/dumprendertree/TestShellActivity.java b/tests/DumpRenderTree/src/com/android/dumprendertree/TestShellActivity.java
index 4ba2e18..945b8f2 100644
--- a/tests/DumpRenderTree/src/com/android/dumprendertree/TestShellActivity.java
+++ b/tests/DumpRenderTree/src/com/android/dumprendertree/TestShellActivity.java
@@ -916,6 +916,9 @@
settings.setWorkersEnabled(false);
settings.setXSSAuditorEnabled(false);
settings.setPageCacheCapacity(0);
+ // this enables cpu upload path (as opposed to gpu upload path)
+ // and it's only meant to be a temporary workaround!
+ settings.setProperty("enable_cpu_upload_path", "true");
}
private WebView mWebView;
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeWindowManager.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeWindowManager.java
index 940b290..5b57266 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeWindowManager.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeWindowManager.java
@@ -464,4 +464,7 @@
public int getPreferredOptionsPanelGravity() throws RemoteException {
return Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM;
}
+
+ public void dismissKeyguard() {
+ }
}
diff --git a/tools/orientationplot/orientationplot.py b/tools/orientationplot/orientationplot.py
index 07449d4..3a44cb2 100755
--- a/tools/orientationplot/orientationplot.py
+++ b/tools/orientationplot/orientationplot.py
@@ -131,42 +131,28 @@
self.orientation_angle_axes, 'orientation', 'black')
self._add_timeseries_legend(self.orientation_angle_axes)
- self.actual_orientation = self._make_timeseries()
- self.proposed_orientation = self._make_timeseries()
+ self.current_rotation = self._make_timeseries()
+ self.proposed_rotation = self._make_timeseries()
+ self.proposal_rotation = self._make_timeseries()
self.orientation_axes = self._add_timeseries_axes(
- 5, 'Actual / Proposed Orientation and Confidence', 'rotation', [-1, 4],
+ 5, 'Current / Proposed Orientation and Confidence', 'rotation', [-1, 4],
sharex=shared_axis,
yticks=range(0, 4))
- self.actual_orientation_line = self._add_timeseries_line(
- self.orientation_axes, 'actual', 'black', linewidth=2)
- self.proposed_orientation_line = self._add_timeseries_line(
- self.orientation_axes, 'proposed', 'purple', linewidth=3)
+ self.current_rotation_line = self._add_timeseries_line(
+ self.orientation_axes, 'current', 'black', linewidth=2)
+ self.proposal_rotation_line = self._add_timeseries_line(
+ self.orientation_axes, 'proposal', 'purple', linewidth=3)
+ self.proposed_rotation_line = self._add_timeseries_line(
+ self.orientation_axes, 'proposed', 'green', linewidth=3)
self._add_timeseries_legend(self.orientation_axes)
- self.confidence = [[self._make_timeseries(), self._make_timeseries()] for i in range(0, 4)]
- self.confidence_polys = []
-
- self.combined_confidence = self._make_timeseries()
- self.orientation_confidence = self._make_timeseries()
- self.tilt_confidence = self._make_timeseries()
- self.magnitude_confidence = self._make_timeseries()
- self.confidence_axes = self._add_timeseries_axes(
- 6, 'Proposed Orientation Confidence Factors', 'confidence', [-0.1, 1.1],
- sharex=shared_axis,
- yticks=[0.0, 0.2, 0.4, 0.6, 0.8, 1.0])
- self.combined_confidence_line = self._add_timeseries_line(
- self.confidence_axes, 'combined', 'purple', linewidth=2)
- self.orientation_confidence_line = self._add_timeseries_line(
- self.confidence_axes, 'orientation', 'black')
- self.tilt_confidence_line = self._add_timeseries_line(
- self.confidence_axes, 'tilt', 'brown')
- self.magnitude_confidence_line = self._add_timeseries_line(
- self.confidence_axes, 'magnitude', 'orange')
- self._add_timeseries_legend(self.confidence_axes)
+ self.proposal_confidence = [[self._make_timeseries(), self._make_timeseries()]
+ for i in range(0, 4)]
+ self.proposal_confidence_polys = []
self.sample_latency = self._make_timeseries()
self.sample_latency_axes = self._add_timeseries_axes(
- 7, 'Accelerometer Sampling Latency', 'ms', [-10, 500],
+ 6, 'Accelerometer Sampling Latency', 'ms', [-10, 500],
sharex=shared_axis,
yticks=range(0, 500, 100))
self.sample_latency_line = self._add_timeseries_line(
@@ -186,7 +172,7 @@
# Add a subplot to the figure for a time series.
def _add_timeseries_axes(self, index, title, ylabel, ylim, yticks, sharex=None):
- num_graphs = 7
+ num_graphs = 6
height = 0.9 / num_graphs
top = 0.95 - height * index
axes = self.fig.add_axes([0.1, top, 0.8, height],
@@ -234,13 +220,10 @@
self.parse_magnitude = None
self.parse_tilt_angle = None
self.parse_orientation_angle = None
- self.parse_proposed_orientation = None
- self.parse_combined_confidence = None
- self.parse_orientation_confidence = None
- self.parse_tilt_confidence = None
- self.parse_magnitude_confidence = None
- self.parse_actual_orientation = None
- self.parse_confidence = None
+ self.parse_current_rotation = None
+ self.parse_proposed_rotation = None
+ self.parse_proposal_rotation = None
+ self.parse_proposal_confidence = None
self.parse_sample_latency = None
# Update samples.
@@ -284,26 +267,13 @@
if line.find('orientationAngle=') != -1:
self.parse_orientation_angle = self._get_following_number(line, 'orientationAngle=')
- if line.find('Proposal:') != -1:
- self.parse_proposed_orientation = self._get_following_number(line, 'proposedOrientation=')
- self.parse_combined_confidence = self._get_following_number(line, 'combinedConfidence=')
- self.parse_orientation_confidence = self._get_following_number(line, 'orientationConfidence=')
- self.parse_tilt_confidence = self._get_following_number(line, 'tiltConfidence=')
- self.parse_magnitude_confidence = self._get_following_number(line, 'magnitudeConfidence=')
-
if line.find('Result:') != -1:
- self.parse_actual_orientation = self._get_following_number(line, 'rotation=')
- self.parse_confidence = self._get_following_array_of_numbers(line, 'confidence=')
+ self.parse_current_rotation = self._get_following_number(line, 'currentRotation=')
+ self.parse_proposed_rotation = self._get_following_number(line, 'proposedRotation=')
+ self.parse_proposal_rotation = self._get_following_number(line, 'proposalRotation=')
+ self.parse_proposal_confidence = self._get_following_number(line, 'proposalConfidence=')
self.parse_sample_latency = self._get_following_number(line, 'timeDeltaMS=')
- for i in range(0, 4):
- if self.parse_confidence is not None:
- self._append(self.confidence[i][0], timeindex, i)
- self._append(self.confidence[i][1], timeindex, i + self.parse_confidence[i])
- else:
- self._append(self.confidence[i][0], timeindex, None)
- self._append(self.confidence[i][1], timeindex, None)
-
self._append(self.raw_acceleration_x, timeindex, self.parse_raw_acceleration_x)
self._append(self.raw_acceleration_y, timeindex, self.parse_raw_acceleration_y)
self._append(self.raw_acceleration_z, timeindex, self.parse_raw_acceleration_z)
@@ -313,12 +283,22 @@
self._append(self.magnitude, timeindex, self.parse_magnitude)
self._append(self.tilt_angle, timeindex, self.parse_tilt_angle)
self._append(self.orientation_angle, timeindex, self.parse_orientation_angle)
- self._append(self.actual_orientation, timeindex, self.parse_actual_orientation)
- self._append(self.proposed_orientation, timeindex, self.parse_proposed_orientation)
- self._append(self.combined_confidence, timeindex, self.parse_combined_confidence)
- self._append(self.orientation_confidence, timeindex, self.parse_orientation_confidence)
- self._append(self.tilt_confidence, timeindex, self.parse_tilt_confidence)
- self._append(self.magnitude_confidence, timeindex, self.parse_magnitude_confidence)
+ self._append(self.current_rotation, timeindex, self.parse_current_rotation)
+ if self.parse_proposed_rotation >= 0:
+ self._append(self.proposed_rotation, timeindex, self.parse_proposed_rotation)
+ else:
+ self._append(self.proposed_rotation, timeindex, None)
+ if self.parse_proposal_rotation >= 0:
+ self._append(self.proposal_rotation, timeindex, self.parse_proposal_rotation)
+ else:
+ self._append(self.proposal_rotation, timeindex, None)
+ for i in range(0, 4):
+ self._append(self.proposal_confidence[i][0], timeindex, i)
+ if i == self.parse_proposal_rotation:
+ self._append(self.proposal_confidence[i][1], timeindex,
+ i + self.parse_proposal_confidence)
+ else:
+ self._append(self.proposal_confidence[i][1], timeindex, i)
self._append(self.sample_latency, timeindex, self.parse_sample_latency)
self._reset_parse_state()
@@ -335,16 +315,13 @@
self._scroll(self.magnitude, bottom)
self._scroll(self.tilt_angle, bottom)
self._scroll(self.orientation_angle, bottom)
- self._scroll(self.actual_orientation, bottom)
- self._scroll(self.proposed_orientation, bottom)
- self._scroll(self.combined_confidence, bottom)
- self._scroll(self.orientation_confidence, bottom)
- self._scroll(self.tilt_confidence, bottom)
- self._scroll(self.magnitude_confidence, bottom)
- self._scroll(self.sample_latency, bottom)
+ self._scroll(self.current_rotation, bottom)
+ self._scroll(self.proposed_rotation, bottom)
+ self._scroll(self.proposal_rotation, bottom)
for i in range(0, 4):
- self._scroll(self.confidence[i][0], bottom)
- self._scroll(self.confidence[i][1], bottom)
+ self._scroll(self.proposal_confidence[i][0], bottom)
+ self._scroll(self.proposal_confidence[i][1], bottom)
+ self._scroll(self.sample_latency, bottom)
# Redraw the plots.
self.raw_acceleration_line_x.set_data(self.raw_acceleration_x)
@@ -356,20 +333,19 @@
self.magnitude_line.set_data(self.magnitude)
self.tilt_angle_line.set_data(self.tilt_angle)
self.orientation_angle_line.set_data(self.orientation_angle)
- self.actual_orientation_line.set_data(self.actual_orientation)
- self.proposed_orientation_line.set_data(self.proposed_orientation)
- self.combined_confidence_line.set_data(self.combined_confidence)
- self.orientation_confidence_line.set_data(self.orientation_confidence)
- self.tilt_confidence_line.set_data(self.tilt_confidence)
- self.magnitude_confidence_line.set_data(self.magnitude_confidence)
+ self.current_rotation_line.set_data(self.current_rotation)
+ self.proposed_rotation_line.set_data(self.proposed_rotation)
+ self.proposal_rotation_line.set_data(self.proposal_rotation)
self.sample_latency_line.set_data(self.sample_latency)
- for poly in self.confidence_polys:
+ for poly in self.proposal_confidence_polys:
poly.remove()
- self.confidence_polys = []
+ self.proposal_confidence_polys = []
for i in range(0, 4):
- self.confidence_polys.append(self.orientation_axes.fill_between(self.confidence[i][0][0],
- self.confidence[i][0][1], self.confidence[i][1][1],
+ self.proposal_confidence_polys.append(self.orientation_axes.fill_between(
+ self.proposal_confidence[i][0][0],
+ self.proposal_confidence[i][0][1],
+ self.proposal_confidence[i][1][1],
facecolor='goldenrod', edgecolor='goldenrod'))
self.fig.canvas.draw_idle()
diff --git a/wifi/java/android/net/wifi/WifiNative.java b/wifi/java/android/net/wifi/WifiNative.java
index a6ea6d4..6ff1bc2 100644
--- a/wifi/java/android/net/wifi/WifiNative.java
+++ b/wifi/java/android/net/wifi/WifiNative.java
@@ -106,12 +106,6 @@
public native static String statusCommand();
- public native static int getRssiCommand();
-
- public native static int getRssiApproxCommand();
-
- public native static int getLinkSpeedCommand();
-
public native static String getMacAddressCommand();
public native static String scanResultsCommand();
@@ -209,6 +203,16 @@
private native static String doStringCommand(String command);
+ /** Example output:
+ * RSSI=-65
+ * LINKSPEED=48
+ * NOISE=9999
+ * FREQUENCY=0
+ */
+ public static String signalPoll() {
+ return doStringCommand("SIGNAL_POLL");
+ }
+
public static boolean wpsPbc() {
return doBooleanCommand("WPS_PBC");
}
diff --git a/wifi/java/android/net/wifi/WifiStateMachine.java b/wifi/java/android/net/wifi/WifiStateMachine.java
index 052d332..41fc55d 100644
--- a/wifi/java/android/net/wifi/WifiStateMachine.java
+++ b/wifi/java/android/net/wifi/WifiStateMachine.java
@@ -1362,7 +1362,28 @@
* Fetch RSSI and linkspeed on current connection
*/
private void fetchRssiAndLinkSpeedNative() {
- int newRssi = WifiNative.getRssiCommand();
+ int newRssi = -1;
+ int newLinkSpeed = -1;
+
+ String signalPoll = WifiNative.signalPoll();
+
+ if (signalPoll != null) {
+ String[] lines = signalPoll.split("\n");
+ for (String line : lines) {
+ String[] prop = line.split("=");
+ if (prop.length < 2) continue;
+ try {
+ if (prop[0].equals("RSSI")) {
+ newRssi = Integer.parseInt(prop[1]);
+ } else if (prop[0].equals("LINKSPEED")) {
+ newLinkSpeed = Integer.parseInt(prop[1]);
+ }
+ } catch (NumberFormatException e) {
+ //Ignore, defaults on rssi and linkspeed are assigned
+ }
+ }
+ }
+
if (newRssi != -1 && MIN_RSSI < newRssi && newRssi < MAX_RSSI) { // screen out invalid values
/* some implementations avoid negative values by adding 256
* so we need to adjust for that here.
@@ -1390,7 +1411,7 @@
} else {
mWifiInfo.setRssi(MIN_RSSI);
}
- int newLinkSpeed = WifiNative.getLinkSpeedCommand();
+
if (newLinkSpeed != -1) {
mWifiInfo.setLinkSpeed(newLinkSpeed);
}
diff --git a/wifi/java/android/net/wifi/WifiWatchdogStateMachine.java b/wifi/java/android/net/wifi/WifiWatchdogStateMachine.java
index fe0e850..af8c486 100644
--- a/wifi/java/android/net/wifi/WifiWatchdogStateMachine.java
+++ b/wifi/java/android/net/wifi/WifiWatchdogStateMachine.java
@@ -589,12 +589,11 @@
updateBssids();
transitionTo(mDnsCheckingState);
mNetEventCounter++;
- return HANDLED;
- case DISCONNECTED:
- case DISCONNECTING:
+ break;
+ default:
mNetEventCounter++;
transitionTo(mNotConnectedState);
- return HANDLED;
+ break;
}
return HANDLED;
case EVENT_WIFI_RADIO_STATE_CHANGE: