Merge "Improved phrasing for "in progress" message."
diff --git a/Android.mk b/Android.mk
index 2673cd8..137ef85 100644
--- a/Android.mk
+++ b/Android.mk
@@ -713,8 +713,6 @@
$(filter-out $(patterns_to_not_document), $(call find-other-java-files, $(dirs_to_document))) \
$(common_src_files)
-# $(call find-other-java-files, $(dirs_to_document)) \
-
# These are relative to frameworks/base
framework_docs_LOCAL_API_CHECK_SRC_FILES := \
$(call find-other-java-files, $(dirs_to_check_apis)) \
diff --git a/api/current.txt b/api/current.txt
index 7b2e273..e0dfb6c 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -28068,8 +28068,9 @@
method public boolean isSystemUser();
method public boolean isUserAGoat();
method public boolean isUserRunning(android.os.UserHandle);
+ method public boolean isUserRunningAndLocked(android.os.UserHandle);
+ method public boolean isUserRunningAndUnlocked(android.os.UserHandle);
method public boolean isUserRunningOrStopping(android.os.UserHandle);
- method public boolean isUserRunningUnlocked(android.os.UserHandle);
method public deprecated boolean setRestrictionsChallenge(java.lang.String);
method public deprecated void setUserRestriction(java.lang.String, boolean);
method public deprecated void setUserRestrictions(android.os.Bundle);
@@ -29635,6 +29636,7 @@
ctor public ContactsContract.CommonDataKinds.Callable();
field public static final android.net.Uri CONTENT_FILTER_URI;
field public static final android.net.Uri CONTENT_URI;
+ field public static final android.net.Uri ENTERPRISE_CONTENT_FILTER_URI;
field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX = "android.provider.extra.ADDRESS_BOOK_INDEX";
field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX_COUNTS = "android.provider.extra.ADDRESS_BOOK_INDEX_COUNTS";
field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX_TITLES = "android.provider.extra.ADDRESS_BOOK_INDEX_TITLES";
@@ -29781,6 +29783,7 @@
field public static final java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/phone_v2";
field public static final java.lang.String CONTENT_TYPE = "vnd.android.cursor.dir/phone_v2";
field public static final android.net.Uri CONTENT_URI;
+ field public static final android.net.Uri ENTERPRISE_CONTENT_FILTER_URI;
field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX = "android.provider.extra.ADDRESS_BOOK_INDEX";
field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX_COUNTS = "android.provider.extra.ADDRESS_BOOK_INDEX_COUNTS";
field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX_TITLES = "android.provider.extra.ADDRESS_BOOK_INDEX_TITLES";
@@ -29960,7 +29963,7 @@
field public static final android.net.Uri CONTENT_URI;
field public static final java.lang.String CONTENT_VCARD_TYPE = "text/x-vcard";
field public static final android.net.Uri CONTENT_VCARD_URI;
- field public static final android.net.Uri CORP_CONTENT_FILTER_URI;
+ field public static final android.net.Uri ENTERPRISE_CONTENT_FILTER_URI;
field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX = "android.provider.extra.ADDRESS_BOOK_INDEX";
field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX_COUNTS = "android.provider.extra.ADDRESS_BOOK_INDEX_COUNTS";
field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX_TITLES = "android.provider.extra.ADDRESS_BOOK_INDEX_TITLES";
@@ -30089,10 +30092,12 @@
field public static final java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/contact_directory";
field public static final java.lang.String CONTENT_TYPE = "vnd.android.cursor.dir/contact_directories";
field public static final android.net.Uri CONTENT_URI;
- field public static final android.net.Uri CORP_CONTENT_URI;
field public static final long DEFAULT = 0L; // 0x0L
field public static final java.lang.String DIRECTORY_AUTHORITY = "authority";
field public static final java.lang.String DISPLAY_NAME = "displayName";
+ field public static final android.net.Uri ENTERPRISE_CONTENT_URI;
+ field public static final long ENTERPRISE_DEFAULT = 1000000000L; // 0x3b9aca00L
+ field public static final long ENTERPRISE_LOCAL_INVISIBLE = 1000000001L; // 0x3b9aca01L
field public static final java.lang.String EXPORT_SUPPORT = "exportSupport";
field public static final int EXPORT_SUPPORT_ANY_ACCOUNT = 2; // 0x2
field public static final int EXPORT_SUPPORT_NONE = 0; // 0x0
@@ -30439,6 +30444,7 @@
field public static final java.lang.String COLUMN_MIME_TYPE = "mime_type";
field public static final java.lang.String COLUMN_SIZE = "_size";
field public static final java.lang.String COLUMN_SUMMARY = "summary";
+ field public static final int FLAG_ARCHIVE = 2048; // 0x800
field public static final int FLAG_DIR_PREFERS_GRID = 16; // 0x10
field public static final int FLAG_DIR_PREFERS_LAST_MODIFIED = 32; // 0x20
field public static final int FLAG_DIR_SUPPORTS_CREATE = 8; // 0x8
@@ -38651,10 +38657,11 @@
field public static final int RTL = 1; // 0x1
}
- public final class LocaleList {
+ public final class LocaleList implements android.os.Parcelable {
ctor public LocaleList();
ctor public LocaleList(java.util.Locale);
ctor public LocaleList(java.util.Locale[]);
+ method public int describeContents();
method public static android.util.LocaleList forLanguageTags(java.lang.String);
method public java.util.Locale get(int);
method public java.util.Locale getBestMatch(java.lang.String[]);
@@ -38664,6 +38671,8 @@
method public boolean isEmpty();
method public int size();
method public java.lang.String toLanguageTags();
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final android.os.Parcelable.Creator<android.util.LocaleList> CREATOR;
}
public final class Log {
@@ -42947,6 +42956,7 @@
field public int initialSelStart;
field public int inputType;
field public java.lang.CharSequence label;
+ field public android.util.LocaleList locales;
field public java.lang.String packageName;
field public java.lang.String privateImeOptions;
}
@@ -64085,4 +64095,3 @@
}
}
-
diff --git a/api/system-current.txt b/api/system-current.txt
index 65dbc50..f8d0953 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -25528,10 +25528,12 @@
field public static final java.lang.String EXTRA_NETWORK_INFO = "networkInfo";
field public static final java.lang.String EXTRA_NEW_RSSI = "newRssi";
field public static final java.lang.String EXTRA_NEW_STATE = "newState";
+ field public static final java.lang.String EXTRA_PREVIOUS_WIFI_AP_STATE = "previous_wifi_state";
field public static final java.lang.String EXTRA_PREVIOUS_WIFI_STATE = "previous_wifi_state";
field public static final java.lang.String EXTRA_RESULTS_UPDATED = "resultsUpdated";
field public static final java.lang.String EXTRA_SUPPLICANT_CONNECTED = "connected";
field public static final java.lang.String EXTRA_SUPPLICANT_ERROR = "supplicantError";
+ field public static final java.lang.String EXTRA_WIFI_AP_STATE = "wifi_state";
field public static final java.lang.String EXTRA_WIFI_CONFIGURATION = "wifiConfiguration";
field public static final java.lang.String EXTRA_WIFI_CREDENTIAL_EVENT_TYPE = "et";
field public static final java.lang.String EXTRA_WIFI_CREDENTIAL_SSID = "ssid";
@@ -25543,6 +25545,12 @@
field public static final java.lang.String SCAN_RESULTS_AVAILABLE_ACTION = "android.net.wifi.SCAN_RESULTS";
field public static final java.lang.String SUPPLICANT_CONNECTION_CHANGE_ACTION = "android.net.wifi.supplicant.CONNECTION_CHANGE";
field public static final java.lang.String SUPPLICANT_STATE_CHANGED_ACTION = "android.net.wifi.supplicant.STATE_CHANGE";
+ field public static final java.lang.String WIFI_AP_STATE_CHANGED_ACTION = "android.net.wifi.WIFI_AP_STATE_CHANGED";
+ field public static final int WIFI_AP_STATE_DISABLED = 11; // 0xb
+ field public static final int WIFI_AP_STATE_DISABLING = 10; // 0xa
+ field public static final int WIFI_AP_STATE_ENABLED = 13; // 0xd
+ field public static final int WIFI_AP_STATE_ENABLING = 12; // 0xc
+ field public static final int WIFI_AP_STATE_FAILED = 14; // 0xe
field public static final java.lang.String WIFI_CREDENTIAL_CHANGED_ACTION = "android.net.wifi.WIFI_CREDENTIAL_CHANGED";
field public static final int WIFI_CREDENTIAL_FORGOT = 1; // 0x1
field public static final int WIFI_CREDENTIAL_SAVED = 0; // 0x0
@@ -30053,8 +30061,9 @@
method public boolean isSystemUser();
method public boolean isUserAGoat();
method public boolean isUserRunning(android.os.UserHandle);
+ method public boolean isUserRunningAndLocked(android.os.UserHandle);
+ method public boolean isUserRunningAndUnlocked(android.os.UserHandle);
method public boolean isUserRunningOrStopping(android.os.UserHandle);
- method public boolean isUserRunningUnlocked(android.os.UserHandle);
method public deprecated boolean setRestrictionsChallenge(java.lang.String);
method public deprecated void setUserRestriction(java.lang.String, boolean);
method public deprecated void setUserRestrictions(android.os.Bundle);
@@ -31620,6 +31629,7 @@
ctor public ContactsContract.CommonDataKinds.Callable();
field public static final android.net.Uri CONTENT_FILTER_URI;
field public static final android.net.Uri CONTENT_URI;
+ field public static final android.net.Uri ENTERPRISE_CONTENT_FILTER_URI;
field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX = "android.provider.extra.ADDRESS_BOOK_INDEX";
field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX_COUNTS = "android.provider.extra.ADDRESS_BOOK_INDEX_COUNTS";
field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX_TITLES = "android.provider.extra.ADDRESS_BOOK_INDEX_TITLES";
@@ -31766,6 +31776,7 @@
field public static final java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/phone_v2";
field public static final java.lang.String CONTENT_TYPE = "vnd.android.cursor.dir/phone_v2";
field public static final android.net.Uri CONTENT_URI;
+ field public static final android.net.Uri ENTERPRISE_CONTENT_FILTER_URI;
field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX = "android.provider.extra.ADDRESS_BOOK_INDEX";
field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX_COUNTS = "android.provider.extra.ADDRESS_BOOK_INDEX_COUNTS";
field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX_TITLES = "android.provider.extra.ADDRESS_BOOK_INDEX_TITLES";
@@ -31945,7 +31956,7 @@
field public static final android.net.Uri CONTENT_URI;
field public static final java.lang.String CONTENT_VCARD_TYPE = "text/x-vcard";
field public static final android.net.Uri CONTENT_VCARD_URI;
- field public static final android.net.Uri CORP_CONTENT_FILTER_URI;
+ field public static final android.net.Uri ENTERPRISE_CONTENT_FILTER_URI;
field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX = "android.provider.extra.ADDRESS_BOOK_INDEX";
field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX_COUNTS = "android.provider.extra.ADDRESS_BOOK_INDEX_COUNTS";
field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX_TITLES = "android.provider.extra.ADDRESS_BOOK_INDEX_TITLES";
@@ -32074,10 +32085,12 @@
field public static final java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/contact_directory";
field public static final java.lang.String CONTENT_TYPE = "vnd.android.cursor.dir/contact_directories";
field public static final android.net.Uri CONTENT_URI;
- field public static final android.net.Uri CORP_CONTENT_URI;
field public static final long DEFAULT = 0L; // 0x0L
field public static final java.lang.String DIRECTORY_AUTHORITY = "authority";
field public static final java.lang.String DISPLAY_NAME = "displayName";
+ field public static final android.net.Uri ENTERPRISE_CONTENT_URI;
+ field public static final long ENTERPRISE_DEFAULT = 1000000000L; // 0x3b9aca00L
+ field public static final long ENTERPRISE_LOCAL_INVISIBLE = 1000000001L; // 0x3b9aca01L
field public static final java.lang.String EXPORT_SUPPORT = "exportSupport";
field public static final int EXPORT_SUPPORT_ANY_ACCOUNT = 2; // 0x2
field public static final int EXPORT_SUPPORT_NONE = 0; // 0x0
@@ -32454,6 +32467,7 @@
field public static final java.lang.String COLUMN_MIME_TYPE = "mime_type";
field public static final java.lang.String COLUMN_SIZE = "_size";
field public static final java.lang.String COLUMN_SUMMARY = "summary";
+ field public static final int FLAG_ARCHIVE = 2048; // 0x800
field public static final int FLAG_DIR_PREFERS_GRID = 16; // 0x10
field public static final int FLAG_DIR_PREFERS_LAST_MODIFIED = 32; // 0x20
field public static final int FLAG_DIR_SUPPORTS_CREATE = 8; // 0x8
@@ -40977,10 +40991,11 @@
field public static final int RTL = 1; // 0x1
}
- public final class LocaleList {
+ public final class LocaleList implements android.os.Parcelable {
ctor public LocaleList();
ctor public LocaleList(java.util.Locale);
ctor public LocaleList(java.util.Locale[]);
+ method public int describeContents();
method public static android.util.LocaleList forLanguageTags(java.lang.String);
method public java.util.Locale get(int);
method public java.util.Locale getBestMatch(java.lang.String[]);
@@ -40990,6 +41005,8 @@
method public boolean isEmpty();
method public int size();
method public java.lang.String toLanguageTags();
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final android.os.Parcelable.Creator<android.util.LocaleList> CREATOR;
}
public final class Log {
@@ -45276,6 +45293,7 @@
field public int initialSelStart;
field public int inputType;
field public java.lang.CharSequence label;
+ field public android.util.LocaleList locales;
field public java.lang.String packageName;
field public java.lang.String privateImeOptions;
}
diff --git a/api/test-current.txt b/api/test-current.txt
index 598924b..1338d90 100644
--- a/api/test-current.txt
+++ b/api/test-current.txt
@@ -28068,8 +28068,9 @@
method public boolean isSystemUser();
method public boolean isUserAGoat();
method public boolean isUserRunning(android.os.UserHandle);
+ method public boolean isUserRunningAndLocked(android.os.UserHandle);
+ method public boolean isUserRunningAndUnlocked(android.os.UserHandle);
method public boolean isUserRunningOrStopping(android.os.UserHandle);
- method public boolean isUserRunningUnlocked(android.os.UserHandle);
method public deprecated boolean setRestrictionsChallenge(java.lang.String);
method public deprecated void setUserRestriction(java.lang.String, boolean);
method public deprecated void setUserRestrictions(android.os.Bundle);
@@ -29637,6 +29638,7 @@
ctor public ContactsContract.CommonDataKinds.Callable();
field public static final android.net.Uri CONTENT_FILTER_URI;
field public static final android.net.Uri CONTENT_URI;
+ field public static final android.net.Uri ENTERPRISE_CONTENT_FILTER_URI;
field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX = "android.provider.extra.ADDRESS_BOOK_INDEX";
field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX_COUNTS = "android.provider.extra.ADDRESS_BOOK_INDEX_COUNTS";
field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX_TITLES = "android.provider.extra.ADDRESS_BOOK_INDEX_TITLES";
@@ -29783,6 +29785,7 @@
field public static final java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/phone_v2";
field public static final java.lang.String CONTENT_TYPE = "vnd.android.cursor.dir/phone_v2";
field public static final android.net.Uri CONTENT_URI;
+ field public static final android.net.Uri ENTERPRISE_CONTENT_FILTER_URI;
field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX = "android.provider.extra.ADDRESS_BOOK_INDEX";
field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX_COUNTS = "android.provider.extra.ADDRESS_BOOK_INDEX_COUNTS";
field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX_TITLES = "android.provider.extra.ADDRESS_BOOK_INDEX_TITLES";
@@ -29962,7 +29965,7 @@
field public static final android.net.Uri CONTENT_URI;
field public static final java.lang.String CONTENT_VCARD_TYPE = "text/x-vcard";
field public static final android.net.Uri CONTENT_VCARD_URI;
- field public static final android.net.Uri CORP_CONTENT_FILTER_URI;
+ field public static final android.net.Uri ENTERPRISE_CONTENT_FILTER_URI;
field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX = "android.provider.extra.ADDRESS_BOOK_INDEX";
field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX_COUNTS = "android.provider.extra.ADDRESS_BOOK_INDEX_COUNTS";
field public static final java.lang.String EXTRA_ADDRESS_BOOK_INDEX_TITLES = "android.provider.extra.ADDRESS_BOOK_INDEX_TITLES";
@@ -30091,10 +30094,12 @@
field public static final java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/contact_directory";
field public static final java.lang.String CONTENT_TYPE = "vnd.android.cursor.dir/contact_directories";
field public static final android.net.Uri CONTENT_URI;
- field public static final android.net.Uri CORP_CONTENT_URI;
field public static final long DEFAULT = 0L; // 0x0L
field public static final java.lang.String DIRECTORY_AUTHORITY = "authority";
field public static final java.lang.String DISPLAY_NAME = "displayName";
+ field public static final android.net.Uri ENTERPRISE_CONTENT_URI;
+ field public static final long ENTERPRISE_DEFAULT = 1000000000L; // 0x3b9aca00L
+ field public static final long ENTERPRISE_LOCAL_INVISIBLE = 1000000001L; // 0x3b9aca01L
field public static final java.lang.String EXPORT_SUPPORT = "exportSupport";
field public static final int EXPORT_SUPPORT_ANY_ACCOUNT = 2; // 0x2
field public static final int EXPORT_SUPPORT_NONE = 0; // 0x0
@@ -30441,6 +30446,7 @@
field public static final java.lang.String COLUMN_MIME_TYPE = "mime_type";
field public static final java.lang.String COLUMN_SIZE = "_size";
field public static final java.lang.String COLUMN_SUMMARY = "summary";
+ field public static final int FLAG_ARCHIVE = 2048; // 0x800
field public static final int FLAG_DIR_PREFERS_GRID = 16; // 0x10
field public static final int FLAG_DIR_PREFERS_LAST_MODIFIED = 32; // 0x20
field public static final int FLAG_DIR_SUPPORTS_CREATE = 8; // 0x8
@@ -38653,10 +38659,11 @@
field public static final int RTL = 1; // 0x1
}
- public final class LocaleList {
+ public final class LocaleList implements android.os.Parcelable {
ctor public LocaleList();
ctor public LocaleList(java.util.Locale);
ctor public LocaleList(java.util.Locale[]);
+ method public int describeContents();
method public static android.util.LocaleList forLanguageTags(java.lang.String);
method public java.util.Locale get(int);
method public java.util.Locale getBestMatch(java.lang.String[]);
@@ -38666,6 +38673,8 @@
method public boolean isEmpty();
method public int size();
method public java.lang.String toLanguageTags();
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final android.os.Parcelable.Creator<android.util.LocaleList> CREATOR;
}
public final class Log {
@@ -42949,6 +42958,7 @@
field public int initialSelStart;
field public int inputType;
field public java.lang.CharSequence label;
+ field public android.util.LocaleList locales;
field public java.lang.String packageName;
field public java.lang.String privateImeOptions;
}
diff --git a/core/java/android/app/ActivityManager.java b/core/java/android/app/ActivityManager.java
index 798deb1..9631268 100644
--- a/core/java/android/app/ActivityManager.java
+++ b/core/java/android/app/ActivityManager.java
@@ -548,6 +548,10 @@
public static boolean canReceiveKeys(int stackId) {
return stackId != PINNED_STACK_ID;
}
+
+ public static boolean isAlwaysOnTop(int stackId) {
+ return stackId == PINNED_STACK_ID;
+ }
}
/**
@@ -2113,7 +2117,9 @@
public int[] taskIds;
public String[] taskNames;
public Rect[] taskBounds;
+ public int[] taskUserIds;
public int displayId;
+ public int userId;
@Override
public int describeContents() {
@@ -2137,7 +2143,9 @@
dest.writeInt(taskBounds[i].right);
dest.writeInt(taskBounds[i].bottom);
}
+ dest.writeIntArray(taskUserIds);
dest.writeInt(displayId);
+ dest.writeInt(userId);
}
public void readFromParcel(Parcel source) {
@@ -2157,7 +2165,9 @@
} else {
taskBounds = null;
}
+ taskUserIds = source.createIntArray();
displayId = source.readInt();
+ userId = source.readInt();
}
public static final Creator<StackInfo> CREATOR = new Creator<StackInfo>() {
@@ -2183,6 +2193,7 @@
sb.append(prefix); sb.append("Stack id="); sb.append(stackId);
sb.append(" bounds="); sb.append(bounds.toShortString());
sb.append(" displayId="); sb.append(displayId);
+ sb.append(" userId="); sb.append(userId);
sb.append("\n");
prefix = prefix + " ";
for (int i = 0; i < taskIds.length; ++i) {
@@ -2191,6 +2202,7 @@
if (taskBounds != null) {
sb.append(" bounds="); sb.append(taskBounds[i].toShortString());
}
+ sb.append(" userId=").append(taskUserIds[i]);
sb.append("\n");
}
return sb.toString();
@@ -3108,9 +3120,29 @@
* @param userid the user's id. Zero indicates the default user.
* @hide
*/
- public boolean isUserRunning(int userid) {
+ public boolean isUserRunning(int userId) {
try {
- return ActivityManagerNative.getDefault().isUserRunning(userid, 0);
+ return ActivityManagerNative.getDefault().isUserRunning(userId, 0);
+ } catch (RemoteException e) {
+ return false;
+ }
+ }
+
+ /** {@hide} */
+ public boolean isUserRunningAndLocked(int userId) {
+ try {
+ return ActivityManagerNative.getDefault().isUserRunning(userId,
+ ActivityManager.FLAG_AND_LOCKED);
+ } catch (RemoteException e) {
+ return false;
+ }
+ }
+
+ /** {@hide} */
+ public boolean isUserRunningAndUnlocked(int userId) {
+ try {
+ return ActivityManagerNative.getDefault().isUserRunning(userId,
+ ActivityManager.FLAG_AND_UNLOCKED);
} catch (RemoteException e) {
return false;
}
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index 74f0c0e..c264368 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -4841,7 +4841,7 @@
if (ii != null) {
final ApplicationInfo instrApp = new ApplicationInfo();
ii.copyTo(instrApp);
-
+ instrApp.initForUser(UserHandle.myUserId());
final LoadedApk pi = getPackageInfo(instrApp, data.compatInfo,
appContext.getClassLoader(), false, true, false);
final ContextImpl instrContext = ContextImpl.createAppContext(this, pi);
diff --git a/core/java/android/app/BackStackRecord.java b/core/java/android/app/BackStackRecord.java
index 9081ef8..984a186 100644
--- a/core/java/android/app/BackStackRecord.java
+++ b/core/java/android/app/BackStackRecord.java
@@ -798,21 +798,33 @@
}
}
- private static void setFirstOut(SparseArray<Fragment> fragments, Fragment fragment) {
+ private static void setFirstOut(SparseArray<Fragment> firstOutFragments,
+ SparseArray<Fragment> lastInFragments, Fragment fragment) {
if (fragment != null) {
int containerId = fragment.mContainerId;
- if (containerId != 0 && !fragment.isHidden() && fragment.isAdded() &&
- fragment.getView() != null && fragments.get(containerId) == null) {
- fragments.put(containerId, fragment);
+ if (containerId != 0 && !fragment.isHidden()) {
+ if (fragment.isAdded() && fragment.getView() != null
+ && firstOutFragments.get(containerId) == null) {
+ firstOutFragments.put(containerId, fragment);
+ }
+ if (lastInFragments.get(containerId) == fragment) {
+ lastInFragments.remove(containerId);
+ }
}
}
}
- private void setLastIn(SparseArray<Fragment> fragments, Fragment fragment) {
+ private void setLastIn(SparseArray<Fragment> firstOutFragments,
+ SparseArray<Fragment> lastInFragments, Fragment fragment) {
if (fragment != null) {
int containerId = fragment.mContainerId;
if (containerId != 0) {
- fragments.put(containerId, fragment);
+ if (!fragment.isAdded()) {
+ lastInFragments.put(containerId, fragment);
+ }
+ if (firstOutFragments.get(containerId) == fragment) {
+ firstOutFragments.remove(containerId);
+ }
}
}
}
@@ -835,7 +847,7 @@
while (op != null) {
switch (op.cmd) {
case OP_ADD:
- setLastIn(lastInFragments, op.fragment);
+ setLastIn(firstOutFragments, lastInFragments, op.fragment);
break;
case OP_REPLACE: {
Fragment f = op.fragment;
@@ -845,29 +857,30 @@
if (f == null || old.mContainerId == f.mContainerId) {
if (old == f) {
f = null;
+ lastInFragments.remove(old.mContainerId);
} else {
- setFirstOut(firstOutFragments, old);
+ setFirstOut(firstOutFragments, lastInFragments, old);
}
}
}
}
- setLastIn(lastInFragments, f);
+ setLastIn(firstOutFragments, lastInFragments, op.fragment);
break;
}
case OP_REMOVE:
- setFirstOut(firstOutFragments, op.fragment);
+ setFirstOut(firstOutFragments, lastInFragments, op.fragment);
break;
case OP_HIDE:
- setFirstOut(firstOutFragments, op.fragment);
+ setFirstOut(firstOutFragments, lastInFragments, op.fragment);
break;
case OP_SHOW:
- setLastIn(lastInFragments, op.fragment);
+ setLastIn(firstOutFragments, lastInFragments, op.fragment);
break;
case OP_DETACH:
- setFirstOut(firstOutFragments, op.fragment);
+ setFirstOut(firstOutFragments, lastInFragments, op.fragment);
break;
case OP_ATTACH:
- setLastIn(lastInFragments, op.fragment);
+ setLastIn(firstOutFragments, lastInFragments, op.fragment);
break;
}
@@ -889,38 +902,38 @@
if (!mManager.mContainer.onHasView()) {
return; // nothing to see, so no transitions
}
- Op op = mHead;
+ Op op = mTail;
while (op != null) {
switch (op.cmd) {
case OP_ADD:
- setFirstOut(firstOutFragments, op.fragment);
+ setFirstOut(firstOutFragments, lastInFragments, op.fragment);
break;
case OP_REPLACE:
if (op.removed != null) {
for (int i = op.removed.size() - 1; i >= 0; i--) {
- setLastIn(lastInFragments, op.removed.get(i));
+ setLastIn(firstOutFragments, lastInFragments, op.removed.get(i));
}
}
- setFirstOut(firstOutFragments, op.fragment);
+ setFirstOut(firstOutFragments, lastInFragments, op.fragment);
break;
case OP_REMOVE:
- setLastIn(lastInFragments, op.fragment);
+ setLastIn(firstOutFragments, lastInFragments, op.fragment);
break;
case OP_HIDE:
- setLastIn(lastInFragments, op.fragment);
+ setLastIn(firstOutFragments, lastInFragments, op.fragment);
break;
case OP_SHOW:
- setFirstOut(firstOutFragments, op.fragment);
+ setFirstOut(firstOutFragments, lastInFragments, op.fragment);
break;
case OP_DETACH:
- setLastIn(lastInFragments, op.fragment);
+ setLastIn(firstOutFragments, lastInFragments, op.fragment);
break;
case OP_ATTACH:
- setFirstOut(firstOutFragments, op.fragment);
+ setFirstOut(firstOutFragments, lastInFragments, op.fragment);
break;
}
- op = op.next;
+ op = op.prev;
}
}
@@ -957,6 +970,7 @@
*/
private TransitionState beginTransition(SparseArray<Fragment> firstOutFragments,
SparseArray<Fragment> lastInFragments, boolean isBack) {
+ ensureFragmentsAreInitialized(lastInFragments);
TransitionState state = new TransitionState();
// Adding a non-existent target view makes sure that the transitions don't target
@@ -982,6 +996,21 @@
return state;
}
+ /**
+ * Ensure that fragments that are entering are at least at the CREATED state
+ * so that they may load Transitions using TransitionInflater.
+ */
+ private void ensureFragmentsAreInitialized(SparseArray<Fragment> lastInFragments) {
+ final int count = lastInFragments.size();
+ for (int i = 0; i < count; i++) {
+ final Fragment fragment = lastInFragments.valueAt(i);
+ if (fragment.mState < Fragment.CREATED) {
+ mManager.makeActive(fragment);
+ mManager.moveToState(fragment, Fragment.CREATED, 0, 0, false);
+ }
+ }
+ }
+
private static Transition cloneTransition(Transition transition) {
if (transition != null) {
transition = transition.clone();
diff --git a/core/java/android/app/INotificationManager.aidl b/core/java/android/app/INotificationManager.aidl
index c504ce3..136b810 100644
--- a/core/java/android/app/INotificationManager.aidl
+++ b/core/java/android/app/INotificationManager.aidl
@@ -52,6 +52,8 @@
int getTopicVisibilityOverride(String pkg, int uid, in Notification.Topic topic);
void setTopicPriority(String pkg, int uid, in Notification.Topic topic, int priority);
int getTopicPriority(String pkg, int uid, in Notification.Topic topic);
+ void setTopicImportance(String pkg, int uid, in Notification.Topic topic, int importance);
+ int getTopicImportance(String pkg, int uid, in Notification.Topic topic);
// TODO: Remove this when callers have been migrated to the equivalent
// INotificationListener method.
diff --git a/core/java/android/bluetooth/BluetoothAdapter.java b/core/java/android/bluetooth/BluetoothAdapter.java
index 2d825fa..3e8a51e 100644
--- a/core/java/android/bluetooth/BluetoothAdapter.java
+++ b/core/java/android/bluetooth/BluetoothAdapter.java
@@ -74,6 +74,8 @@
* {@link #listenUsingRfcommWithServiceRecord(String,UUID)}; or start a scan for
* Bluetooth LE devices with {@link #startLeScan(LeScanCallback callback)}.
*
+ * <p>This class is thread safe.
+ *
* <p class="note"><strong>Note:</strong>
* Most methods require the {@link android.Manifest.permission#BLUETOOTH}
* permission and some also require the
@@ -82,7 +84,7 @@
* <div class="special reference">
* <h3>Developer Guides</h3>
* <p>For more information about using Bluetooth, read the
- * <a href="{@docRoot}guide/topics/wireless/bluetooth.html">Bluetooth</a> developer guide.</p>
+ * <a href="{@docRoot}guide/topics/wireless/bluetooth.html">Bluetooth</a> developer guide.
* </div>
*
* {@see BluetoothDevice}
diff --git a/core/java/android/content/pm/PackageManager.java b/core/java/android/content/pm/PackageManager.java
index aa960a4..abd4c28 100644
--- a/core/java/android/content/pm/PackageManager.java
+++ b/core/java/android/content/pm/PackageManager.java
@@ -259,6 +259,14 @@
*/
public static final int SKIP_CURRENT_PROFILE = 0x00000002;
+ /**
+ * Flag for {@link addCrossProfileIntentFilter}: if this flag is set:
+ * activities in the other profiles can respond to the intent only if no activity with
+ * non-negative priority in current profile can respond to the intent.
+ * @hide
+ */
+ public static final int ONLY_IF_NO_MATCH_FOUND = 0x00000004;
+
/** @hide */
@IntDef({PERMISSION_GRANTED, PERMISSION_DENIED})
@Retention(RetentionPolicy.SOURCE)
@@ -4636,7 +4644,8 @@
* @param filter The {@link IntentFilter} the intent has to match
* @param sourceUserId The source user id.
* @param targetUserId The target user id.
- * @param flags The only possible value is {@link SKIP_CURRENT_PROFILE}
+ * @param flags The possible values are {@link SKIP_CURRENT_PROFILE} and
+ * {@link ONLY_IF_NO_MATCH_FOUND}.
* @hide
*/
public abstract void addCrossProfileIntentFilter(IntentFilter filter, int sourceUserId,
diff --git a/core/java/android/content/pm/RegisteredServicesCache.java b/core/java/android/content/pm/RegisteredServicesCache.java
index b3f03c3..a413f36 100644
--- a/core/java/android/content/pm/RegisteredServicesCache.java
+++ b/core/java/android/content/pm/RegisteredServicesCache.java
@@ -294,14 +294,16 @@
*/
public static class ServiceInfo<V> {
public final V type;
+ public final ComponentInfo componentInfo;
public final ComponentName componentName;
public final int uid;
/** @hide */
- public ServiceInfo(V type, ComponentName componentName, int uid) {
+ public ServiceInfo(V type, ComponentInfo componentInfo, ComponentName componentName) {
this.type = type;
+ this.componentInfo = componentInfo;
this.componentName = componentName;
- this.uid = uid;
+ this.uid = (componentInfo != null) ? componentInfo.applicationInfo.uid : -1;
}
@Override
@@ -362,8 +364,9 @@
@VisibleForTesting
protected List<ResolveInfo> queryIntentServices(int userId) {
final PackageManager pm = mContext.getPackageManager();
- return pm.queryIntentServicesAsUser(
- new Intent(mInterfaceName), PackageManager.GET_META_DATA, userId);
+ return pm.queryIntentServicesAsUser(new Intent(mInterfaceName),
+ PackageManager.GET_META_DATA | PackageManager.GET_ENCRYPTION_UNAWARE_COMPONENTS,
+ userId);
}
/**
@@ -563,9 +566,7 @@
return null;
}
final android.content.pm.ServiceInfo serviceInfo = service.serviceInfo;
- final ApplicationInfo applicationInfo = serviceInfo.applicationInfo;
- final int uid = applicationInfo.uid;
- return new ServiceInfo<V>(v, componentName, uid);
+ return new ServiceInfo<V>(v, serviceInfo, componentName);
} catch (NameNotFoundException e) {
throw new XmlPullParserException(
"Unable to load resources for pacakge " + si.packageName);
diff --git a/core/java/android/net/LocalSocket.java b/core/java/android/net/LocalSocket.java
index a374a86..e14facb1 100644
--- a/core/java/android/net/LocalSocket.java
+++ b/core/java/android/net/LocalSocket.java
@@ -25,7 +25,8 @@
/**
* Creates a (non-server) socket in the UNIX-domain namespace. The interface
- * here is not entirely unlike that of java.net.Socket
+ * here is not entirely unlike that of java.net.Socket. This class and the streams
+ * returned from it may be used from multiple threads.
*/
public class LocalSocket implements Closeable {
diff --git a/core/java/android/net/http/HttpResponseCache.java b/core/java/android/net/http/HttpResponseCache.java
index 188287f..729aff0 100644
--- a/core/java/android/net/http/HttpResponseCache.java
+++ b/core/java/android/net/http/HttpResponseCache.java
@@ -36,7 +36,8 @@
* saving time and bandwidth. This class supports {@link
* java.net.HttpURLConnection} and {@link javax.net.ssl.HttpsURLConnection};
* there is no platform-provided cache for {@code DefaultHttpClient} or
- * {@code AndroidHttpClient}.
+ * {@code AndroidHttpClient}. Installation and instances are thread
+ * safe.
*
* <h3>Installing an HTTP response cache</h3>
* Enable caching of all of your application's HTTP requests by installing the
diff --git a/core/java/android/os/UserManager.java b/core/java/android/os/UserManager.java
index 79390d4..c2fc5e4 100644
--- a/core/java/android/os/UserManager.java
+++ b/core/java/android/os/UserManager.java
@@ -755,6 +755,23 @@
}
/**
+ * Return whether the given user is running in a "locked" state. A user
+ * is unlocked only after they've entered their credentials (such as a lock
+ * pattern or PIN), and credential-encrypted private app data storage is
+ * available.
+ *
+ * @param user to retrieve the unlocked state for.
+ */
+ public boolean isUserRunningAndLocked(UserHandle user) {
+ try {
+ return ActivityManagerNative.getDefault().isUserRunning(
+ user.getIdentifier(), ActivityManager.FLAG_AND_LOCKED);
+ } catch (RemoteException e) {
+ return false;
+ }
+ }
+
+ /**
* Return whether the given user is running in an "unlocked" state. A user
* is unlocked only after they've entered their credentials (such as a lock
* pattern or PIN), and credential-encrypted private app data storage is
@@ -762,7 +779,7 @@
*
* @param user to retrieve the unlocked state for.
*/
- public boolean isUserRunningUnlocked(UserHandle user) {
+ public boolean isUserRunningAndUnlocked(UserHandle user) {
try {
return ActivityManagerNative.getDefault().isUserRunning(
user.getIdentifier(), ActivityManager.FLAG_AND_UNLOCKED);
diff --git a/core/java/android/provider/ContactsContract.java b/core/java/android/provider/ContactsContract.java
index 94a2bea..c0d95a1 100644
--- a/core/java/android/provider/ContactsContract.java
+++ b/core/java/android/provider/ContactsContract.java
@@ -394,12 +394,19 @@
Uri.withAppendedPath(AUTHORITY_URI, "directories");
/**
- * The content:// style URI for enterprise Directory table. Requests to this URI can be
- * performed on the UI thread because they are always unblocking.
+ * URI used for getting all directories from primary and managed profile.
+ * It supports the same semantics as {@link #CONTENT_URI} and returns the same columns.
+ * If the device has no managed profile that is linked to the current profile, it behaves
+ * in the exact same way as {@link #CONTENT_URI}.
+ * If there is a managed profile linked to the current profile, it will merge
+ * managed profile and current profile's results and return.
+ *
+ * Note: this query returns primary profile results before managed profile results,
+ * and this order is not affected by sorting parameter.
*
*/
- public static final Uri CORP_CONTENT_URI = Uri.withAppendedPath(AUTHORITY_URI,
- "directories_corp");
+ public static final Uri ENTERPRISE_CONTENT_URI = Uri.withAppendedPath(AUTHORITY_URI,
+ "directories_enterprise");
/**
* The MIME-type of {@link #CONTENT_URI} providing a directory of
@@ -426,16 +433,12 @@
/**
* _ID of the work profile default directory, which represents locally stored contacts.
- *
- * @hide
*/
public static final long ENTERPRISE_DEFAULT = Directory.ENTERPRISE_DIRECTORY_ID_BASE
+ DEFAULT;
/**
* _ID of the work profile directory that represents locally stored invisible contacts.
- *
- * @hide
*/
public static final long ENTERPRISE_LOCAL_INVISIBLE = Directory.ENTERPRISE_DIRECTORY_ID_BASE
+ LOCAL_INVISIBLE;
@@ -1640,12 +1643,12 @@
CONTENT_URI, "filter");
/**
- * It supports the same semantics as {@link #CONTENT_FILTER_URI} and returns the same
- * columns. If there is a corp profile linked to the current profile, it will query corp
- * profile, otherwise it will return null.
+ * It supports the similar semantics as {@link #CONTENT_FILTER_URI} and returns the same
+ * columns. This URI requires {@link ContactsContract#DIRECTORY_PARAM_KEY} in parameters,
+ * otherwise it will throw UnsupportedOperationException.
*/
- public static final Uri CORP_CONTENT_FILTER_URI = Uri.withAppendedPath(
- CORP_CONTENT_URI, "filter");
+ public static final Uri ENTERPRISE_CONTENT_FILTER_URI = Uri.withAppendedPath(
+ CONTENT_URI, "filter_enterprise");
/**
* The content:// style URI for this table joined with useful data from
@@ -5915,6 +5918,14 @@
"filter");
/**
+ * It supports the similar semantics as {@link #CONTENT_FILTER_URI} and returns the same
+ * columns. This URI requires {@link ContactsContract#DIRECTORY_PARAM_KEY} in
+ * parameters, otherwise it will throw UnsupportedOperationException.
+ */
+ public static final Uri ENTERPRISE_CONTENT_FILTER_URI = Uri.withAppendedPath(
+ CONTENT_URI, "filter_enterprise");
+
+ /**
* A boolean query parameter that can be used with {@link #CONTENT_FILTER_URI}.
* If "1" or "true", display names are searched. If "0" or "false", display names
* are not searched. Default is "1".
@@ -7395,6 +7406,14 @@
*/
public static final Uri CONTENT_FILTER_URI = Uri.withAppendedPath(CONTENT_URI,
"filter");
+
+ /**
+ * Similar to {@link Phone#ENTERPRISE_CONTENT_FILTER_URI}, but allows users to filter
+ * callable data. This URI requires {@link ContactsContract#DIRECTORY_PARAM_KEY} in
+ * parameters, otherwise it will throw UnsupportedOperationException.
+ */
+ public static final Uri ENTERPRISE_CONTENT_FILTER_URI = Uri.withAppendedPath(
+ CONTENT_URI, "filter_enterprise");
}
/**
diff --git a/core/java/android/provider/DocumentsContract.java b/core/java/android/provider/DocumentsContract.java
index d53bb0d..77a4485 100644
--- a/core/java/android/provider/DocumentsContract.java
+++ b/core/java/android/provider/DocumentsContract.java
@@ -234,6 +234,7 @@
* @see #FLAG_DIR_PREFERS_GRID
* @see #FLAG_DIR_PREFERS_LAST_MODIFIED
* @see #FLAG_VIRTUAL_DOCUMENT
+ * @see #FLAG_ARCHIVE
*/
public static final String COLUMN_FLAGS = "flags";
@@ -368,6 +369,18 @@
public static final int FLAG_VIRTUAL_DOCUMENT = 1 << 10;
/**
+ * Flag indicating that a document is an archive, and it's contents can be
+ * obtained via {@link DocumentsProvider#queryChildDocuments}.
+ * <p>
+ * The <em>provider</em> support library offers utility classes to add common
+ * archive support.
+ *
+ * @see #COLUMN_FLAGS
+ * @see DocumentsProvider#queryChildDocuments(String, String[], String)
+ */
+ public static final int FLAG_ARCHIVE = 1 << 11;
+
+ /**
* Flag indicating that document titles should be hidden when viewing
* this directory in a larger format grid. For example, a directory
* containing only images may want the image thumbnails to speak for
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index c92382a..fa1bf76 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -4931,6 +4931,15 @@
"accessibility_autoclick_delay";
/**
+ * Whether or not larger size icons are used for the pointer of mouse/trackpad for
+ * accessibility.
+ * (0 = false, 1 = true)
+ * @hide
+ */
+ public static final String ACCESSIBILITY_LARGE_POINTER_ICON =
+ "accessibility_large_pointer_icon";
+
+ /**
* The timeout for considering a press to be a long press in milliseconds.
* @hide
*/
diff --git a/core/java/android/service/notification/NotificationListenerService.java b/core/java/android/service/notification/NotificationListenerService.java
index d741f1a..a7545f2 100644
--- a/core/java/android/service/notification/NotificationListenerService.java
+++ b/core/java/android/service/notification/NotificationListenerService.java
@@ -823,9 +823,9 @@
public static final int VISIBILITY_NO_OVERRIDE = -1000;
/**
- * Value signifying thatn the has not expressed an importance.
+ * Value signifying that the user has not expressed an importance.
*
- * This value is for persisting preferences, and should never ve associated with
+ * This value is for persisting preferences, and should never be associated with
* an actual notification.
*/
public static final int IMPORTANCE_UNSPECIFIED = -1000;
@@ -952,6 +952,28 @@
mVisibilityOverride = visibilityOverride;
mSuppressedVisualEffects = suppressedVisualEffects;
}
+
+ /**
+ * {@hide}
+ */
+ public static String importanceToString(int importance) {
+ switch (importance) {
+ case IMPORTANCE_UNSPECIFIED:
+ return "UNSPECIFIED";
+ case IMPORTANCE_NONE:
+ return "NONE";
+ case IMPORTANCE_LOW:
+ return "LOW";
+ case IMPORTANCE_DEFAULT:
+ return "DEFAULT";
+ case IMPORTANCE_HIGH:
+ return "HIGH";
+ case IMPORTANCE_MAX:
+ return "MAX";
+ default:
+ return "UNKNOWN(" + String.valueOf(importance) + ")";
+ }
+ }
}
/**
diff --git a/core/java/android/util/EventLog.java b/core/java/android/util/EventLog.java
index 558b8f5..6bda83d2 100644
--- a/core/java/android/util/EventLog.java
+++ b/core/java/android/util/EventLog.java
@@ -52,7 +52,7 @@
private static HashMap<String, Integer> sTagCodes = null;
private static HashMap<Integer, String> sTagNames = null;
- /** A previously logged event read from the logs. */
+ /** A previously logged event read from the logs. Instances are thread safe. */
public static final class Event {
private final ByteBuffer mBuffer;
diff --git a/core/java/android/util/LocaleList.aidl b/core/java/android/util/LocaleList.aidl
new file mode 100644
index 0000000..f5de354
--- /dev/null
+++ b/core/java/android/util/LocaleList.aidl
@@ -0,0 +1,19 @@
+/*
+ * Copyright (C) 2015 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.util;
+
+parcelable LocaleList;
diff --git a/core/java/android/util/LocaleList.java b/core/java/android/util/LocaleList.java
index c1d23bb..b2ee045 100644
--- a/core/java/android/util/LocaleList.java
+++ b/core/java/android/util/LocaleList.java
@@ -19,6 +19,8 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.Size;
+import android.os.Parcel;
+import android.os.Parcelable;
import com.android.internal.annotations.GuardedBy;
@@ -35,11 +37,12 @@
* LocaleList is an immutable list of Locales, typically used to keep an
* ordered user preferences for locales.
*/
-public final class LocaleList {
+public final class LocaleList implements Parcelable {
private final Locale[] mList;
// This is a comma-separated list of the locales in the LocaleList created at construction time,
// basically the result of running each locale's toLanguageTag() method and concatenating them
// with commas in between.
+ @NonNull
private final String mStringRepresentation;
private static final Locale[] sEmptyList = new Locale[0];
@@ -101,6 +104,16 @@
return sb.toString();
}
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
+ public void writeToParcel(Parcel dest, int parcelableFlags) {
+ dest.writeString(mStringRepresentation);
+ }
+
@NonNull
public String toLanguageTags() {
return mStringRepresentation;
@@ -163,10 +176,25 @@
}
}
+ public static final Parcelable.Creator<LocaleList> CREATOR
+ = new Parcelable.Creator<LocaleList>() {
+ @Override
+ public LocaleList createFromParcel(Parcel source) {
+ return LocaleList.forLanguageTags(source.readString());
+ }
+
+ @Override
+ public LocaleList[] newArray(int size) {
+ return new LocaleList[size];
+ }
+ };
+
+ @NonNull
public static LocaleList getEmptyLocaleList() {
return sEmptyLocaleList;
}
+ @NonNull
public static LocaleList forLanguageTags(@Nullable String list) {
if (list == null || list.equals("")) {
return getEmptyLocaleList();
diff --git a/core/java/android/view/PointerIcon.java b/core/java/android/view/PointerIcon.java
index b61706e..d2a7d4a 100644
--- a/core/java/android/view/PointerIcon.java
+++ b/core/java/android/view/PointerIcon.java
@@ -16,6 +16,8 @@
package android.view;
+import android.os.UserHandle;
+import android.provider.Settings;
import com.android.internal.util.XmlUtils;
import android.annotation.XmlRes;
@@ -199,9 +201,14 @@
styleIndex = getSystemIconStyleIndex(STYLE_DEFAULT);
}
+ int accessibilityConfig = Settings.Secure.getIntForUser(
+ context.getContentResolver(), Settings.Secure.ACCESSIBILITY_LARGE_POINTER_ICON,
+ 0, UserHandle.USER_CURRENT);
+ int defStyle = (accessibilityConfig == 1) ?
+ com.android.internal.R.style.LargePointer : com.android.internal.R.style.Pointer;
TypedArray a = context.obtainStyledAttributes(null,
com.android.internal.R.styleable.Pointer,
- com.android.internal.R.attr.pointerStyle, 0);
+ 0, defStyle);
int resourceId = a.getResourceId(styleIndex, -1);
a.recycle();
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index b0e68de..49b21f9 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -3057,14 +3057,29 @@
/**
* @hide
*
- * Makes system ui transparent.
+ * Makes navigation bar transparent (but not the status bar).
*/
- public static final int SYSTEM_UI_TRANSPARENT = 0x00008000;
+ public static final int NAVIGATION_BAR_TRANSPARENT = 0x00008000;
+
+ /**
+ * @hide
+ *
+ * Makes status bar transparent (but not the navigation bar).
+ */
+ public static final int STATUS_BAR_TRANSPARENT = 0x0000008;
+
+ /**
+ * @hide
+ *
+ * Makes both status bar and navigation bar transparent.
+ */
+ public static final int SYSTEM_UI_TRANSPARENT = NAVIGATION_BAR_TRANSPARENT
+ | STATUS_BAR_TRANSPARENT;
/**
* @hide
*/
- public static final int PUBLIC_STATUS_BAR_VISIBILITY_MASK = 0x00003FFF;
+ public static final int PUBLIC_STATUS_BAR_VISIBILITY_MASK = 0x00003FF7;
/**
* These are the system UI flags that can be cleared by events outside
@@ -18559,13 +18574,13 @@
*
* @param location an array of two integers in which to hold the coordinates
*/
- public void getLocationOnScreen(@Size(2) int[] location) {
- getLocationInWindow(location);
+ public void getLocationOnScreen(@Size(2) int[] outLocation) {
+ getLocationInWindow(outLocation);
final AttachInfo info = mAttachInfo;
if (info != null) {
- location[0] += info.mWindowLeft;
- location[1] += info.mWindowTop;
+ outLocation[0] += info.mWindowLeft;
+ outLocation[1] += info.mWindowTop;
}
}
@@ -18576,11 +18591,15 @@
*
* @param outWindowSpace an array of two integers in which to hold the coordinates
*/
- public void getLocationInWindow(@Size(2) int[] outWindowSpace) {
- outWindowSpace[0] = 0;
- outWindowSpace[1] = 0;
+ public void getLocationInWindow(@Size(2) int[] outLocation) {
+ if (outLocation == null || outLocation.length < 2) {
+ throw new IllegalArgumentException("outLocation must be an array of two integers");
+ }
- transformFromViewToWindowSpace(outWindowSpace);
+ outLocation[0] = 0;
+ outLocation[1] = 0;
+
+ transformFromViewToWindowSpace(outLocation);
}
void transformFromViewToWindowSpace(@Size(2) int[] inOutLocation) {
diff --git a/core/java/android/view/inputmethod/EditorInfo.java b/core/java/android/view/inputmethod/EditorInfo.java
index 6130fd5..3ff9522 100644
--- a/core/java/android/view/inputmethod/EditorInfo.java
+++ b/core/java/android/view/inputmethod/EditorInfo.java
@@ -21,6 +21,7 @@
import android.os.Parcelable;
import android.text.InputType;
import android.text.TextUtils;
+import android.util.LocaleList;
import android.util.Printer;
/**
@@ -340,6 +341,22 @@
public Bundle extras;
/**
+ * Additional context information that tells what languages are expected by the user.
+ *
+ * <p><strong>IME authors:</strong> Possible use cases for IME developers would be:</p>
+ * <ul>
+ * <li>Automatically switching keyboard layout.</li>
+ * <li>Changing language model for better typing experience.</li>
+ * </ul>
+ *
+ * <p><strong>Editor authors:</strong> Providing this context information can help IMEs to
+ * improve text input experience. For example, chat applications can remember what language is
+ * used in the last conversation for each chat session, and put the last used language at the
+ * top of {@link #locales}.</p>
+ */
+ public LocaleList locales = LocaleList.getEmptyLocaleList();
+
+ /**
* Ensure that the data in this EditorInfo is compatible with an application
* that was developed against the given target API version. This can
* impact the following input types:
@@ -393,6 +410,7 @@
+ " fieldId=" + fieldId
+ " fieldName=" + fieldName);
pw.println(prefix + "extras=" + extras);
+ pw.println(prefix + "locales=" + locales);
}
/**
@@ -416,6 +434,7 @@
dest.writeInt(fieldId);
dest.writeString(fieldName);
dest.writeBundle(extras);
+ locales.writeToParcel(dest, flags);
}
/**
@@ -439,6 +458,7 @@
res.fieldId = source.readInt();
res.fieldName = source.readString();
res.extras = source.readBundle();
+ res.locales = LocaleList.CREATOR.createFromParcel(source);
return res;
}
diff --git a/core/java/android/widget/SearchView.java b/core/java/android/widget/SearchView.java
index 88f02d1..45fc6c3 100644
--- a/core/java/android/widget/SearchView.java
+++ b/core/java/android/widget/SearchView.java
@@ -45,7 +45,9 @@
import android.text.TextWatcher;
import android.text.style.ImageSpan;
import android.util.AttributeSet;
+import android.util.DisplayMetrics;
import android.util.Log;
+import android.util.TypedValue;
import android.view.CollapsibleActionView;
import android.view.KeyEvent;
import android.view.LayoutInflater;
@@ -1722,6 +1724,14 @@
mThreshold = getThreshold();
}
+ @Override
+ protected void onFinishInflate() {
+ super.onFinishInflate();
+ DisplayMetrics metrics = getResources().getDisplayMetrics();
+ setMinWidth((int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
+ getSearchViewTextMinWidthDp(), metrics));
+ }
+
void setSearchView(SearchView searchView) {
mSearchView = searchView;
}
@@ -1818,5 +1828,21 @@
return super.onKeyPreIme(keyCode, event);
}
+ /**
+ * Get minimum width of the search view text entry area.
+ */
+ private int getSearchViewTextMinWidthDp() {
+ final Configuration configuration = getResources().getConfiguration();
+ final int width = configuration.screenWidthDp;
+ final int height = configuration.screenHeightDp;
+ final int orientation = configuration.orientation;
+ if (width >= 960 && height >= 720
+ && orientation == Configuration.ORIENTATION_LANDSCAPE) {
+ return 256;
+ } else if (width >= 600 || (width >= 640 && height >= 480)) {
+ return 192;
+ };
+ return 160;
+ }
}
}
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index d666939..cca84ee 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -6439,6 +6439,9 @@
outAttrs.initialCapsMode = ic.getCursorCapsMode(getInputType());
return ic;
}
+ // LocaleList is designed to be immutable. This is theoretically equivalent to copy
+ // the snapshot of the current text locales.
+ outAttrs.locales = getTextLocales();
}
return null;
}
diff --git a/core/java/com/android/internal/policy/BackdropFrameRenderer.java b/core/java/com/android/internal/policy/BackdropFrameRenderer.java
index b101733..75ca639 100644
--- a/core/java/com/android/internal/policy/BackdropFrameRenderer.java
+++ b/core/java/com/android/internal/policy/BackdropFrameRenderer.java
@@ -17,6 +17,7 @@
package com.android.internal.policy;
import android.graphics.Rect;
+import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.os.Looper;
import android.view.Choreographer;
@@ -44,6 +45,7 @@
// The render nodes for the multi threaded renderer.
private ThreadedRenderer mRenderer;
private RenderNode mFrameAndBackdropNode;
+ private RenderNode mSystemBarBackgroundNode;
private final Rect mOldTargetRect = new Rect();
private final Rect mNewTargetRect = new Rect();
@@ -62,13 +64,16 @@
private Drawable mCaptionBackgroundDrawable;
private Drawable mResizingBackgroundDrawable;
+ private ColorDrawable mStatusBarColor;
public BackdropFrameRenderer(DecorView decorView, ThreadedRenderer renderer, Rect initialBounds,
- Drawable resizingBackgroundDrawable, Drawable captionBackgroundDrawable) {
+ Drawable resizingBackgroundDrawable, Drawable captionBackgroundDrawable,
+ int statusBarColor) {
setName("ResizeFrame");
mRenderer = renderer;
- onResourcesLoaded(decorView, resizingBackgroundDrawable, captionBackgroundDrawable);
+ onResourcesLoaded(decorView, resizingBackgroundDrawable, captionBackgroundDrawable,
+ statusBarColor);
// Create a render node for the content and frame backdrop
// which can be resized independently from the content.
@@ -87,10 +92,24 @@
}
void onResourcesLoaded(DecorView decorView, Drawable resizingBackgroundDrawable,
- Drawable captionBackgroundDrawableDrawable) {
+ Drawable captionBackgroundDrawableDrawable, int statusBarColor) {
mDecorView = decorView;
mResizingBackgroundDrawable = resizingBackgroundDrawable;
mCaptionBackgroundDrawable = captionBackgroundDrawableDrawable;
+ if (statusBarColor != 0) {
+ mStatusBarColor = new ColorDrawable(statusBarColor);
+ addSystemBarNodeIfNeeded();
+ } else {
+ mStatusBarColor = null;
+ }
+ }
+
+ private void addSystemBarNodeIfNeeded() {
+ if (mSystemBarBackgroundNode != null) {
+ return;
+ }
+ mSystemBarBackgroundNode = RenderNode.create("SystemBarBackgroundNode", null);
+ mRenderer.addRenderNode(mSystemBarBackgroundNode, false);
}
/**
@@ -132,6 +151,9 @@
// Remove the render node again
// (see comment above - better to do that only once).
mRenderer.removeRenderNode(mFrameAndBackdropNode);
+ if (mSystemBarBackgroundNode != null) {
+ mRenderer.removeRenderNode(mSystemBarBackgroundNode);
+ }
mRenderer = null;
@@ -232,6 +254,8 @@
// inaccessible. For that case we remember the previous metrics to avoid flashes.
// Note that even when there is no visible caption, the caption child will exist.
final int captionHeight = mDecorView.getCaptionHeight();
+ final int statusBarHeight = mDecorView.getStatusBarHeight();
+
// The caption height will probably never dynamically change while we are resizing.
// Once set to something other then 0 it should be kept that way.
if (captionHeight != 0) {
@@ -256,7 +280,7 @@
mFrameAndBackdropNode.setLeftTopRightBottom(left, top, left + width, top + height);
// Draw the caption and content backdrops in to our render node.
- final DisplayListCanvas canvas = mFrameAndBackdropNode.start(width, height);
+ DisplayListCanvas canvas = mFrameAndBackdropNode.start(width, height);
mCaptionBackgroundDrawable.setBounds(0, 0, left + width, top + mLastCaptionHeight);
mCaptionBackgroundDrawable.draw(canvas);
@@ -265,6 +289,15 @@
mResizingBackgroundDrawable.draw(canvas);
mFrameAndBackdropNode.end(canvas);
+ if (mSystemBarBackgroundNode != null && mStatusBarColor != null) {
+ canvas = mSystemBarBackgroundNode.start(width, height);
+ mSystemBarBackgroundNode.setLeftTopRightBottom(left, top, left + width, top + height);
+ mStatusBarColor.setBounds(0, 0, left + width, statusBarHeight);
+ mStatusBarColor.draw(canvas);
+ mSystemBarBackgroundNode.end(canvas);
+ mRenderer.drawRenderNode(mSystemBarBackgroundNode);
+ }
+
// We need to render the node explicitly
mRenderer.drawRenderNode(mFrameAndBackdropNode);
diff --git a/core/java/com/android/internal/policy/DecorView.java b/core/java/com/android/internal/policy/DecorView.java
index a95c401..9107b1f 100644
--- a/core/java/com/android/internal/policy/DecorView.java
+++ b/core/java/com/android/internal/policy/DecorView.java
@@ -151,6 +151,8 @@
private final Interpolator mShowInterpolator;
private final Interpolator mHideInterpolator;
private final int mBarEnterExitDuration;
+ private final boolean mForceWindowDrawsStatusBarBackground;
+ private final int mSemiTransparentStatusBarColor;
private final BackgroundFallback mBackgroundFallback = new BackgroundFallback();
@@ -197,6 +199,10 @@
mBarEnterExitDuration = context.getResources().getInteger(
R.integer.dock_enter_exit_duration);
+ mForceWindowDrawsStatusBarBackground = context.getResources().getBoolean(
+ R.bool.config_forceWindowDrawsStatusBarBackground);
+ mSemiTransparentStatusBarColor = context.getResources().getColor(
+ R.color.system_bar_background_semi_transparent, null /* theme */);
setWindow(window);
}
@@ -884,14 +890,15 @@
int navBarSize = navBarToRightEdge ? mLastRightInset : mLastBottomInset;
updateColorViewInt(mNavigationColorViewState, sysUiVisibility,
mWindow.mNavigationBarColor, navBarSize, navBarToRightEdge,
- 0 /* rightInset */, animate && !disallowAnimate);
+ 0 /* rightInset */, animate && !disallowAnimate, false /* force */);
boolean statusBarNeedsRightInset = navBarToRightEdge
&& mNavigationColorViewState.present;
int statusBarRightInset = statusBarNeedsRightInset ? mLastRightInset : 0;
- updateColorViewInt(mStatusColorViewState, sysUiVisibility, mWindow.mStatusBarColor,
- mLastTopInset, false /* matchVertical */, statusBarRightInset,
- animate && !disallowAnimate);
+ updateColorViewInt(mStatusColorViewState, sysUiVisibility,
+ calculateStatusBarColor(), mLastTopInset,
+ false /* matchVertical */, statusBarRightInset, animate && !disallowAnimate,
+ mForceWindowDrawsStatusBarBackground);
}
// When we expand the window with FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS, we still need
@@ -935,6 +942,21 @@
return insets;
}
+ private int calculateStatusBarColor() {
+ int flags = mWindow.getAttributes().flags;
+ return (flags & FLAG_TRANSLUCENT_STATUS) != 0 ? mSemiTransparentStatusBarColor
+ : (flags & FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) != 0 ? mWindow.mStatusBarColor
+ : Color.BLACK;
+ }
+
+ private int getCurrentColor(ColorViewState state) {
+ if (state.visible) {
+ return state.color;
+ } else {
+ return 0;
+ }
+ }
+
/**
* Update a color view
*
@@ -948,13 +970,15 @@
* @param animate if true, the change will be animated.
*/
private void updateColorViewInt(final ColorViewState state, int sysUiVis, int color,
- int size, boolean verticalBar, int rightMargin, boolean animate) {
+ int size, boolean verticalBar, int rightMargin, boolean animate, boolean force) {
state.present = size > 0 && (sysUiVis & state.systemUiHideFlag) == 0
&& (mWindow.getAttributes().flags & state.hideWindowFlag) == 0
- && (mWindow.getAttributes().flags & FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) != 0;
+ && ((mWindow.getAttributes().flags & FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) != 0
+ || force);
boolean show = state.present
&& (color & Color.BLACK) != 0
- && (mWindow.getAttributes().flags & state.translucentFlag) == 0;
+ && ((mWindow.getAttributes().flags & state.translucentFlag) == 0 || force);
+ boolean showView = show && !isResizing();
boolean visibilityChanged = false;
View view = state.view;
@@ -964,7 +988,7 @@
int resolvedGravity = verticalBar ? state.horizontalGravity : state.verticalGravity;
if (view == null) {
- if (show) {
+ if (showView) {
state.view = view = new View(mContext);
view.setBackgroundColor(color);
view.setTransitionName(state.transitionName);
@@ -980,7 +1004,7 @@
updateColorViewTranslations();
}
} else {
- int vis = show ? VISIBLE : INVISIBLE;
+ int vis = showView ? VISIBLE : INVISIBLE;
visibilityChanged = state.targetVisibility != vis;
state.targetVisibility = vis;
LayoutParams lp = (LayoutParams) view.getLayoutParams();
@@ -992,14 +1016,14 @@
lp.rightMargin = rightMargin;
view.setLayoutParams(lp);
}
- if (show) {
+ if (showView) {
view.setBackgroundColor(color);
}
}
if (visibilityChanged) {
view.animate().cancel();
- if (animate) {
- if (show) {
+ if (animate && !isResizing()) {
+ if (showView) {
if (view.getVisibility() != VISIBLE) {
view.setVisibility(VISIBLE);
view.setAlpha(0.0f);
@@ -1019,9 +1043,11 @@
}
} else {
view.setAlpha(1.0f);
- view.setVisibility(show ? VISIBLE : INVISIBLE);
+ view.setVisibility(showView ? VISIBLE : INVISIBLE);
}
}
+ state.visible = show;
+ state.color = color;
}
private void updateColorViewTranslations() {
@@ -1553,7 +1579,8 @@
if (mBackdropFrameRenderer != null) {
mBackdropFrameRenderer.onResourcesLoaded(
- this, mResizingBackgroundDrawable, mCaptionBackgroundDrawable);
+ this, mResizingBackgroundDrawable, mCaptionBackgroundDrawable,
+ getCurrentColor(mStatusColorViewState));
}
mDecorCaptionView = createDecorCaptionView(inflater);
@@ -1668,9 +1695,15 @@
if (mDecorCaptionView != null) {
mDecorCaptionView.removeContentView();
} else {
- // This window doesn't have caption, so we need to just remove the
- // children of the decor view.
- removeAllViews();
+ // This window doesn't have caption, so we need to remove everything except our views
+ // we might have added.
+ for (int i = getChildCount() - 1; i >= 0; i--) {
+ View v = getChildAt(i);
+ if (v != mStatusColorViewState.view && v != mNavigationColorViewState.view
+ && v != mStatusGuard && v != mNavigationGuard) {
+ removeViewAt(i);
+ }
+ }
}
}
@@ -1694,18 +1727,22 @@
final ThreadedRenderer renderer = (ThreadedRenderer) getHardwareRenderer();
if (renderer != null) {
mBackdropFrameRenderer = new BackdropFrameRenderer(this, renderer,
- initialBounds, mResizingBackgroundDrawable, mCaptionBackgroundDrawable);
+ initialBounds, mResizingBackgroundDrawable, mCaptionBackgroundDrawable,
+ getCurrentColor(mStatusColorViewState));
// Get rid of the shadow while we are resizing. Shadow drawing takes considerable time.
// If we want to get the shadow shown while resizing, we would need to elevate a new
// element which owns the caption and has the elevation.
updateElevation();
+
+ updateColorViews(null /* insets */, false);
}
}
@Override
public void onWindowDragResizeEnd() {
releaseThreadedRenderer();
+ updateColorViews(null /* insets */, false);
}
@Override
@@ -1738,6 +1775,10 @@
}
}
+ private boolean isResizing() {
+ return mBackdropFrameRenderer != null;
+ }
+
/**
* The elevation gets set for the first time and the framework needs to be informed that
* the surface layer gets created with the shadow size in mind.
@@ -1753,8 +1794,7 @@
final boolean wasAdjustedForStack = mElevationAdjustedForStack;
// Do not use a shadow when we are in resizing mode (mBackdropFrameRenderer not null)
// since the shadow is bound to the content size and not the target size.
- if (ActivityManager.StackId.hasWindowShadow(mStackId)
- && mBackdropFrameRenderer == null) {
+ if (ActivityManager.StackId.hasWindowShadow(mStackId) && !isResizing()) {
elevation = hasWindowFocus() ?
DECOR_SHADOW_FOCUSED_HEIGHT_IN_DIP : DECOR_SHADOW_UNFOCUSED_HEIGHT_IN_DIP;
// TODO(skuhne): Remove this if clause once b/22668382 got fixed.
@@ -1784,6 +1824,10 @@
return isShowingCaption() ? mDecorCaptionView.getCaptionHeight() : 0;
}
+ int getStatusBarHeight() {
+ return mStatusColorViewState.view != null ? mStatusColorViewState.view.getHeight() : 0;
+ }
+
/**
* Converts a DIP measure into physical pixels.
* @param dip The dip value.
@@ -1798,6 +1842,8 @@
View view = null;
int targetVisibility = View.INVISIBLE;
boolean present = false;
+ boolean visible;
+ int color;
final int id;
final int systemUiHideFlag;
diff --git a/core/java/com/android/internal/policy/PhoneWindow.java b/core/java/com/android/internal/policy/PhoneWindow.java
index 04f1dc5..57d2244 100644
--- a/core/java/com/android/internal/policy/PhoneWindow.java
+++ b/core/java/com/android/internal/policy/PhoneWindow.java
@@ -2406,6 +2406,13 @@
setNeedsMenuKey(WindowManager.LayoutParams.NEEDS_MENU_SET_FALSE);
}
+ if (!mForcedStatusBarColor) {
+ mStatusBarColor = a.getColor(R.styleable.Window_statusBarColor, 0xFF000000);
+ }
+ if (!mForcedNavigationBarColor) {
+ mNavigationBarColor = a.getColor(R.styleable.Window_navigationBarColor, 0xFF000000);
+ }
+
// Non-floating windows on high end devices must put up decor beneath the system bars and
// therefore must know about visibility changes of those.
if (!mIsFloating && ActivityManager.isHighEndGfx()) {
@@ -2416,12 +2423,6 @@
FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS & ~getForcedWindowFlags());
}
}
- if (!mForcedStatusBarColor) {
- mStatusBarColor = a.getColor(R.styleable.Window_statusBarColor, 0xFF000000);
- }
- if (!mForcedNavigationBarColor) {
- mNavigationBarColor = a.getColor(R.styleable.Window_navigationBarColor, 0xFF000000);
- }
if (a.getBoolean(R.styleable.Window_windowLightStatusBar, false)) {
decor.setSystemUiVisibility(
decor.getSystemUiVisibility() | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
diff --git a/core/java/com/android/internal/view/ActionBarPolicy.java b/core/java/com/android/internal/view/ActionBarPolicy.java
index 007ab29..755faf3 100644
--- a/core/java/com/android/internal/view/ActionBarPolicy.java
+++ b/core/java/com/android/internal/view/ActionBarPolicy.java
@@ -78,7 +78,11 @@
// The embedded tabs policy changed in Jellybean; give older apps the old policy
// so they get what they expect.
- return mContext.getResources().getBoolean(R.bool.action_bar_embed_tabs_pre_jb);
+ final Configuration configuration = mContext.getResources().getConfiguration();
+ final int width = configuration.screenWidthDp;
+ final int height = configuration.screenHeightDp;
+ return configuration.orientation == Configuration.ORIENTATION_LANDSCAPE ||
+ width >= 480 || (width >= 640 && height >= 480);
}
public int getTabContainerHeight() {
diff --git a/core/java/com/android/internal/view/menu/ActionMenuItemView.java b/core/java/com/android/internal/view/menu/ActionMenuItemView.java
index ce5bc90..bd97e5d 100644
--- a/core/java/com/android/internal/view/menu/ActionMenuItemView.java
+++ b/core/java/com/android/internal/view/menu/ActionMenuItemView.java
@@ -72,8 +72,7 @@
public ActionMenuItemView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
final Resources res = context.getResources();
- mAllowTextWithIcon = res.getBoolean(
- com.android.internal.R.bool.config_allowActionMenuItemTextWithIcon);
+ mAllowTextWithIcon = shouldAllowTextWithIcon();
final TypedArray a = context.obtainStyledAttributes(attrs,
com.android.internal.R.styleable.ActionMenuItemView, defStyleAttr, defStyleRes);
mMinWidth = a.getDimensionPixelSize(
@@ -93,11 +92,22 @@
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
- mAllowTextWithIcon = getContext().getResources().getBoolean(
- com.android.internal.R.bool.config_allowActionMenuItemTextWithIcon);
+ mAllowTextWithIcon = shouldAllowTextWithIcon();
updateTextButtonVisibility();
}
+ /**
+ * Whether action menu items should obey the "withText" showAsAction flag. This may be set to
+ * false for situations where space is extremely limited. -->
+ */
+ private boolean shouldAllowTextWithIcon() {
+ final Configuration configuration = getContext().getResources().getConfiguration();
+ final int width = configuration.screenWidthDp;
+ final int height = configuration.screenHeightDp;
+ return width >= 480 || (width >= 640 && height >= 480)
+ || configuration.orientation == Configuration.ORIENTATION_LANDSCAPE;
+ }
+
@Override
public void setPadding(int l, int t, int r, int b) {
mSavedPaddingLeft = l;
diff --git a/core/res/res/drawable-mdpi/pointer_alias_large.png b/core/res/res/drawable-mdpi/pointer_alias_large.png
new file mode 100644
index 0000000..283bf7f
--- /dev/null
+++ b/core/res/res/drawable-mdpi/pointer_alias_large.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/pointer_all_scroll_large.png b/core/res/res/drawable-mdpi/pointer_all_scroll_large.png
new file mode 100644
index 0000000..c29db87
--- /dev/null
+++ b/core/res/res/drawable-mdpi/pointer_all_scroll_large.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/pointer_arrow_large.png b/core/res/res/drawable-mdpi/pointer_arrow_large.png
new file mode 100644
index 0000000..9f59c4c
--- /dev/null
+++ b/core/res/res/drawable-mdpi/pointer_arrow_large.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/pointer_cell_large.png b/core/res/res/drawable-mdpi/pointer_cell_large.png
new file mode 100644
index 0000000..3dec5e5
--- /dev/null
+++ b/core/res/res/drawable-mdpi/pointer_cell_large.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/pointer_context_menu_large.png b/core/res/res/drawable-mdpi/pointer_context_menu_large.png
new file mode 100644
index 0000000..7c9e250
--- /dev/null
+++ b/core/res/res/drawable-mdpi/pointer_context_menu_large.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/pointer_copy_large.png b/core/res/res/drawable-mdpi/pointer_copy_large.png
new file mode 100644
index 0000000..18f4696
--- /dev/null
+++ b/core/res/res/drawable-mdpi/pointer_copy_large.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/pointer_crosshair_large.png b/core/res/res/drawable-mdpi/pointer_crosshair_large.png
new file mode 100644
index 0000000..ea1f5fc
--- /dev/null
+++ b/core/res/res/drawable-mdpi/pointer_crosshair_large.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/pointer_grab_large.png b/core/res/res/drawable-mdpi/pointer_grab_large.png
new file mode 100644
index 0000000..2e32766
--- /dev/null
+++ b/core/res/res/drawable-mdpi/pointer_grab_large.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/pointer_grabbing_large.png b/core/res/res/drawable-mdpi/pointer_grabbing_large.png
new file mode 100644
index 0000000..3c54751
--- /dev/null
+++ b/core/res/res/drawable-mdpi/pointer_grabbing_large.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/pointer_hand_large.png b/core/res/res/drawable-mdpi/pointer_hand_large.png
new file mode 100644
index 0000000..785047f
--- /dev/null
+++ b/core/res/res/drawable-mdpi/pointer_hand_large.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/pointer_help_large.png b/core/res/res/drawable-mdpi/pointer_help_large.png
new file mode 100644
index 0000000..6552f9b
--- /dev/null
+++ b/core/res/res/drawable-mdpi/pointer_help_large.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/pointer_horizontal_double_arrow_large.png b/core/res/res/drawable-mdpi/pointer_horizontal_double_arrow_large.png
new file mode 100644
index 0000000..7086106
--- /dev/null
+++ b/core/res/res/drawable-mdpi/pointer_horizontal_double_arrow_large.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/pointer_nodrop_large.png b/core/res/res/drawable-mdpi/pointer_nodrop_large.png
new file mode 100644
index 0000000..da981df
--- /dev/null
+++ b/core/res/res/drawable-mdpi/pointer_nodrop_large.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/pointer_text_large.png b/core/res/res/drawable-mdpi/pointer_text_large.png
new file mode 100644
index 0000000..2fba190
--- /dev/null
+++ b/core/res/res/drawable-mdpi/pointer_text_large.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/pointer_top_left_diagonal_double_arrow_large.png b/core/res/res/drawable-mdpi/pointer_top_left_diagonal_double_arrow_large.png
new file mode 100644
index 0000000..eecaa89
--- /dev/null
+++ b/core/res/res/drawable-mdpi/pointer_top_left_diagonal_double_arrow_large.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/pointer_top_right_diagonal_double_arrow_large.png b/core/res/res/drawable-mdpi/pointer_top_right_diagonal_double_arrow_large.png
new file mode 100644
index 0000000..9d47ecf
--- /dev/null
+++ b/core/res/res/drawable-mdpi/pointer_top_right_diagonal_double_arrow_large.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/pointer_vertical_double_arrow_large.png b/core/res/res/drawable-mdpi/pointer_vertical_double_arrow_large.png
new file mode 100644
index 0000000..fd777b1
--- /dev/null
+++ b/core/res/res/drawable-mdpi/pointer_vertical_double_arrow_large.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/pointer_vertical_text_large.png b/core/res/res/drawable-mdpi/pointer_vertical_text_large.png
new file mode 100644
index 0000000..1cbe49a
--- /dev/null
+++ b/core/res/res/drawable-mdpi/pointer_vertical_text_large.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/pointer_zoom_in_large.png b/core/res/res/drawable-mdpi/pointer_zoom_in_large.png
new file mode 100644
index 0000000..923ad79
--- /dev/null
+++ b/core/res/res/drawable-mdpi/pointer_zoom_in_large.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/pointer_zoom_out_large.png b/core/res/res/drawable-mdpi/pointer_zoom_out_large.png
new file mode 100644
index 0000000..aa47eb9
--- /dev/null
+++ b/core/res/res/drawable-mdpi/pointer_zoom_out_large.png
Binary files differ
diff --git a/core/res/res/drawable/pointer_alias_large_icon.xml b/core/res/res/drawable/pointer_alias_large_icon.xml
new file mode 100644
index 0000000..149f58c
--- /dev/null
+++ b/core/res/res/drawable/pointer_alias_large_icon.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<pointer-icon xmlns:android="http://schemas.android.com/apk/res/android"
+ android:bitmap="@drawable/pointer_alias_large"
+ android:hotSpotX="19dp"
+ android:hotSpotY="11dp" />
diff --git a/core/res/res/drawable/pointer_all_scroll_large_icon.xml b/core/res/res/drawable/pointer_all_scroll_large_icon.xml
new file mode 100644
index 0000000..c580f76
--- /dev/null
+++ b/core/res/res/drawable/pointer_all_scroll_large_icon.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<pointer-icon xmlns:android="http://schemas.android.com/apk/res/android"
+ android:bitmap="@drawable/pointer_all_scroll_large"
+ android:hotSpotX="32dp"
+ android:hotSpotY="31dp" />
diff --git a/core/res/res/drawable/pointer_arrow_large_icon.xml b/core/res/res/drawable/pointer_arrow_large_icon.xml
new file mode 100644
index 0000000..22c7bfe
--- /dev/null
+++ b/core/res/res/drawable/pointer_arrow_large_icon.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<pointer-icon xmlns:android="http://schemas.android.com/apk/res/android"
+ android:bitmap="@drawable/pointer_arrow_large"
+ android:hotSpotX="10dp"
+ android:hotSpotY="10dp" />
diff --git a/core/res/res/drawable/pointer_cell_large_icon.xml b/core/res/res/drawable/pointer_cell_large_icon.xml
new file mode 100644
index 0000000..f2530b7
--- /dev/null
+++ b/core/res/res/drawable/pointer_cell_large_icon.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<pointer-icon xmlns:android="http://schemas.android.com/apk/res/android"
+ android:bitmap="@drawable/pointer_cell_large"
+ android:hotSpotX="30dp"
+ android:hotSpotY="30dp" />
diff --git a/core/res/res/drawable/pointer_context_menu_large_icon.xml b/core/res/res/drawable/pointer_context_menu_large_icon.xml
new file mode 100644
index 0000000..c57e615
--- /dev/null
+++ b/core/res/res/drawable/pointer_context_menu_large_icon.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<pointer-icon xmlns:android="http://schemas.android.com/apk/res/android"
+ android:bitmap="@drawable/pointer_context_menu_large"
+ android:hotSpotX="11dp"
+ android:hotSpotY="11dp" />
diff --git a/core/res/res/drawable/pointer_copy_large_icon.xml b/core/res/res/drawable/pointer_copy_large_icon.xml
new file mode 100644
index 0000000..4ee3f18
--- /dev/null
+++ b/core/res/res/drawable/pointer_copy_large_icon.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<pointer-icon xmlns:android="http://schemas.android.com/apk/res/android"
+ android:bitmap="@drawable/pointer_copy_large"
+ android:hotSpotX="10dp"
+ android:hotSpotY="10dp" />
diff --git a/core/res/res/drawable/pointer_crosshair_large_icon.xml b/core/res/res/drawable/pointer_crosshair_large_icon.xml
new file mode 100644
index 0000000..6a71b7b
--- /dev/null
+++ b/core/res/res/drawable/pointer_crosshair_large_icon.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<pointer-icon xmlns:android="http://schemas.android.com/apk/res/android"
+ android:bitmap="@drawable/pointer_crosshair_large"
+ android:hotSpotX="31dp"
+ android:hotSpotY="30dp" />
diff --git a/core/res/res/drawable/pointer_grab_large_icon.xml b/core/res/res/drawable/pointer_grab_large_icon.xml
new file mode 100644
index 0000000..f2df1cb
--- /dev/null
+++ b/core/res/res/drawable/pointer_grab_large_icon.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<pointer-icon xmlns:android="http://schemas.android.com/apk/res/android"
+ android:bitmap="@drawable/pointer_grab_large"
+ android:hotSpotX="21dp"
+ android:hotSpotY="11dp" />
diff --git a/core/res/res/drawable/pointer_grabbing_large_icon.xml b/core/res/res/drawable/pointer_grabbing_large_icon.xml
new file mode 100644
index 0000000..e4042bf
--- /dev/null
+++ b/core/res/res/drawable/pointer_grabbing_large_icon.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<pointer-icon xmlns:android="http://schemas.android.com/apk/res/android"
+ android:bitmap="@drawable/pointer_grabbing_large"
+ android:hotSpotX="20dp"
+ android:hotSpotY="12dp" />
diff --git a/core/res/res/drawable/pointer_hand_large_icon.xml b/core/res/res/drawable/pointer_hand_large_icon.xml
new file mode 100644
index 0000000..e34422a
--- /dev/null
+++ b/core/res/res/drawable/pointer_hand_large_icon.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<pointer-icon xmlns:android="http://schemas.android.com/apk/res/android"
+ android:bitmap="@drawable/pointer_hand_large"
+ android:hotSpotX="25dp"
+ android:hotSpotY="7dp" />
diff --git a/core/res/res/drawable/pointer_help_large_icon.xml b/core/res/res/drawable/pointer_help_large_icon.xml
new file mode 100644
index 0000000..4c60a55
--- /dev/null
+++ b/core/res/res/drawable/pointer_help_large_icon.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<pointer-icon xmlns:android="http://schemas.android.com/apk/res/android"
+ android:bitmap="@drawable/pointer_help_large"
+ android:hotSpotX="10dp"
+ android:hotSpotY="11dp" />
diff --git a/core/res/res/drawable/pointer_horizontal_double_arrow_large_icon.xml b/core/res/res/drawable/pointer_horizontal_double_arrow_large_icon.xml
new file mode 100644
index 0000000..a2039e6
--- /dev/null
+++ b/core/res/res/drawable/pointer_horizontal_double_arrow_large_icon.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<pointer-icon xmlns:android="http://schemas.android.com/apk/res/android"
+ android:bitmap="@drawable/pointer_horizontal_double_arrow_large"
+ android:hotSpotX="35dp"
+ android:hotSpotY="29dp" />
diff --git a/core/res/res/drawable/pointer_nodrop_large_icon.xml b/core/res/res/drawable/pointer_nodrop_large_icon.xml
new file mode 100644
index 0000000..cde2e41
--- /dev/null
+++ b/core/res/res/drawable/pointer_nodrop_large_icon.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<pointer-icon xmlns:android="http://schemas.android.com/apk/res/android"
+ android:bitmap="@drawable/pointer_nodrop_large"
+ android:hotSpotX="10dp"
+ android:hotSpotY="10dp" />
diff --git a/core/res/res/drawable/pointer_text_large_icon.xml b/core/res/res/drawable/pointer_text_large_icon.xml
new file mode 100644
index 0000000..24d35b0
--- /dev/null
+++ b/core/res/res/drawable/pointer_text_large_icon.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<pointer-icon xmlns:android="http://schemas.android.com/apk/res/android"
+ android:bitmap="@drawable/pointer_text_large"
+ android:hotSpotX="30dp"
+ android:hotSpotY="32dp" />
diff --git a/core/res/res/drawable/pointer_top_left_diagonal_double_arrow_large_icon.xml b/core/res/res/drawable/pointer_top_left_diagonal_double_arrow_large_icon.xml
new file mode 100644
index 0000000..270ccc9
--- /dev/null
+++ b/core/res/res/drawable/pointer_top_left_diagonal_double_arrow_large_icon.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<pointer-icon xmlns:android="http://schemas.android.com/apk/res/android"
+ android:bitmap="@drawable/pointer_top_left_diagonal_double_arrow_large"
+ android:hotSpotX="32dp"
+ android:hotSpotY="30dp" />
diff --git a/core/res/res/drawable/pointer_top_right_diagonal_double_arrow_large_icon.xml b/core/res/res/drawable/pointer_top_right_diagonal_double_arrow_large_icon.xml
new file mode 100644
index 0000000..e350a43
--- /dev/null
+++ b/core/res/res/drawable/pointer_top_right_diagonal_double_arrow_large_icon.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<pointer-icon xmlns:android="http://schemas.android.com/apk/res/android"
+ android:bitmap="@drawable/pointer_top_right_diagonal_double_arrow_large"
+ android:hotSpotX="32dp"
+ android:hotSpotY="31dp" />
diff --git a/core/res/res/drawable/pointer_vertical_double_arrow_large_icon.xml b/core/res/res/drawable/pointer_vertical_double_arrow_large_icon.xml
new file mode 100644
index 0000000..65728ad
--- /dev/null
+++ b/core/res/res/drawable/pointer_vertical_double_arrow_large_icon.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<pointer-icon xmlns:android="http://schemas.android.com/apk/res/android"
+ android:bitmap="@drawable/pointer_vertical_double_arrow_large"
+ android:hotSpotX="29dp"
+ android:hotSpotY="32dp" />
diff --git a/core/res/res/drawable/pointer_vertical_text_large_icon.xml b/core/res/res/drawable/pointer_vertical_text_large_icon.xml
new file mode 100644
index 0000000..48211cb
--- /dev/null
+++ b/core/res/res/drawable/pointer_vertical_text_large_icon.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<pointer-icon xmlns:android="http://schemas.android.com/apk/res/android"
+ android:bitmap="@drawable/pointer_vertical_text_large"
+ android:hotSpotX="32dp"
+ android:hotSpotY="30dp" />
diff --git a/core/res/res/drawable/pointer_zoom_in_large_icon.xml b/core/res/res/drawable/pointer_zoom_in_large_icon.xml
new file mode 100644
index 0000000..3eb89f56
--- /dev/null
+++ b/core/res/res/drawable/pointer_zoom_in_large_icon.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<pointer-icon xmlns:android="http://schemas.android.com/apk/res/android"
+ android:bitmap="@drawable/pointer_zoom_in_large"
+ android:hotSpotX="25dp"
+ android:hotSpotY="26dp" />
diff --git a/core/res/res/drawable/pointer_zoom_out_large_icon.xml b/core/res/res/drawable/pointer_zoom_out_large_icon.xml
new file mode 100644
index 0000000..df6412e
--- /dev/null
+++ b/core/res/res/drawable/pointer_zoom_out_large_icon.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<pointer-icon xmlns:android="http://schemas.android.com/apk/res/android"
+ android:bitmap="@drawable/pointer_zoom_out_large"
+ android:hotSpotX="26dp"
+ android:hotSpotY="26dp" />
diff --git a/core/res/res/layout/search_view.xml b/core/res/res/layout/search_view.xml
index b5b5b27..718e4a2 100644
--- a/core/res/res/layout/search_view.xml
+++ b/core/res/res/layout/search_view.xml
@@ -81,7 +81,6 @@
android:layout_height="36dip"
android:layout_width="0dp"
android:layout_weight="1"
- android:minWidth="@dimen/search_view_text_min_width"
android:layout_gravity="bottom"
android:paddingStart="@dimen/dropdownitem_text_padding_left"
android:paddingEnd="@dimen/dropdownitem_text_padding_right"
@@ -113,7 +112,7 @@
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="match_parent">
-
+
<ImageView
android:id="@+id/search_go_btn"
android:layout_width="wrap_content"
diff --git a/core/res/res/values-large/dimens.xml b/core/res/res/values-large/dimens.xml
index 8cd614d..69a1aa1 100644
--- a/core/res/res/values-large/dimens.xml
+++ b/core/res/res/values-large/dimens.xml
@@ -24,9 +24,6 @@
<!-- keyboardHeight = key_height*4 + key_bottom_gap*3 -->
<dimen name="password_keyboard_height">48.0mm</dimen>
- <!-- Minimum width of the search view text entry area. -->
- <dimen name="search_view_text_min_width">192dip</dimen>
-
<item type="dimen" name="dialog_min_width_major">55%</item>
<item type="dimen" name="dialog_min_width_minor">80%</item>
diff --git a/core/res/res/values-mcc302-mnc220/config.xml b/core/res/res/values-mcc302-mnc220/config.xml
index 09a63aa..454e4b6 100644
--- a/core/res/res/values-mcc302-mnc220/config.xml
+++ b/core/res/res/values-mcc302-mnc220/config.xml
@@ -37,7 +37,7 @@
Or string format of ApnSettingV3.
note that empty fields can be ommitted: "name,apn,,,,,,,,,310,260,,DUN" -->
<string-array translatable="false" name="config_tether_apndata">
- <item>[ApnSettingV3]TELUS ISP,isp.telus.com,,,,,,,,,302,220,,DUN,,,true,0,,,,,,,gid,54</item>
+ <item>[ApnSettingV3]TELUS ISP,isp.telus.com,,,,,,,,,302,220,,DUN,IP,IP,true,0,,,,,,,gid,54</item>
<item>[ApnSettingV3]Tethered Mobile Internet,isp.mb.com,,,,,,,,,302,220,,DUN,,,true,0,,,,,,,gid,50</item>
<item>[ApnSettingV3]Tethered Public Mobile,isp.mb.com,,,,,,,,,302,220,,DUN,,,true,0,,,,,,,gid,4D4F</item>
</string-array>
diff --git a/core/res/res/values-w480dp/bools.xml b/core/res/res/values-w480dp/bools.xml
index 3a463a6..c7df562 100644
--- a/core/res/res/values-w480dp/bools.xml
+++ b/core/res/res/values-w480dp/bools.xml
@@ -17,6 +17,5 @@
*/
-->
<resources>
- <bool name="action_bar_embed_tabs_pre_jb">true</bool>
<bool name="split_action_bar_is_narrow">false</bool>
</resources>
diff --git a/core/res/res/values-w480dp/config.xml b/core/res/res/values-w480dp/config.xml
deleted file mode 100644
index 269a9b4..0000000
--- a/core/res/res/values-w480dp/config.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
-** 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.
-*/
--->
-<resources>
- <bool name="config_allowActionMenuItemTextWithIcon">true</bool>
-</resources>
diff --git a/core/res/res/values-xlarge-land/dimens.xml b/core/res/res/values-xlarge-land/dimens.xml
index 0b43a42..3812178 100644
--- a/core/res/res/values-xlarge-land/dimens.xml
+++ b/core/res/res/values-xlarge-land/dimens.xml
@@ -20,6 +20,4 @@
<!-- Default height of a key in the password keyboard for alpha -->
<dimen name="password_keyboard_key_height_alpha">100dip</dimen>
<dimen name="password_keyboard_key_height_numeric">75dip</dimen>
- <!-- Minimum width of the search view text entry area. -->
- <dimen name="search_view_text_min_width">256dip</dimen>
</resources>
diff --git a/core/res/res/values-xlarge/dimens.xml b/core/res/res/values-xlarge/dimens.xml
index 29cea26..b13e74a 100644
--- a/core/res/res/values-xlarge/dimens.xml
+++ b/core/res/res/values-xlarge/dimens.xml
@@ -25,9 +25,6 @@
<!-- keyboardHeight = key_height*4 + key_bottom_gap*3 -->
<dimen name="password_keyboard_height">48.0mm</dimen>
- <!-- Minimum width of the search view text entry area. -->
- <dimen name="search_view_text_min_width">192dip</dimen>
-
<item type="dimen" name="dialog_min_width_major">45%</item>
<item type="dimen" name="dialog_min_width_minor">72%</item>
</resources>
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index f9f8162..34a66d0 100644
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -1026,9 +1026,6 @@
<!-- ============== -->
<eat-comment />
- <!-- Reference to the Pointer style -->
- <attr name="pointerStyle" format="reference" />
-
<!-- The drawable for accessibility focused views. -->
<attr name="accessibilityFocusedDrawable" format="reference" />
diff --git a/core/res/res/values/bools.xml b/core/res/res/values/bools.xml
index 457131a..5c50e73 100644
--- a/core/res/res/values/bools.xml
+++ b/core/res/res/values/bools.xml
@@ -19,7 +19,6 @@
<bool name="kg_center_small_widgets_vertically">false</bool>
<bool name="kg_top_align_page_shrink_on_bouncer_visible">true</bool>
<bool name="action_bar_embed_tabs">true</bool>
- <bool name="action_bar_embed_tabs_pre_jb">false</bool>
<bool name="split_action_bar_is_narrow">true</bool>
<bool name="preferences_prefer_dual_pane">false</bool>
<bool name="show_ongoing_ime_switcher">true</bool>
diff --git a/core/res/res/values/colors.xml b/core/res/res/values/colors.xml
index dad68ba..af8ff2e 100644
--- a/core/res/res/values/colors.xml
+++ b/core/res/res/values/colors.xml
@@ -173,4 +173,7 @@
<color name="Red_800">#ffb93221</color>
<color name="chooser_service_row_background_color">#fff5f5f5</color>
+
+ <!-- Status bar color for semi transparent mode. -->
+ <color name="system_bar_background_semi_transparent">#66000000</color> <!-- 40% black -->
</resources>
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index caa20dc..decb1ef 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -1537,11 +1537,6 @@
it should be disabled in that locale's resources. -->
<bool name="config_actionMenuItemAllCaps">true</bool>
- <!-- Whether action menu items should obey the "withText" showAsAction
- flag. This may be set to false for situations where space is
- extremely limited. -->
- <bool name="config_allowActionMenuItemTextWithIcon">false</bool>
-
<!-- Remote server that can provide NTP responses. -->
<string translatable="false" name="config_ntpServer">2.android.pool.ntp.org</string>
<!-- Normal polling frequency in milliseconds -->
@@ -1965,6 +1960,7 @@
<item>com.android.server.notification.TopicPriorityExtractor</item>
<item>com.android.server.notification.NotificationIntrusivenessExtractor</item>
<item>com.android.server.notification.TopicVisibilityExtractor</item>
+ <item>com.android.server.notification.TopicImportanceExtractor</item>
</string-array>
<!-- Flag indicating that this device does not rotate and will always remain in its default
@@ -2400,4 +2396,9 @@
The duplication is necessary, because this information is used before the features are
available to the system.-->
<bool name="config_freeformWindowManagement">false</bool>
+
+ <!-- If set, this will force all windows to draw the status bar background, including the apps
+ that have not requested doing so (via the WindowManager.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS
+ flag). -->
+ <bool name="config_forceWindowDrawsStatusBarBackground">true</bool>
</resources>
diff --git a/core/res/res/values/dimens.xml b/core/res/res/values/dimens.xml
index 7b4becc..b167711 100644
--- a/core/res/res/values/dimens.xml
+++ b/core/res/res/values/dimens.xml
@@ -162,9 +162,6 @@
<!-- The minimum height of the content if there is a picture present with big picture -->
<dimen name="notification_big_picture_content_min_height_with_picture">41dp</dimen>
- <!-- Minimum width of the search view text entry area. -->
- <dimen name="search_view_text_min_width">160dip</dimen>
-
<!-- Preferred width of the search view. -->
<dimen name="search_view_preferred_width">320dip</dimen>
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index d6dd842..e5415df 100644
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -3954,6 +3954,22 @@
<!-- [CHAR_LIMIT=NONE] Battery saver: Feature description -->
<string name="battery_saver_description">To help improve battery life, battery saver reduces your device’s performance and limits vibration, location services, and most background data. Email, messaging, and other apps that rely on syncing may not update unless you open them.\n\nBattery saver turns off automatically when your device is charging.</string>
+
+ <!-- [CHAR LIMIT=100] Notification Importance slider: blocked importance level description -->
+ <string name="notification_importance_blocked">Blocked: Never show these notifications</string>
+
+ <!-- [CHAR LIMIT=100] Notification Importance slider: low importance level description -->
+ <string name="notification_importance_low">Low: Silently show at the bottom of the notification list</string>
+
+ <!-- [CHAR LIMIT=100] Notification Importance slider: normal importance level description -->
+ <string name="notification_importance_default">Normal: Silently show these notifications</string>
+
+ <!-- [CHAR LIMIT=100] Notification Importance slider: high importance level description -->
+ <string name="notification_importance_high">High: Show at the top of the notifications list and make sound</string>
+
+ <!-- [CHAR LIMIT=100] Notification Importance slider: max importance level description -->
+ <string name="notification_importance_max">Urgent: Peek onto the screen and make sound</string>
+
<!-- Zen mode condition - summary: time duration in minutes. [CHAR LIMIT=NONE] -->
<plurals name="zen_mode_duration_minutes_summary">
<item quantity="one">For one minute (until <xliff:g id="formattedTime" example="10:00 PM">%2$s</xliff:g>)</item>
diff --git a/core/res/res/values/styles.xml b/core/res/res/values/styles.xml
index e6f279d..9a4016b 100644
--- a/core/res/res/values/styles.xml
+++ b/core/res/res/values/styles.xml
@@ -1368,6 +1368,42 @@
<item name="pointerIconGrabbing">@drawable/pointer_grabbing_icon</item>
</style>
+ <style name="LargePointer">
+ <item name="pointerIconArrow">@drawable/pointer_arrow_large_icon</item>
+ <item name="pointerIconSpotHover">@drawable/pointer_spot_hover_icon</item>
+ <item name="pointerIconSpotTouch">@drawable/pointer_spot_touch_icon</item>
+ <item name="pointerIconSpotAnchor">@drawable/pointer_spot_anchor_icon</item>
+ <item name="pointerIconHand">@drawable/pointer_hand_large_icon</item>
+ <item name="pointerIconContextMenu">@drawable/pointer_context_menu_large_icon</item>
+ <item name="pointerIconHelp">@drawable/pointer_help_large_icon</item>
+ <!-- TODO: create large wait icon. -->
+ <item name="pointerIconWait">@drawable/pointer_wait_icon</item>
+ <item name="pointerIconCell">@drawable/pointer_cell_large_icon</item>
+ <item name="pointerIconCrosshair">@drawable/pointer_crosshair_large_icon</item>
+ <item name="pointerIconText">@drawable/pointer_text_large_icon</item>
+ <item name="pointerIconVerticalText">@drawable/pointer_vertical_text_large_icon</item>
+ <item name="pointerIconAlias">@drawable/pointer_alias_large_icon</item>
+ <item name="pointerIconCopy">@drawable/pointer_copy_large_icon</item>
+ <item name="pointerIconAllScroll">@drawable/pointer_all_scroll_large_icon</item>
+ <item name="pointerIconNodrop">@drawable/pointer_nodrop_large_icon</item>
+ <item name="pointerIconHorizontalDoubleArrow">
+ @drawable/pointer_horizontal_double_arrow_large_icon
+ </item>
+ <item name="pointerIconVerticalDoubleArrow">
+ @drawable/pointer_vertical_double_arrow_large_icon
+ </item>
+ <item name="pointerIconTopRightDiagonalDoubleArrow">
+ @drawable/pointer_top_right_diagonal_double_arrow_large_icon
+ </item>
+ <item name="pointerIconTopLeftDiagonalDoubleArrow">
+ @drawable/pointer_top_left_diagonal_double_arrow_large_icon
+ </item>
+ <item name="pointerIconZoomIn">@drawable/pointer_zoom_in_large_icon</item>
+ <item name="pointerIconZoomOut">@drawable/pointer_zoom_out_large_icon</item>
+ <item name="pointerIconGrab">@drawable/pointer_grab_large_icon</item>
+ <item name="pointerIconGrabbing">@drawable/pointer_grabbing_large_icon</item>
+ </style>
+
<!-- Wifi dialog styles -->
<!-- @hide -->
<style name="wifi_item">
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index 16c9db1..d92adc2 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -227,7 +227,6 @@
<java-symbol type="attr" name="gestureOverlayViewStyle" />
<java-symbol type="attr" name="keyboardViewStyle" />
<java-symbol type="attr" name="numberPickerStyle" />
- <java-symbol type="attr" name="pointerStyle" />
<java-symbol type="attr" name="preferenceFrameLayoutStyle" />
<java-symbol type="attr" name="searchDialogTheme" />
<java-symbol type="attr" name="textAppearanceAutoCorrectionSuggestion" />
@@ -243,10 +242,8 @@
<java-symbol type="attr" name="isLightTheme"/>
<java-symbol type="bool" name="action_bar_embed_tabs" />
- <java-symbol type="bool" name="action_bar_embed_tabs_pre_jb" />
<java-symbol type="bool" name="action_bar_expanded_action_views_exclusive" />
<java-symbol type="bool" name="config_avoidGfxAccel" />
- <java-symbol type="bool" name="config_allowActionMenuItemTextWithIcon" />
<java-symbol type="bool" name="config_bluetooth_address_validation" />
<java-symbol type="bool" name="config_bluetooth_sco_off_call" />
<java-symbol type="bool" name="config_bluetooth_le_peripheral_mode_supported" />
@@ -1424,6 +1421,8 @@
<java-symbol type="style" name="Theme.DeviceDefault.Dialog.NoFrame" />
<java-symbol type="style" name="Theme.IconMenu" />
<java-symbol type="style" name="Theme.DeviceDefault.VoiceInteractionSession" />
+ <java-symbol type="style" name="Pointer" />
+ <java-symbol type="style" name="LargePointer" />
<java-symbol type="attr" name="mediaRouteButtonStyle" />
<java-symbol type="attr" name="externalRouteEnabledDrawable" />
@@ -2087,6 +2086,11 @@
<java-symbol type="array" name="config_system_condition_providers" />
<java-symbol type="string" name="muted_by" />
<java-symbol type="string" name="zen_mode_alarm" />
+ <java-symbol type="string" name="notification_importance_blocked" />
+ <java-symbol type="string" name="notification_importance_low" />
+ <java-symbol type="string" name="notification_importance_default" />
+ <java-symbol type="string" name="notification_importance_high" />
+ <java-symbol type="string" name="notification_importance_max" />
<java-symbol type="string" name="select_day" />
<java-symbol type="string" name="select_year" />
@@ -2347,6 +2351,8 @@
<java-symbol type="string" name="config_packagedKeyboardName" />
<java-symbol type="string" name="default_notification_topic_label" />
+ <java-symbol type="bool" name="config_forceWindowDrawsStatusBarBackground" />
+ <java-symbol type="color" name="system_bar_background_semi_transparent" />
<!-- EditText suggestion popup. -->
<java-symbol type="id" name="suggestionContainer" />
diff --git a/core/res/res/values/themes.xml b/core/res/res/values/themes.xml
index d56674a..bf7718e 100644
--- a/core/res/res/values/themes.xml
+++ b/core/res/res/values/themes.xml
@@ -428,9 +428,6 @@
<item name="fastScrollOverlayPosition">floating</item>
<item name="fastScrollTextColor">@color/primary_text_dark</item>
- <!-- Pointer style -->
- <item name="pointerStyle">@style/Pointer</item>
-
<!-- Accessibility focused drawable -->
<item name="accessibilityFocusedDrawable">@drawable/view_accessibility_focused</item>
diff --git a/core/tests/coretests/src/android/content/pm/RegisteredServicesCacheTest.java b/core/tests/coretests/src/android/content/pm/RegisteredServicesCacheTest.java
index 32b4557..271c639 100644
--- a/core/tests/coretests/src/android/content/pm/RegisteredServicesCacheTest.java
+++ b/core/tests/coretests/src/android/content/pm/RegisteredServicesCacheTest.java
@@ -188,7 +188,10 @@
private static RegisteredServicesCache.ServiceInfo<TestServiceType> newServiceInfo(
TestServiceType type, int uid) {
- return new RegisteredServicesCache.ServiceInfo<>(type, null, uid);
+ final ComponentInfo info = new ComponentInfo();
+ info.applicationInfo = new ApplicationInfo();
+ info.applicationInfo.uid = uid;
+ return new RegisteredServicesCache.ServiceInfo<>(type, info, null);
}
private void assertNotEmptyFileCreated(TestServicesCache cache, int userId) {
diff --git a/core/tests/coretests/src/com/android/internal/inputmethod/InputMethodUtilsTest.java b/core/tests/coretests/src/com/android/internal/inputmethod/InputMethodUtilsTest.java
index c279c8f..d133a12 100644
--- a/core/tests/coretests/src/com/android/internal/inputmethod/InputMethodUtilsTest.java
+++ b/core/tests/coretests/src/com/android/internal/inputmethod/InputMethodUtilsTest.java
@@ -1191,4 +1191,25 @@
InputMethodUtils.buildInputMethodsAndSubtypesString(map)));
}
}
+
+ @SmallTest
+ public void testConstructLocaleFromString() throws Exception {
+ assertEquals(new Locale("en"), InputMethodUtils.constructLocaleFromString("en"));
+ assertEquals(new Locale("en", "US"), InputMethodUtils.constructLocaleFromString("en_US"));
+ assertEquals(new Locale("en", "US", "POSIX"),
+ InputMethodUtils.constructLocaleFromString("en_US_POSIX"));
+
+ // Special rewrite rule for "tl" for versions of Android earlier than Lollipop that did not
+ // support three letter language codes, and used "tl" (Tagalog) as the language string for
+ // "fil" (Filipino).
+ assertEquals(new Locale("fil"), InputMethodUtils.constructLocaleFromString("tl"));
+ assertEquals(new Locale("fil", "PH"), InputMethodUtils.constructLocaleFromString("tl_PH"));
+ assertEquals(new Locale("fil", "PH", "POSIX"),
+ InputMethodUtils.constructLocaleFromString("tl_PH_POSIX"));
+
+ // So far rejecting an invalid/unexpected locale string is out of the scope of this method.
+ assertEquals(new Locale("a"), InputMethodUtils.constructLocaleFromString("a"));
+ assertEquals(new Locale("a b c"), InputMethodUtils.constructLocaleFromString("a b c"));
+ assertEquals(new Locale("en-US"), InputMethodUtils.constructLocaleFromString("en-US"));
+ }
}
diff --git a/libs/hwui/Android.mk b/libs/hwui/Android.mk
index fc4916c..d98497b 100644
--- a/libs/hwui/Android.mk
+++ b/libs/hwui/Android.mk
@@ -30,7 +30,6 @@
utils/StringUtils.cpp \
utils/TestWindowContext.cpp \
utils/VectorDrawableUtils.cpp \
- utils/TestUtils.cpp \
AmbientShadow.cpp \
AnimationContext.cpp \
Animator.cpp \
@@ -90,6 +89,9 @@
VectorDrawablePath.cpp \
protos/hwui.proto
+hwui_test_common_src_files := \
+ tests/common/TestUtils.cpp
+
hwui_cflags := \
-DEGL_EGLEXT_PROTOTYPES -DGL_GLEXT_PROTOTYPES \
-DATRACE_TAG=ATRACE_TAG_VIEW -DLOG_TAG=\"OpenGLRenderer\" \
@@ -180,8 +182,8 @@
-DHWUI_NULL_GPU
LOCAL_SRC_FILES := \
$(hwui_src_files) \
- tests/nullegl.cpp \
- tests/nullgles.cpp
+ tests/common/nullegl.cpp \
+ tests/common/nullgles.cpp
LOCAL_C_INCLUDES := $(hwui_c_includes) $(call hwui_proto_include)
LOCAL_EXPORT_C_INCLUDE_DIRS := $(hwui_c_includes) $(call hwui_proto_include)
@@ -215,28 +217,29 @@
-DHWUI_NULL_GPU
LOCAL_SRC_FILES += \
- unit_tests/CanvasStateTests.cpp \
- unit_tests/ClipAreaTests.cpp \
- unit_tests/DamageAccumulatorTests.cpp \
- unit_tests/DeviceInfoTests.cpp \
- unit_tests/FatVectorTests.cpp \
- unit_tests/LayerUpdateQueueTests.cpp \
- unit_tests/LinearAllocatorTests.cpp \
- unit_tests/VectorDrawableTests.cpp \
- unit_tests/OffscreenBufferPoolTests.cpp \
- unit_tests/StringUtilsTests.cpp
+ $(hwui_test_common_src_files) \
+ tests/unit/CanvasStateTests.cpp \
+ tests/unit/ClipAreaTests.cpp \
+ tests/unit/DamageAccumulatorTests.cpp \
+ tests/unit/DeviceInfoTests.cpp \
+ tests/unit/FatVectorTests.cpp \
+ tests/unit/LayerUpdateQueueTests.cpp \
+ tests/unit/LinearAllocatorTests.cpp \
+ tests/unit/VectorDrawableTests.cpp \
+ tests/unit/OffscreenBufferPoolTests.cpp \
+ tests/unit/StringUtilsTests.cpp
ifeq (true, $(HWUI_NEW_OPS))
LOCAL_SRC_FILES += \
- unit_tests/BakedOpStateTests.cpp \
- unit_tests/RecordingCanvasTests.cpp \
- unit_tests/OpReordererTests.cpp
+ tests/unit/BakedOpStateTests.cpp \
+ tests/unit/RecordingCanvasTests.cpp \
+ tests/unit/OpReordererTests.cpp
endif
include $(BUILD_NATIVE_TEST)
# ------------------------
-# test app
+# Macro-bench app
# ------------------------
include $(CLEAR_VARS)
@@ -255,11 +258,12 @@
LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static
LOCAL_SRC_FILES += \
- tests/TestContext.cpp \
- tests/TestSceneRunner.cpp \
- tests/main.cpp
+ $(hwui_test_common_src_files) \
+ tests/macrobench/TestContext.cpp \
+ tests/macrobench/TestSceneRunner.cpp \
+ tests/macrobench/main.cpp
-LOCAL_SRC_FILES += $(call all-cpp-files-under, tests/scenes)
+LOCAL_SRC_FILES += $(call all-cpp-files-under, tests/common/scenes)
include $(BUILD_EXECUTABLE)
@@ -285,14 +289,15 @@
LOCAL_STATIC_LIBRARIES := libbenchmark libbase
LOCAL_SRC_FILES += \
- microbench/DisplayListCanvasBench.cpp \
- microbench/LinearAllocatorBench.cpp \
- microbench/PathParserBench.cpp \
- microbench/ShadowBench.cpp
+ $(hwui_test_common_src_files) \
+ tests/microbench/DisplayListCanvasBench.cpp \
+ tests/microbench/LinearAllocatorBench.cpp \
+ tests/microbench/PathParserBench.cpp \
+ tests/microbench/ShadowBench.cpp
ifeq (true, $(HWUI_NEW_OPS))
LOCAL_SRC_FILES += \
- microbench/OpReordererBench.cpp
+ tests/microbench/OpReordererBench.cpp
endif
include $(BUILD_EXECUTABLE)
diff --git a/libs/hwui/TextDropShadowCache.cpp b/libs/hwui/TextDropShadowCache.cpp
index 996ac8e..51f1652 100644
--- a/libs/hwui/TextDropShadowCache.cpp
+++ b/libs/hwui/TextDropShadowCache.cpp
@@ -83,7 +83,7 @@
if (!lhs.positions) return -1;
if (!rhs.positions) return +1;
- return memcmp(lhs.positions, rhs.positions, lhs.glyphCount << 1);
+ return memcmp(lhs.positions, rhs.positions, lhs.glyphCount * sizeof(float) * 2);
}
return 0;
@@ -169,7 +169,7 @@
ShadowTexture* TextDropShadowCache::get(const SkPaint* paint, const char* glyphs, int numGlyphs,
float radius, const float* positions) {
- ShadowText entry(paint, radius, numGlyphs * 2, glyphs, positions);
+ ShadowText entry(paint, radius, numGlyphs, glyphs, positions);
ShadowTexture* texture = mCache.get(entry);
if (!texture) {
diff --git a/libs/hwui/tests/TestScene.h b/libs/hwui/tests/common/TestScene.h
similarity index 100%
rename from libs/hwui/tests/TestScene.h
rename to libs/hwui/tests/common/TestScene.h
diff --git a/libs/hwui/utils/TestUtils.cpp b/libs/hwui/tests/common/TestUtils.cpp
similarity index 100%
rename from libs/hwui/utils/TestUtils.cpp
rename to libs/hwui/tests/common/TestUtils.cpp
diff --git a/libs/hwui/utils/TestUtils.h b/libs/hwui/tests/common/TestUtils.h
similarity index 100%
rename from libs/hwui/utils/TestUtils.h
rename to libs/hwui/tests/common/TestUtils.h
diff --git a/libs/hwui/tests/nullegl.cpp b/libs/hwui/tests/common/nullegl.cpp
similarity index 100%
rename from libs/hwui/tests/nullegl.cpp
rename to libs/hwui/tests/common/nullegl.cpp
diff --git a/libs/hwui/tests/nullgles.cpp b/libs/hwui/tests/common/nullgles.cpp
similarity index 100%
rename from libs/hwui/tests/nullgles.cpp
rename to libs/hwui/tests/common/nullgles.cpp
diff --git a/libs/hwui/tests/scenes/HwLayerAnimation.cpp b/libs/hwui/tests/common/scenes/HwLayerAnimation.cpp
similarity index 100%
rename from libs/hwui/tests/scenes/HwLayerAnimation.cpp
rename to libs/hwui/tests/common/scenes/HwLayerAnimation.cpp
diff --git a/libs/hwui/tests/scenes/ListViewAnimation.cpp b/libs/hwui/tests/common/scenes/ListViewAnimation.cpp
similarity index 100%
rename from libs/hwui/tests/scenes/ListViewAnimation.cpp
rename to libs/hwui/tests/common/scenes/ListViewAnimation.cpp
diff --git a/libs/hwui/tests/scenes/OvalAnimation.cpp b/libs/hwui/tests/common/scenes/OvalAnimation.cpp
similarity index 100%
rename from libs/hwui/tests/scenes/OvalAnimation.cpp
rename to libs/hwui/tests/common/scenes/OvalAnimation.cpp
diff --git a/libs/hwui/tests/scenes/PartialDamageAnimation.cpp b/libs/hwui/tests/common/scenes/PartialDamageAnimation.cpp
similarity index 100%
rename from libs/hwui/tests/scenes/PartialDamageAnimation.cpp
rename to libs/hwui/tests/common/scenes/PartialDamageAnimation.cpp
diff --git a/libs/hwui/tests/scenes/RecentsAnimation.cpp b/libs/hwui/tests/common/scenes/RecentsAnimation.cpp
similarity index 100%
rename from libs/hwui/tests/scenes/RecentsAnimation.cpp
rename to libs/hwui/tests/common/scenes/RecentsAnimation.cpp
diff --git a/libs/hwui/tests/scenes/RectGridAnimation.cpp b/libs/hwui/tests/common/scenes/RectGridAnimation.cpp
similarity index 100%
rename from libs/hwui/tests/scenes/RectGridAnimation.cpp
rename to libs/hwui/tests/common/scenes/RectGridAnimation.cpp
diff --git a/libs/hwui/tests/scenes/SaveLayerAnimation.cpp b/libs/hwui/tests/common/scenes/SaveLayerAnimation.cpp
similarity index 100%
rename from libs/hwui/tests/scenes/SaveLayerAnimation.cpp
rename to libs/hwui/tests/common/scenes/SaveLayerAnimation.cpp
diff --git a/libs/hwui/tests/scenes/ShadowGrid2Animation.cpp b/libs/hwui/tests/common/scenes/ShadowGrid2Animation.cpp
similarity index 100%
rename from libs/hwui/tests/scenes/ShadowGrid2Animation.cpp
rename to libs/hwui/tests/common/scenes/ShadowGrid2Animation.cpp
diff --git a/libs/hwui/tests/scenes/ShadowGridAnimation.cpp b/libs/hwui/tests/common/scenes/ShadowGridAnimation.cpp
similarity index 100%
rename from libs/hwui/tests/scenes/ShadowGridAnimation.cpp
rename to libs/hwui/tests/common/scenes/ShadowGridAnimation.cpp
diff --git a/libs/hwui/tests/scenes/TestSceneBase.h b/libs/hwui/tests/common/scenes/TestSceneBase.h
similarity index 86%
rename from libs/hwui/tests/scenes/TestSceneBase.h
rename to libs/hwui/tests/common/scenes/TestSceneBase.h
index a208509..8a24149 100644
--- a/libs/hwui/tests/scenes/TestSceneBase.h
+++ b/libs/hwui/tests/common/scenes/TestSceneBase.h
@@ -19,10 +19,10 @@
#include "DisplayListCanvas.h"
#include "RecordingCanvas.h"
#include "RenderNode.h"
-#include "tests/Benchmark.h"
-#include "tests/TestContext.h"
-#include "tests/TestScene.h"
-#include "utils/TestUtils.h"
+#include "tests/macrobench/Benchmark.h"
+#include "tests/macrobench/TestContext.h"
+#include "tests/common/TestScene.h"
+#include "tests/common/TestUtils.h"
#include <functional>
diff --git a/libs/hwui/tests/Benchmark.h b/libs/hwui/tests/macrobench/Benchmark.h
similarity index 97%
rename from libs/hwui/tests/Benchmark.h
rename to libs/hwui/tests/macrobench/Benchmark.h
index 3f87d7f..aad8eb3 100644
--- a/libs/hwui/tests/Benchmark.h
+++ b/libs/hwui/tests/macrobench/Benchmark.h
@@ -16,7 +16,7 @@
#ifndef TESTS_BENCHMARK_H
#define TESTS_BENCHMARK_H
-#include "TestScene.h"
+#include "tests/common/TestScene.h"
#include <string>
#include <vector>
diff --git a/libs/hwui/tests/TestContext.cpp b/libs/hwui/tests/macrobench/TestContext.cpp
similarity index 100%
rename from libs/hwui/tests/TestContext.cpp
rename to libs/hwui/tests/macrobench/TestContext.cpp
diff --git a/libs/hwui/tests/TestContext.h b/libs/hwui/tests/macrobench/TestContext.h
similarity index 100%
rename from libs/hwui/tests/TestContext.h
rename to libs/hwui/tests/macrobench/TestContext.h
diff --git a/libs/hwui/tests/TestSceneRunner.cpp b/libs/hwui/tests/macrobench/TestSceneRunner.cpp
similarity index 98%
rename from libs/hwui/tests/TestSceneRunner.cpp
rename to libs/hwui/tests/macrobench/TestSceneRunner.cpp
index 0376e10..1e1c6a1 100644
--- a/libs/hwui/tests/TestSceneRunner.cpp
+++ b/libs/hwui/tests/macrobench/TestSceneRunner.cpp
@@ -18,7 +18,7 @@
#include "Benchmark.h"
#include "RenderNode.h"
#include "TestContext.h"
-#include "scenes/TestSceneBase.h"
+#include "tests/common/scenes/TestSceneBase.h"
#include "renderthread/RenderProxy.h"
#include "renderthread/RenderTask.h"
diff --git a/libs/hwui/tests/how_to_run.txt b/libs/hwui/tests/macrobench/how_to_run.txt
similarity index 100%
rename from libs/hwui/tests/how_to_run.txt
rename to libs/hwui/tests/macrobench/how_to_run.txt
diff --git a/libs/hwui/tests/main.cpp b/libs/hwui/tests/macrobench/main.cpp
similarity index 100%
rename from libs/hwui/tests/main.cpp
rename to libs/hwui/tests/macrobench/main.cpp
diff --git a/libs/hwui/microbench/DisplayListCanvasBench.cpp b/libs/hwui/tests/microbench/DisplayListCanvasBench.cpp
similarity index 98%
rename from libs/hwui/microbench/DisplayListCanvasBench.cpp
rename to libs/hwui/tests/microbench/DisplayListCanvasBench.cpp
index 4be1f99..2e59eb4 100644
--- a/libs/hwui/microbench/DisplayListCanvasBench.cpp
+++ b/libs/hwui/tests/microbench/DisplayListCanvasBench.cpp
@@ -22,8 +22,8 @@
#else
#include "DisplayListCanvas.h"
#endif
-#include "microbench/MicroBench.h"
-#include "utils/TestUtils.h"
+#include "tests/common/TestUtils.h"
+#include "tests/microbench/MicroBench.h"
using namespace android;
using namespace android::uirenderer;
diff --git a/libs/hwui/microbench/LinearAllocatorBench.cpp b/libs/hwui/tests/microbench/LinearAllocatorBench.cpp
similarity index 97%
rename from libs/hwui/microbench/LinearAllocatorBench.cpp
rename to libs/hwui/tests/microbench/LinearAllocatorBench.cpp
index 75f57cb..28513e4 100644
--- a/libs/hwui/microbench/LinearAllocatorBench.cpp
+++ b/libs/hwui/tests/microbench/LinearAllocatorBench.cpp
@@ -16,8 +16,8 @@
#include <benchmark/Benchmark.h>
+#include "tests/microbench/MicroBench.h"
#include "utils/LinearAllocator.h"
-#include "microbench/MicroBench.h"
#include <vector>
diff --git a/libs/hwui/microbench/MicroBench.h b/libs/hwui/tests/microbench/MicroBench.h
similarity index 100%
rename from libs/hwui/microbench/MicroBench.h
rename to libs/hwui/tests/microbench/MicroBench.h
diff --git a/libs/hwui/microbench/OpReordererBench.cpp b/libs/hwui/tests/microbench/OpReordererBench.cpp
similarity index 98%
rename from libs/hwui/microbench/OpReordererBench.cpp
rename to libs/hwui/tests/microbench/OpReordererBench.cpp
index 53b64c3..406bfcc 100644
--- a/libs/hwui/microbench/OpReordererBench.cpp
+++ b/libs/hwui/tests/microbench/OpReordererBench.cpp
@@ -23,7 +23,7 @@
#include "OpReorderer.h"
#include "RecordedOp.h"
#include "RecordingCanvas.h"
-#include "utils/TestUtils.h"
+#include "tests/common/TestUtils.h"
#include "Vector.h"
#include "microbench/MicroBench.h"
diff --git a/libs/hwui/microbench/PathParserBench.cpp b/libs/hwui/tests/microbench/PathParserBench.cpp
similarity index 100%
rename from libs/hwui/microbench/PathParserBench.cpp
rename to libs/hwui/tests/microbench/PathParserBench.cpp
diff --git a/libs/hwui/microbench/ShadowBench.cpp b/libs/hwui/tests/microbench/ShadowBench.cpp
similarity index 98%
rename from libs/hwui/microbench/ShadowBench.cpp
rename to libs/hwui/tests/microbench/ShadowBench.cpp
index 1b0f5ea..98ec4d9 100644
--- a/libs/hwui/microbench/ShadowBench.cpp
+++ b/libs/hwui/tests/microbench/ShadowBench.cpp
@@ -21,7 +21,7 @@
#include "Vector.h"
#include "VertexBuffer.h"
#include "TessellationCache.h"
-#include "microbench/MicroBench.h"
+#include "tests/microbench/MicroBench.h"
#include <SkPath.h>
diff --git a/libs/hwui/microbench/how_to_run.txt b/libs/hwui/tests/microbench/how_to_run.txt
similarity index 100%
rename from libs/hwui/microbench/how_to_run.txt
rename to libs/hwui/tests/microbench/how_to_run.txt
diff --git a/libs/hwui/unit_tests/BakedOpStateTests.cpp b/libs/hwui/tests/unit/BakedOpStateTests.cpp
similarity index 98%
rename from libs/hwui/unit_tests/BakedOpStateTests.cpp
rename to libs/hwui/tests/unit/BakedOpStateTests.cpp
index 7ad2f9b..de14abf 100644
--- a/libs/hwui/unit_tests/BakedOpStateTests.cpp
+++ b/libs/hwui/tests/unit/BakedOpStateTests.cpp
@@ -18,7 +18,7 @@
#include <BakedOpState.h>
#include <RecordedOp.h>
-#include <utils/TestUtils.h>
+#include <tests/common/TestUtils.h>
namespace android {
namespace uirenderer {
diff --git a/libs/hwui/unit_tests/CanvasStateTests.cpp b/libs/hwui/tests/unit/CanvasStateTests.cpp
similarity index 100%
rename from libs/hwui/unit_tests/CanvasStateTests.cpp
rename to libs/hwui/tests/unit/CanvasStateTests.cpp
diff --git a/libs/hwui/unit_tests/ClipAreaTests.cpp b/libs/hwui/tests/unit/ClipAreaTests.cpp
similarity index 100%
rename from libs/hwui/unit_tests/ClipAreaTests.cpp
rename to libs/hwui/tests/unit/ClipAreaTests.cpp
diff --git a/libs/hwui/unit_tests/DamageAccumulatorTests.cpp b/libs/hwui/tests/unit/DamageAccumulatorTests.cpp
similarity index 100%
rename from libs/hwui/unit_tests/DamageAccumulatorTests.cpp
rename to libs/hwui/tests/unit/DamageAccumulatorTests.cpp
diff --git a/libs/hwui/unit_tests/DeviceInfoTests.cpp b/libs/hwui/tests/unit/DeviceInfoTests.cpp
similarity index 100%
rename from libs/hwui/unit_tests/DeviceInfoTests.cpp
rename to libs/hwui/tests/unit/DeviceInfoTests.cpp
diff --git a/libs/hwui/unit_tests/FatVectorTests.cpp b/libs/hwui/tests/unit/FatVectorTests.cpp
similarity index 98%
rename from libs/hwui/unit_tests/FatVectorTests.cpp
rename to libs/hwui/tests/unit/FatVectorTests.cpp
index c6ccf4d..64b0ba1 100644
--- a/libs/hwui/unit_tests/FatVectorTests.cpp
+++ b/libs/hwui/tests/unit/FatVectorTests.cpp
@@ -17,7 +17,7 @@
#include <gtest/gtest.h>
#include <utils/FatVector.h>
-#include <utils/TestUtils.h>
+#include <tests/common/TestUtils.h>
using namespace android;
using namespace android::uirenderer;
diff --git a/libs/hwui/unit_tests/LayerUpdateQueueTests.cpp b/libs/hwui/tests/unit/LayerUpdateQueueTests.cpp
similarity index 98%
rename from libs/hwui/unit_tests/LayerUpdateQueueTests.cpp
rename to libs/hwui/tests/unit/LayerUpdateQueueTests.cpp
index cc15cc6..8b0e91c 100644
--- a/libs/hwui/unit_tests/LayerUpdateQueueTests.cpp
+++ b/libs/hwui/tests/unit/LayerUpdateQueueTests.cpp
@@ -19,7 +19,7 @@
#include <LayerUpdateQueue.h>
#include <RenderNode.h>
-#include <utils/TestUtils.h>
+#include <tests/common/TestUtils.h>
namespace android {
namespace uirenderer {
diff --git a/libs/hwui/unit_tests/LinearAllocatorTests.cpp b/libs/hwui/tests/unit/LinearAllocatorTests.cpp
similarity index 98%
rename from libs/hwui/unit_tests/LinearAllocatorTests.cpp
rename to libs/hwui/tests/unit/LinearAllocatorTests.cpp
index 0591db6..78d65dd 100644
--- a/libs/hwui/unit_tests/LinearAllocatorTests.cpp
+++ b/libs/hwui/tests/unit/LinearAllocatorTests.cpp
@@ -17,7 +17,7 @@
#include <gtest/gtest.h>
#include <utils/LinearAllocator.h>
-#include <utils/TestUtils.h>
+#include <tests/common/TestUtils.h>
using namespace android;
using namespace android::uirenderer;
diff --git a/libs/hwui/unit_tests/OffscreenBufferPoolTests.cpp b/libs/hwui/tests/unit/OffscreenBufferPoolTests.cpp
similarity index 98%
rename from libs/hwui/unit_tests/OffscreenBufferPoolTests.cpp
rename to libs/hwui/tests/unit/OffscreenBufferPoolTests.cpp
index de86aed..2187654 100644
--- a/libs/hwui/unit_tests/OffscreenBufferPoolTests.cpp
+++ b/libs/hwui/tests/unit/OffscreenBufferPoolTests.cpp
@@ -17,7 +17,7 @@
#include <gtest/gtest.h>
#include <renderstate/OffscreenBufferPool.h>
-#include <utils/TestUtils.h>
+#include <tests/common/TestUtils.h>
using namespace android;
using namespace android::uirenderer;
diff --git a/libs/hwui/unit_tests/OpReordererTests.cpp b/libs/hwui/tests/unit/OpReordererTests.cpp
similarity index 99%
rename from libs/hwui/unit_tests/OpReordererTests.cpp
rename to libs/hwui/tests/unit/OpReordererTests.cpp
index 2ce1d0a..98a430a 100644
--- a/libs/hwui/unit_tests/OpReordererTests.cpp
+++ b/libs/hwui/tests/unit/OpReordererTests.cpp
@@ -21,7 +21,7 @@
#include <OpReorderer.h>
#include <RecordedOp.h>
#include <RecordingCanvas.h>
-#include <utils/TestUtils.h>
+#include <tests/common/TestUtils.h>
#include <unordered_map>
diff --git a/libs/hwui/unit_tests/RecordingCanvasTests.cpp b/libs/hwui/tests/unit/RecordingCanvasTests.cpp
similarity index 99%
rename from libs/hwui/unit_tests/RecordingCanvasTests.cpp
rename to libs/hwui/tests/unit/RecordingCanvasTests.cpp
index 81f0851..2449ce8 100644
--- a/libs/hwui/unit_tests/RecordingCanvasTests.cpp
+++ b/libs/hwui/tests/unit/RecordingCanvasTests.cpp
@@ -18,7 +18,7 @@
#include <RecordedOp.h>
#include <RecordingCanvas.h>
-#include <utils/TestUtils.h>
+#include <tests/common/TestUtils.h>
namespace android {
namespace uirenderer {
diff --git a/libs/hwui/unit_tests/StringUtilsTests.cpp b/libs/hwui/tests/unit/StringUtilsTests.cpp
similarity index 100%
rename from libs/hwui/unit_tests/StringUtilsTests.cpp
rename to libs/hwui/tests/unit/StringUtilsTests.cpp
diff --git a/libs/hwui/unit_tests/VectorDrawableTests.cpp b/libs/hwui/tests/unit/VectorDrawableTests.cpp
similarity index 100%
rename from libs/hwui/unit_tests/VectorDrawableTests.cpp
rename to libs/hwui/tests/unit/VectorDrawableTests.cpp
diff --git a/libs/hwui/unit_tests/how_to_run.txt b/libs/hwui/tests/unit/how_to_run.txt
similarity index 100%
rename from libs/hwui/unit_tests/how_to_run.txt
rename to libs/hwui/tests/unit/how_to_run.txt
diff --git a/libs/input/PointerController.cpp b/libs/input/PointerController.cpp
index bd6af78..6a1167a 100644
--- a/libs/input/PointerController.cpp
+++ b/libs/input/PointerController.cpp
@@ -91,7 +91,14 @@
mLocked.buttonState = 0;
+ mPolicy->loadPointerIcon(&mLocked.pointerIcon);
+
loadResources();
+
+ if (mLocked.pointerIcon.isValid()) {
+ mLocked.pointerIconChanged = true;
+ updatePointerLocked();
+ }
}
PointerController::~PointerController() {
@@ -325,6 +332,23 @@
}
}
+void PointerController::reloadPointerResources() {
+ AutoMutex _l(mLock);
+
+ loadResources();
+
+ if (mLocked.presentation == PRESENTATION_POINTER) {
+ mLocked.additionalMouseResources.clear();
+ mLocked.animationResources.clear();
+ mPolicy->loadPointerIcon(&mLocked.pointerIcon);
+ mPolicy->loadAdditionalMouseResources(&mLocked.additionalMouseResources,
+ &mLocked.animationResources);
+ }
+
+ mLocked.presentationChanged = true;
+ updatePointerLocked();
+}
+
void PointerController::setDisplayViewport(int32_t width, int32_t height, int32_t orientation) {
AutoMutex _l(mLock);
@@ -415,15 +439,6 @@
}
}
-void PointerController::setPointerIcon(const SpriteIcon& icon) {
- AutoMutex _l(mLock);
-
- mLocked.pointerIcon = icon.copy();
- mLocked.pointerIconChanged = true;
-
- updatePointerLocked();
-}
-
void PointerController::handleMessage(const Message& message) {
switch (message.what) {
case MSG_INACTIVITY_TIMEOUT:
diff --git a/libs/input/PointerController.h b/libs/input/PointerController.h
index b6c01d2..4fd2d85 100644
--- a/libs/input/PointerController.h
+++ b/libs/input/PointerController.h
@@ -62,6 +62,7 @@
virtual ~PointerControllerPolicyInterface() { }
public:
+ virtual void loadPointerIcon(SpriteIcon* icon) = 0;
virtual void loadPointerResources(PointerResources* outResources) = 0;
virtual void loadAdditionalMouseResources(std::map<int32_t, SpriteIcon>* outResources,
std::map<int32_t, PointerAnimation>* outAnimationResources) = 0;
@@ -105,8 +106,8 @@
void updatePointerShape(int32_t iconId);
void setDisplayViewport(int32_t width, int32_t height, int32_t orientation);
- void setPointerIcon(const SpriteIcon& icon);
void setInactivityTimeout(InactivityTimeout inactivityTimeout);
+ void reloadPointerResources();
private:
static const size_t MAX_RECYCLED_SPRITES = 12;
diff --git a/media/java/android/media/MediaMetadataEditor.java b/media/java/android/media/MediaMetadataEditor.java
index 566b93f..877c872 100644
--- a/media/java/android/media/MediaMetadataEditor.java
+++ b/media/java/android/media/MediaMetadataEditor.java
@@ -73,7 +73,8 @@
/**
* Applies all of the metadata changes that have been set since the MediaMetadataEditor instance
- * was created or since {@link #clear()} was called.
+ * was created or since {@link #clear()} was called. Subclasses should synchronize on
+ * {@code this} for thread safety.
*/
public abstract void apply();
diff --git a/packages/DocumentsUI/res/values/config.xml b/packages/DocumentsUI/res/values/config.xml
index ad419aa..ff28e15 100644
--- a/packages/DocumentsUI/res/values/config.xml
+++ b/packages/DocumentsUI/res/values/config.xml
@@ -15,6 +15,9 @@
-->
<resources>
+ <!-- Allow Advanced Devices default value to be customised -->
+ <bool name="config_defaultAdvancedDevices">false</bool>
+
<bool name="productivity_device">true</bool>
<!-- Intentionally unset. Vendors should set this in an overlay. -->
<string name="trusted_quick_viewer_package"></string>
diff --git a/packages/DocumentsUI/src/com/android/documentsui/LocalPreferences.java b/packages/DocumentsUI/src/com/android/documentsui/LocalPreferences.java
index e6c5ae2..113e9d7 100644
--- a/packages/DocumentsUI/src/com/android/documentsui/LocalPreferences.java
+++ b/packages/DocumentsUI/src/com/android/documentsui/LocalPreferences.java
@@ -24,8 +24,10 @@
private static final String KEY_FILE_SIZE = "fileSize";
public static boolean getDisplayAdvancedDevices(Context context) {
+ boolean defaultAdvanced = context.getResources()
+ .getBoolean(R.bool.config_defaultAdvancedDevices);
return PreferenceManager.getDefaultSharedPreferences(context)
- .getBoolean(KEY_ADVANCED_DEVICES, false);
+ .getBoolean(KEY_ADVANCED_DEVICES, defaultAdvanced);
}
public static boolean getDisplayFileSize(Context context) {
diff --git a/packages/DocumentsUI/tests/src/com/android/documentsui/dirlist/MultiSelectManager_SelectionTest.java b/packages/DocumentsUI/tests/src/com/android/documentsui/dirlist/MultiSelectManager_SelectionTest.java
index 72fc108..030ac6c 100644
--- a/packages/DocumentsUI/tests/src/com/android/documentsui/dirlist/MultiSelectManager_SelectionTest.java
+++ b/packages/DocumentsUI/tests/src/com/android/documentsui/dirlist/MultiSelectManager_SelectionTest.java
@@ -22,7 +22,7 @@
import com.android.documentsui.dirlist.MultiSelectManager.Selection;
@SmallTest
-public class MultiSelectManager_SelectionTest extends AndroidTestCase{
+public class MultiSelectManager_SelectionTest extends AndroidTestCase {
private Selection selection;
diff --git a/packages/MtpDocumentsProvider/tests/src/com/android/mtp/MtpManagerTest.java b/packages/MtpDocumentsProvider/tests/src/com/android/mtp/MtpManagerTest.java
index a045d06..ed617e7 100644
--- a/packages/MtpDocumentsProvider/tests/src/com/android/mtp/MtpManagerTest.java
+++ b/packages/MtpDocumentsProvider/tests/src/com/android/mtp/MtpManagerTest.java
@@ -24,6 +24,9 @@
import android.test.InstrumentationTestCase;
import java.io.IOException;
+import java.util.concurrent.Callable;
+import java.util.concurrent.FutureTask;
+import java.util.concurrent.TimeUnit;
@RealDeviceTest
public class MtpManagerTest extends InstrumentationTestCase {
@@ -53,20 +56,23 @@
public void testCancelEvent() throws Exception {
final CancellationSignal signal = new CancellationSignal();
- final Thread thread = new Thread() {
- @Override
- public void run() {
- try {
- mManager.readEvent(mUsbDevice.getDeviceId(), signal);
- } catch (OperationCanceledException | IOException e) {
- getInstrumentation().show(e.getMessage());
- }
- }
- };
+ final FutureTask<Boolean> future = new FutureTask<Boolean>(
+ new Callable<Boolean>() {
+ @Override
+ public Boolean call() throws IOException {
+ try {
+ mManager.readEvent(mUsbDevice.getDeviceId(), signal);
+ return false;
+ } catch (OperationCanceledException exception) {
+ return true;
+ }
+ }
+ });
+ final Thread thread = new Thread(future);
thread.start();
Thread.sleep(TIMEOUT_MS);
signal.cancel();
- thread.join(TIMEOUT_MS);
+ assertTrue(future.get(TIMEOUT_MS, TimeUnit.MILLISECONDS));
}
private Context getContext() {
diff --git a/packages/MtpDocumentsProvider/tests/src/com/android/mtp/TestResultInstrumentation.java b/packages/MtpDocumentsProvider/tests/src/com/android/mtp/TestResultInstrumentation.java
index 3e64f9a2..4e4cf78 100644
--- a/packages/MtpDocumentsProvider/tests/src/com/android/mtp/TestResultInstrumentation.java
+++ b/packages/MtpDocumentsProvider/tests/src/com/android/mtp/TestResultInstrumentation.java
@@ -23,6 +23,10 @@
import junit.framework.Test;
import junit.framework.TestListener;
+/**
+ * Instrumentation that can show the test result in the TestResultActivity.
+ * It's useful when it runs testcases with a real USB device and could not use USB port for ADB.
+ */
public class TestResultInstrumentation extends InstrumentationTestRunner implements TestListener {
private boolean mHasError = false;
diff --git a/packages/MtpDocumentsProvider/tests/src/com/android/mtp/TestUtil.java b/packages/MtpDocumentsProvider/tests/src/com/android/mtp/TestUtil.java
index e6c12cb..f910321 100644
--- a/packages/MtpDocumentsProvider/tests/src/com/android/mtp/TestUtil.java
+++ b/packages/MtpDocumentsProvider/tests/src/com/android/mtp/TestUtil.java
@@ -33,7 +33,7 @@
/**
* Static utility methods for testing.
*/
-class TestUtil {
+final class TestUtil {
private static final String ACTION_USB_PERMISSION =
"com.android.mtp.USB_PERMISSION";
@@ -42,12 +42,11 @@
/**
* Requests permission for a MTP device and returns the first MTP device that has at least one
* storage.
- * @throws Exception
*/
static UsbDevice setupMtpDevice(
TestResultInstrumentation instrumentation,
UsbManager usbManager,
- MtpManager manager) throws Exception {
+ MtpManager manager) throws InterruptedException, IOException {
for (int i = 0; i < 2; i++) {
final UsbDevice device = findMtpDevice(instrumentation, usbManager);
manager.openDevice(device.getDeviceId());
@@ -121,7 +120,7 @@
private static void waitForStorages(
TestResultInstrumentation instrumentation,
MtpManager manager,
- int deviceId) throws Exception {
+ int deviceId) throws IOException, InterruptedException {
while (true) {
if (manager.getRoots(deviceId).length == 0) {
instrumentation.show("Wait for storages.");
diff --git a/packages/SettingsLib/res/values/arrays.xml b/packages/SettingsLib/res/values/arrays.xml
index a52ed69..4e88c1c 100644
--- a/packages/SettingsLib/res/values/arrays.xml
+++ b/packages/SettingsLib/res/values/arrays.xml
@@ -78,4 +78,306 @@
<!-- Status message of Wi-Fi when connectiong is being verified. -->
<item>Temporarily avoiding poor connection</item>
</string-array>
+
+ <!-- Titles for HDCP checking preference. [CHAR LIMIT=35] -->
+ <string-array name="hdcp_checking_titles">
+ <item>Never check</item>
+ <item>Check for DRM content only</item>
+ <item>Always check</item>
+ </string-array>
+
+ <!-- Values for HDCP checking preference. -->
+ <string-array name="hdcp_checking_values" translatable="false" >
+ <item>never</item>
+ <item>drm-only</item>
+ <item>always</item>
+ </string-array>
+
+ <!-- Summaries for HDCP checking preference. [CHAR LIMIT=100]-->
+ <string-array name="hdcp_checking_summaries" >
+ <item>Never use HDCP checking</item>
+ <item>Use HDCP checking for DRM content only</item>
+ <item>Always use HDCP checking</item>
+ </string-array>
+
+ <!-- Titles for logd limit size selection preference. [CHAR LIMIT=14] -->
+ <string-array name="select_logd_size_titles">
+ <item>64K</item>
+ <item>256K</item>
+ <item>1M</item>
+ <item>4M</item>
+ <item>16M</item>
+ </string-array>
+
+ <!-- Titles for logd limit size lowram selection preference. [CHAR LIMIT=14] -->
+ <string-array name="select_logd_size_lowram_titles">
+ <item>64K</item>
+ <item>256K</item>
+ <item>1M</item>
+ </string-array>
+
+ <!-- Values for logd limit size selection preference. -->
+ <string-array name="select_logd_size_values" translatable="false" >
+ <item>65536</item>
+ <item>262144</item>
+ <item>1048576</item>
+ <item>4194304</item>
+ <item>16777216</item>
+ </string-array>
+
+ <!-- Summaries for logd limit size selection preference. [CHAR LIMIT=30]-->
+ <string-array name="select_logd_size_summaries" >
+ <item>64K per log buffer</item>
+ <item>256K per log buffer</item>
+ <item>1M per log buffer</item>
+ <item>4M per log buffer</item>
+ <item>16M per log buffer</item>
+ </string-array>
+
+ <!-- Titles for window animation scale preference. [CHAR LIMIT=35] -->
+ <string-array name="window_animation_scale_entries">
+ <item>Animation off</item>
+ <item>Animation scale .5x</item>
+ <item>Animation scale 1x</item>
+ <item>Animation scale 1.5x</item>
+ <item>Animation scale 2x</item>
+ <item>Animation scale 5x</item>
+ <item>Animation scale 10x</item>
+ </string-array>
+
+ <!-- Values for window animation scale preference. -->
+ <string-array name="window_animation_scale_values" translatable="false" >
+ <item>0</item>
+ <item>.5</item>
+ <item>1</item>
+ <item>1.5</item>
+ <item>2</item>
+ <item>5</item>
+ <item>10</item>
+ </string-array>
+
+ <!-- Titles for transition animation scale preference. [CHAR LIMIT=35] -->
+ <string-array name="transition_animation_scale_entries">
+ <item>Animation off</item>
+ <item>Animation scale .5x</item>
+ <item>Animation scale 1x</item>
+ <item>Animation scale 1.5x</item>
+ <item>Animation scale 2x</item>
+ <item>Animation scale 5x</item>
+ <item>Animation scale 10x</item>
+ </string-array>
+
+ <!-- Values for transition animation scale preference. -->
+ <string-array name="transition_animation_scale_values" translatable="false" >
+ <item>0</item>
+ <item>.5</item>
+ <item>1</item>
+ <item>1.5</item>
+ <item>2</item>
+ <item>5</item>
+ <item>10</item>
+ </string-array>
+
+ <!-- Titles for animator duration scale preference. [CHAR LIMIT=35] -->
+ <string-array name="animator_duration_scale_entries">
+ <item>Animation off</item>
+ <item>Animation scale .5x</item>
+ <item>Animation scale 1x</item>
+ <item>Animation scale 1.5x</item>
+ <item>Animation scale 2x</item>
+ <item>Animation scale 5x</item>
+ <item>Animation scale 10x</item>
+ </string-array>
+
+ <!-- Values for animator duration scale preference. -->
+ <string-array name="animator_duration_scale_values" translatable="false" >
+ <item>0</item>
+ <item>.5</item>
+ <item>1</item>
+ <item>1.5</item>
+ <item>2</item>
+ <item>5</item>
+ <item>10</item>
+ </string-array>
+
+ <!-- Titles for overlay display devices preference. [CHAR LIMIT=35] -->
+ <string-array name="overlay_display_devices_entries">
+ <item>None</item>
+ <item>480p</item>
+ <item>480p (secure)</item>
+ <item>720p</item>
+ <item>720p (secure)</item>
+ <item>1080p</item>
+ <item>1080p (secure)</item>
+ <item>4K</item>
+ <item>4K (secure)</item>
+ <item>4K (upscaled)</item>
+ <item>4K (upscaled, secure)</item>
+ <item>720p, 1080p (dual screen)</item>
+ </string-array>
+
+ <!-- Values for overlay display devices preference. -->
+ <string-array name="overlay_display_devices_values" translatable="false" >
+ <item></item>
+ <item>720x480/142</item>
+ <item>720x480/142,secure</item>
+ <item>1280x720/213</item>
+ <item>1280x720/213,secure</item>
+ <item>1920x1080/320</item>
+ <item>1920x1080/320,secure</item>
+ <item>3840x2160/320</item>
+ <item>3840x2160/320,secure</item>
+ <item>1920x1080/320|3840x2160/640</item>
+ <item>1920x1080/320|3840x2160/640,secure</item>
+ <item>1280x720/213;1920x1080/320</item>
+ </string-array>
+
+ <!-- Titles for OpenGL traces preference. [CHAR LIMIT=35] -->
+ <string-array name="enable_opengl_traces_entries">
+ <item>None</item>
+ <item>Logcat</item>
+ <item>Systrace (Graphics)</item>
+ <item>Call stack on glGetError</item>
+ </string-array>
+
+ <!-- Values for OpenGL traces preference. -->
+ <string-array name="enable_opengl_traces_values" translatable="false" >
+ <item>0</item>
+ <item>1</item>
+ <item>systrace</item>
+ <item>error</item>
+ </string-array>
+
+ <!-- Titles for non-rectangular clipping preference. [CHAR LIMIT=35] -->
+ <string-array name="show_non_rect_clip_entries">
+ <item>Off</item>
+ <item>Draw non-rectangular clip region in blue</item>
+ <item>Highlight tested drawing commands in green</item>
+ </string-array>
+
+ <!-- Values for non-rectangular clipping preference. -->
+ <string-array name="show_non_rect_clip_values" translatable="false" >
+ <item>hide</item>
+ <item>region</item>
+ <item>highlight</item>
+ </string-array>
+
+ <!-- Titles for frame time tracking preference. [CHAR LIMIT=35] -->
+ <string-array name="track_frame_time_entries">
+ <item>Off</item>
+ <item>On screen as bars</item>
+ <item>In adb shell dumpsys gfxinfo</item>
+ </string-array>
+
+ <!-- Values for frame time tracking preference. -->
+ <string-array name="track_frame_time_values" translatable="false" >
+ <item>false</item>
+ <item>visual_bars</item>
+ <item>true</item>
+ </string-array>
+
+ <!-- Titles for debug overdraw preference. [CHAR LIMIT=50] -->
+ <string-array name="debug_hw_overdraw_entries">
+ <item>Off</item>
+ <item>Show overdraw areas</item>
+ <item>Show areas for Deuteranomaly</item>
+ </string-array>
+
+ <!-- Values for debug overdraw preference. -->
+ <string-array name="debug_hw_overdraw_values" translatable="false" >
+ <item>false</item>
+ <item>show</item>
+ <item>show_deuteranomaly</item>
+ </string-array>
+
+ <!-- Titles for app process limit preference. [CHAR LIMIT=35] -->
+ <string-array name="app_process_limit_entries">
+ <item>Standard limit</item>
+ <item>No background processes</item>
+ <item>At most 1 process</item>
+ <item>At most 2 processes</item>
+ <item>At most 3 processes</item>
+ <item>At most 4 processes</item>
+ </string-array>
+
+ <!-- Values for app process limit preference. -->
+ <string-array name="app_process_limit_values" translatable="false" >
+ <item>-1</item>
+ <item>0</item>
+ <item>1</item>
+ <item>2</item>
+ <item>3</item>
+ <item>4</item>
+ </string-array>
+
+ <!-- USB configuration names for Developer Settings.
+ This can be overridden by devices with additional USB configurations. -->
+ <string-array name="usb_configuration_titles">
+ <item>Charging</item>
+ <item>MTP (Media Transfer Protocol)</item>
+ <item>PTP (Picture Transfer Protocol)</item>
+ <item>RNDIS (USB Ethernet)</item>
+ <item>Audio Source</item>
+ <item>MIDI</item>
+ </string-array>
+
+ <!-- USB configuration values for Developer Settings.
+ These are lists of USB functions passed to the USB Manager to change USB configuraton.
+ This can be overridden by devices with additional USB configurations.
+ Do not translate. -->
+ <string-array name="usb_configuration_values" translatable="false">
+ <!-- Do not translate. -->
+ <item>none</item>
+ <!-- Do not translate. -->
+ <item>mtp</item>
+ <!-- Do not translate. -->
+ <item>ptp</item>
+ <!-- Do not translate. -->
+ <item>rndis</item>
+ <!-- Do not translate. -->
+ <item>audio_source</item>
+ <!-- Do not translate. -->
+ <item>midi</item>
+ </string-array>
+
+ <!-- Possible values for user theme in Display Settings.
+ Do not translate. -->
+ <string-array name="night_mode_entries" translatable="false">
+ <!-- Do not translate. -->
+ <item>@string/night_mode_no</item>
+ <!-- Do not translate. -->
+ <item>@string/night_mode_yes</item>
+ <!-- Do not translate. -->
+ <item>@string/night_mode_auto</item>
+ </string-array>
+
+ <!-- These values should match up with the MODE_NIGHT constants in UiModeManager.
+ Do not translate. -->
+ <string-array name="night_mode_values" translatable="false">
+ <!-- Do not translate. -->
+ <item>1</item>
+ <!-- Do not translate. -->
+ <item>2</item>
+ <!-- Do not translate. -->
+ <item>0</item>
+ </string-array>
+
+ <!-- Display color space adjustment modes for developers -->
+ <string-array name="simulate_color_space_entries" translatable="false">
+ <item>@string/daltonizer_mode_disabled</item>
+ <item>@string/daltonizer_mode_monochromacy</item>
+ <item>@string/daltonizer_mode_deuteranomaly</item>
+ <item>@string/daltonizer_mode_protanomaly</item>
+ <item>@string/daltonizer_mode_tritanomaly</item>
+ </string-array>
+
+ <!-- Values for display color space adjustment modes for developers -->
+ <string-array name="simulate_color_space_values" translatable="false">
+ <item>-1</item>
+ <item>0</item>
+ <item>2</item>
+ <item>1</item>
+ <item>3</item>
+ </string-array>
+
</resources>
diff --git a/packages/SettingsLib/res/values/strings.xml b/packages/SettingsLib/res/values/strings.xml
index a37196e..55bd08a 100644
--- a/packages/SettingsLib/res/values/strings.xml
+++ b/packages/SettingsLib/res/values/strings.xml
@@ -351,4 +351,369 @@
<!-- Full package name of OEM preferred device feedback reporter. Leave this blank, overlaid in Settings/TvSettings [DO NOT TRANSLATE] -->
<string name="oem_preferred_feedback_reporter" translatable="false" />
+ <!-- Development settings -->
+ <skip/>
+ <!-- Development Settings. the title for the item to take the user to Development settings. Development settings are settings meant for application developers. -->
+ <string name="development_settings_title">Developer options</string>
+ <!-- Development settings enable title. -->
+ <string name="development_settings_enable">Enable developer options</string>
+ <!-- Development Settings summary. The summary of the item to take the user to Development settings. Development settings are settings meant for application developers. -->
+ <string name="development_settings_summary">Set options for app development</string>
+ <!-- Setting checkbox title for Whether to enable USB debugging support on the phone. -->
+ <!-- Error message for users that aren't allowed to modify developer options [CHAR LIMIT=none] -->
+ <string name="development_settings_not_available">Developer options are not available for this user</string>
+ <!-- Error message for users that aren't allowed to modify VPN settings [CHAR LIMIT=none] -->
+ <string name="vpn_settings_not_available">VPN settings are not available for this user</string>
+ <!-- Error message for users that aren't allowed to modify Tethering settings [CHAR LIMIT=none] -->
+ <string name="tethering_settings_not_available">Tethering settings are not available for this user</string>
+ <!-- Error message for users that aren't allowed to modify Access Point Names settings [CHAR LIMIT=none] -->
+ <string name="apn_settings_not_available">Access Point Name settings are not available for this user</string>
+ <string name="enable_adb">USB debugging</string>
+ <!-- Setting checkbox summary for Whether to enable USB debugging support on the phone -->
+ <string name="enable_adb_summary">Debug mode when USB is connected</string>
+ <!-- Setting title to revoke secure USB debugging authorizations -->
+ <string name="clear_adb_keys">Revoke USB debugging authorizations</string>
+ <!-- [CHAR LIMIT=NONE] Setting checkbox title for Whether to include bug report item in power menu. -->
+ <string name="bugreport_in_power">Bug report shortcut</string>
+ <!-- [CHAR LIMIT=NONE] Setting checkbox summary for Whether to include bug report item in power -->
+ <string name="bugreport_in_power_summary">Show a button in the power menu for taking a bug report</string>
+ <!-- Setting Checkbox title whether to keep the screen on when plugged in to a power source -->
+ <string name="keep_screen_on">Stay awake</string>
+ <!-- setting Checkbox summary whether to keep the screen on when plugged in -->
+ <string name="keep_screen_on_summary">Screen will never sleep while charging</string>
+ <!-- Setting Checkbox title whether to enable bluetooth HCI snoop log -->
+ <string name="bt_hci_snoop_log">Enable Bluetooth HCI snoop log</string>
+ <!-- setting Checkbox summary whether to capture all bluetooth HCI packets in a file -->
+ <string name="bt_hci_snoop_log_summary">Capture all bluetooth HCI packets in a file</string>
+ <!-- setting Checkbox title whether to enable OEM unlock [CHAR_LIMIT=35] -->
+ <string name="oem_unlock_enable">OEM unlocking</string>
+ <!-- setting Checkbox summary whether to enable OEM unlock [CHAR_LIMIT=50] -->
+ <string name="oem_unlock_enable_summary">Allow the bootloader to be unlocked</string>
+ <!-- Confirmation dialog title to ensure user wishes to enable OEM unlock and disable theft protection features -->
+ <string name="confirm_enable_oem_unlock_title">Allow OEM unlocking?</string>
+ <!-- Warning dialog message to confirm user wishes to enable OEM unlock and disable theft protection features -->
+ <string name="confirm_enable_oem_unlock_text">WARNING: Device protection features will not work on this device while this setting is turned on.</string>
+
+ <!-- UI debug setting: select current app to mock location [CHAR LIMIT=50] -->
+ <string name="mock_location_app">Select mock location app</string>
+ <!-- UI debug setting: no mock location app has been set [CHAR LIMIT=50] -->
+ <string name="mock_location_app_not_set">No mock location app set</string>
+ <!-- UI debug setting: mock location app has been set [CHAR LIMIT=50] -->
+ <string name="mock_location_app_set">Mock location app: <xliff:g id="app_name">%1$s</xliff:g></string>
+
+ <!-- Preference category for networking debugging development settings. [CHAR LIMIT=50] -->
+ <string name="debug_networking_category">Networking</string>
+
+ <!-- Setting Checkbox title whether to show options for wireless display certification -->
+ <string name="wifi_display_certification">Wireless display certification</string>
+ <!-- Setting Checkbox title whether to enable WiFi Verbose Logging. [CHAR LIMIT=40] -->
+ <string name="wifi_verbose_logging">Enable Wi\u2011Fi Verbose Logging</string>
+ <!-- Setting Checkbox title whether to enable WiFi Aggressive Handover. [CHAR LIMIT=40] -->
+ <string name="wifi_aggressive_handover">Aggressive Wi\u2011Fi to Cellular handover</string>
+ <!-- Setting Checkbox title whether to enable WiFi Scanning in the presence of traffic. [CHAR LIMIT=80] -->
+ <string name="wifi_allow_scan_with_traffic">Always allow Wi\u2011Fi Roam Scans</string>
+ <!-- Setting Checkbox title whether to enable WiFi Scanning in the presence of traffic. [CHAR LIMIT=80] -->
+ <string name="legacy_dhcp_client">Use legacy DHCP client</string>
+ <!-- Setting Checkbox title whether to always keep cellular data active. [CHAR LIMIT=80] -->
+ <string name="mobile_data_always_on">Cellular data always active</string>
+
+ <!-- setting Checkbox summary whether to show options for wireless display certification -->
+ <string name="wifi_display_certification_summary">Show options for wireless display certification</string>
+ <!-- Setting Checkbox summary whether to enable Wifi verbose Logging [CHAR LIMIT=80] -->
+ <string name="wifi_verbose_logging_summary">Increase Wi\u2011Fi logging level, show per SSID RSSI in Wi\u2011Fi Picker</string>
+ <!-- Setting Checkbox summary whether to enable Wifi aggressive handover [CHAR LIMIT=130] -->
+ <string name="wifi_aggressive_handover_summary">When enabled, Wi\u2011Fi will be more aggressive in handing over the data connection to Cellular, when Wi\u2011Fi signal is low</string>
+ <!-- Setting Checkbox summary whether to always allow WiFi Roam Scans [CHAR LIMIT=130] -->
+ <string name="wifi_allow_scan_with_traffic_summary">Allow/Disallow Wi\u2011Fi Roam Scans based on the amount of data traffic present at the interface</string>
+ <!-- UI debug setting: limit size of Android logger buffers -->
+ <string name="select_logd_size_title">Logger buffer sizes</string>
+ <!-- UI debug setting: limit size of Android logger buffers [CHAR LIMIT=59] -->
+ <string name="select_logd_size_dialog_title">Select Logger sizes per log buffer</string>
+ <!-- UI debug setting: select USB configuration -->
+ <string name="select_usb_configuration_title">Select USB Configuration</string>
+ <!-- UI debug setting: limit size of Android logger buffers [CHAR LIMIT=59] -->
+ <string name="select_usb_configuration_dialog_title">Select USB Configuration</string>
+ <!-- Setting Checkbox title whether to allow mock locations -->
+ <string name="allow_mock_location">Allow mock locations</string>
+ <!-- setting Checkbox summary whether to allow mock locations -->
+ <string name="allow_mock_location_summary">Allow mock locations</string>
+ <!-- Setting Checkbox title whether to enable view attribute inspection -->
+ <string name="debug_view_attributes">Enable view attribute inspection</string>
+ <!-- Setting Checkbox summary whether to use DHCP client from Lollipop (Android 5.0) [CHAR LIMIT=130] -->
+ <string name="legacy_dhcp_client_summary">Use the DHCP client from Lollipop instead of the new Android DHCP client.</string>
+ <string name="mobile_data_always_on_summary">Always keep mobile data active, even when Wi\u2011Fi is active (for fast network switching).</string>
+ <!-- Title of warning dialog about the implications of enabling USB debugging -->
+ <string name="adb_warning_title">Allow USB debugging?</string>
+ <!-- Warning text to user about the implications of enabling USB debugging -->
+ <string name="adb_warning_message">USB debugging is intended for development purposes only. Use it to copy data between your computer and your device, install apps on your device without notification, and read log data.</string>
+ <!-- Message of dialog confirming that user wants to revoke access to adb from all computers they have authorized -->
+ <string name="adb_keys_warning_message">Revoke access to USB debugging from all computers you\u2019ve previously authorized?</string>
+ <!-- Title of warning dialog about the implications of enabling developer settings -->
+ <string name="dev_settings_warning_title">Allow development settings?</string>
+ <!-- Warning text to user about the implications of enabling USB debugging -->
+ <string name="dev_settings_warning_message">These settings are intended for development use only. They can cause your device and the applications on it to break or misbehave.</string>
+ <!-- Title of checkbox setting to perform package verification on apps installed over USB/ADT/ADB [CHAR LIMIT=32] -->
+ <string name="verify_apps_over_usb_title">Verify apps over USB</string>
+ <!-- Summary of checkbox setting to perform package verification on apps installed over USB/ADT/ADB [CHAR LIMIT=NONE] -->
+ <string name="verify_apps_over_usb_summary">Check apps installed via ADB/ADT for harmful behavior.</string>
+
+ <!-- Title of checkbox setting that enables the terminal app. [CHAR LIMIT=32] -->
+ <string name="enable_terminal_title">Local terminal</string>
+ <!-- Summary of checkbox setting that enables the terminal app. [CHAR LIMIT=64] -->
+ <string name="enable_terminal_summary">Enable terminal app that offers local shell access</string>
+
+ <!-- HDCP checking title, used for debug purposes only. [CHAR LIMIT=25] -->
+ <string name="hdcp_checking_title">HDCP checking</string>
+ <!-- HDCP checking dialog title, used for debug purposes only. [CHAR LIMIT=25] -->
+ <string name="hdcp_checking_dialog_title">Set HDCP checking behavior</string>
+
+ <!-- Preference category for app debugging development settings. [CHAR LIMIT=50] -->
+ <string name="debug_debugging_category">Debugging</string>
+
+ <!-- UI debug setting: select current app to debug [CHAR LIMIT=50] -->
+ <string name="debug_app">Select debug app</string>
+ <!-- UI debug setting: no debug app has been set [CHAR LIMIT=50] -->
+ <string name="debug_app_not_set">No debug application set</string>
+ <!-- UI debug setting: debug app has been set [CHAR LIMIT=50] -->
+ <string name="debug_app_set">Debugging application: <xliff:g id="app_name">%1$s</xliff:g></string>
+
+ <!-- UI debug setting: title for app picker dialog [CHAR LIMIT=50] -->
+ <string name="select_application">Select application</string>
+ <!-- UI debug setting: label for app picker to select no applicatiojn [CHAR LIMIT=50] -->
+ <string name="no_application">Nothing</string>
+
+ <!-- UI debug setting: wait for debugger to attach to debugging process? [CHAR LIMIT=50] -->
+ <string name="wait_for_debugger">Wait for debugger</string>
+ <!-- UI debug setting: wait for debugger to attach to debugging process summary [CHAR LIMIT=500] -->
+ <string name="wait_for_debugger_summary">Debugged application waits for debugger to
+ attach before executing</string>
+
+ <!-- Preference category for input debugging development settings. [CHAR LIMIT=25] -->
+ <string name="debug_input_category">Input</string>
+
+ <!-- Preference category for drawing debugging development settings. [CHAR LIMIT=25] -->
+ <string name="debug_drawing_category">Drawing</string>
+
+ <!-- Preference category for hardware accelerated drawing debugging development settings. [CHAR LIMIT=50] -->
+ <string name="debug_hw_drawing_category">Hardware accelerated rendering</string>
+
+ <!-- Preference category for media development settings. [CHAR LIMIT=50] -->
+ <string name="media_category">Media</string>
+
+ <!-- Preference category for monitoring debugging development settings. [CHAR LIMIT=25] -->
+ <string name="debug_monitoring_category">Monitoring</string>
+
+ <!-- UI debug setting: always enable strict mode? [CHAR LIMIT=25] -->
+ <string name="strict_mode">Strict mode enabled</string>
+ <!-- UI debug setting: show strict mode summary [CHAR LIMIT=50] -->
+ <string name="strict_mode_summary">Flash screen when apps do long operations
+ on main thread</string>
+
+ <!-- UI debug setting: show pointer location? [CHAR LIMIT=25] -->
+ <string name="pointer_location">Pointer location</string>
+ <!-- UI debug setting: show pointer location summary [CHAR LIMIT=50] -->
+ <string name="pointer_location_summary">Screen overlay showing current touch data</string>
+
+ <!-- UI debug setting: show touches? [CHAR LIMIT=25] -->
+ <string name="show_touches">Show touches</string>
+ <!-- UI debug setting: show touches location summary [CHAR LIMIT=50] -->
+ <string name="show_touches_summary">Show visual feedback for touches</string>
+
+ <!-- UI debug setting: show where surface updates happen? [CHAR LIMIT=25] -->
+ <string name="show_screen_updates">Show surface updates</string>
+ <!-- UI debug setting: show surface updates summary [CHAR LIMIT=50] -->
+ <string name="show_screen_updates_summary">Flash entire window surfaces when they update</string>
+
+ <!-- UI debug setting: show where window updates happen with GPU rendering? [CHAR LIMIT=25] -->
+ <string name="show_hw_screen_updates">Show GPU view updates</string>
+ <!-- UI debug setting: show GPU rendering screen updates summary [CHAR LIMIT=50] -->
+ <string name="show_hw_screen_updates_summary">Flash views inside windows when drawn with the GPU</string>
+
+ <!-- UI debug setting: show when hardware layers get updated [CHAR LIMIT=25] -->
+ <string name="show_hw_layers_updates">Show hardware layers updates</string>
+ <!-- UI debug setting: show hardware layers updates summary [CHAR LIMIT=50] -->
+ <string name="show_hw_layers_updates_summary">Flash hardware layers green when they update</string>
+
+ <!-- UI debug setting: show the amount of overdraw in apps using the GPU [CHAR LIMIT=25] -->
+ <string name="debug_hw_overdraw">Debug GPU overdraw</string>
+
+ <!-- UI debug setting: disable use of overlays? [CHAR LIMIT=25] -->
+ <string name="disable_overlays">Disable HW overlays</string>
+ <!-- UI debug setting: disable use of overlays summary [CHAR LIMIT=50] -->
+ <string name="disable_overlays_summary">Always use GPU for screen compositing</string>
+
+ <!-- UI debug setting: simulate color space anomalies. [CHAR LIMIT=25] -->
+ <string name="simulate_color_space">Simulate color space</string>
+
+ <!-- UI debug setting: enable various types of OpenGL traces [CHAR LIMIT=25] -->
+ <string name="enable_opengl_traces_title">Enable OpenGL traces</string>
+
+ <!-- UI debug setting: disable USB audio routing title [CHAR LIMIT=32] -->
+ <string name="usb_audio_disable_routing">Disable USB audio routing</string>
+ <!-- UI debug setting: disable USB audio routing summary [CHAR LIMIT=50] -->
+ <string name="usb_audio_disable_routing_summary">Disable automatic routing to USB audio peripherals</string>
+
+ <!-- UI debug setting: show layout bounds information [CHAR LIMIT=25] -->
+ <string name="debug_layout">Show layout bounds</string>
+ <!-- UI debug setting: show layout bounds information summary [CHAR LIMIT=50] -->
+ <string name="debug_layout_summary">Show clip bounds, margins, etc.</string>
+
+ <!-- UI debug setting: force right to left layout [CHAR LIMIT=37] -->
+ <string name="force_rtl_layout_all_locales">Force RTL layout direction</string>
+ <!-- UI debug setting: force right to left layout summary [CHAR LIMIT=100] -->
+ <string name="force_rtl_layout_all_locales_summary">Force screen layout direction to RTL for all locales</string>
+
+ <!-- UI debug setting: show how CPU is being used? [CHAR LIMIT=25] -->
+ <string name="show_cpu_usage">Show CPU usage</string>
+ <!-- UI debug setting: show cpu usage summary [CHAR LIMIT=50] -->
+ <string name="show_cpu_usage_summary">Screen overlay showing current CPU usage</string>
+
+ <!-- UI debug setting: force hardware acceleration to render apps [CHAR LIMIT=25] -->
+ <string name="force_hw_ui">Force GPU rendering</string>
+ <!-- UI debug setting: force hardware acceleration summary [CHAR LIMIT=50] -->
+ <string name="force_hw_ui_summary">Force use of GPU for 2d drawing</string>
+
+ <!-- UI debug setting: force anti-aliasing to render apps [CHAR LIMIT=25] -->
+ <string name="force_msaa">Force 4x MSAA</string>
+ <!-- UI debug setting: force anti-aliasing summary [CHAR LIMIT=50] -->
+ <string name="force_msaa_summary">Enable 4x MSAA in OpenGL ES 2.0 apps</string>
+
+ <!-- UI debug setting: show when non-rectangular clip operations are used [CHAR LIMIT=100] -->
+ <string name="show_non_rect_clip">Debug non-rectangular clip operations</string>
+
+ <!-- UI debug setting: profile time taken by hardware acceleration to render apps [CHAR LIMIT=25] -->
+ <string name="track_frame_time">Profile GPU rendering</string>
+
+ <!-- UI debug setting: scaling factor for window animations [CHAR LIMIT=25] -->
+ <string name="window_animation_scale_title">Window animation scale</string>
+
+ <!-- UI debug setting: scaling factor for transition animations [CHAR LIMIT=25] -->
+ <string name="transition_animation_scale_title">Transition animation scale</string>
+
+ <!-- UI debug setting: scaling factor for all Animator-based animations [CHAR LIMIT=25] -->
+ <string name="animator_duration_scale_title">Animator duration scale</string>
+
+ <!-- UI debug setting: simulate secondary display devices using overlays [CHAR LIMIT=25] -->
+ <string name="overlay_display_devices_title">Simulate secondary displays</string>
+
+ <!-- Preference category for application debugging development settings. [CHAR LIMIT=25] -->
+ <string name="debug_applications_category">Apps</string>
+
+ <!-- UI debug setting: immediately destroy activities? [CHAR LIMIT=25] -->
+ <string name="immediately_destroy_activities">Don\u2019t keep activities</string>
+ <!-- UI debug setting: immediately destroy activities summary [CHAR LIMIT=50] -->
+ <string name="immediately_destroy_activities_summary">Destroy every activity as soon as
+ the user leaves it</string>
+
+ <!-- UI debug setting: limit number of running background processes [CHAR LIMIT=25] -->
+ <string name="app_process_limit_title">Background process limit</string>
+
+ <!-- UI debug setting: show all ANRs? [CHAR LIMIT=25] -->
+ <string name="show_all_anrs">Show all ANRs</string>
+ <!-- UI debug setting: show all ANRs summary [CHAR LIMIT=50] -->
+ <string name="show_all_anrs_summary">Show App Not Responding dialog
+ for background apps</string>
+
+ <!-- UI debug setting: force allow apps on external storage [CHAR LIMIT=50] -->
+ <string name="force_allow_on_external">Force allow apps on external</string>
+ <!-- UI debug setting: force allow on external summary [CHAR LIMIT=150] -->
+ <string name="force_allow_on_external_summary">Makes any app elligible to be written to external storage, regardless of manifest values</string>
+
+ <!-- UI debug setting: force all activites to be resizable for multiwindow [CHAR LIMIT=50] -->
+ <string name="force_resizable_activities">Force activities to be resizable</string>
+ <!-- UI debug setting: force allow on external summary [CHAR LIMIT=150] -->
+ <string name="force_resizable_activities_summary">Makes all activities resizable for multi-window, regardless of manifest values.</string>
+
+ <!-- Local (desktop) backup password menu title [CHAR LIMIT=25] -->
+ <string name="local_backup_password_title">Desktop backup password</string>
+ <!-- Summary text of the "local backup password" setting when the user has not supplied a password -->
+ <string name="local_backup_password_summary_none">Desktop full backups aren\u2019t currently protected</string>
+ <!-- Summary text of the "local backup password" setting when the user has already supplied a password -->
+ <string name="local_backup_password_summary_change">Touch to change or remove the password for desktop full backups</string>
+
+ <!-- Toast message shown when the user successfully sets a new local backup password [CHAR LIMIT=80] -->
+ <string name="local_backup_password_toast_success">New backup password set</string>
+ <!-- Toast message shown when setting a new local backup password fails due to the user not correctly typing the password again for confirmation [CHAR LIMIT=80] -->
+ <string name="local_backup_password_toast_confirmation_mismatch">New password and confirmation don\u2019t match</string>
+ <!-- Toast message shown when setting a new local backup password fails due to the user not supplying the correct existing password. The phrasing here is deliberately quite general. [CHAR LIMIT=80] -->
+ <string name="local_backup_password_toast_validation_failure">Failure setting backup password</string>
+
+ <!-- Name of each color mode for the display. [CHAR LIMIT=40] -->
+ <string-array name="color_mode_names">
+ <item>Vibrant (default)</item>
+ <item>Natural</item>
+ <item>Standard</item>
+ </string-array>
+
+ <!-- Description of each color mode for the display. [CHAR LIMIT=NONE] -->
+ <string-array name="color_mode_descriptions">
+ <item>Enhanced colors</item>
+ <item>Natural colors as seen by the eye</item>
+ <item>Colors optimized for digital content</item>
+ </string-array>
+
+ <!-- Settings item title for inactive apps [CHAR LIMIT=35] -->
+ <string name="inactive_apps_title">Inactive apps</string>
+ <!-- Settings item summary for inactive app [CHAR LIMIT=100] -->
+ <string name="inactive_app_inactive_summary">Inactive. Touch to toggle.</string>
+ <!-- Settings item summary for active app [CHAR LIMIT=100] -->
+ <string name="inactive_app_active_summary">Active. Touch to toggle.</string>
+
+ <!-- Services settings screen, setting option name for the user to go to the screen to view running services -->
+ <string name="runningservices_settings_title">Running services</string>
+ <!-- Services settings screen, setting option summary for the user to go to the screen to view running services -->
+ <string name="runningservices_settings_summary">View and control currently running services</string>
+
+ <!-- Sound & display settings screen, setting option name to change the user interface theme [CHAR LIMIT=30] -->
+ <string name="night_mode_title">Night mode</string>
+ <!-- Sound & display settings screen, setting option summary to change the user interface theme [CHAR LIMIT=100] -->
+ <string name="night_mode_summary">%s</string>
+ <!-- Sound & display settings screen, theme setting value to prefer a light-colored user interface [CHAR LIMIT=30] -->
+ <string name="night_mode_no">Disabled</string>
+ <!-- Sound & display settings screen, theme setting value to prefer a dark-colored user interface [CHAR LIMIT=30] -->
+ <string name="night_mode_yes">Always on</string>
+ <!-- Sound & display settings screen, theme setting value to automatically switch between a light- or dark-colored user interface [CHAR LIMIT=30] -->
+ <string name="night_mode_auto">Automatic</string>
+
+ <!-- Developer settings screen, convert userdata to file encryption option name -->
+ <string name="convert_to_file_encryption">Convert to file encryption</string>
+ <!-- Developer settings screen, convert userdata to file encryption summary when option is available -->
+ <string name="convert_to_file_encryption_enabled">Convert\u2026</string>
+ <!-- Developer settings screen, convert userdata to file encryption summary when option is already done -->
+ <string name="convert_to_file_encryption_done">Already file encrypted</string>
+ <!-- Title used on dialog with final prompt for converting to file encryption -->
+ <string name="title_convert_fbe">Converting to file based encryption</string>
+ <!-- Warning displayed on dialog with final prompt for converting to file encryption -->
+ <string name="convert_to_fbe_warning">
+ Convert data partition to file based encryption.\n
+ !!Warning!! This will erase all your data.\n
+ This feature is alpha, and may not work correctly.\n
+ Press \'Wipe and convert\u2026\' to continue.</string>
+ <!-- Button on dialog that triggers convertion to file encryption -->
+ <string name="button_convert_fbe">Wipe and convert\u2026</string>
+
+ <!-- Name of feature to change color setting for the display [CHAR LIMIT=60] -->
+ <string name="picture_color_mode">Picture color mode</string>
+
+ <!-- Description of feature to change color setting for the display [CHAR LIMIT=NONE] -->
+ <string name="picture_color_mode_desc">Use sRGB</string>
+
+ <!-- Label for disabling color space adjustment [CHAR LIMIT=45] -->
+ <string name="daltonizer_mode_disabled">Disabled</string>
+ <!-- Label for converting display colors to grayscale, which simulates monochromacy (complete color blindness). [CHAR LIMIT=45] -->
+ <string name="daltonizer_mode_monochromacy">Monochromacy</string>
+ <!-- Label for deuteranomaly (red-green color blindness) [CHAR LIMIT=45] -->
+ <string name="daltonizer_mode_deuteranomaly">Deuteranomaly (red-green)</string>
+ <!-- Label for protanomaly (red-green color blindness) [CHAR LIMIT=45] -->
+ <string name="daltonizer_mode_protanomaly">Protanomaly (red-green)</string>
+ <!-- Label for tritanomaly (blue-yellow color blindness) [CHAR LIMIT=45] -->
+ <string name="daltonizer_mode_tritanomaly">Tritanomaly (blue-yellow)</string>
+
+ <!-- Title for the accessibility preference to configure display color space correction. [CHAR LIMIT=NONE] -->
+ <string name="accessibility_display_daltonizer_preference_title">Color correction</string>
+ <!-- Subtitle for the accessibility preference to configure display color space correction. [CHAR LIMIT=NONE] -->
+ <string name="accessibility_display_daltonizer_preference_subtitle">This feature is experimental and may affect performance.</string>
+ <!-- Summary shown for color space correction preference when its value is overridden by another preference [CHAR LIMIT=35] -->
+ <string name="daltonizer_type_overridden">Overridden by <xliff:g id="title" example="Simulate color space">%1$s</xliff:g></string>
+
</resources>
diff --git a/packages/SystemUI/res/values/colors.xml b/packages/SystemUI/res/values/colors.xml
index bfd8af9..5618e9b 100644
--- a/packages/SystemUI/res/values/colors.xml
+++ b/packages/SystemUI/res/values/colors.xml
@@ -21,7 +21,6 @@
<drawable name="ticker_background_color">#ff1d1d1d</drawable>
<drawable name="system_bar_background">@color/system_bar_background_opaque</drawable>
<color name="system_bar_background_opaque">#ff000000</color>
- <color name="system_bar_background_semi_transparent">#66000000</color> <!-- 40% black -->
<color name="system_bar_background_transparent">#00000000</color>
<color name="notification_panel_solid_background">#ff000000</color>
<drawable name="status_bar_notification_row_background_color">#ff090909</drawable>
diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml
index 902db26..a0052ce 100644
--- a/packages/SystemUI/res/values/config.xml
+++ b/packages/SystemUI/res/values/config.xml
@@ -175,7 +175,7 @@
<integer name="recents_animate_task_view_remove_duration">250</integer>
<!-- The animation duration for scrolling the stack to a particular item. -->
- <integer name="recents_animate_task_stack_scroll_duration">225</integer>
+ <integer name="recents_animate_task_stack_scroll_duration">200</integer>
<!-- The animation duration for entering and exiting the history. -->
<integer name="recents_history_transition_duration">250</integer>
diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml
index d6a361c..002b9f5 100644
--- a/packages/SystemUI/res/values/strings.xml
+++ b/packages/SystemUI/res/values/strings.xml
@@ -1171,13 +1171,23 @@
<!-- Toggles fullscreen screenshots. DO NOT TRANSLATE -->
<string name="overview_fullscreen_thumbnails">Enable fullscreen screenshots</string>
<!-- Description for the toggle for fullscreen screenshots. DO NOT TRANSLATE -->
- <string name="overview_fullscreen_thumbnails_desc">Enable fullscreen screenshots in Overview</string>
+ <string name="overview_fullscreen_thumbnails_desc">Enable fullscreen screenshots in Overview. Restart required.</string>
+
+ <!-- Toggle to enable the Overview nav bar gesture. DO NOT TRANSLATE -->
+ <string name="overview_nav_bar_gesture">Enable navigation bar gesture</string>
+ <!-- Description for the toggle to enable the Overview nav bar gesture. DO NOT TRANSLATE -->
+ <string name="overview_nav_bar_gesture_desc">Enables the gesture to enter Overview by swiping up on the Nav bar</string>
<!-- Toggle to show the history view in Overview. DO NOT TRANSLATE -->
<string name="overview_show_history">Show History</string>
<!-- Description for the toggle to show the history view in Overview. DO NOT TRANSLATE -->
<string name="overview_show_history_desc">Enables the history view to see more recent tasks</string>
+ <!-- Toggle to set the initial scroll state to be paging or stack. DO NOT TRANSLATE -->
+ <string name="overview_initial_state_paging">Initialize to paging</string>
+ <!-- Description for the toggle to set the initial scroll state to be paging or stack. DO NOT TRANSLATE -->
+ <string name="overview_initial_state_paging_desc">Determines whether Overview will initially be in a stacked or paged state</string>
+
<!-- Category in the System UI Tuner settings, where new/experimental
settings are -->
<string name="experimental">Experimental</string>
diff --git a/packages/SystemUI/res/xml/tuner_prefs.xml b/packages/SystemUI/res/xml/tuner_prefs.xml
index f398af3..8dcf8a7 100644
--- a/packages/SystemUI/res/xml/tuner_prefs.xml
+++ b/packages/SystemUI/res/xml/tuner_prefs.xml
@@ -93,11 +93,21 @@
android:summary="@string/overview_page_on_toggle_desc" />
<com.android.systemui.tuner.TunerSwitch
+ android:key="overview_initial_state_paging"
+ android:title="@string/overview_initial_state_paging"
+ android:summary="@string/overview_initial_state_paging_desc" />
+
+ <com.android.systemui.tuner.TunerSwitch
android:key="overview_fast_toggle"
android:title="@string/overview_fast_toggle_via_button"
android:summary="@string/overview_fast_toggle_via_button_desc" />
<com.android.systemui.tuner.TunerSwitch
+ android:key="overview_nav_bar_gesture"
+ android:title="@string/overview_nav_bar_gesture"
+ android:summary="@string/overview_nav_bar_gesture_desc" />
+
+ <com.android.systemui.tuner.TunerSwitch
android:key="overview_fullscreen_thumbnails"
android:title="@string/overview_fullscreen_thumbnails"
android:summary="@string/overview_fullscreen_thumbnails_desc" />
diff --git a/packages/SystemUI/src/com/android/systemui/RecentsComponent.java b/packages/SystemUI/src/com/android/systemui/RecentsComponent.java
index 4cb8a3c..7f6cda0 100644
--- a/packages/SystemUI/src/com/android/systemui/RecentsComponent.java
+++ b/packages/SystemUI/src/com/android/systemui/RecentsComponent.java
@@ -32,7 +32,7 @@
/**
* Docks the top-most task and opens recents.
*/
- void dockTopTask(boolean draggingInRecents, Rect initialBounds);
+ void dockTopTask(boolean draggingInRecents, int stackCreateMode, Rect initialBounds);
/**
* Called during a drag-from-navbar-in gesture.
diff --git a/packages/SystemUI/src/com/android/systemui/recents/Recents.java b/packages/SystemUI/src/com/android/systemui/recents/Recents.java
index c98ecb5..b81c23a 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/Recents.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/Recents.java
@@ -365,8 +365,8 @@
}
@Override
- public void dockTopTask(boolean draggingInRecents, Rect initialBounds) {
- mImpl.dockTopTask(draggingInRecents, initialBounds);
+ public void dockTopTask(boolean draggingInRecents, int stackCreateMode, Rect initialBounds) {
+ mImpl.dockTopTask(draggingInRecents, stackCreateMode,initialBounds);
if (draggingInRecents) {
mDraggingInRecentsCurrentUser = sSystemServicesProxy.getCurrentUser();
}
diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsActivityLaunchState.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsActivityLaunchState.java
index 43db666..e0bd59b 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/RecentsActivityLaunchState.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsActivityLaunchState.java
@@ -82,7 +82,7 @@
if (launchedFromHome) {
return numTasks - 1;
} else {
- if (flags.isFastToggleRecentsEnabled()) {
+ if (flags.isFastToggleRecentsEnabled() || !flags.isInitialStatePaging()) {
return numTasks - 1;
} else {
return numTasks - 2;
diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsConfiguration.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsConfiguration.java
index cdfad18..53c10b7 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/RecentsConfiguration.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsConfiguration.java
@@ -115,8 +115,8 @@
// Recompute some values based on the given state, since we can not rely on the resource
// system to get certain values.
boolean isLandscape = windowRect.width() > windowRect.height();
- hasTransposedNavBar = isLandscape && isLargeScreen && !isXLargeScreen;
- hasTransposedSearchBar = isLandscape && isLargeScreen && !isXLargeScreen;
+ hasTransposedNavBar = isLandscape && !isXLargeScreen;
+ hasTransposedSearchBar = isLandscape && !isXLargeScreen;
}
/**
diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsDebugFlags.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsDebugFlags.java
index e8b8816..d778886 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/RecentsDebugFlags.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsDebugFlags.java
@@ -30,6 +30,7 @@
private static final String KEY_PAGE_ON_TOGGLE = "overview_page_on_toggle";
private static final String KEY_FULLSCREEN_THUMBNAILS = "overview_fullscreen_thumbnails";
private static final String KEY_SHOW_HISTORY = "overview_show_history";
+ private static final String KEY_INITIAL_STATE_PAGING = "overview_initial_state_paging";
public static class Static {
// Enables debug drawing for the transition thumbnail
@@ -54,6 +55,7 @@
private boolean mPageOnToggle;
private boolean mUseFullscreenThumbnails;
private boolean mShowHistory;
+ private boolean mInitialStatePaging;
/**
* We read the prefs once when we start the activity, then update them as the tuner changes
@@ -63,7 +65,7 @@
// Register all our flags, this will also call onTuningChanged() for each key, which will
// initialize the current state of each flag
TunerService.get(context).addTunable(this, KEY_FAST_TOGGLE, KEY_PAGE_ON_TOGGLE,
- KEY_FULLSCREEN_THUMBNAILS, KEY_SHOW_HISTORY);
+ KEY_FULLSCREEN_THUMBNAILS, KEY_SHOW_HISTORY, KEY_INITIAL_STATE_PAGING);
}
/**
@@ -94,6 +96,13 @@
return mShowHistory;
}
+ /**
+ * @return whether the initial stack state is paging.
+ */
+ public boolean isInitialStatePaging() {
+ return mInitialStatePaging;
+ }
+
@Override
public void onTuningChanged(String key, String newValue) {
switch (key) {
@@ -113,6 +122,10 @@
mShowHistory = (newValue != null) &&
(Integer.parseInt(newValue) != 0);
break;
+ case KEY_INITIAL_STATE_PAGING:
+ mInitialStatePaging = (newValue != null) &&
+ (Integer.parseInt(newValue) != 0);
+ break;
}
EventBus.getDefault().send(new DebugFlagsChangedEvent());
}
diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java
index 3efb0cc..2a4017a 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java
@@ -539,12 +539,11 @@
showRelativeAffiliatedTask(false);
}
- public void dockTopTask(boolean draggingInRecents, Rect initialBounds) {
+ public void dockTopTask(boolean draggingInRecents, int stackCreateMode, Rect initialBounds) {
SystemServicesProxy ssp = Recents.getSystemServices();
ActivityManager.RunningTaskInfo topTask = ssp.getTopMostTask();
if (topTask != null && !SystemServicesProxy.isHomeStack(topTask.stackId)) {
- ssp.moveTaskToDockedStack(topTask.id,
- ActivityManager.DOCKED_STACK_CREATE_MODE_TOP_OR_LEFT, initialBounds);
+ ssp.moveTaskToDockedStack(topTask.id, stackCreateMode, initialBounds);
showRecents(false /* triggeredFromAltTab */, draggingInRecents, false /* animate */,
true /* reloadTasks*/);
}
diff --git a/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java b/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java
index 2b20c07..5d17e2c 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java
@@ -115,7 +115,6 @@
/** Private constructor */
public SystemServicesProxy(Context context) {
- RecentsDebugFlags flags = Recents.getDebugFlags();
mAccm = AccessibilityManager.getInstance(context);
mAm = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
mIam = ActivityManagerNative.getDefault();
diff --git a/packages/SystemUI/src/com/android/systemui/recents/model/TaskStack.java b/packages/SystemUI/src/com/android/systemui/recents/model/TaskStack.java
index 530cd2d..7a98393 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/model/TaskStack.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/model/TaskStack.java
@@ -137,7 +137,7 @@
/** Returns the index of this task in the list of filtered tasks */
int indexOf(Task t) {
- if (mTaskIndices.containsKey(t.key)) {
+ if (t != null && mTaskIndices.containsKey(t.key)) {
return mTaskIndices.get(t.key);
}
return -1;
@@ -199,8 +199,8 @@
/** Task stack callbacks */
public interface TaskStackCallbacks {
/* Notifies when a task has been removed from the stack */
- void onStackTaskRemoved(TaskStack stack, Task removedTask, int removedTaskIndex,
- boolean wasFrontMostTask, Task newFrontMostTask);
+ void onStackTaskRemoved(TaskStack stack, Task removedTask, boolean wasFrontMostTask,
+ Task newFrontMostTask);
/* Notifies when a task has been removed from the history */
void onHistoryTaskRemoved(TaskStack stack, Task removedTask);
@@ -393,8 +393,7 @@
}
if (mCb != null) {
// Notify that a task has been removed
- mCb.onStackTaskRemoved(this, t, removedTaskIndex, wasFrontMostTask,
- newFrontMostTask);
+ mCb.onStackTaskRemoved(this, t, wasFrontMostTask, newFrontMostTask);
}
} else if (mHistoryTaskList.contains(t)) {
removeTaskImpl(mHistoryTaskList, t);
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java b/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java
index 4a3bb11..a0a1bac 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java
@@ -16,6 +16,8 @@
package com.android.systemui.recents.views;
+import android.animation.Animator;
+import android.animation.AnimatorListenerAdapter;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Canvas;
@@ -27,6 +29,8 @@
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
+import android.view.ViewConfiguration;
+import android.view.ViewPropertyAnimator;
import android.view.WindowInsets;
import android.view.animation.AnimationUtils;
import android.view.animation.Interpolator;
@@ -55,6 +59,8 @@
import com.android.systemui.recents.misc.SystemServicesProxy;
import com.android.systemui.recents.model.Task;
import com.android.systemui.recents.model.TaskStack;
+import com.android.systemui.stackdivider.WindowManagerProxy;
+import com.android.systemui.statusbar.FlingAnimationUtils;
import java.util.ArrayList;
import java.util.List;
@@ -94,8 +100,10 @@
Rect mSystemInsets = new Rect();
+ final FlingAnimationUtils mFlingAnimationUtils;
+
public RecentsView(Context context) {
- super(context);
+ this(context, null);
}
public RecentsView(Context context, AttributeSet attrs) {
@@ -118,6 +126,7 @@
com.android.internal.R.interpolator.fast_out_linear_in);
mHistoryTransitionDuration = res.getInteger(R.integer.recents_history_transition_duration);
mTouchHandler = new RecentsViewTouchHandler(this);
+ mFlingAnimationUtils = new FlingAnimationUtils(context, 0.3f);
LayoutInflater inflater = LayoutInflater.from(context);
mHistoryButton = inflater.inflate(R.layout.recents_history_button, this, false);
@@ -511,7 +520,22 @@
}
public final void onBusEvent(DraggingInRecentsEndedEvent event) {
- animate().translationY(0f);
+ ViewPropertyAnimator animator = animate();
+ if (event.velocity > mFlingAnimationUtils.getMinVelocityPxPerSecond()) {
+ animator.translationY(getHeight());
+ animator.withEndAction(new Runnable() {
+ @Override
+ public void run() {
+ WindowManagerProxy.getInstance().maximizeDockedStack();
+ }
+ });
+ mFlingAnimationUtils.apply(animator, getTranslationY(), getHeight(), event.velocity);
+ } else {
+ animator.translationY(0f);
+ animator.setListener(null);
+ mFlingAnimationUtils.apply(animator, getTranslationY(), 0, event.velocity);
+ }
+ animator.start();
}
public final void onBusEvent(ShowHistoryEvent event) {
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackLayoutAlgorithm.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackLayoutAlgorithm.java
index 5c906a6..7d5daae 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackLayoutAlgorithm.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackLayoutAlgorithm.java
@@ -118,18 +118,21 @@
*/
public static class StackState {
- public static final StackState FREEFORM_ONLY = new StackState(1f);
- public static final StackState STACK_ONLY = new StackState(0f);
- public static final StackState SPLIT = new StackState(0.5f);
+ public static final StackState FREEFORM_ONLY = new StackState(1f, 0);
+ public static final StackState STACK_ONLY = new StackState(0f, 0);
+ public static final StackState SPLIT = new StackState(0.5f, 255);
public final float freeformHeightPct;
+ public final int freeformBackgroundAlpha;
/**
* @param freeformHeightPct the percentage of the stack height (not including paddings) to
* allocate to the freeform workspace
+ * @param freeformBackgroundAlpha the background alpha for the freeform workspace
*/
- StackState(float freeformHeightPct) {
+ StackState(float freeformHeightPct, int freeformBackgroundAlpha) {
this.freeformHeightPct = freeformHeightPct;
+ this.freeformBackgroundAlpha = freeformBackgroundAlpha;
}
/**
@@ -210,7 +213,7 @@
Context mContext;
private TaskStackView mStackView;
- private Interpolator mFastOutSlowInInterpolator;
+ private Interpolator mLinearOutSlowInInterpolator;
private StackState mState = StackState.SPLIT;
// The task bounds (untransformed) for layout. This rect is anchored at mTaskRoot.
@@ -278,7 +281,6 @@
FreeformWorkspaceLayoutAlgorithm mFreeformLayoutAlgorithm;
public TaskStackLayoutAlgorithm(Context context, TaskStackView stackView) {
- SystemServicesProxy ssp = Recents.getSystemServices();
Resources res = context.getResources();
mStackView = stackView;
@@ -293,8 +295,8 @@
mMaxTranslationZ = res.getDimensionPixelSize(R.dimen.recents_task_view_z_max);
mContext = context;
mFreeformLayoutAlgorithm = new FreeformWorkspaceLayoutAlgorithm();
- mFastOutSlowInInterpolator = AnimationUtils.loadInterpolator(context,
- com.android.internal.R.interpolator.fast_out_slow_in);
+ mLinearOutSlowInInterpolator = AnimationUtils.loadInterpolator(context,
+ com.android.internal.R.interpolator.linear_out_slow_in);
}
/**
@@ -309,9 +311,6 @@
*/
public void setSystemInsets(Rect systemInsets) {
mSystemInsets.set(systemInsets);
- if (DEBUG) {
- Log.d(TAG, "setSystemInsets: " + systemInsets);
- }
}
/**
@@ -343,6 +342,7 @@
// The freeform height is the visible height (not including system insets) - padding above
// freeform and below stack - gap between the freeform and stack
+ mState = state;
mStackTopOffset = mFocusedPeekHeight + heightPadding;
mStackBottomOffset = mSystemInsets.bottom + heightPadding;
state.computeRects(mFreeformRect, mStackRect, taskStackBounds, widthPadding, heightPadding,
@@ -486,8 +486,9 @@
if (Float.compare(newState, getFocusState()) != 0) {
mFocusStateAnimator = ObjectAnimator.ofFloat(this, FOCUS_STATE, getFocusState(),
newState);
- mFocusStateAnimator.setDuration(200);
- mFocusStateAnimator.setInterpolator(mFastOutSlowInInterpolator);
+ mFocusStateAnimator.setDuration(mContext.getResources().getInteger(
+ R.integer.recents_animate_task_stack_scroll_duration));
+ mFocusStateAnimator.setInterpolator(mLinearOutSlowInInterpolator);
mFocusStateAnimator.start();
}
}
@@ -498,7 +499,8 @@
public float getDefaultFocusState() {
RecentsActivityLaunchState launchState = Recents.getConfiguration().getLaunchState();
RecentsDebugFlags debugFlags = Recents.getDebugFlags();
- if (debugFlags.isPageOnToggleEnabled() || launchState.launchedWithAltTab) {
+ if (launchState.launchedWithAltTab ||
+ (debugFlags.isPageOnToggleEnabled() && debugFlags.isInitialStatePaging())) {
return 1f;
}
return 0f;
@@ -514,6 +516,14 @@
}
/**
+ *
+ * Returns the current stack state.
+ */
+ public StackState getStackState() {
+ return mState;
+ }
+
+ /**
* Computes the maximum number of visible tasks and thumbnails when the scroll is at the initial
* stack scroll. Requires that update() is called first.
*/
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java
index 3aba7e5..cc5aaae 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java
@@ -16,6 +16,7 @@
package com.android.systemui.recents.views;
+import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.content.ComponentName;
import android.content.Context;
@@ -23,8 +24,11 @@
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.drawable.ColorDrawable;
+import android.graphics.drawable.Drawable;
import android.os.Bundle;
+import android.util.IntProperty;
import android.util.Log;
+import android.util.Property;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
@@ -90,6 +94,19 @@
private static final float SHOW_HISTORY_BUTTON_SCROLL_THRESHOLD = 0.3f;
private static final float HIDE_HISTORY_BUTTON_SCROLL_THRESHOLD = 0.3f;
+ public static final Property<ColorDrawable, Integer> COLOR_DRAWABLE_ALPHA =
+ new IntProperty<ColorDrawable>("colorDrawableAlpha") {
+ @Override
+ public void setValue(ColorDrawable object, int alpha) {
+ object.setAlpha(alpha);
+ }
+
+ @Override
+ public Integer get(ColorDrawable object) {
+ return object.getAlpha();
+ }
+ };
+
/** The TaskView callbacks */
interface TaskStackViewCallbacks {
public void onTaskViewClicked(TaskStackView stackView, TaskView tv, TaskStack stack, Task t,
@@ -102,10 +119,11 @@
TaskStackViewTouchHandler mTouchHandler;
TaskStackViewCallbacks mCb;
ColorDrawable mFreeformWorkspaceBackground;
+ ObjectAnimator mFreeformWorkspaceBackgroundAnimator;
ViewPool<TaskView, Task> mViewPool;
ArrayList<TaskViewTransform> mCurrentTaskTransforms = new ArrayList<>();
DozeTrigger mUIDozeTrigger;
- int mFocusedTaskIndex = -1;
+ Task mFocusedTask;
// Optimizations
int mStackViewsAnimationDuration;
boolean mStackViewsDirty = true;
@@ -119,7 +137,6 @@
int[] mTmpVisibleRange = new int[2];
Rect mTmpRect = new Rect();
RectF mTmpTaskRect = new RectF();
- TaskViewTransform mTmpTransform = new TaskViewTransform();
TaskViewTransform mTmpStackBackTransform = new TaskViewTransform();
TaskViewTransform mTmpStackFrontTransform = new TaskViewTransform();
HashMap<Task, TaskView> mTmpTaskViewMap = new HashMap<>();
@@ -185,6 +202,7 @@
setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES);
mFreeformWorkspaceBackground = new ColorDrawable(0x33000000);
+ mFreeformWorkspaceBackground.setCallback(this);
}
/** Sets the callbacks */
@@ -463,19 +481,12 @@
tv = mViewPool.pickUpViewFromPool(task, task);
} else {
// Reattach it in the right z order
- detachViewFromParent(tv);
- int insertIndex = -1;
int taskIndex = mStack.indexOfStackTask(task);
- taskViews = getTaskViews();
- taskViewCount = taskViews.size();
- for (int j = 0; j < taskViewCount; j++) {
- Task tvTask = taskViews.get(j).getTask();
- if (taskIndex <= mStack.indexOfStackTask(tvTask)) {
- insertIndex = j;
- break;
- }
+ int insertIndex = findTaskViewInsertIndex(task, taskIndex);
+ if (insertIndex != getTaskViews().indexOf(tv)){
+ detachViewFromParent(tv);
+ attachViewToParent(tv, insertIndex, tv.getLayoutParams());
}
- attachViewToParent(tv, insertIndex, tv.getLayoutParams());
}
// Animate the task into place
@@ -606,7 +617,6 @@
SystemServicesProxy ssp = Recents.getSystemServices();
if (ssp.hasFreeformWorkspaceSupport()) {
mTmpRect.set(mLayoutAlgorithm.mFreeformRect);
- mFreeformWorkspaceBackground.setAlpha(255);
mFreeformWorkspaceBackground.setBounds(mTmpRect);
}
@@ -636,7 +646,7 @@
* @return whether or not the stack will scroll as a part of this focus change
*/
private boolean setFocusedTask(int taskIndex, boolean scrollToTask, final boolean animated,
- final boolean requestViewFocus) {
+ final boolean requestViewFocus) {
// Find the next task to focus
int newFocusedTaskIndex = mStack.getStackTaskCount() > 0 ?
Math.max(0, Math.min(mStack.getStackTaskCount() - 1, taskIndex)) : -1;
@@ -644,16 +654,13 @@
mStack.getStackTasks().get(newFocusedTaskIndex) : null;
// Reset the last focused task state if changed
- if (mFocusedTaskIndex != -1) {
- Task focusedTask = mStack.getStackTasks().get(mFocusedTaskIndex);
- if (focusedTask != newFocusedTask) {
- resetFocusedTask(focusedTask);
- }
+ if (mFocusedTask != null) {
+ resetFocusedTask(mFocusedTask);
}
boolean willScroll = false;
- mFocusedTaskIndex = newFocusedTaskIndex;
- if (mFocusedTaskIndex != -1) {
+ mFocusedTask = newFocusedTask;
+ if (newFocusedTask != null) {
Runnable focusTaskRunnable = new Runnable() {
@Override
public void run() {
@@ -723,13 +730,11 @@
*/
public void setRelativeFocusedTask(boolean forward, boolean stackTasksOnly, boolean animated,
boolean cancelWindowAnimations) {
- int newIndex = -1;
- if (mFocusedTaskIndex != -1) {
+ int newIndex = mStack.indexOfStackTask(mFocusedTask);
+ if (mFocusedTask != null) {
if (stackTasksOnly) {
List<Task> tasks = mStack.getStackTasks();
- newIndex = mFocusedTaskIndex;
- Task task = tasks.get(mFocusedTaskIndex);
- if (task.isFreeformTask()) {
+ if (mFocusedTask.isFreeformTask()) {
// Try and focus the front most stack task
TaskView tv = getFrontMostTaskView(stackTasksOnly);
if (tv != null) {
@@ -737,7 +742,7 @@
}
} else {
// Try the next task if it is a stack task
- int tmpNewIndex = mFocusedTaskIndex + (forward ? -1 : 1);
+ int tmpNewIndex = newIndex + (forward ? -1 : 1);
if (0 <= tmpNewIndex && tmpNewIndex < tasks.size()) {
Task t = tasks.get(tmpNewIndex);
if (!t.isFreeformTask()) {
@@ -749,7 +754,7 @@
// No restrictions, lets just move to the new task (looping forward/backwards if
// necessary)
int taskCount = mStack.getStackTaskCount();
- newIndex = (mFocusedTaskIndex + (forward ? -1 : 1) + taskCount) % taskCount;
+ newIndex = (newIndex + (forward ? -1 : 1) + taskCount) % taskCount;
}
} else {
// We don't have a focused task, so focus the first visible task view
@@ -778,17 +783,14 @@
tv.setFocusedState(false, false /* animated */, false /* requestViewFocus */);
}
}
- mFocusedTaskIndex = -1;
+ mFocusedTask = null;
}
/**
* Returns the focused task.
*/
Task getFocusedTask() {
- if (mFocusedTaskIndex != -1) {
- return mStack.getStackTasks().get(mFocusedTaskIndex);
- }
- return null;
+ return mFocusedTask;
}
@Override
@@ -813,12 +815,13 @@
super.onInitializeAccessibilityNodeInfo(info);
List<TaskView> taskViews = getTaskViews();
int taskViewCount = taskViews.size();
- if (taskViewCount > 1 && mFocusedTaskIndex != -1) {
+ if (taskViewCount > 1 && mFocusedTask != null) {
info.setScrollable(true);
- if (mFocusedTaskIndex > 0) {
+ int focusedTaskIndex = mStack.indexOfStackTask(mFocusedTask);
+ if (focusedTaskIndex > 0) {
info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_FORWARD);
}
- if (mFocusedTaskIndex < mStack.getStackTaskCount() - 1) {
+ if (focusedTaskIndex < mStack.getStackTaskCount() - 1) {
info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD);
}
}
@@ -1021,6 +1024,11 @@
mStartEnterAnimationContext = null;
}
+ // Animate in the freeform workspace
+ animateFreeformWorkspaceBackgroundAlpha(
+ mLayoutAlgorithm.getStackState().freeformBackgroundAlpha, 150,
+ mFastOutSlowInInterpolator);
+
// Set the task focused state without requesting view focus, and leave the focus animations
// until after the enter-animation
RecentsConfiguration config = Recents.getConfiguration();
@@ -1082,11 +1090,11 @@
// requesting view focus in onFirstLayout(), actually request view focus and
// animate the focused state if we are alt-tabbing now, after the window enter
// animation is completed
- if (mFocusedTaskIndex != -1) {
+ if (mFocusedTask != null) {
RecentsConfiguration config = Recents.getConfiguration();
RecentsActivityLaunchState launchState = config.getLaunchState();
- setFocusedTask(mFocusedTaskIndex, false /* scrollToTask */,
- launchState.launchedWithAltTab);
+ setFocusedTask(mStack.indexOfStackTask(mFocusedTask),
+ false /* scrollToTask */, launchState.launchedWithAltTab);
}
}
});
@@ -1100,6 +1108,11 @@
mStackScroller.stopBoundScrollAnimation();
// Animate all the task views out of view
ctx.offscreenTranslationY = mLayoutAlgorithm.mStackRect.bottom;
+ // Dismiss the freeform workspace background
+ int taskViewExitToHomeDuration = getResources().getInteger(
+ R.integer.recents_task_exit_to_home_duration);
+ animateFreeformWorkspaceBackgroundAlpha(0, taskViewExitToHomeDuration,
+ mFastOutSlowInInterpolator);
List<TaskView> taskViews = getTaskViews();
int taskViewCount = taskViews.size();
@@ -1151,6 +1164,14 @@
super.dispatchDraw(canvas);
}
+ @Override
+ protected boolean verifyDrawable(Drawable who) {
+ if (who == mFreeformWorkspaceBackground) {
+ return true;
+ }
+ return super.verifyDrawable(who);
+ }
+
/**
* Launches the freeform tasks.
*/
@@ -1166,9 +1187,9 @@
/**** TaskStackCallbacks Implementation ****/
@Override
- public void onStackTaskRemoved(TaskStack stack, Task removedTask, int removedTaskIndex,
- boolean wasFrontMostTask, Task newFrontMostTask) {
- if (mFocusedTaskIndex == removedTaskIndex) {
+ public void onStackTaskRemoved(TaskStack stack, Task removedTask, boolean wasFrontMostTask,
+ Task newFrontMostTask) {
+ if (mFocusedTask == removedTask) {
resetFocusedTask(removedTask);
}
@@ -1297,19 +1318,8 @@
tv.setNoUserInteractionState();
// Find the index where this task should be placed in the stack
- int insertIndex = -1;
int taskIndex = mStack.indexOfStackTask(task);
- if (taskIndex != -1) {
- List<TaskView> taskViews = getTaskViews();
- int taskViewCount = taskViews.size();
- for (int i = 0; i < taskViewCount; i++) {
- Task tvTask = taskViews.get(i).getTask();
- if (taskIndex < mStack.indexOfStackTask(tvTask)) {
- insertIndex = i;
- break;
- }
- }
- }
+ int insertIndex = findTaskViewInsertIndex(task, taskIndex);
// Add/attach the view to the hierarchy
if (isNewView) {
@@ -1327,7 +1337,7 @@
tv.setCallbacks(this);
tv.setTouchEnabled(true);
tv.setClipViewInStack(true);
- if (mFocusedTaskIndex == taskIndex) {
+ if (mFocusedTask == task) {
tv.setFocusedState(true, false /* animated */, false /* requestViewFocus */);
}
}
@@ -1413,10 +1423,12 @@
}
public final void onBusEvent(DismissFocusedTaskViewEvent event) {
- if (mFocusedTaskIndex != -1) {
- Task t = mStack.getStackTasks().get(mFocusedTaskIndex);
- TaskView tv = getChildViewForTask(t);
- tv.dismissTask();
+ if (mFocusedTask != null) {
+ TaskView tv = getChildViewForTask(mFocusedTask);
+ if (tv != null) {
+ tv.dismissTask();
+ }
+ resetFocusedTask(mFocusedTask);
}
}
@@ -1558,4 +1570,50 @@
// Remove the task from the stack
mStack.removeTask(task);
}
+
+ /**
+ * Starts an alpha animation on the freeform workspace background.
+ */
+ private void animateFreeformWorkspaceBackgroundAlpha(int targetAlpha, int duration,
+ Interpolator interpolator) {
+ if (mFreeformWorkspaceBackground.getAlpha() == targetAlpha) {
+ return;
+ }
+
+ Utilities.cancelAnimationWithoutCallbacks(mFreeformWorkspaceBackgroundAnimator);
+ mFreeformWorkspaceBackgroundAnimator = ObjectAnimator.ofInt(mFreeformWorkspaceBackground,
+ COLOR_DRAWABLE_ALPHA, mFreeformWorkspaceBackground.getAlpha(), targetAlpha);
+ mFreeformWorkspaceBackgroundAnimator.setDuration(duration);
+ mFreeformWorkspaceBackgroundAnimator.setInterpolator(interpolator);
+ mFreeformWorkspaceBackgroundAnimator.start();
+ }
+
+ /**
+ * Returns the insert index for the task in the current set of task views. If the given task
+ * is already in the task view list, then this method returns the insert index assuming it
+ * is first removed at the previous index.
+ *
+ * @param task the task we are finding the index for
+ * @param taskIndex the index of the task in the stack
+ */
+ private int findTaskViewInsertIndex(Task task, int taskIndex) {
+ if (taskIndex != -1) {
+ List<TaskView> taskViews = getTaskViews();
+ boolean foundTaskView = false;
+ int taskViewCount = taskViews.size();
+ for (int i = 0; i < taskViewCount; i++) {
+ Task tvTask = taskViews.get(i).getTask();
+ if (tvTask == task) {
+ foundTaskView = true;
+ } else if (taskIndex < mStack.indexOfStackTask(tvTask)) {
+ if (foundTaskView) {
+ return i - 1;
+ } else {
+ return i;
+ }
+ }
+ }
+ }
+ return -1;
+ }
}
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackViewScroller.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackViewScroller.java
index 4095d2e..56942a8 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackViewScroller.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackViewScroller.java
@@ -49,7 +49,7 @@
ObjectAnimator mScrollAnimator;
float mFinalAnimatedScroll;
- Interpolator mLinearOutSlowInInterpolator;
+ private Interpolator mLinearOutSlowInInterpolator;
public TaskStackViewScroller(Context context, TaskStackLayoutAlgorithm layoutAlgorithm) {
mContext = context;
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackViewTouchHandler.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackViewTouchHandler.java
index 907ed2f..1a6f129 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackViewTouchHandler.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackViewTouchHandler.java
@@ -176,11 +176,11 @@
}
case MotionEvent.ACTION_POINTER_DOWN: {
final int index = ev.getActionIndex();
- mDownX = (int) ev.getX();
- mDownY = (int) ev.getY();
+ mActivePointerId = ev.getPointerId(index);
+ mDownX = (int) ev.getX(index);
+ mDownY = (int) ev.getY(index);
mLastY = mDownY;
mDownScrollP = mScroller.getStackScroll();
- mActivePointerId = ev.getPointerId(index);
mVelocityTracker.addMovement(ev);
break;
}
@@ -221,6 +221,10 @@
// Select a new active pointer id and reset the motion state
final int newPointerIndex = (pointerIndex == 0) ? 1 : 0;
mActivePointerId = ev.getPointerId(newPointerIndex);
+ mDownX = (int) ev.getX(pointerIndex);
+ mDownY = (int) ev.getY(pointerIndex);
+ mLastY = mDownY;
+ mDownScrollP = mScroller.getStackScroll();
}
mVelocityTracker.addMovement(ev);
break;
diff --git a/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java b/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java
index 98f3f0c..93264ff 100644
--- a/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java
+++ b/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java
@@ -74,7 +74,7 @@
private final Rect mTmpRect = new Rect();
private final Rect mLastResizeRect = new Rect();
- private final WindowManagerProxy mWindowManagerProxy = new WindowManagerProxy();
+ private final WindowManagerProxy mWindowManagerProxy = WindowManagerProxy.getInstance();
private Interpolator mFastOutSlowInInterpolator;
private final Interpolator mTouchResponseInterpolator =
new PathInterpolator(0.3f, 0f, 0.1f, 1f);
diff --git a/packages/SystemUI/src/com/android/systemui/stackdivider/WindowManagerProxy.java b/packages/SystemUI/src/com/android/systemui/stackdivider/WindowManagerProxy.java
index 0d3f803..58de5d5 100644
--- a/packages/SystemUI/src/com/android/systemui/stackdivider/WindowManagerProxy.java
+++ b/packages/SystemUI/src/com/android/systemui/stackdivider/WindowManagerProxy.java
@@ -37,6 +37,8 @@
private static final String TAG = "WindowManagerProxy";
+ private static final WindowManagerProxy sInstance = new WindowManagerProxy();
+
@GuardedBy("mResizeRect")
private final Rect mResizeRect = new Rect();
private final Rect mTmpRect = new Rect();
@@ -78,6 +80,13 @@
}
};
+ private WindowManagerProxy() {
+ }
+
+ public static WindowManagerProxy getInstance() {
+ return sInstance;
+ }
+
public void resizeDockedStack(Rect rect) {
synchronized (mResizeRect) {
mResizeRect.set(rect);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/BarTransitions.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/BarTransitions.java
index 1601b83..a3f404a 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/BarTransitions.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/BarTransitions.java
@@ -146,7 +146,8 @@
mWarning = 0xffff0000;
} else {
mOpaque = context.getColor(R.color.system_bar_background_opaque);
- mSemiTransparent = context.getColor(R.color.system_bar_background_semi_transparent);
+ mSemiTransparent = context.getColor(
+ com.android.internal.R.color.system_bar_background_semi_transparent);
mTransparent = context.getColor(R.color.system_bar_background_transparent);
mWarning = context.getColor(com.android.internal.R.color.battery_saver_mode_color);
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarGestureHelper.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarGestureHelper.java
index d91bfb9..a2616fe 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarGestureHelper.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarGestureHelper.java
@@ -16,30 +16,29 @@
package com.android.systemui.statusbar.phone;
+import android.app.ActivityManager;
import android.content.Context;
-import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.Rect;
-import android.os.SystemProperties;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.VelocityTracker;
import android.view.ViewConfiguration;
-import android.view.WindowManager;
import com.android.systemui.R;
import com.android.systemui.RecentsComponent;
import com.android.systemui.stackdivider.Divider;
-import com.android.systemui.statusbar.BaseStatusBar;
+import com.android.systemui.tuner.TunerService;
import static android.view.WindowManager.*;
/**
* Class to detect gestures on the navigation bar.
*/
-public class NavigationBarGestureHelper extends GestureDetector.SimpleOnGestureListener {
+public class NavigationBarGestureHelper extends GestureDetector.SimpleOnGestureListener
+ implements TunerService.Tunable {
- private static final String DOCK_WINDOW_GESTURE_ENABLED_PROP = "persist.dock_gesture_enabled";
+ private static final String KEY_DOCK_WINDOW_GESTURE = "overview_nav_bar_gesture";
/**
* When dragging from the navigation bar, we drag in recents.
@@ -53,6 +52,7 @@
private RecentsComponent mRecentsComponent;
private Divider mDivider;
+ private Context mContext;
private boolean mIsVertical;
private boolean mIsRTL;
@@ -69,13 +69,14 @@
private int mDragMode;
public NavigationBarGestureHelper(Context context) {
+ mContext = context;
ViewConfiguration configuration = ViewConfiguration.get(context);
Resources r = context.getResources();
mScrollTouchSlop = r.getDimensionPixelSize(R.dimen.navigation_bar_min_swipe_distance);
mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();
mMinFlingVelocity = configuration.getScaledMinimumFlingVelocity();
mTaskSwitcherDetector = new GestureDetector(context, this);
- mDockWindowEnabled = SystemProperties.getBoolean(DOCK_WINDOW_GESTURE_ENABLED_PROP, false);
+ TunerService.get(context).addTunable(this, KEY_DOCK_WINDOW_GESTURE);
}
public void setComponents(RecentsComponent recentsComponent, Divider divider) {
@@ -172,6 +173,7 @@
== DOCKED_INVALID) {
mDragMode = calculateDragMode();
Rect initialBounds = null;
+ int createMode = ActivityManager.DOCKED_STACK_CREATE_MODE_TOP_OR_LEFT;
if (mDragMode == DRAG_MODE_DIVIDER) {
initialBounds = new Rect();
mDivider.getView().calculateBoundsForPosition(mIsVertical
@@ -181,8 +183,12 @@
? DOCKED_TOP
: DOCKED_LEFT,
initialBounds);
+ } else if (mDragMode == DRAG_MODE_RECENTS && mTouchDownX
+ < mContext.getResources().getDisplayMetrics().widthPixels / 2) {
+ createMode = ActivityManager.DOCKED_STACK_CREATE_MODE_BOTTOM_OR_RIGHT;
}
- mRecentsComponent.dockTopTask(mDragMode == DRAG_MODE_RECENTS, initialBounds);
+ mRecentsComponent.dockTopTask(mDragMode == DRAG_MODE_RECENTS, createMode,
+ initialBounds);
if (mDragMode == DRAG_MODE_DIVIDER) {
mDivider.getView().startDragging();
}
@@ -259,4 +265,14 @@
}
return true;
}
+
+ @Override
+ public void onTuningChanged(String key, String newValue) {
+ switch (key) {
+ case KEY_DOCK_WINDOW_GESTURE:
+ mDockWindowEnabled = (newValue != null) &&
+ (Integer.parseInt(newValue) != 0);
+ break;
+ }
+ }
}
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 685c4e5..e51cf7ac 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -1133,7 +1133,9 @@
@Override
public boolean onLongClick(View v) {
if (mRecents != null) {
- mRecents.dockTopTask(false /* draggingInRecents */, null /* initialBounds */);
+ mRecents.dockTopTask(false /* draggingInRecents */,
+ ActivityManager.DOCKED_STACK_CREATE_MODE_TOP_OR_LEFT,
+ null /* initialBounds */);
return true;
}
return false;
@@ -2486,12 +2488,14 @@
// update status bar mode
final int sbMode = computeBarMode(oldVal, newVal, mStatusBarView.getBarTransitions(),
- View.STATUS_BAR_TRANSIENT, View.STATUS_BAR_TRANSLUCENT);
+ View.STATUS_BAR_TRANSIENT, View.STATUS_BAR_TRANSLUCENT,
+ View.STATUS_BAR_TRANSPARENT);
// update navigation bar mode
final int nbMode = mNavigationBarView == null ? -1 : computeBarMode(
oldVal, newVal, mNavigationBarView.getBarTransitions(),
- View.NAVIGATION_BAR_TRANSIENT, View.NAVIGATION_BAR_TRANSLUCENT);
+ View.NAVIGATION_BAR_TRANSIENT, View.NAVIGATION_BAR_TRANSLUCENT,
+ View.NAVIGATION_BAR_TRANSPARENT);
final boolean sbModeChanged = sbMode != -1;
final boolean nbModeChanged = nbMode != -1;
boolean checkBarModes = false;
@@ -2542,21 +2546,21 @@
}
private int computeBarMode(int oldVis, int newVis, BarTransitions transitions,
- int transientFlag, int translucentFlag) {
- final int oldMode = barMode(oldVis, transientFlag, translucentFlag);
- final int newMode = barMode(newVis, transientFlag, translucentFlag);
+ int transientFlag, int translucentFlag, int transparentFlag) {
+ final int oldMode = barMode(oldVis, transientFlag, translucentFlag, transparentFlag);
+ final int newMode = barMode(newVis, transientFlag, translucentFlag, transparentFlag);
if (oldMode == newMode) {
return -1; // no mode change
}
return newMode;
}
- private int barMode(int vis, int transientFlag, int translucentFlag) {
- int lightsOutTransparent = View.SYSTEM_UI_FLAG_LOW_PROFILE | View.SYSTEM_UI_TRANSPARENT;
+ private int barMode(int vis, int transientFlag, int translucentFlag, int transparentFlag) {
+ int lightsOutTransparent = View.SYSTEM_UI_FLAG_LOW_PROFILE | transparentFlag;
return (vis & transientFlag) != 0 ? MODE_SEMI_TRANSPARENT
: (vis & translucentFlag) != 0 ? MODE_TRANSLUCENT
: (vis & lightsOutTransparent) == lightsOutTransparent ? MODE_LIGHTS_OUT_TRANSPARENT
- : (vis & View.SYSTEM_UI_TRANSPARENT) != 0 ? MODE_TRANSPARENT
+ : (vis & transparentFlag) != 0 ? MODE_TRANSPARENT
: (vis & View.SYSTEM_UI_FLAG_LOW_PROFILE) != 0 ? MODE_LIGHTS_OUT
: MODE_OPAQUE;
}
diff --git a/services/core/java/com/android/server/LockSettingsService.java b/services/core/java/com/android/server/LockSettingsService.java
index 6aa5263..033a4b8 100644
--- a/services/core/java/com/android/server/LockSettingsService.java
+++ b/services/core/java/com/android/server/LockSettingsService.java
@@ -624,7 +624,13 @@
byte[] hash = credentialUtil.toHash(credential, userId);
if (Arrays.equals(hash, storedHash.hash)) {
unlockKeystore(credentialUtil.adjustForKeystore(credential), userId);
- unlockUser(userId, null);
+
+ // TODO: pass through a meaningful token from gatekeeper to
+ // unlock credential keys; for now pass through a stub value to
+ // indicate that we came from a user challenge.
+ final byte[] token = String.valueOf(userId).getBytes();
+ unlockUser(userId, token);
+
// migrate credential to GateKeeper
credentialUtil.setCredential(credential, null, userId);
if (!hasChallenge) {
@@ -677,7 +683,13 @@
if (response.getResponseCode() == VerifyCredentialResponse.RESPONSE_OK) {
// credential has matched
unlockKeystore(credential, userId);
- unlockUser(userId, null);
+
+ // TODO: pass through a meaningful token from gatekeeper to
+ // unlock credential keys; for now pass through a stub value to
+ // indicate that we came from a user challenge.
+ final byte[] token = String.valueOf(userId).getBytes();
+ unlockUser(userId, token);
+
UserInfo info = UserManager.get(mContext).getUserInfo(userId);
if (LockPatternUtils.isSeparateWorkChallengeEnabled() && info.isManagedProfile()) {
TrustManager trustManager =
diff --git a/services/core/java/com/android/server/MountService.java b/services/core/java/com/android/server/MountService.java
index bd43a71..807c0d6 100644
--- a/services/core/java/com/android/server/MountService.java
+++ b/services/core/java/com/android/server/MountService.java
@@ -100,6 +100,7 @@
import com.android.internal.util.HexDump;
import com.android.internal.util.IndentingPrintWriter;
import com.android.internal.util.Preconditions;
+import com.android.internal.widget.LockPatternUtils;
import com.android.server.NativeDaemonConnector.Command;
import com.android.server.NativeDaemonConnector.SensitiveArg;
import com.android.server.pm.PackageManagerService;
@@ -435,6 +436,7 @@
private PackageManagerService mPms;
private final Callbacks mCallbacks;
+ private final LockPatternUtils mLockPatternUtils;
// Two connectors - mConnector & mCryptConnector
private final CountDownLatch mConnectedSignal = new CountDownLatch(2);
@@ -1429,6 +1431,7 @@
mContext = context;
mCallbacks = new Callbacks(FgThread.get().getLooper());
+ mLockPatternUtils = new LockPatternUtils(mContext);
// XXX: This will go away soon in favor of IMountServiceObserver
mPms = (PackageManagerService) ServiceManager.getService("package");
@@ -2721,6 +2724,12 @@
enforcePermission(android.Manifest.permission.STORAGE_INTERNAL);
waitForReady();
+ // When a user has secure lock screen, require a challenge token to
+ // actually unlock. This check is mostly in place for emulation mode.
+ if (mLockPatternUtils.isSecure(userId) && ArrayUtils.isEmpty(token)) {
+ throw new IllegalStateException("Token required to unlock secure user " + userId);
+ }
+
final String encodedToken;
if (ArrayUtils.isEmpty(token)) {
encodedToken = "!";
diff --git a/services/core/java/com/android/server/NativeDaemonConnector.java b/services/core/java/com/android/server/NativeDaemonConnector.java
index e6b6074..d6dbad8 100644
--- a/services/core/java/com/android/server/NativeDaemonConnector.java
+++ b/services/core/java/com/android/server/NativeDaemonConnector.java
@@ -177,6 +177,7 @@
mCallbacks.onDaemonConnected();
+ FileDescriptor[] fdList = null;
byte[] buffer = new byte[BUFFER_SIZE];
int start = 0;
@@ -186,6 +187,7 @@
loge("got " + count + " reading with start = " + start);
break;
}
+ fdList = socket.getAncillaryFileDescriptors();
// Add our starting point to the count and reset the start.
count += start;
@@ -200,8 +202,8 @@
boolean releaseWl = false;
try {
- final NativeDaemonEvent event = NativeDaemonEvent.parseRawEvent(
- rawEvent);
+ final NativeDaemonEvent event =
+ NativeDaemonEvent.parseRawEvent(rawEvent, fdList);
log("RCV <- {" + event + "}");
diff --git a/services/core/java/com/android/server/NativeDaemonEvent.java b/services/core/java/com/android/server/NativeDaemonEvent.java
index 4e61c0b..e6feda3 100644
--- a/services/core/java/com/android/server/NativeDaemonEvent.java
+++ b/services/core/java/com/android/server/NativeDaemonEvent.java
@@ -19,6 +19,7 @@
import android.util.Slog;
import com.google.android.collect.Lists;
+import java.io.FileDescriptor;
import java.util.ArrayList;
/**
@@ -35,15 +36,17 @@
private final String mRawEvent;
private final String mLogMessage;
private String[] mParsed;
+ private FileDescriptor[] mFdList;
private NativeDaemonEvent(int cmdNumber, int code, String message,
- String rawEvent, String logMessage) {
+ String rawEvent, String logMessage, FileDescriptor[] fdList) {
mCmdNumber = cmdNumber;
mCode = code;
mMessage = message;
mRawEvent = rawEvent;
mLogMessage = logMessage;
mParsed = null;
+ mFdList = fdList;
}
static public final String SENSITIVE_MARKER = "{{sensitive}}";
@@ -60,6 +63,10 @@
return mMessage;
}
+ public FileDescriptor[] getFileDescriptors() {
+ return mFdList;
+ }
+
@Deprecated
public String getRawEvent() {
return mRawEvent;
@@ -127,7 +134,7 @@
* @throws IllegalArgumentException when line doesn't match format expected
* from native side.
*/
- public static NativeDaemonEvent parseRawEvent(String rawEvent) {
+ public static NativeDaemonEvent parseRawEvent(String rawEvent, FileDescriptor[] fdList) {
final String[] parsed = rawEvent.split(" ");
if (parsed.length < 2) {
throw new IllegalArgumentException("Insufficient arguments");
@@ -164,7 +171,7 @@
final String message = rawEvent.substring(skiplength);
- return new NativeDaemonEvent(cmdNumber, code, message, rawEvent, logMessage);
+ return new NativeDaemonEvent(cmdNumber, code, message, rawEvent, logMessage, fdList);
}
/**
diff --git a/services/core/java/com/android/server/accounts/AccountManagerService.java b/services/core/java/com/android/server/accounts/AccountManagerService.java
index 93eaf0e..91702cf 100644
--- a/services/core/java/com/android/server/accounts/AccountManagerService.java
+++ b/services/core/java/com/android/server/accounts/AccountManagerService.java
@@ -3484,6 +3484,14 @@
return false;
}
+ final ActivityManager am = mContext.getSystemService(ActivityManager.class);
+ if (am.isUserRunningAndLocked(mAccounts.userId)
+ && !authenticatorInfo.componentInfo.encryptionAware) {
+ Slog.w(TAG, "Blocking binding to authenticator " + authenticatorInfo.componentName
+ + " which isn't encryption aware");
+ return false;
+ }
+
Intent intent = new Intent();
intent.setAction(AccountManager.ACTION_AUTHENTICATOR_INTENT);
intent.setComponent(authenticatorInfo.componentName);
@@ -3498,7 +3506,6 @@
return false;
}
-
return true;
}
}
diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java
index 36a7cee..cae8b8e 100644
--- a/services/core/java/com/android/server/am/ActivityStack.java
+++ b/services/core/java/com/android/server/am/ActivityStack.java
@@ -538,9 +538,8 @@
if (addIndex > 0) {
final ActivityStack topStack = mStacks.get(addIndex - 1);
- if (topStack.mStackId == PINNED_STACK_ID && topStack != this) {
- // The pinned stack is always the top most stack (always-on-top).
- // So, stack is moved just below the pinned stack.
+ if (StackId.isAlwaysOnTop(topStack.mStackId) && topStack != this) {
+ // If the top stack is always on top, we move this stack just below it.
addIndex--;
}
}
@@ -1424,16 +1423,15 @@
final void ensureActivitiesVisibleLocked(ActivityRecord starting, int configChanges,
boolean preserveWindows) {
ActivityRecord top = topRunningActivityLocked();
- if (top == null) {
- return;
- }
if (DEBUG_VISIBILITY) Slog.v(TAG_VISIBILITY, "ensureActivitiesVisible behind " + top
+ " configChanges=0x" + Integer.toHexString(configChanges));
- checkTranslucentActivityWaiting(top);
+ if (top != null) {
+ checkTranslucentActivityWaiting(top);
+ }
// If the top activity is not fullscreen, then we need to
// make sure any activities under it are now visible.
- boolean aboveTop = true;
+ boolean aboveTop = top != null;
final boolean stackInvisible = !isStackVisibleLocked();
boolean behindFullscreenActivity = stackInvisible;
boolean noStackActivityResumed = (isInStackLocked(starting) == null);
@@ -1447,13 +1445,15 @@
if (r.finishing) {
continue;
}
- if (aboveTop && r != top) {
+ final boolean isTop = r == top;
+ if (aboveTop && !isTop) {
continue;
}
aboveTop = false;
// mLaunchingBehind: Activities launching behind are at the back of the task stack
// but must be drawn initially for the animation as though they were visible.
- if (!behindFullscreenActivity || r.mLaunchTaskBehind) {
+ if ((!behindFullscreenActivity || r.mLaunchTaskBehind)
+ && okToShowLocked(r)) {
if (DEBUG_VISIBILITY) Slog.v(TAG_VISIBILITY,
"Make visible? " + r + " finishing=" + r.finishing
+ " state=" + r.state);
@@ -1464,7 +1464,7 @@
}
if (r.app == null || r.app.thread == null) {
- if (makeVisibleAndRestartIfNeeded(starting, configChanges, top,
+ if (makeVisibleAndRestartIfNeeded(starting, configChanges, isTop,
noStackActivityResumed, r)) {
if (activityNdx >= activities.size()) {
// Record may be removed if its process needs to restart.
@@ -1474,18 +1474,19 @@
}
}
} else if (r.visible) {
- if (alreadyVisible(r)) {
+ // If this activity is already visible, then there is nothing to do here.
+ if (handleAlreadyVisible(r)) {
noStackActivityResumed = false;
}
} else {
- becomeVisible(starting, r);
+ makeVisible(starting, r);
}
// Aggregate current change flags.
configChanges |= r.configChangeFlags;
behindFullscreenActivity = updateBehindFullscreen(stackInvisible,
behindFullscreenActivity, task, r);
} else {
- becomeInvisible(stackInvisible, behindFullscreenActivity, r);
+ makeInvisible(stackInvisible, behindFullscreenActivity, r);
}
}
if (mStackId == FREEFORM_WORKSPACE_STACK_ID) {
@@ -1516,12 +1517,12 @@
}
private boolean makeVisibleAndRestartIfNeeded(ActivityRecord starting, int configChanges,
- ActivityRecord top, boolean noStackActivityResumed, ActivityRecord r) {
+ boolean isTop, boolean noStackActivityResumed, ActivityRecord r) {
// We need to make sure the app is running if it's the top, or it is just made visible from
// invisible. If the app is already visible, it must have died while it was visible. In this
// case, we'll show the dead window but will not restart the app. Otherwise we could end up
// thrashing.
- if (r == top || !r.visible) {
+ if (isTop || !r.visible) {
// This activity needs to be visible, but isn't even running...
// get it started and resume if no other stack in this stack is resumed.
if (DEBUG_VISIBILITY) Slog.v(TAG_VISIBILITY, "Start and freeze screen for " + r);
@@ -1540,7 +1541,7 @@
return false;
}
- private void becomeInvisible(boolean stackInvisible, boolean behindFullscreenActivity,
+ private void makeInvisible(boolean stackInvisible, boolean behindFullscreenActivity,
ActivityRecord r) {
if (DEBUG_VISIBILITY) Slog.v(TAG_VISIBILITY, "Make invisible? " + r + " finishing="
+ r.finishing + " state=" + r.state + " stackInvisible=" + stackInvisible
@@ -1606,7 +1607,7 @@
return behindFullscreenActivity;
}
- private void becomeVisible(ActivityRecord starting, ActivityRecord r) {
+ private void makeVisible(ActivityRecord starting, ActivityRecord r) {
// This activity is not currently visible, but is running. Tell it to become visible.
r.visible = true;
if (r.state != ActivityState.RESUMED && r != starting) {
@@ -1631,8 +1632,7 @@
}
}
- private boolean alreadyVisible(ActivityRecord r) {
- // If this activity is already visible, then there is nothing else to do here.
+ private boolean handleAlreadyVisible(ActivityRecord r) {
if (DEBUG_VISIBILITY) Slog.v(TAG_VISIBILITY, "Skipping: already visible at " + r);
r.stopFreezingScreenLocked(false);
try {
diff --git a/services/core/java/com/android/server/am/ActivityStackSupervisor.java b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
index a6af0d10..18b3e62 100644
--- a/services/core/java/com/android/server/am/ActivityStackSupervisor.java
+++ b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
@@ -2702,7 +2702,6 @@
Configuration config) {
if (DEBUG_ALL) Slog.v(TAG, "Activity idle: " + token);
- ArrayList<ActivityRecord> stops = null;
ArrayList<ActivityRecord> finishes = null;
ArrayList<UserState> startingUsers = null;
int NS = 0;
@@ -2756,7 +2755,7 @@
}
// Atomically retrieve all of the other things to do.
- stops = processStoppingActivitiesLocked(true);
+ final ArrayList<ActivityRecord> stops = processStoppingActivitiesLocked(true);
NS = stops != null ? stops.size() : 0;
if ((NF = mFinishingActivities.size()) > 0) {
finishes = new ArrayList<>(mFinishingActivities);
@@ -4304,12 +4303,14 @@
mWindowManager.getStackBounds(stack.mStackId, info.bounds);
info.displayId = Display.DEFAULT_DISPLAY;
info.stackId = stack.mStackId;
+ info.userId = stack.mCurrentUser;
ArrayList<TaskRecord> tasks = stack.getAllTasks();
final int numTasks = tasks.size();
int[] taskIds = new int[numTasks];
String[] taskNames = new String[numTasks];
Rect[] taskBounds = new Rect[numTasks];
+ int[] taskUserIds = new int[numTasks];
for (int i = 0; i < numTasks; ++i) {
final TaskRecord task = tasks.get(i);
taskIds[i] = task.taskId;
@@ -4319,10 +4320,12 @@
: "unknown";
taskBounds[i] = new Rect();
mWindowManager.getTaskBounds(task.taskId, taskBounds[i]);
+ taskUserIds[i] = task.userId;
}
info.taskIds = taskIds;
info.taskNames = taskNames;
info.taskBounds = taskBounds;
+ info.taskUserIds = taskUserIds;
return info;
}
diff --git a/services/core/java/com/android/server/am/UserController.java b/services/core/java/com/android/server/am/UserController.java
index 195465c..f6f82da 100644
--- a/services/core/java/com/android/server/am/UserController.java
+++ b/services/core/java/com/android/server/am/UserController.java
@@ -82,8 +82,6 @@
import java.util.List;
import java.util.Set;
-import libcore.util.EmptyArray;
-
/**
* Helper class for {@link ActivityManagerService} responsible for multi-user functionality.
*/
@@ -223,7 +221,7 @@
AppOpsManager.OP_NONE, null, true, false, MY_PID, SYSTEM_UID, userId);
}
- maybeFinishUserUnlock(uss);
+ maybeUnlockUser(userId);
}
}
@@ -232,7 +230,7 @@
* {@link UserState#STATE_RUNNING}, which only occurs if the user storage is
* actually unlocked.
*/
- void maybeFinishUserUnlock(UserState uss) {
+ void finishUserUnlock(UserState uss) {
final int userId = uss.mHandle.getIdentifier();
synchronized (mService) {
// Bail if we ended up with a stale user
@@ -530,9 +528,12 @@
return userManager;
}
+ private IMountService getMountService() {
+ return IMountService.Stub.asInterface(ServiceManager.getService("mount"));
+ }
+
private boolean isUserKeyUnlocked(int userId) {
- final IMountService mountService = IMountService.Stub
- .asInterface(ServiceManager.getService("mount"));
+ final IMountService mountService = getMountService();
if (mountService != null) {
try {
return mountService.isUserKeyUnlocked(userId);
@@ -743,6 +744,17 @@
}
}
+ /**
+ * Attempt to unlock user without a credential token. This typically
+ * succeeds when the device doesn't have credential-encrypted storage, or
+ * when the the credential-encrypted storage isn't tied to a user-provided
+ * PIN or pattern.
+ */
+ boolean maybeUnlockUser(final int userId) {
+ // Try unlocking storage using empty token
+ return unlockUserCleared(userId, null);
+ }
+
boolean unlockUserCleared(final int userId, byte[] token) {
synchronized (mService) {
// Bail if already running unlocked
@@ -750,19 +762,20 @@
if (uss.state == UserState.STATE_RUNNING) return true;
}
- final UserInfo userInfo = getUserInfo(userId);
- final IMountService mountService = IMountService.Stub
- .asInterface(ServiceManager.getService("mount"));
- try {
- mountService.unlockUserKey(userId, userInfo.serialNumber, token);
- } catch (RemoteException e) {
- Slog.w(TAG, "Failed to unlock: " + e.getMessage());
- return false;
+ if (!isUserKeyUnlocked(userId)) {
+ final UserInfo userInfo = getUserInfo(userId);
+ final IMountService mountService = getMountService();
+ try {
+ mountService.unlockUserKey(userId, userInfo.serialNumber, token);
+ } catch (RemoteException | RuntimeException e) {
+ Slog.w(TAG, "Failed to unlock: " + e.getMessage());
+ return false;
+ }
}
synchronized (mService) {
final UserState uss = mStartedUsers.get(userId);
- maybeFinishUserUnlock(uss);
+ finishUserUnlock(uss);
}
return true;
diff --git a/services/core/java/com/android/server/content/SyncManager.java b/services/core/java/com/android/server/content/SyncManager.java
index 4f53882..a066835 100644
--- a/services/core/java/com/android/server/content/SyncManager.java
+++ b/services/core/java/com/android/server/content/SyncManager.java
@@ -422,8 +422,8 @@
if (Intent.ACTION_USER_REMOVED.equals(action)) {
onUserRemoved(userId);
- } else if (Intent.ACTION_USER_STARTING.equals(action)) {
- onUserStarting(userId);
+ } else if (Intent.ACTION_USER_UNLOCKED.equals(action)) {
+ onUserUnlocked(userId);
} else if (Intent.ACTION_USER_STOPPING.equals(action)) {
onUserStopping(userId);
}
@@ -517,7 +517,7 @@
intentFilter = new IntentFilter();
intentFilter.addAction(Intent.ACTION_USER_REMOVED);
- intentFilter.addAction(Intent.ACTION_USER_STARTING);
+ intentFilter.addAction(Intent.ACTION_USER_UNLOCKED);
intentFilter.addAction(Intent.ACTION_USER_STOPPING);
mContext.registerReceiverAsUser(
mUserIntentReceiver, UserHandle.ALL, intentFilter, null, null);
@@ -1292,7 +1292,7 @@
}
}
- private void onUserStarting(int userId) {
+ private void onUserUnlocked(int userId) {
// Make sure that accounts we're about to use are valid
AccountManagerService.getSingleton().validateAccounts(userId);
@@ -2673,21 +2673,20 @@
final Iterator<SyncOperation> operationIterator =
mSyncQueue.getOperations().iterator();
- final ActivityManager activityManager
- = (ActivityManager) mContext.getSystemService(Context.ACTIVITY_SERVICE);
+ final ActivityManager am = mContext.getSystemService(ActivityManager.class);
final Set<Integer> removedUsers = Sets.newHashSet();
while (operationIterator.hasNext()) {
final SyncOperation op = operationIterator.next();
- // If the user is not running, skip the request.
- if (!activityManager.isUserRunning(op.target.userId)) {
+ // If the user is not running unlocked, skip the request.
+ if (!am.isUserRunningAndUnlocked(op.target.userId)) {
final UserInfo userInfo = mUserManager.getUserInfo(op.target.userId);
if (userInfo == null) {
removedUsers.add(op.target.userId);
}
if (isLoggable) {
Log.v(TAG, " Dropping all sync operations for + "
- + op.target.userId + ": user not running.");
+ + op.target.userId + ": user not running unlocked.");
}
continue;
}
diff --git a/services/core/java/com/android/server/input/InputManagerService.java b/services/core/java/com/android/server/input/InputManagerService.java
index ae8fca8..f2d0031 100644
--- a/services/core/java/com/android/server/input/InputManagerService.java
+++ b/services/core/java/com/android/server/input/InputManagerService.java
@@ -212,6 +212,7 @@
private static native String nativeDump(long ptr);
private static native void nativeMonitor(long ptr);
private static native void nativeSetPointerIconShape(long ptr, int iconId);
+ private static native void nativeReloadPointerIcons(long ptr);
// Input event injection constants defined in InputDispatcher.h.
private static final int INPUT_EVENT_INJECTION_SUCCEEDED = 0;
@@ -311,12 +312,14 @@
registerPointerSpeedSettingObserver();
registerShowTouchesSettingObserver();
+ registerAccessibilityLargePointerSettingObserver();
mContext.registerReceiver(new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
updatePointerSpeedFromSettings();
updateShowTouchesFromSettings();
+ nativeReloadPointerIcons(mPtr);
}
}, new IntentFilter(Intent.ACTION_USER_SWITCHED), null, mHandler);
@@ -1362,6 +1365,17 @@
}, UserHandle.USER_ALL);
}
+ private void registerAccessibilityLargePointerSettingObserver() {
+ mContext.getContentResolver().registerContentObserver(
+ Settings.Secure.getUriFor(Settings.Secure.ACCESSIBILITY_LARGE_POINTER_ICON), true,
+ new ContentObserver(mHandler) {
+ @Override
+ public void onChange(boolean selfChange) {
+ nativeReloadPointerIcons(mPtr);
+ }
+ }, UserHandle.USER_ALL);
+ }
+
private int getShowTouchesSetting(int defaultValue) {
int result = defaultValue;
try {
@@ -1431,11 +1445,11 @@
}
}
- // Binder call
- @Override
- public void setPointerIconShape(int iconId) {
- nativeSetPointerIconShape(mPtr, iconId);
- }
+ // Binder call
+ @Override
+ public void setPointerIconShape(int iconId) {
+ nativeSetPointerIconShape(mPtr, iconId);
+ }
@Override
public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
diff --git a/services/core/java/com/android/server/job/JobStore.java b/services/core/java/com/android/server/job/JobStore.java
index 0004c42..d9f94d0 100644
--- a/services/core/java/com/android/server/job/JobStore.java
+++ b/services/core/java/com/android/server/job/JobStore.java
@@ -278,6 +278,11 @@
// Copy over the jobs so we can release the lock before writing.
for (int i=0; i<mJobSet.size(); i++) {
JobStatus jobStatus = mJobSet.valueAt(i);
+
+ if (!jobStatus.isPersisted()){
+ continue;
+ }
+
JobStatus copy = new JobStatus(jobStatus.getJob(), jobStatus.getUid(),
jobStatus.getEarliestRunTime(), jobStatus.getLatestRunTimeElapsed());
mStoreCopy.add(copy);
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java
index c2666b8..33f39bc 100644
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -1243,6 +1243,20 @@
return mRankingHelper.getTopicVisibilityOverride(pkg, uid, topic);
}
+ @Override
+ public void setTopicImportance(String pkg, int uid, Notification.Topic topic,
+ int importance) {
+ checkCallerIsSystem();
+ mRankingHelper.setTopicImportance(pkg, uid, topic, importance);
+ savePolicyFile();
+ }
+
+ @Override
+ public int getTopicImportance(String pkg, int uid, Notification.Topic topic) {
+ checkCallerIsSystem();
+ return mRankingHelper.getTopicImportance(pkg, uid, topic);
+ }
+
/**
* System-only API for getting a list of current (i.e. not cleared) notifications.
*
@@ -2201,6 +2215,7 @@
}
mRankingHelper.extractSignals(r);
+ savePolicyFile();
// 3. Apply local rules
diff --git a/services/core/java/com/android/server/notification/NotificationRecord.java b/services/core/java/com/android/server/notification/NotificationRecord.java
index 2a7568d..3b7384e 100644
--- a/services/core/java/com/android/server/notification/NotificationRecord.java
+++ b/services/core/java/com/android/server/notification/NotificationRecord.java
@@ -23,6 +23,7 @@
import android.graphics.drawable.Icon;
import android.media.AudioAttributes;
import android.os.UserHandle;
+import android.service.notification.NotificationListenerService;
import android.service.notification.StatusBarNotification;
import com.android.internal.annotations.VisibleForTesting;
@@ -82,6 +83,7 @@
private int mAuthoritativeRank;
private String mGlobalSortKey;
private int mPackageVisibility;
+ private int mTopicImportance = NotificationListenerService.Ranking.IMPORTANCE_UNSPECIFIED;
private int mSuppressedVisualEffects = 0;
@@ -106,6 +108,7 @@
mRankingTimeMs = calculateRankingTimeMs(previous.getRankingTimeMs());
mCreationTimeMs = previous.mCreationTimeMs;
mVisibleSinceMs = previous.mVisibleSinceMs;
+ mTopicImportance = previous.mTopicImportance;
// Don't copy mGlobalSortKey, recompute it.
}
@@ -195,6 +198,8 @@
pw.println(prefix + " mRecentlyIntrusive=" + mRecentlyIntrusive);
pw.println(prefix + " mPackagePriority=" + mPackagePriority);
pw.println(prefix + " mPackageVisibility=" + mPackageVisibility);
+ pw.println(prefix + " mTopicImportance="
+ + NotificationListenerService.Ranking.importanceToString(mTopicImportance));
pw.println(prefix + " mIntercept=" + mIntercept);
pw.println(prefix + " mGlobalSortKey=" + mGlobalSortKey);
pw.println(prefix + " mRankingTimeMs=" + mRankingTimeMs);
@@ -268,6 +273,16 @@
return mPackageVisibility;
}
+ public void setTopicImportance(int importance) {
+ if (importance != NotificationListenerService.Ranking.IMPORTANCE_UNSPECIFIED) {
+ mTopicImportance = importance;
+ }
+ }
+
+ public int getTopicImportance() {
+ return mTopicImportance;
+ }
+
public boolean setIntercepted(boolean intercept) {
mIntercept = intercept;
return mIntercept;
diff --git a/services/core/java/com/android/server/notification/RankingConfig.java b/services/core/java/com/android/server/notification/RankingConfig.java
index 7ee29e4..acdd90a 100644
--- a/services/core/java/com/android/server/notification/RankingConfig.java
+++ b/services/core/java/com/android/server/notification/RankingConfig.java
@@ -31,4 +31,8 @@
void setTopicVisibilityOverride(String packageName, int uid, Notification.Topic topic,
int visibility);
+
+ void setTopicImportance(String packageName, int uid, Notification.Topic topic, int importance);
+
+ int getTopicImportance(String packageName, int uid, Notification.Topic topic);
}
diff --git a/services/core/java/com/android/server/notification/RankingHelper.java b/services/core/java/com/android/server/notification/RankingHelper.java
index 543cd89..5a31c6a 100644
--- a/services/core/java/com/android/server/notification/RankingHelper.java
+++ b/services/core/java/com/android/server/notification/RankingHelper.java
@@ -23,6 +23,7 @@
import android.os.Message;
import android.os.UserHandle;
import android.service.notification.NotificationListenerService;
+import android.service.notification.NotificationListenerService.Ranking;
import android.text.TextUtils;
import android.util.ArrayMap;
import android.util.Slog;
@@ -55,12 +56,13 @@
private static final String ATT_UID = "uid";
private static final String ATT_PRIORITY = "priority";
private static final String ATT_VISIBILITY = "visibility";
+ private static final String ATT_IMPORTANCE = "importance";
private static final String ATT_TOPIC_ID = "id";
private static final String ATT_TOPIC_LABEL = "label";
private static final int DEFAULT_PRIORITY = Notification.PRIORITY_DEFAULT;
- private static final int DEFAULT_VISIBILITY =
- NotificationListenerService.Ranking.VISIBILITY_NO_OVERRIDE;
+ private static final int DEFAULT_VISIBILITY = Ranking.VISIBILITY_NO_OVERRIDE;
+ private static final int DEFAULT_IMPORTANCE = Ranking.IMPORTANCE_UNSPECIFIED;
private final NotificationSignalExtractor[] mSignalExtractors;
private final NotificationComparator mPreliminaryComparator = new NotificationComparator();
@@ -197,6 +199,7 @@
if (TAG_TOPIC.equals(tagName)) {
int priority = safeInt(parser, ATT_PRIORITY, DEFAULT_PRIORITY);
int vis = safeInt(parser, ATT_VISIBILITY, DEFAULT_VISIBILITY);
+ int importance = safeInt(parser, ATT_IMPORTANCE, DEFAULT_IMPORTANCE);
String id = parser.getAttributeValue(null, ATT_TOPIC_ID);
CharSequence label = parser.getAttributeValue(null, ATT_TOPIC_LABEL);
@@ -209,6 +212,9 @@
if (vis != DEFAULT_VISIBILITY) {
topic.visibility = vis;
}
+ if (importance != DEFAULT_IMPORTANCE) {
+ topic.importance = importance;
+ }
r.topics.put(id, topic);
}
}
@@ -267,6 +273,9 @@
if (t.visibility != DEFAULT_VISIBILITY) {
out.attribute(null, ATT_VISIBILITY, Integer.toString(t.visibility));
}
+ if (t.importance != DEFAULT_IMPORTANCE) {
+ out.attribute(null, ATT_IMPORTANCE, Integer.toString(t.importance));
+ }
out.endTag(null, TAG_TOPIC);
}
}
@@ -403,6 +412,20 @@
updateConfig();
}
+ @Override
+ public int getTopicImportance(String packageName, int uid, Notification.Topic topic) {
+ final Record r = getOrCreateRecord(packageName, uid);
+ return getOrCreateTopic(r, topic).importance;
+ }
+
+ @Override
+ public void setTopicImportance(String pkgName, int uid, Notification.Topic topic,
+ int importance) {
+ final Record r = getOrCreateRecord(pkgName, uid);
+ getOrCreateTopic(r, topic).importance = importance;
+ updateConfig();
+ }
+
private Topic getOrCreateTopic(Record r, Notification.Topic topic) {
if (topic == null) {
topic = createDefaultTopic();
@@ -468,6 +491,10 @@
pw.print(" visibility=");
pw.print(Notification.visibilityToString(t.visibility));
}
+ if (t.importance != DEFAULT_IMPORTANCE) {
+ pw.print(" importance=");
+ pw.print(Ranking.importanceToString(t.importance));
+ }
pw.println();
}
}
@@ -512,6 +539,7 @@
Notification.Topic topic;
int priority = DEFAULT_PRIORITY;
int visibility = DEFAULT_VISIBILITY;
+ int importance = DEFAULT_IMPORTANCE;
public Topic(Notification.Topic topic) {
this.topic = topic;
diff --git a/services/core/java/com/android/server/notification/TopicImportanceExtractor.java b/services/core/java/com/android/server/notification/TopicImportanceExtractor.java
new file mode 100644
index 0000000..01770d0
--- /dev/null
+++ b/services/core/java/com/android/server/notification/TopicImportanceExtractor.java
@@ -0,0 +1,56 @@
+/**
+* Copyright (C) 2015 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.notification;
+
+import android.content.Context;
+import android.util.Slog;
+
+/**
+ * Determines the importance of the given notification.
+ */
+public class TopicImportanceExtractor implements NotificationSignalExtractor {
+ private static final String TAG = "ImportantTopicExtractor";
+ private static final boolean DBG = false;
+
+ private RankingConfig mConfig;
+
+ public void initialize(Context ctx, NotificationUsageStats usageStats) {
+ if (DBG) Slog.d(TAG, "Initializing " + getClass().getSimpleName() + ".");
+ }
+
+ public RankingReconsideration process(NotificationRecord record) {
+ if (record == null || record.getNotification() == null) {
+ if (DBG) Slog.d(TAG, "skipping empty notification");
+ return null;
+ }
+
+ if (mConfig == null) {
+ if (DBG) Slog.d(TAG, "missing config");
+ return null;
+ }
+
+ final int topicImportance = mConfig.getTopicImportance(record.sbn.getPackageName(),
+ record.sbn.getUid(), record.sbn.getNotification().getTopic());
+ record.setTopicImportance(topicImportance);
+
+ return null;
+ }
+
+ @Override
+ public void setConfig(RankingConfig config) {
+ mConfig = config;
+ }
+}
diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java
index 8ef8276..6f19911 100644
--- a/services/core/java/com/android/server/pm/PackageManagerService.java
+++ b/services/core/java/com/android/server/pm/PackageManagerService.java
@@ -4868,15 +4868,21 @@
// Check for results in the current profile.
List<ResolveInfo> result = mActivities.queryIntent(
intent, resolvedType, flags, userId);
+ result = filterIfNotSystemUser(result, userId);
// Check for cross profile results.
+ boolean hasNonNegativePriorityResult = hasNonNegativePriority(result);
xpResolveInfo = queryCrossProfileIntents(
- matchingFilters, intent, resolvedType, flags, userId);
+ matchingFilters, intent, resolvedType, flags, userId,
+ hasNonNegativePriorityResult);
if (xpResolveInfo != null && isUserEnabled(xpResolveInfo.targetUserId)) {
- result.add(xpResolveInfo);
- Collections.sort(result, mResolvePrioritySorter);
+ boolean isVisibleToUser = filterIfNotSystemUser(
+ Collections.singletonList(xpResolveInfo), userId).size() > 0;
+ if (isVisibleToUser) {
+ result.add(xpResolveInfo);
+ Collections.sort(result, mResolvePrioritySorter);
+ }
}
- result = filterIfNotSystemUser(result, userId);
if (hasWebURI(intent)) {
CrossProfileDomainInfo xpDomainInfo = null;
final UserInfo parent = getProfileParent(userId);
@@ -5009,6 +5015,14 @@
return resolveInfos;
}
+ /**
+ * @param resolveInfos list of resolve infos in descending priority order
+ * @return if the list contains a resolve info with non-negative priority
+ */
+ private boolean hasNonNegativePriority(List<ResolveInfo> resolveInfos) {
+ return resolveInfos.size() > 0 && resolveInfos.get(0).priority >= 0;
+ }
+
private static boolean hasWebURI(Intent intent) {
if (intent.getData() == null) {
return false;
@@ -5212,10 +5226,10 @@
return null;
}
- // Return matching ResolveInfo if any for skip current profile intent filters.
+ // Return matching ResolveInfo in target user if any.
private ResolveInfo queryCrossProfileIntents(
List<CrossProfileIntentFilter> matchingFilters, Intent intent, String resolvedType,
- int flags, int sourceUserId) {
+ int flags, int sourceUserId, boolean matchInCurrentProfile) {
if (matchingFilters != null) {
// Two {@link CrossProfileIntentFilter}s can have the same targetUserId and
// match the same intent. For performance reasons, it is better not to
@@ -5225,8 +5239,12 @@
for (int i = 0; i < size; i++) {
CrossProfileIntentFilter filter = matchingFilters.get(i);
int targetUserId = filter.getTargetUserId();
- if ((filter.getFlags() & PackageManager.SKIP_CURRENT_PROFILE) == 0
- && !alreadyTriedUserIds.get(targetUserId)) {
+ boolean skipCurrentProfile =
+ (filter.getFlags() & PackageManager.SKIP_CURRENT_PROFILE) != 0;
+ boolean skipCurrentProfileIfNoMatchFound =
+ (filter.getFlags() & PackageManager.ONLY_IF_NO_MATCH_FOUND) != 0;
+ if (!skipCurrentProfile && !alreadyTriedUserIds.get(targetUserId)
+ && (!skipCurrentProfileIfNoMatchFound || !matchInCurrentProfile)) {
// Checking if there are activities in the target user that can handle the
// intent.
ResolveInfo resolveInfo = createForwardingResolveInfo(filter, intent,
diff --git a/services/core/java/com/android/server/pm/PackageManagerShellCommand.java b/services/core/java/com/android/server/pm/PackageManagerShellCommand.java
index dbb5818..c549b8c 100644
--- a/services/core/java/com/android/server/pm/PackageManagerShellCommand.java
+++ b/services/core/java/com/android/server/pm/PackageManagerShellCommand.java
@@ -101,6 +101,8 @@
return runList();
case "uninstall":
return runUninstall();
+ case "resolve-activity":
+ return runResolveActivity();
case "query-intent-activities":
return runQueryIntentActivities();
case "query-intent-services":
@@ -565,6 +567,28 @@
return intent;
}
+ private int runResolveActivity() {
+ Intent intent;
+ try {
+ intent = parseIntentAndUser();
+ } catch (URISyntaxException e) {
+ throw new RuntimeException(e.getMessage(), e);
+ }
+ try {
+ ResolveInfo ri = mInterface.resolveIntent(intent, null, 0, mTargetUser);
+ PrintWriter pw = getOutPrintWriter();
+ if (ri == null) {
+ pw.println("No activity found");
+ } else {
+ PrintWriterPrinter pr = new PrintWriterPrinter(pw);
+ ri.dump(pr, "");
+ }
+ } catch (RemoteException e) {
+ throw new RuntimeException("Failed calling service", e);
+ }
+ return 0;
+ }
+
private int runQueryIntentActivities() {
Intent intent;
try {
@@ -1016,6 +1040,8 @@
pw.println(" -s: short summary");
pw.println(" -d: only list dangerous permissions");
pw.println(" -u: list only the permissions users will see");
+ pw.println(" resolve-intent [--user USER_ID] INTENT");
+ pw.println(" Prints the activity that resolves to the given Intent.");
pw.println(" query-intent-activities [--user USER_ID] INTENT");
pw.println(" Prints all activities that can handle the given Intent.");
pw.println(" query-intent-services [--user USER_ID] INTENT");
diff --git a/services/core/java/com/android/server/policy/BarController.java b/services/core/java/com/android/server/policy/BarController.java
index 051b7fb..0c80ffa 100644
--- a/services/core/java/com/android/server/policy/BarController.java
+++ b/services/core/java/com/android/server/policy/BarController.java
@@ -47,6 +47,7 @@
private final int mTransientFlag;
private final int mUnhideFlag;
private final int mTranslucentFlag;
+ private final int mTransparentFlag;
private final int mStatusBarManagerId;
private final int mTranslucentWmFlag;
protected final Handler mHandler;
@@ -63,13 +64,14 @@
private boolean mNoAnimationOnNextShow;
public BarController(String tag, int transientFlag, int unhideFlag, int translucentFlag,
- int statusBarManagerId, int translucentWmFlag) {
+ int statusBarManagerId, int translucentWmFlag, int transparentFlag) {
mTag = "BarController." + tag;
mTransientFlag = transientFlag;
mUnhideFlag = unhideFlag;
mTranslucentFlag = translucentFlag;
mStatusBarManagerId = statusBarManagerId;
mTranslucentWmFlag = translucentWmFlag;
+ mTransparentFlag = transparentFlag;
mHandler = new Handler();
}
@@ -126,13 +128,13 @@
vis &= ~mTranslucentFlag;
}
if ((fl & WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) != 0) {
- vis |= View.SYSTEM_UI_TRANSPARENT;
+ vis |= mTransparentFlag;
} else {
- vis &= ~View.SYSTEM_UI_TRANSPARENT;
+ vis &= ~mTransparentFlag;
}
} else {
vis = (vis & ~mTranslucentFlag) | (oldVis & mTranslucentFlag);
- vis = (vis & ~View.SYSTEM_UI_TRANSPARENT) | (oldVis & View.SYSTEM_UI_TRANSPARENT);
+ vis = (vis & ~mTransparentFlag) | (oldVis & mTransparentFlag);
}
}
return vis;
@@ -247,7 +249,7 @@
}
}
if (mShowTransparent) {
- vis |= View.SYSTEM_UI_TRANSPARENT;
+ vis |= mTransparentFlag;
if (mSetUnHideFlagWhenNextTransparent) {
vis |= mUnhideFlag;
mSetUnHideFlagWhenNextTransparent = false;
@@ -258,7 +260,7 @@
vis &= ~View.SYSTEM_UI_FLAG_LOW_PROFILE; // never show transient bars in low profile
}
if ((vis & mTranslucentFlag) != 0 || (oldVis & mTranslucentFlag) != 0 ||
- ((vis | oldVis) & View.SYSTEM_UI_TRANSPARENT) != 0) {
+ ((vis | oldVis) & mTransparentFlag) != 0) {
mLastTranslucent = SystemClock.uptimeMillis();
}
return vis;
diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java
index 2031061..fe427d3 100644
--- a/services/core/java/com/android/server/policy/PhoneWindowManager.java
+++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java
@@ -209,7 +209,8 @@
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.STATUS_BAR_TRANSLUCENT
| View.NAVIGATION_BAR_TRANSLUCENT
- | View.SYSTEM_UI_TRANSPARENT;
+ | View.STATUS_BAR_TRANSPARENT
+ | View.NAVIGATION_BAR_TRANSPARENT;
private static final AudioAttributes VIBRATION_ATTRIBUTES = new AudioAttributes.Builder()
.setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
@@ -626,6 +627,8 @@
private final LogDecelerateInterpolator mLogDecelerateInterpolator
= new LogDecelerateInterpolator(100, 0);
+ private boolean mForceWindowDrawsStatusBarBackground;
+
private static final int MSG_ENABLE_POINTER_LOCATION = 1;
private static final int MSG_DISABLE_POINTER_LOCATION = 2;
private static final int MSG_DISPATCH_MEDIA_KEY_WITH_WAKE_LOCK = 3;
@@ -806,7 +809,8 @@
View.NAVIGATION_BAR_UNHIDE,
View.NAVIGATION_BAR_TRANSLUCENT,
StatusBarManager.WINDOW_NAVIGATION_BAR,
- WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
+ WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION,
+ View.NAVIGATION_BAR_TRANSPARENT);
private ImmersiveModeConfirmation mImmersiveModeConfirmation;
@@ -1587,6 +1591,8 @@
mScreenshotChordEnabled = mContext.getResources().getBoolean(
com.android.internal.R.bool.config_enableScreenshotChord);
+ mForceWindowDrawsStatusBarBackground = mContext.getResources().getBoolean(
+ R.bool.config_forceWindowDrawsStatusBarBackground);
mGlobalKeyManager = new GlobalKeyManager(mContext);
@@ -2049,10 +2055,14 @@
attrs.privateFlags &= ~WindowManager.LayoutParams.PRIVATE_FLAG_KEYGUARD;
}
- if (ActivityManager.isHighEndGfx()
- && (attrs.flags & FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) != 0) {
- attrs.subtreeSystemUiVisibility |= View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
- | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION;
+ if (ActivityManager.isHighEndGfx()) {
+ if ((attrs.flags & FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) != 0) {
+ attrs.subtreeSystemUiVisibility |= View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION;
+ }
+ if ((attrs.flags & FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) != 0
+ || mForceWindowDrawsStatusBarBackground) {
+ attrs.subtreeSystemUiVisibility |= View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN;
+ }
}
}
@@ -3609,7 +3619,7 @@
final int sysui = mLastSystemUiFlags;
boolean navVisible = (sysui & View.SYSTEM_UI_FLAG_HIDE_NAVIGATION) == 0;
boolean navTranslucent = (sysui
- & (View.NAVIGATION_BAR_TRANSLUCENT | View.SYSTEM_UI_TRANSPARENT)) != 0;
+ & (View.NAVIGATION_BAR_TRANSLUCENT | View.NAVIGATION_BAR_TRANSPARENT)) != 0;
boolean immersive = (sysui & View.SYSTEM_UI_FLAG_IMMERSIVE) != 0;
boolean immersiveSticky = (sysui & View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY) != 0;
boolean navAllowedHidden = immersive || immersiveSticky;
@@ -3677,7 +3687,7 @@
boolean statusBarTransient = (sysui & View.STATUS_BAR_TRANSIENT) != 0;
boolean statusBarTranslucent = (sysui
- & (View.STATUS_BAR_TRANSLUCENT | View.SYSTEM_UI_TRANSPARENT)) != 0;
+ & (View.STATUS_BAR_TRANSLUCENT | View.STATUS_BAR_TRANSPARENT)) != 0;
if (!isKeyguardShowing) {
statusBarTranslucent &= areTranslucentBarsAllowed();
}
@@ -4008,7 +4018,8 @@
&& (fl & WindowManager.LayoutParams.FLAG_FULLSCREEN) == 0
&& (fl & WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS) == 0
&& (fl & WindowManager.LayoutParams.
- FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) == 0) {
+ FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) == 0
+ && !mForceWindowDrawsStatusBarBackground) {
// Ensure policy decor includes status bar
dcf.top = mStableTop;
}
@@ -6733,10 +6744,7 @@
final boolean freeformStackVisible =
mWindowManagerInternal.isStackVisible(FREEFORM_WORKSPACE_STACK_ID);
final boolean forceShowSystemBars = dockedStackVisible || freeformStackVisible;
- // TODO(multi-window): Update to force opaque independently for status bar and nav bar.
- // This will require refactoring the code to have separate vis flag for each bar so it can
- // be adjusted independently.
- final boolean forceOpaqueSystemBars = forceShowSystemBars;
+ final boolean forceOpaqueSystemBars = forceShowSystemBars && !mForceStatusBarFromKeyguard;
// apply translucent bar vis flags
WindowState transWin = isStatusBarKeyguard() && !mHideLockScreen
@@ -6766,6 +6774,11 @@
| View.SYSTEM_UI_TRANSPARENT);
}
+ if (mForceWindowDrawsStatusBarBackground) {
+ vis |= View.STATUS_BAR_TRANSPARENT;
+ vis &= ~View.STATUS_BAR_TRANSLUCENT;
+ }
+
// update status bar
boolean immersiveSticky =
(vis & View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY) != 0;
diff --git a/services/core/java/com/android/server/policy/StatusBarController.java b/services/core/java/com/android/server/policy/StatusBarController.java
index b935f5a..9d353c6 100644
--- a/services/core/java/com/android/server/policy/StatusBarController.java
+++ b/services/core/java/com/android/server/policy/StatusBarController.java
@@ -111,7 +111,8 @@
View.STATUS_BAR_UNHIDE,
View.STATUS_BAR_TRANSLUCENT,
StatusBarManager.WINDOW_STATUS_BAR,
- WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
+ WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS,
+ View.STATUS_BAR_TRANSPARENT);
}
public AppTransitionListener getAppTransitionListener() {
diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java
index 4bbf586..898a9a4 100644
--- a/services/core/java/com/android/server/wm/DisplayContent.java
+++ b/services/core/java/com/android/server/wm/DisplayContent.java
@@ -237,8 +237,8 @@
}
void moveStack(TaskStack stack, boolean toTop) {
- if (stack.mStackId == PINNED_STACK_ID && !toTop) {
- // Pinned stack is always-on-top silly...
+ if (StackId.isAlwaysOnTop(stack.mStackId) && !toTop) {
+ // This stack is always-on-top silly...
Slog.w(TAG, "Ignoring move of always-on-top stack=" + stack + " to bottom");
return;
}
diff --git a/services/core/java/com/android/server/wm/DockedStackDividerController.java b/services/core/java/com/android/server/wm/DockedStackDividerController.java
index df8d5d6..32c9b2a 100644
--- a/services/core/java/com/android/server/wm/DockedStackDividerController.java
+++ b/services/core/java/com/android/server/wm/DockedStackDividerController.java
@@ -20,8 +20,6 @@
import android.graphics.Rect;
import android.os.RemoteException;
import android.util.Slog;
-import android.util.SparseArray;
-import android.util.SparseIntArray;
import android.view.IDockDividerVisibilityListener;
import static android.app.ActivityManager.StackId.DOCKED_STACK_ID;
@@ -46,6 +44,7 @@
private final Rect mLastRect = new Rect();
private IDockDividerVisibilityListener mListener;
private boolean mLastVisibility = false;
+ private boolean mForceVisibilityReevaluation;
DockedStackDividerController(Context context, DisplayContent displayContent) {
mDisplayContent = displayContent;
@@ -69,16 +68,16 @@
void setWindow(WindowState window) {
mWindow = window;
- reevaluateVisibility();
+ reevaluateVisibility(false);
}
- void reevaluateVisibility() {
+ void reevaluateVisibility(boolean force) {
if (mWindow == null) {
return;
}
TaskStack stack = mDisplayContent.mService.mStackIdToStack.get(DOCKED_STACK_ID);
final boolean visible = stack != null && stack.isVisibleLocked();
- if (mLastVisibility == visible) {
+ if (mLastVisibility == visible && !force) {
return;
}
mLastVisibility = visible;
@@ -131,5 +130,6 @@
throw new IllegalStateException("Dock divider visibility listener already set!");
}
mListener = listener;
+ reevaluateVisibility(true);
}
}
diff --git a/services/core/java/com/android/server/wm/Task.java b/services/core/java/com/android/server/wm/Task.java
index 22f1d63..e4f6c56 100644
--- a/services/core/java/com/android/server/wm/Task.java
+++ b/services/core/java/com/android/server/wm/Task.java
@@ -252,7 +252,7 @@
}
int boundsChange = BOUNDS_CHANGE_NONE;
- if (mBounds.left != bounds.left || mBounds.right != bounds.right) {
+ if (mBounds.left != bounds.left || mBounds.top != bounds.top) {
boundsChange |= BOUNDS_CHANGE_POSITION;
}
if (mBounds.width() != bounds.width() || mBounds.height() != bounds.height()) {
diff --git a/services/core/java/com/android/server/wm/TaskTapPointerEventListener.java b/services/core/java/com/android/server/wm/TaskTapPointerEventListener.java
index 2f890be..af109d4 100644
--- a/services/core/java/com/android/server/wm/TaskTapPointerEventListener.java
+++ b/services/core/java/com/android/server/wm/TaskTapPointerEventListener.java
@@ -109,6 +109,7 @@
final int y = (int) motionEvent.getY();
final Task task = mDisplayContent.findTaskForControlPoint(x, y);
if (task == null) {
+ mPointerIconShape = STYLE_NOT_SPECIFIED;
break;
}
task.getDimBounds(mTmpRect);
@@ -137,6 +138,7 @@
} break;
case MotionEvent.ACTION_HOVER_EXIT:
+ mPointerIconShape = STYLE_NOT_SPECIFIED;
motionEvent.getDevice().setPointerShape(STYLE_DEFAULT);
break;
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java
index 4736c60..410d810 100644
--- a/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -58,6 +58,8 @@
import android.animation.ValueAnimator;
import android.annotation.NonNull;
import android.annotation.Nullable;
+import android.app.ActivityManager;
+import android.app.ActivityManager.StackId;
import android.app.ActivityManagerNative;
import android.app.AppOpsManager;
import android.app.IActivityManager;
@@ -2517,7 +2519,7 @@
}
void repositionChild(Session session, IWindow client,
- int top, int left, int right, int bottom,
+ int left, int top, int right, int bottom,
long deferTransactionUntilFrame, Rect outFrame) {
Trace.traceBegin(Trace.TRACE_TAG_WINDOW_MANAGER, "repositionChild");
long origId = Binder.clearCallingIdentity();
@@ -2538,23 +2540,24 @@
win.mAttrs.y = top;
win.mAttrs.width = right - left;
win.mAttrs.height = bottom - top;
-
win.setWindowScale(win.mRequestedWidth, win.mRequestedHeight);
- win.mWinAnimator.computeShownFrameLocked();
-
if (SHOW_TRANSACTIONS) {
Slog.i(TAG, ">>> OPEN TRANSACTION repositionChild");
}
SurfaceControl.openTransaction();
+ win.applyGravityAndUpdateFrame();
+ win.mWinAnimator.computeShownFrameLocked();
+
+ win.mWinAnimator.setSurfaceBoundariesLocked(false);
+
if (deferTransactionUntilFrame > 0) {
win.mWinAnimator.mSurfaceController.deferTransactionUntil(
win.mAttachedWindow.mWinAnimator.mSurfaceController.getHandle(),
deferTransactionUntilFrame);
}
- win.mWinAnimator.setSurfaceBoundariesLocked(false);
SurfaceControl.closeTransaction();
if (SHOW_TRANSACTIONS) {
@@ -2588,6 +2591,7 @@
if (win == null) {
return 0;
}
+
WindowStateAnimator winAnimator = win.mWinAnimator;
if (viewVisibility != View.GONE) {
win.setRequestedSize(requestedWidth, requestedHeight);
@@ -8028,7 +8032,7 @@
case UPDATE_DOCKED_STACK_DIVIDER: {
synchronized (mWindowMap) {
getDefaultDisplayContentLocked().getDockedDividerController()
- .reevaluateVisibility();
+ .reevaluateVisibility(false);
}
}
break;
@@ -8650,14 +8654,7 @@
} else if (wtoken != null) {
winAnimator.mAnimLayer =
w.mLayer + wtoken.mAppAnimator.animLayerAdjustment;
- if (wtoken.mWillReplaceWindow && wtoken.mReplacingWindow != w
- && wtoken.mAnimateReplacingWindow) {
- // We know that we will be animating a relaunching window in the near future,
- // which will receive a z-order increase. We want the replaced window to
- // immediately receive the same treatment, e.g. to be above the dock divider.
- w.mLayer += TYPE_LAYER_OFFSET;
- winAnimator.mAnimLayer += TYPE_LAYER_OFFSET;
- }
+ forceHigherLayerIfNeeded(w, winAnimator, wtoken);
} else {
winAnimator.mAnimLayer = w.mLayer;
}
@@ -8694,6 +8691,30 @@
}
}
+ private void forceHigherLayerIfNeeded(WindowState w, WindowStateAnimator winAnimator,
+ AppWindowToken wtoken) {
+ boolean force = false;
+ if (wtoken.mWillReplaceWindow && wtoken.mReplacingWindow != w
+ && wtoken.mAnimateReplacingWindow) {
+ // We know that we will be animating a relaunching window in the near future,
+ // which will receive a z-order increase. We want the replaced window to
+ // immediately receive the same treatment, e.g. to be above the dock divider.
+ force = true;
+ }
+ if (!force) {
+ final TaskStack stack = w.getStack();
+ if (stack != null && StackId.isAlwaysOnTop(stack.mStackId)) {
+ // If the window's stack is always on top, we want to make it above other windows
+ // also when these windows are animating.
+ force = true;
+ }
+ }
+ if (force) {
+ w.mLayer += TYPE_LAYER_OFFSET;
+ winAnimator.mAnimLayer += TYPE_LAYER_OFFSET;
+ }
+ }
+
void makeWindowFreezingScreenIfNeededLocked(WindowState w) {
// If the screen is currently frozen or off, then keep
// it frozen/off until this window draws at its new
@@ -10193,7 +10214,7 @@
public void setReplacingWindow(IBinder token, boolean animate) {
synchronized (mWindowMap) {
AppWindowToken appWindowToken = findAppWindowToken(token);
- if (appWindowToken == null) {
+ if (appWindowToken == null || !appWindowToken.isVisible()) {
Slog.w(TAG, "Attempted to set replacing window on non-existing app token " + token);
return;
}
diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java
index cfa2bb3..5e38492 100644
--- a/services/core/java/com/android/server/wm/WindowState.java
+++ b/services/core/java/com/android/server/wm/WindowState.java
@@ -72,6 +72,7 @@
import static android.view.WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED;
import static android.view.WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON;
import static android.view.WindowManager.LayoutParams.LAST_SUB_WINDOW;
+import static android.view.WindowManager.LayoutParams.MATCH_PARENT;
import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_COMPATIBLE_WINDOW;
import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_KEYGUARD;
import static android.view.WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE;
@@ -618,39 +619,6 @@
final int pw = mContainingFrame.width();
final int ph = mContainingFrame.height();
- int w,h;
- if ((mAttrs.flags & FLAG_SCALED) != 0) {
- if (mAttrs.width < 0) {
- w = pw;
- } else if (mEnforceSizeCompat) {
- w = (int)(mAttrs.width * mGlobalScale + .5f);
- } else {
- w = mAttrs.width;
- }
- if (mAttrs.height < 0) {
- h = ph;
- } else if (mEnforceSizeCompat) {
- h = (int)(mAttrs.height * mGlobalScale + .5f);
- } else {
- h = mAttrs.height;
- }
- } else {
- if (mAttrs.width == WindowManager.LayoutParams.MATCH_PARENT) {
- w = pw;
- } else if (mEnforceSizeCompat) {
- w = (int)(mRequestedWidth * mGlobalScale + .5f);
- } else {
- w = mRequestedWidth;
- }
- if (mAttrs.height == WindowManager.LayoutParams.MATCH_PARENT) {
- h = ph;
- } else if (mEnforceSizeCompat) {
- h = (int)(mRequestedHeight * mGlobalScale + .5f);
- } else {
- h = mRequestedHeight;
- }
- }
-
if (!mParentFrame.equals(pf)) {
//Slog.i(TAG, "Window " + this + " content frame from " + mParentFrame
// + " to " + pf);
@@ -676,28 +644,7 @@
final int fw = mFrame.width();
final int fh = mFrame.height();
- float x, y;
- if (mEnforceSizeCompat) {
- x = mAttrs.x * mGlobalScale;
- y = mAttrs.y * mGlobalScale;
- } else {
- x = mAttrs.x;
- y = mAttrs.y;
- }
-
- if (nonFullscreenTask) {
- // Make sure window fits in containing frame since it is in a non-fullscreen stack as
- // required by {@link Gravity#apply} call.
- w = Math.min(w, pw);
- h = Math.min(h, ph);
- }
-
- Gravity.apply(mAttrs.gravity, w, h, mContainingFrame,
- (int) (x + mAttrs.horizontalMargin * pw),
- (int) (y + mAttrs.verticalMargin * ph), mFrame);
-
- // Now make sure the window fits in the overall display frame.
- Gravity.applyDisplay(mAttrs.gravity, mDisplayFrame, mFrame);
+ applyGravityAndUpdateFrame();
// Calculate the outsets before the content frame gets shrinked to the window frame.
if (hasOutsets) {
@@ -2229,4 +2176,69 @@
rect.bottom = rect.top + (int)((rect.bottom - rect.top) / mVScale);
}
}
+
+ void applyGravityAndUpdateFrame() {
+ final int pw = mContainingFrame.width();
+ final int ph = mContainingFrame.height();
+ final Task task = getTask();
+ final boolean nonFullscreenTask = task != null && !task.isFullscreen();
+
+ float x, y;
+ int w,h;
+
+ if ((mAttrs.flags & FLAG_SCALED) != 0) {
+ if (mAttrs.width < 0) {
+ w = pw;
+ } else if (mEnforceSizeCompat) {
+ w = (int)(mAttrs.width * mGlobalScale + .5f);
+ } else {
+ w = mAttrs.width;
+ }
+ if (mAttrs.height < 0) {
+ h = ph;
+ } else if (mEnforceSizeCompat) {
+ h = (int)(mAttrs.height * mGlobalScale + .5f);
+ } else {
+ h = mAttrs.height;
+ }
+ } else {
+ if (mAttrs.width == MATCH_PARENT) {
+ w = pw;
+ } else if (mEnforceSizeCompat) {
+ w = (int)(mRequestedWidth * mGlobalScale + .5f);
+ } else {
+ w = mRequestedWidth;
+ }
+ if (mAttrs.height == MATCH_PARENT) {
+ h = ph;
+ } else if (mEnforceSizeCompat) {
+ h = (int)(mRequestedHeight * mGlobalScale + .5f);
+ } else {
+ h = mRequestedHeight;
+ }
+ }
+
+ if (mEnforceSizeCompat) {
+ x = mAttrs.x * mGlobalScale;
+ y = mAttrs.y * mGlobalScale;
+ } else {
+ x = mAttrs.x;
+ y = mAttrs.y;
+ }
+
+ if (nonFullscreenTask) {
+ // Make sure window fits in containing frame since it is in a non-fullscreen stack as
+ // required by {@link Gravity#apply} call.
+ w = Math.min(w, pw);
+ h = Math.min(h, ph);
+ }
+
+ // Set mFrame
+ Gravity.apply(mAttrs.gravity, w, h, mContainingFrame,
+ (int) (x + mAttrs.horizontalMargin * pw),
+ (int) (y + mAttrs.verticalMargin * ph), mFrame);
+
+ // Now make sure the window fits in the overall display frame.
+ Gravity.applyDisplay(mAttrs.gravity, mDisplayFrame, mFrame);
+ }
}
diff --git a/services/core/jni/com_android_server_input_InputManagerService.cpp b/services/core/jni/com_android_server_input_InputManagerService.cpp
index b5654ee..9c9a5da 100644
--- a/services/core/jni/com_android_server_input_InputManagerService.cpp
+++ b/services/core/jni/com_android_server_input_InputManagerService.cpp
@@ -205,6 +205,7 @@
void setInteractive(bool interactive);
void reloadCalibration();
void setPointerIconShape(int32_t iconId);
+ void reloadPointerIcons();
/* --- InputReaderPolicyInterface implementation --- */
@@ -242,6 +243,7 @@
/* --- PointerControllerPolicyInterface implementation --- */
+ virtual void loadPointerIcon(SpriteIcon* icon);
virtual void loadPointerResources(PointerResources* outResources);
virtual void loadAdditionalMouseResources(std::map<int32_t, SpriteIcon>* outResources,
std::map<int32_t, PointerAnimation>* outAnimationResources);
@@ -477,22 +479,6 @@
v.logicalBottom - v.logicalTop,
v.orientation);
- JNIEnv* env = jniEnv();
- jobject pointerIconObj = env->CallObjectMethod(mServiceObj,
- gServiceClassInfo.getPointerIcon);
- if (!checkAndClearExceptionFromCallback(env, "getPointerIcon")) {
- PointerIcon pointerIcon;
- status_t status = android_view_PointerIcon_load(env, pointerIconObj,
- mContextObj, &pointerIcon);
- if (!status && !pointerIcon.isNullIcon()) {
- controller->setPointerIcon(SpriteIcon(pointerIcon.bitmap,
- pointerIcon.hotSpotX, pointerIcon.hotSpotY));
- } else {
- controller->setPointerIcon(SpriteIcon());
- }
- env->DeleteLocalRef(pointerIconObj);
- }
-
updateInactivityTimeoutLocked(controller);
}
return controller;
@@ -789,12 +775,19 @@
}
void NativeInputManager::setPointerIconShape(int32_t iconId) {
- AutoMutex _l(mLock);
- sp<PointerController> controller = mLocked.pointerController.promote();
- if (controller != NULL) {
- // Use 0 (the default icon) for ARROW.
+ AutoMutex _l(mLock);
+ sp<PointerController> controller = mLocked.pointerController.promote();
+ if (controller != NULL) {
controller->updatePointerShape(iconId);
- }
+ }
+}
+
+void NativeInputManager::reloadPointerIcons() {
+ AutoMutex _l(mLock);
+ sp<PointerController> controller = mLocked.pointerController.promote();
+ if (controller != NULL) {
+ controller->reloadPointerResources();
+ }
}
TouchAffineTransformation NativeInputManager::getTouchAffineTransformation(
@@ -1036,6 +1029,25 @@
return result;
}
+void NativeInputManager::loadPointerIcon(SpriteIcon* icon) {
+ JNIEnv* env = jniEnv();
+
+ ScopedLocalRef<jobject> pointerIconObj(env, env->CallObjectMethod(
+ mServiceObj, gServiceClassInfo.getPointerIcon));
+ if (checkAndClearExceptionFromCallback(env, "getPointerIcon")) {
+ return;
+ }
+
+ PointerIcon pointerIcon;
+ status_t status = android_view_PointerIcon_load(env, pointerIconObj.get(),
+ mContextObj, &pointerIcon);
+ if (!status && !pointerIcon.isNullIcon()) {
+ *icon = SpriteIcon(pointerIcon.bitmap, pointerIcon.hotSpotX, pointerIcon.hotSpotY);
+ } else {
+ *icon = SpriteIcon();
+ }
+}
+
void NativeInputManager::loadPointerResources(PointerResources* outResources) {
JNIEnv* env = jniEnv();
@@ -1420,6 +1432,11 @@
im->setPointerIconShape(iconId);
}
+static void nativeReloadPointerIcons(JNIEnv* /* env */, jclass /* clazz */, jlong ptr) {
+ NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr);
+ im->reloadPointerIcons();
+}
+
// ----------------------------------------------------------------------------
static const JNINativeMethod gInputManagerMethods[] = {
@@ -1480,6 +1497,8 @@
(void*) nativeMonitor },
{ "nativeSetPointerIconShape", "(JI)V",
(void*) nativeSetPointerIconShape },
+ { "nativeReloadPointerIcons", "(J)V",
+ (void*) nativeReloadPointerIcons },
};
#define FIND_CLASS(var, className) \
diff --git a/services/tests/servicestests/src/com/android/server/accounts/AccountManagerServiceTest.java b/services/tests/servicestests/src/com/android/server/accounts/AccountManagerServiceTest.java
index f9aa124..5b4803b 100644
--- a/services/tests/servicestests/src/com/android/server/accounts/AccountManagerServiceTest.java
+++ b/services/tests/servicestests/src/com/android/server/accounts/AccountManagerServiceTest.java
@@ -195,8 +195,8 @@
mServices = new ArrayList<ServiceInfo<AuthenticatorDescription>>();
AuthenticatorDescription d1 = new AuthenticatorDescription("type1", "p1", 0, 0, 0, 0);
AuthenticatorDescription d2 = new AuthenticatorDescription("type2", "p2", 0, 0, 0, 0);
- mServices.add(new ServiceInfo<AuthenticatorDescription>(d1, null, 0));
- mServices.add(new ServiceInfo<AuthenticatorDescription>(d2, null, 0));
+ mServices.add(new ServiceInfo<AuthenticatorDescription>(d1, null, null));
+ mServices.add(new ServiceInfo<AuthenticatorDescription>(d2, null, null));
}
@Override
diff --git a/services/tests/servicestests/src/com/android/server/job/JobStoreTest.java b/services/tests/servicestests/src/com/android/server/job/JobStoreTest.java
index 0b73beb..312b1b0 100644
--- a/services/tests/servicestests/src/com/android/server/job/JobStoreTest.java
+++ b/services/tests/servicestests/src/com/android/server/job/JobStoreTest.java
@@ -183,6 +183,28 @@
}
/**
+ * Test that non persisted job is not written to disk.
+ */
+ public void testNonPersistedTaskIsNotPersisted() throws Exception {
+ JobInfo.Builder b = new Builder(42, mComponent)
+ .setOverrideDeadline(10000)
+ .setPersisted(false);
+ JobStatus jsNonPersisted = new JobStatus(b.build(), SOME_UID);
+ mTaskStoreUnderTest.add(jsNonPersisted);
+ b = new Builder(43, mComponent)
+ .setOverrideDeadline(10000)
+ .setPersisted(true);
+ JobStatus jsPersisted = new JobStatus(b.build(), SOME_UID);
+ mTaskStoreUnderTest.add(jsPersisted);
+ Thread.sleep(IO_WAIT);
+ final ArraySet<JobStatus> jobStatusSet = new ArraySet<JobStatus>();
+ mTaskStoreUnderTest.readJobMapFromDisk(jobStatusSet);
+ assertEquals("Job count is incorrect.", 1, jobStatusSet.size());
+ JobStatus jobStatus = jobStatusSet.iterator().next();
+ assertEquals("Wrong job persisted.", 43, jobStatus.getJobId());
+ }
+
+ /**
* Helper function to throw an error if the provided task and TaskStatus objects are not equal.
*/
private void assertTasksEqual(JobInfo first, JobInfo second) {
diff --git a/services/tests/servicestests/src/com/android/server/notification/RankingHelperTest.java b/services/tests/servicestests/src/com/android/server/notification/RankingHelperTest.java
index b40fd068..d0065cd 100644
--- a/services/tests/servicestests/src/com/android/server/notification/RankingHelperTest.java
+++ b/services/tests/servicestests/src/com/android/server/notification/RankingHelperTest.java
@@ -15,10 +15,17 @@
*/
package com.android.server.notification;
+import static android.service.notification.NotificationListenerService.Ranking.IMPORTANCE_UNSPECIFIED;
+import static android.service.notification.NotificationListenerService.Ranking.IMPORTANCE_HIGH;
+import static android.service.notification.NotificationListenerService.Ranking.IMPORTANCE_LOW;
+import static android.service.notification.NotificationListenerService.Ranking.IMPORTANCE_MAX;
+import static android.service.notification.NotificationListenerService.Ranking.IMPORTANCE_NONE;
+
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import android.app.Notification;
+import android.os.Handler;
import android.os.UserHandle;
import android.service.notification.StatusBarNotification;
import android.test.AndroidTestCase;
@@ -28,6 +35,7 @@
public class RankingHelperTest extends AndroidTestCase {
@Mock NotificationUsageStats mUsageStats;
+ @Mock Handler handler;
private Notification mNotiGroupGSortA;
private Notification mNotiGroupGSortB;
@@ -46,13 +54,15 @@
MockitoAnnotations.initMocks(this);
UserHandle user = UserHandle.ALL;
- mHelper = new RankingHelper(getContext(), null, mUsageStats, new String[0]);
+ mHelper = new RankingHelper(getContext(), handler, mUsageStats,
+ new String[] {TopicImportanceExtractor.class.getName()});
mNotiGroupGSortA = new Notification.Builder(getContext())
.setContentTitle("A")
.setGroup("G")
.setSortKey("A")
.setWhen(1205)
+ .setTopic(new Notification.Topic("A", "a"))
.build();
mRecordGroupGSortA = new NotificationRecord(new StatusBarNotification(
"package", "package", 1, null, 0, 0, 0, mNotiGroupGSortA, user), 0);
@@ -62,6 +72,7 @@
.setGroup("G")
.setSortKey("B")
.setWhen(1200)
+ .setTopic(new Notification.Topic("A", "a"))
.build();
mRecordGroupGSortB = new NotificationRecord(new StatusBarNotification(
"package", "package", 1, null, 0, 0, 0, mNotiGroupGSortB, user), 0);
@@ -69,6 +80,7 @@
mNotiNoGroup = new Notification.Builder(getContext())
.setContentTitle("C")
.setWhen(1201)
+ .setTopic(new Notification.Topic("C", "c"))
.build();
mRecordNoGroup = new NotificationRecord(new StatusBarNotification(
"package", "package", 1, null, 0, 0, 0, mNotiNoGroup, user), 0);
@@ -76,6 +88,7 @@
mNotiNoGroup2 = new Notification.Builder(getContext())
.setContentTitle("D")
.setWhen(1202)
+ .setTopic(new Notification.Topic("D", "d"))
.build();
mRecordNoGroup2 = new NotificationRecord(new StatusBarNotification(
"package", "package", 1, null, 0, 0, 0, mNotiNoGroup2, user), 0);
@@ -84,6 +97,7 @@
.setContentTitle("E")
.setWhen(1201)
.setSortKey("A")
+ .setTopic(new Notification.Topic("E", "e"))
.build();
mRecordNoGroupSortA = new NotificationRecord(new StatusBarNotification(
"package", "package", 1, null, 0, 0, 0, mNotiNoGroupSortA, user), 0);
@@ -138,4 +152,30 @@
ArrayList<NotificationRecord> notificationList = new ArrayList<NotificationRecord>();
mHelper.sort(notificationList);
}
+
+ @SmallTest
+ public void testTopicImportanceExtractor() throws Exception {
+ mHelper.setTopicImportance("package", 0, new Notification.Topic("A", "a"),
+ IMPORTANCE_MAX);
+ // There is no B. There never was a b. Moving on...
+ mHelper.setTopicImportance("package", 0, new Notification.Topic("C", "c"),
+ IMPORTANCE_HIGH);
+ mHelper.setTopicImportance("package", 0, new Notification.Topic("D", "d"),
+ IMPORTANCE_LOW);
+ // watch out: different package.
+ mHelper.setTopicImportance("package2", 0, new Notification.Topic("E", "e"),
+ IMPORTANCE_NONE);
+
+ TopicImportanceExtractor validator = mHelper.findExtractor(TopicImportanceExtractor.class);
+ validator.process(mRecordGroupGSortA);
+ validator.process(mRecordGroupGSortB);
+ validator.process(mRecordNoGroup);
+ validator.process(mRecordNoGroup2);
+ validator.process(mRecordNoGroupSortA);
+ assertTrue(mRecordGroupGSortA.getTopicImportance() == IMPORTANCE_MAX);
+ assertTrue(mRecordGroupGSortB.getTopicImportance() == IMPORTANCE_MAX);
+ assertTrue(mRecordNoGroup.getTopicImportance() == IMPORTANCE_HIGH);
+ assertTrue(mRecordNoGroup2.getTopicImportance() == IMPORTANCE_LOW);
+ assertTrue(mRecordNoGroupSortA.getTopicImportance() == IMPORTANCE_UNSPECIFIED);
+ }
}
diff --git a/services/usb/java/com/android/server/usb/UsbSettingsManager.java b/services/usb/java/com/android/server/usb/UsbSettingsManager.java
index 154cbd3..4786d11 100644
--- a/services/usb/java/com/android/server/usb/UsbSettingsManager.java
+++ b/services/usb/java/com/android/server/usb/UsbSettingsManager.java
@@ -984,7 +984,14 @@
public boolean hasPermission(UsbDevice device) {
synchronized (mLock) {
int uid = Binder.getCallingUid();
- if (uid == Process.SYSTEM_UID || mDisablePermissionDialogs) {
+ int androidMediaUid;
+ try {
+ androidMediaUid = mPackageManager.getApplicationInfo("com.android.mtp", 0).uid;
+ } catch (NameNotFoundException e) {
+ androidMediaUid = -1;
+ }
+ if (uid == Process.SYSTEM_UID || UserHandle.getAppId(uid) == androidMediaUid ||
+ mDisablePermissionDialogs) {
return true;
}
SparseBooleanArray uidList = mDevicePermissionMap.get(device.getDeviceName());
diff --git a/telephony/java/android/telephony/CellSignalStrengthLte.java b/telephony/java/android/telephony/CellSignalStrengthLte.java
index 5a1559a..2606466 100644
--- a/telephony/java/android/telephony/CellSignalStrengthLte.java
+++ b/telephony/java/android/telephony/CellSignalStrengthLte.java
@@ -168,6 +168,20 @@
}
/**
+ * @hide
+ */
+ public int getRsrq() {
+ return mRsrq;
+ }
+
+ /**
+ * @hide
+ */
+ public int getRssnr() {
+ return mRssnr;
+ }
+
+ /**
* Get signal strength as dBm
*/
@Override
diff --git a/telephony/java/android/telephony/PhoneNumberUtils.java b/telephony/java/android/telephony/PhoneNumberUtils.java
index b430340..553221d 100644
--- a/telephony/java/android/telephony/PhoneNumberUtils.java
+++ b/telephony/java/android/telephony/PhoneNumberUtils.java
@@ -2354,7 +2354,7 @@
tempDialStr = postDialStr.substring(dialableIndex);
} else {
// Non-dialable character such as P/W should not be at the end of
- // the dial string after P/W processing in CdmaConnection.java
+ // the dial string after P/W processing in GsmCdmaConnection.java
// Set the postDialStr to "" to break out of the loop
if (dialableIndex < 0) {
postDialStr = "";
diff --git a/telephony/java/android/telephony/ServiceState.java b/telephony/java/android/telephony/ServiceState.java
index 1337487..8537f9c 100644
--- a/telephony/java/android/telephony/ServiceState.java
+++ b/telephony/java/android/telephony/ServiceState.java
@@ -906,7 +906,7 @@
/**
* In CDMA, mOperatorAlphaLong can be set from the ERI text.
- * This is done from the CDMAPhone and not from the CdmaServiceStateTracker.
+ * This is done from the GsmCdmaPhone and not from the ServiceStateTracker.
*
* @hide
*/
diff --git a/wifi/java/android/net/wifi/WifiManager.java b/wifi/java/android/net/wifi/WifiManager.java
index 3fb9667..7a5a74f 100644
--- a/wifi/java/android/net/wifi/WifiManager.java
+++ b/wifi/java/android/net/wifi/WifiManager.java
@@ -188,6 +188,7 @@
*
* @hide
*/
+ @SystemApi
public static final String WIFI_AP_STATE_CHANGED_ACTION =
"android.net.wifi.WIFI_AP_STATE_CHANGED";
@@ -204,6 +205,7 @@
*
* @hide
*/
+ @SystemApi
public static final String EXTRA_WIFI_AP_STATE = "wifi_state";
/**
@@ -222,6 +224,7 @@
*
* @hide
*/
+ @SystemApi
public static final String EXTRA_PREVIOUS_WIFI_AP_STATE = "previous_wifi_state";
/**
* Wi-Fi AP is currently being disabled. The state will change to
@@ -232,6 +235,7 @@
*
* @hide
*/
+ @SystemApi
public static final int WIFI_AP_STATE_DISABLING = 10;
/**
* Wi-Fi AP is disabled.
@@ -241,6 +245,7 @@
*
* @hide
*/
+ @SystemApi
public static final int WIFI_AP_STATE_DISABLED = 11;
/**
* Wi-Fi AP is currently being enabled. The state will change to
@@ -251,6 +256,7 @@
*
* @hide
*/
+ @SystemApi
public static final int WIFI_AP_STATE_ENABLING = 12;
/**
* Wi-Fi AP is enabled.
@@ -260,6 +266,7 @@
*
* @hide
*/
+ @SystemApi
public static final int WIFI_AP_STATE_ENABLED = 13;
/**
* Wi-Fi AP is in a failed state. This state will occur when an error occurs during
@@ -270,6 +277,7 @@
*
* @hide
*/
+ @SystemApi
public static final int WIFI_AP_STATE_FAILED = 14;
/**