Merge "Fixed a bug with the anti-falsing logic with dismissing" into lmp-dev
diff --git a/api/current.txt b/api/current.txt
index a1f2acf..ef9d879 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -5526,8 +5526,8 @@
field public static final java.lang.String EXTRA_PROVISIONING_WIFI_PROXY_PORT = "android.app.extra.PROVISIONING_WIFI_PROXY_PORT";
field public static final java.lang.String EXTRA_PROVISIONING_WIFI_SECURITY_TYPE = "android.app.extra.PROVISIONING_WIFI_SECURITY_TYPE";
field public static final java.lang.String EXTRA_PROVISIONING_WIFI_SSID = "android.app.extra.PROVISIONING_WIFI_SSID";
- field public static int FLAG_MANAGED_CAN_ACCESS_PARENT;
- field public static int FLAG_PARENT_CAN_ACCESS_MANAGED;
+ field public static final int FLAG_MANAGED_CAN_ACCESS_PARENT = 2; // 0x2
+ field public static final int FLAG_PARENT_CAN_ACCESS_MANAGED = 1; // 0x1
field public static final int KEYGUARD_DISABLE_FEATURES_ALL = 2147483647; // 0x7fffffff
field public static final int KEYGUARD_DISABLE_FEATURES_NONE = 0; // 0x0
field public static final int KEYGUARD_DISABLE_FINGERPRINT = 32; // 0x20
@@ -8617,21 +8617,16 @@
public class LauncherApps {
method public void addCallback(android.content.pm.LauncherApps.Callback);
- method public void addCallback(android.content.pm.LauncherApps.Callback, android.os.Handler);
- method public void addOnAppsChangedCallback(android.content.pm.LauncherApps.OnAppsChangedCallback);
- method public void addOnAppsChangedCallback(android.content.pm.LauncherApps.OnAppsChangedCallback, android.os.Handler);
method public java.util.List<android.content.pm.LauncherActivityInfo> getActivityList(java.lang.String, android.os.UserHandle);
method public boolean isActivityEnabled(android.content.ComponentName, android.os.UserHandle);
- method public boolean isActivityEnabledForProfile(android.content.ComponentName, android.os.UserHandle);
method public boolean isPackageEnabled(java.lang.String, android.os.UserHandle);
- method public boolean isPackageEnabledForProfile(java.lang.String, android.os.UserHandle);
+ method public void registerCallback(android.content.pm.LauncherApps.Callback);
+ method public void registerCallback(android.content.pm.LauncherApps.Callback, android.os.Handler);
method public void removeCallback(android.content.pm.LauncherApps.Callback);
- method public void removeOnAppsChangedCallback(android.content.pm.LauncherApps.OnAppsChangedCallback);
method public android.content.pm.LauncherActivityInfo resolveActivity(android.content.Intent, android.os.UserHandle);
- method public void showAppDetailsForProfile(android.content.ComponentName, android.os.UserHandle, android.graphics.Rect, android.os.Bundle);
- method public void startActivityForProfile(android.content.ComponentName, android.os.UserHandle, android.graphics.Rect, android.os.Bundle);
method public void startAppDetailsActivity(android.content.ComponentName, android.os.UserHandle, android.graphics.Rect, android.os.Bundle);
method public void startMainActivity(android.content.ComponentName, android.os.UserHandle, android.graphics.Rect, android.os.Bundle);
+ method public void unregisterCallback(android.content.pm.LauncherApps.Callback);
}
public static abstract class LauncherApps.Callback {
@@ -8643,10 +8638,6 @@
method public abstract void onPackagesUnavailable(java.lang.String[], android.os.UserHandle, boolean);
}
- public static abstract class LauncherApps.OnAppsChangedCallback extends android.content.pm.LauncherApps.Callback {
- ctor public LauncherApps.OnAppsChangedCallback();
- }
-
public class PackageInfo implements android.os.Parcelable {
ctor public PackageInfo();
method public int describeContents();
@@ -8901,6 +8892,7 @@
field public static final java.lang.String FEATURE_FAKETOUCH = "android.hardware.faketouch";
field public static final java.lang.String FEATURE_FAKETOUCH_MULTITOUCH_DISTINCT = "android.hardware.faketouch.multitouch.distinct";
field public static final java.lang.String FEATURE_FAKETOUCH_MULTITOUCH_JAZZHAND = "android.hardware.faketouch.multitouch.jazzhand";
+ field public static final java.lang.String FEATURE_GAMEPAD = "android.hardware.gamepad";
field public static final java.lang.String FEATURE_HOME_SCREEN = "android.software.home_screen";
field public static final java.lang.String FEATURE_INPUT_METHODS = "android.software.input_methods";
field public static final java.lang.String FEATURE_LEANBACK = "android.software.leanback";
@@ -14055,6 +14047,7 @@
field public static final int CONTENT_TYPE_UNKNOWN = 0; // 0x0
field public static final android.os.Parcelable.Creator CREATOR;
field public static final int FLAG_AUDIBILITY_ENFORCED = 1; // 0x1
+ field public static final int FLAG_HW_AV_SYNC = 16; // 0x10
field public static final int USAGE_ALARM = 4; // 0x4
field public static final int USAGE_ASSISTANCE_ACCESSIBILITY = 11; // 0xb
field public static final int USAGE_ASSISTANCE_NAVIGATION_GUIDANCE = 12; // 0xc
@@ -23704,7 +23697,6 @@
field public static final java.lang.String DURATION = "duration";
field public static final java.lang.String EXTRA_CALL_TYPE_FILTER = "android.provider.extra.CALL_TYPE_FILTER";
field public static final java.lang.String FEATURES = "features";
- field public static final int FEATURES_NONE = 0; // 0x0
field public static final int FEATURES_VIDEO = 1; // 0x1
field public static final java.lang.String GEOCODED_LOCATION = "geocoded_location";
field public static final int INCOMING_TYPE = 1; // 0x1
@@ -28222,7 +28214,6 @@
method public int describeContents();
method public void writeToParcel(android.os.Parcel, int);
field public static final android.os.Parcelable.Creator CREATOR;
- field public static final int ROUTE_ALL = 15; // 0xf
field public static final int ROUTE_BLUETOOTH = 2; // 0x2
field public static final int ROUTE_EARPIECE = 1; // 0x1
field public static final int ROUTE_SPEAKER = 8; // 0x8
@@ -28239,7 +28230,7 @@
method public final void destroy();
method public final int getCapabilities();
method public final java.util.List<android.telecomm.Connection> getConnections();
- method public final android.telecomm.PhoneAccountHandle getPhoneAccount();
+ method public final android.telecomm.PhoneAccountHandle getPhoneAccountHandle();
method public final int getState();
method public void onDisconnect();
method public void onHold();
@@ -28314,12 +28305,11 @@
}
public final class ConnectionRequest implements android.os.Parcelable {
- ctor public ConnectionRequest(android.telecomm.PhoneAccountHandle, android.net.Uri, int, android.os.Bundle);
+ ctor public ConnectionRequest(android.telecomm.PhoneAccountHandle, android.net.Uri, android.os.Bundle);
method public int describeContents();
method public android.telecomm.PhoneAccountHandle getAccountHandle();
+ method public android.net.Uri getAddress();
method public android.os.Bundle getExtras();
- method public android.net.Uri getHandle();
- method public int getHandlePresentation();
method public void writeToParcel(android.os.Parcel, int);
field public static final android.os.Parcelable.Creator CREATOR;
}
@@ -28350,16 +28340,16 @@
}
public class PhoneAccount implements android.os.Parcelable {
- method public static android.telecomm.PhoneAccount.Builder builder();
+ method public static android.telecomm.PhoneAccount.Builder builder(android.telecomm.PhoneAccountHandle, java.lang.CharSequence);
method public int describeContents();
method public android.telecomm.PhoneAccountHandle getAccountHandle();
+ method public android.net.Uri getAddress();
method public int getCapabilities();
- method public android.net.Uri getHandle();
method public android.graphics.drawable.Drawable getIcon(android.content.Context);
method public int getIconResId();
method public java.lang.CharSequence getLabel();
method public java.lang.CharSequence getShortDescription();
- method public java.lang.String getSubscriptionNumber();
+ method public android.net.Uri getSubscriptionAddress();
method public java.util.List<java.lang.String> getSupportedUriSchemes();
method public boolean supportsUriScheme(java.lang.String);
method public void writeToParcel(android.os.Parcel, int);
@@ -28372,17 +28362,14 @@
}
public static class PhoneAccount.Builder {
- ctor public PhoneAccount.Builder();
+ ctor public PhoneAccount.Builder(android.telecomm.PhoneAccountHandle, java.lang.CharSequence);
method public android.telecomm.PhoneAccount build();
- method public android.telecomm.PhoneAccount.Builder withAccountHandle(android.telecomm.PhoneAccountHandle);
- method public android.telecomm.PhoneAccount.Builder withCapabilities(int);
- method public android.telecomm.PhoneAccount.Builder withHandle(android.net.Uri);
- method public android.telecomm.PhoneAccount.Builder withIconResId(int);
- method public android.telecomm.PhoneAccount.Builder withLabel(java.lang.CharSequence);
- method public android.telecomm.PhoneAccount.Builder withShortDescription(java.lang.CharSequence);
- method public android.telecomm.PhoneAccount.Builder withSubscriptionNumber(java.lang.String);
- method public android.telecomm.PhoneAccount.Builder withSupportedUriScheme(java.lang.String);
- method public android.telecomm.PhoneAccount.Builder withSupportedUriSchemes(java.util.List<java.lang.String>);
+ method public android.telecomm.PhoneAccount.Builder setAddress(android.net.Uri);
+ method public android.telecomm.PhoneAccount.Builder setCapabilities(int);
+ method public android.telecomm.PhoneAccount.Builder setIconResId(int);
+ method public android.telecomm.PhoneAccount.Builder setShortDescription(java.lang.CharSequence);
+ method public android.telecomm.PhoneAccount.Builder setSubscriptionAddress(android.net.Uri);
+ method public android.telecomm.PhoneAccount.Builder setSupportedUriSchemes(java.util.List<java.lang.String>);
}
public class PhoneAccountHandle implements android.os.Parcelable {
@@ -28497,11 +28484,11 @@
public final class StatusHints implements android.os.Parcelable {
ctor public StatusHints(android.content.ComponentName, java.lang.CharSequence, int, android.os.Bundle);
method public int describeContents();
- method public android.content.ComponentName getComponentName();
method public android.os.Bundle getExtras();
method public android.graphics.drawable.Drawable getIcon(android.content.Context);
method public int getIconResId();
method public java.lang.CharSequence getLabel();
+ method public android.content.ComponentName getPackageName();
method public void writeToParcel(android.os.Parcel, int);
field public static final android.os.Parcelable.Creator CREATOR;
}
@@ -28895,8 +28882,6 @@
method public void downloadMultimediaMessage(java.lang.String, android.net.Uri, android.os.Bundle, android.app.PendingIntent);
method public android.os.Bundle getCarrierConfigValues();
method public static android.telephony.SmsManager getDefault();
- method public static android.telephony.SmsManager getSmsManagerUsingSubId(long);
- method public long getSubId();
method public void injectSmsPdu(byte[], java.lang.String, android.app.PendingIntent);
method public void sendDataMessage(java.lang.String, java.lang.String, short, byte[], android.app.PendingIntent, android.app.PendingIntent);
method public void sendMultimediaMessage(android.net.Uri, java.lang.String, android.os.Bundle, android.app.PendingIntent);
diff --git a/core/java/android/accessibilityservice/IAccessibilityServiceConnection.aidl b/core/java/android/accessibilityservice/IAccessibilityServiceConnection.aidl
index 5f7a17d..27a03b6 100644
--- a/core/java/android/accessibilityservice/IAccessibilityServiceConnection.aidl
+++ b/core/java/android/accessibilityservice/IAccessibilityServiceConnection.aidl
@@ -54,6 +54,10 @@
int action, in Bundle arguments, int interactionId,
IAccessibilityInteractionConnectionCallback callback, long threadId);
+ boolean computeClickPointInScreen(int accessibilityWindowId, long accessibilityNodeId,
+ int interactionId, IAccessibilityInteractionConnectionCallback callback,
+ long threadId);
+
AccessibilityWindowInfo getWindow(int windowId);
List<AccessibilityWindowInfo> getWindows();
diff --git a/core/java/android/app/ActivityTransitionCoordinator.java b/core/java/android/app/ActivityTransitionCoordinator.java
index 9e80a4b..9f49194 100644
--- a/core/java/android/app/ActivityTransitionCoordinator.java
+++ b/core/java/android/app/ActivityTransitionCoordinator.java
@@ -205,6 +205,7 @@
private boolean mIsStartingTransition;
private ArrayList<GhostViewListeners> mGhostViewListeners =
new ArrayList<GhostViewListeners>();
+ private ArrayMap<View, Float> mOriginalAlphas = new ArrayMap<View, Float>();
public ActivityTransitionCoordinator(Window window,
ArrayList<String> allSharedElementNames,
@@ -580,6 +581,7 @@
mWindow = null;
mSharedElements.clear();
mTransitioningViews.clear();
+ mOriginalAlphas.clear();
mResultReceiver = null;
mPendingTransition = null;
mListener = null;
@@ -589,10 +591,27 @@
return getWindow().getTransitionBackgroundFadeDuration();
}
- protected static void setTransitionAlpha(ArrayList<View> views, float alpha) {
+ protected void hideViews(ArrayList<View> views) {
int count = views.size();
for (int i = 0; i < count; i++) {
- views.get(i).setTransitionAlpha(alpha);
+ View view = views.get(i);
+ if (!mOriginalAlphas.containsKey(view)) {
+ mOriginalAlphas.put(view, view.getAlpha());
+ }
+ view.setAlpha(0f);
+ view.setTransitionAlpha(0f);
+ }
+ }
+
+ protected void showViews(ArrayList<View> views) {
+ int count = views.size();
+ for (int i = 0; i < count; i++) {
+ View view = views.get(i);
+ Float alpha = mOriginalAlphas.remove(view);
+ if (alpha != null) {
+ view.setAlpha(alpha);
+ view.setTransitionAlpha(1f);
+ }
}
}
diff --git a/core/java/android/app/EnterTransitionCoordinator.java b/core/java/android/app/EnterTransitionCoordinator.java
index f432c49..f38c108 100644
--- a/core/java/android/app/EnterTransitionCoordinator.java
+++ b/core/java/android/app/EnterTransitionCoordinator.java
@@ -112,9 +112,9 @@
protected void viewsReady(ArrayMap<String, View> sharedElements) {
super.viewsReady(sharedElements);
mIsReadyForTransition = true;
- setTransitionAlpha(mSharedElements, 0);
+ hideViews(mSharedElements);
if (getViewsTransition() != null) {
- setTransitionAlpha(mTransitioningViews, 0);
+ hideViews(mTransitioningViews);
}
if (mIsReturning) {
sendSharedElementDestination();
@@ -240,7 +240,7 @@
if (!mIsCanceled) {
mIsCanceled = true;
if (getViewsTransition() == null || mIsViewsTransitionStarted) {
- setTransitionAlpha(mSharedElements, 1);
+ showViews(mSharedElements);
} else {
mTransitioningViews.addAll(mSharedElements);
}
@@ -300,7 +300,7 @@
// Now start shared element transition
ArrayList<View> sharedElementSnapshots = createSnapshots(sharedElementState,
mSharedElementNames);
- setTransitionAlpha(mSharedElements, 1);
+ showViews(mSharedElements);
scheduleSetSharedElementEnd(sharedElementSnapshots);
ArrayList<SharedElementOriginalState> originalImageViewState =
setSharedElementState(sharedElementState, sharedElementSnapshots);
@@ -411,7 +411,7 @@
@Override
public void onTransitionStart(Transition transition) {
mEnterViewsTransition = transition;
- setTransitionAlpha(mTransitioningViews, 1);
+ showViews(mTransitioningViews);
super.onTransitionStart(transition);
}
diff --git a/core/java/android/app/ExitTransitionCoordinator.java b/core/java/android/app/ExitTransitionCoordinator.java
index a59a927..982bbc4 100644
--- a/core/java/android/app/ExitTransitionCoordinator.java
+++ b/core/java/android/app/ExitTransitionCoordinator.java
@@ -126,8 +126,8 @@
}
public void resetViews() {
- setTransitionAlpha(mTransitioningViews, 1);
- setTransitionAlpha(mSharedElements, 1);
+ showViews(mTransitioningViews);
+ showViews(mSharedElements);
mIsHidden = true;
if (!mIsReturning && getDecor() != null) {
getDecor().suppressLayout(false);
@@ -187,7 +187,7 @@
private void hideSharedElements() {
moveSharedElementsFromOverlay();
if (!mIsHidden) {
- setTransitionAlpha(mSharedElements, 0);
+ hideViews(mSharedElements);
}
mSharedElementsHidden = true;
finishIfNecessary();
@@ -296,7 +296,7 @@
transition.removeListener(this);
exitTransitionComplete();
if (mIsHidden) {
- setTransitionAlpha(mTransitioningViews, 1);
+ showViews(mTransitioningViews);
}
if (mSharedElementBundle != null) {
delayCancel();
@@ -323,7 +323,7 @@
transition.removeListener(this);
sharedElementTransitionComplete();
if (mIsHidden) {
- setTransitionAlpha(mSharedElements, 1);
+ showViews(mSharedElements);
}
}
});
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java
index 1083943..c831c25 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -3386,8 +3386,16 @@
*/
public static abstract class Style {
private CharSequence mBigContentTitle;
- private CharSequence mSummaryText = null;
- private boolean mSummaryTextSet = false;
+
+ /**
+ * @hide
+ */
+ protected CharSequence mSummaryText = null;
+
+ /**
+ * @hide
+ */
+ protected boolean mSummaryTextSet = false;
protected Builder mBuilder;
@@ -3679,6 +3687,11 @@
* @see Notification#bigContentView
*/
public static class BigTextStyle extends Style {
+
+ private static final int MAX_LINES = 13;
+ private static final int LINES_CONSUMED_BY_ACTIONS = 3;
+ private static final int LINES_CONSUMED_BY_SUMMARY = 2;
+
private CharSequence mBigText;
public BigTextStyle() {
@@ -3745,6 +3758,7 @@
contentView.setTextViewText(R.id.big_text, mBuilder.processLegacyText(mBigText));
contentView.setViewVisibility(R.id.big_text, View.VISIBLE);
+ contentView.setInt(R.id.big_text, "setMaxLines", calculateMaxLines());
contentView.setViewVisibility(R.id.text2, View.GONE);
applyTopPadding(contentView);
@@ -3756,6 +3770,24 @@
return contentView;
}
+ private int calculateMaxLines() {
+ int lineCount = MAX_LINES;
+ boolean hasActions = mBuilder.mActions.size() > 0;
+ boolean hasSummary = (mSummaryTextSet ? mSummaryText : mBuilder.mSubText) != null;
+ if (hasActions) {
+ lineCount -= LINES_CONSUMED_BY_ACTIONS;
+ }
+ if (hasSummary) {
+ lineCount -= LINES_CONSUMED_BY_SUMMARY;
+ }
+
+ // If we have less top padding at the top, we can fit less lines.
+ if (!mBuilder.mHasThreeLines) {
+ lineCount--;
+ }
+ return lineCount;
+ }
+
/**
* @hide
*/
diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java
index 112fc82..926a348 100644
--- a/core/java/android/app/admin/DevicePolicyManager.java
+++ b/core/java/android/app/admin/DevicePolicyManager.java
@@ -441,13 +441,13 @@
* Flag used by {@link #addCrossProfileIntentFilter} to allow access of certain intents from a
* managed profile to its parent.
*/
- public static int FLAG_PARENT_CAN_ACCESS_MANAGED = 0x0001;
+ public static final int FLAG_PARENT_CAN_ACCESS_MANAGED = 0x0001;
/**
* Flag used by {@link #addCrossProfileIntentFilter} to allow access of certain intents from the
* parent to its managed profile.
*/
- public static int FLAG_MANAGED_CAN_ACCESS_PARENT = 0x0002;
+ public static final int FLAG_MANAGED_CAN_ACCESS_PARENT = 0x0002;
/**
* Return true if the given administrator component is currently
diff --git a/core/java/android/content/ContentProvider.java b/core/java/android/content/ContentProvider.java
index fde8b2e..2853c58 100644
--- a/core/java/android/content/ContentProvider.java
+++ b/core/java/android/content/ContentProvider.java
@@ -639,12 +639,14 @@
* @param authorities the semi-colon separated authorities of the ContentProvider.
*/
protected final void setAuthorities(String authorities) {
- if (authorities.indexOf(';') == -1) {
- mAuthority = authorities;
- mAuthorities = null;
- } else {
- mAuthority = null;
- mAuthorities = authorities.split(";");
+ if (authorities != null) {
+ if (authorities.indexOf(';') == -1) {
+ mAuthority = authorities;
+ mAuthorities = null;
+ } else {
+ mAuthority = null;
+ mAuthorities = authorities.split(";");
+ }
}
}
@@ -653,9 +655,11 @@
if (mAuthority != null) {
return mAuthority.equals(authority);
}
- int length = mAuthorities.length;
- for (int i = 0; i < length; i++) {
- if (mAuthorities[i].equals(authority)) return true;
+ if (mAuthorities != null) {
+ int length = mAuthorities.length;
+ for (int i = 0; i < length; i++) {
+ if (mAuthorities[i].equals(authority)) return true;
+ }
}
return false;
}
diff --git a/core/java/android/content/pm/LauncherApps.java b/core/java/android/content/pm/LauncherApps.java
index f9370b3..d49bc50 100644
--- a/core/java/android/content/pm/LauncherApps.java
+++ b/core/java/android/content/pm/LauncherApps.java
@@ -278,21 +278,21 @@
/**
- * Adds a callback for changes to packages in current and managed profiles.
+ * Registers a callback for changes to packages in current and managed profiles.
*
- * @param callback The callback to add.
+ * @param callback The callback to register.
*/
- public void addCallback(Callback callback) {
- addCallback(callback, null);
+ public void registerCallback(Callback callback) {
+ registerCallback(callback, null);
}
/**
- * Adds a callback for changes to packages in current and managed profiles.
+ * Registers a callback for changes to packages in current and managed profiles.
*
- * @param callback The callback to add.
+ * @param callback The callback to register.
* @param handler that should be used to post callbacks on, may be null.
*/
- public void addCallback(Callback callback, Handler handler) {
+ public void registerCallback(Callback callback, Handler handler) {
synchronized (this) {
if (callback != null && !mCallbacks.contains(callback)) {
boolean addedFirstCallback = mCallbacks.size() == 0;
@@ -308,12 +308,12 @@
}
/**
- * Removes a callback that was previously added.
+ * Unregisters a callback that was previously registered.
*
- * @param callback The callback to remove.
- * @see #addCallback(Callback)
+ * @param callback The callback to unregister.
+ * @see #registerCallback(Callback)
*/
- public void removeCallback(Callback callback) {
+ public void unregisterCallback(Callback callback) {
synchronized (this) {
removeCallbackLocked(callback);
if (mCallbacks.size() == 0) {
@@ -500,44 +500,12 @@
}
}
- /** Remove after unbundled apps have migrated STOP SHIP */
- public static abstract class OnAppsChangedCallback extends Callback {
+ /** STOPSHIP remove when launcher 3 has been updated */
+ public void addCallback(Callback callback) {
+ registerCallback(callback);
}
-
- /** Remove after unbundled apps have migrated STOP SHIP */
- public void addOnAppsChangedCallback(OnAppsChangedCallback callback) {
- addCallback(callback, null);
- }
-
- /** Remove after unbundled apps have migrated STOP SHIP */
- public void addOnAppsChangedCallback(OnAppsChangedCallback callback, Handler handler) {
- addCallback(callback, handler);
- }
-
- /** Remove after unbundled apps have migrated STOP SHIP */
- public void removeOnAppsChangedCallback(OnAppsChangedCallback callback) {
- removeCallback(callback);
- }
-
- /** Remove after unbundled apps have migrated STOP SHIP */
- public void startActivityForProfile(ComponentName component, UserHandle user, Rect sourceBounds,
- Bundle opts) {
- startMainActivity(component, user, sourceBounds, opts);
- }
-
- /** Remove after unbundled apps have migrated STOP SHIP */
- public void showAppDetailsForProfile(ComponentName component, UserHandle user,
- Rect sourceBounds, Bundle opts) {
- startAppDetailsActivity(component, user, sourceBounds, opts);
- }
-
- /** Remove after unbundled apps have migrated STOP SHIP */
- public boolean isPackageEnabledForProfile(String packageName, UserHandle user) {
- return isPackageEnabled(packageName, user);
- }
-
- /** Remove after unbundled apps have migrated STOP SHIP */
- public boolean isActivityEnabledForProfile(ComponentName component, UserHandle user) {
- return isActivityEnabled(component, user);
+ /** STOPSHIP remove when launcher 3 has been updated */
+ public void removeCallback(Callback callback) {
+ unregisterCallback(callback);
}
}
diff --git a/core/java/android/content/pm/PackageInstaller.java b/core/java/android/content/pm/PackageInstaller.java
index 0a211cf..06d4c4a 100644
--- a/core/java/android/content/pm/PackageInstaller.java
+++ b/core/java/android/content/pm/PackageInstaller.java
@@ -285,6 +285,9 @@
*
* @throws IOException if parameters were unsatisfiable, such as lack of
* disk space or unavailable media.
+ * @throws SecurityException when installation services are unavailable,
+ * such as when called from a restricted user.
+ * @throws IllegalArgumentException when {@link SessionParams} is invalid.
* @return positive, non-zero unique ID that represents the created session.
* This ID remains consistent across device reboots until the
* session is finalized. IDs are not reused during a given boot.
@@ -303,6 +306,11 @@
/**
* Open an existing session to actively perform work. To succeed, the caller
* must be the owner of the install session.
+ *
+ * @throws IOException if parameters were unsatisfiable, such as lack of
+ * disk space or unavailable media.
+ * @throws SecurityException when the caller does not own the session, or
+ * the session is invalid.
*/
public @NonNull Session openSession(int sessionId) throws IOException {
try {
@@ -319,6 +327,9 @@
* Update the icon representing the app being installed in a specific
* session. This should be roughly
* {@link ActivityManager#getLauncherLargeIconSize()} in both dimensions.
+ *
+ * @throws SecurityException when the caller does not own the session, or
+ * the session is invalid.
*/
public void updateSessionAppIcon(int sessionId, @Nullable Bitmap appIcon) {
try {
@@ -331,6 +342,9 @@
/**
* Update the label representing the app being installed in a specific
* session.
+ *
+ * @throws SecurityException when the caller does not own the session, or
+ * the session is invalid.
*/
public void updateSessionAppLabel(int sessionId, @Nullable CharSequence appLabel) {
try {
@@ -341,6 +355,15 @@
}
}
+ /**
+ * Completely abandon the given session, destroying all staged data and
+ * rendering it invalid. Abandoned sessions will be reported to
+ * {@link SessionCallback} listeners as failures. This is equivalent to
+ * opening the session and calling {@link Session#abandon()}.
+ *
+ * @throws SecurityException when the caller does not own the session, or
+ * the session is invalid.
+ */
public void abandonSession(int sessionId) {
try {
mInstaller.abandonSession(sessionId);
@@ -350,7 +373,11 @@
}
/**
- * Return details for a specific session.
+ * Return details for a specific session. No special permissions are
+ * required to retrieve these details.
+ *
+ * @return details for the requested session, or {@code null} if the session
+ * does not exist.
*/
public @Nullable SessionInfo getSessionInfo(int sessionId) {
try {
@@ -361,7 +388,7 @@
}
/**
- * Return list of all active install sessions, regardless of the installer.
+ * Return list of all known install sessions, regardless of the installer.
*/
public @NonNull List<SessionInfo> getAllSessions() {
final ApplicationInfo info = mContext.getApplicationInfo();
@@ -379,7 +406,7 @@
}
/**
- * Return list of all install sessions owned by the calling app.
+ * Return list of all known install sessions owned by the calling app.
*/
public @NonNull List<SessionInfo> getMySessions() {
try {
@@ -547,7 +574,8 @@
}
/**
- * Register to watch for session lifecycle events.
+ * Register to watch for session lifecycle events. No special permissions
+ * are required to watch for these events.
*/
public void registerSessionCallback(@NonNull SessionCallback callback) {
registerSessionCallback(callback, new Handler());
@@ -560,7 +588,8 @@
}
/**
- * Register to watch for session lifecycle events.
+ * Register to watch for session lifecycle events. No special permissions
+ * are required to watch for these events.
*
* @param handler to dispatch callback events through, otherwise uses
* calling thread.
@@ -593,7 +622,7 @@
}
/**
- * Unregister an existing callback.
+ * Unregister a previously registered callback.
*/
public void unregisterSessionCallback(@NonNull SessionCallback callback) {
synchronized (mDelegates) {
@@ -686,6 +715,12 @@
* start at the beginning of the file.
* @param lengthBytes total size of the file being written, used to
* preallocate the underlying disk space, or -1 if unknown.
+ * The system may clear various caches as needed to allocate
+ * this space.
+ * @throws IOException if trouble opening the file for writing, such as
+ * lack of disk space or unavailable media.
+ * @throws SecurityException if called after the session has been
+ * committed or abandoned.
*/
public @NonNull OutputStream openWrite(@NonNull String name, long offsetBytes,
long lengthBytes) throws IOException {
@@ -719,6 +754,9 @@
* <p>
* This returns all names which have been previously written through
* {@link #openWrite(String, long, long)} as part of this session.
+ *
+ * @throws SecurityException if called after the session has been
+ * committed or abandoned.
*/
public @NonNull String[] getNames() throws IOException {
try {
@@ -738,6 +776,9 @@
* through {@link #openWrite(String, long, long)} as part of this
* session. For example, this stream may be used to calculate a
* {@link MessageDigest} of a written APK before committing.
+ *
+ * @throws SecurityException if called after the session has been
+ * committed or abandoned.
*/
public @NonNull InputStream openRead(@NonNull String name) throws IOException {
try {
@@ -759,6 +800,9 @@
* Once this method is called, no additional mutations may be performed
* on the session. If the device reboots before the session has been
* finalized, you may commit the session again.
+ *
+ * @throws SecurityException if streams opened through
+ * {@link #openWrite(String, long, long)} are still open.
*/
public void commit(@NonNull IntentSender statusReceiver) {
try {
@@ -783,7 +827,9 @@
/**
* Completely abandon this session, destroying all staged data and
- * rendering it invalid.
+ * rendering it invalid. Abandoned sessions will be reported to
+ * {@link SessionCallback} listeners as failures. This is equivalent to
+ * opening the session and calling {@link Session#abandon()}.
*/
public void abandon() {
try {
@@ -937,6 +983,18 @@
}
/** {@hide} */
+ public void setInstallFlagsInternal() {
+ installFlags |= PackageManager.INSTALL_INTERNAL;
+ installFlags &= ~PackageManager.INSTALL_EXTERNAL;
+ }
+
+ /** {@hide} */
+ public void setInstallFlagsExternal() {
+ installFlags |= PackageManager.INSTALL_EXTERNAL;
+ installFlags &= ~PackageManager.INSTALL_INTERNAL;
+ }
+
+ /** {@hide} */
public void dump(IndentingPrintWriter pw) {
pw.printPair("mode", mode);
pw.printHexPair("installFlags", installFlags);
diff --git a/core/java/android/content/pm/PackageManager.java b/core/java/android/content/pm/PackageManager.java
index 748fca2..8e64e36 100644
--- a/core/java/android/content/pm/PackageManager.java
+++ b/core/java/android/content/pm/PackageManager.java
@@ -1554,6 +1554,15 @@
public static final String FEATURE_HDMI_CEC = "android.hardware.hdmi.cec";
/**
+ * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}:
+ * The device has all of the inputs necessary to be considered a compatible game controller, or
+ * includes a compatible game controller in the box.
+ */
+ @SdkConstant(SdkConstantType.FEATURE)
+ public static final String FEATURE_GAMEPAD = "android.hardware.gamepad";
+
+
+ /**
* Action to external storage service to clean out removed apps.
* @hide
*/
diff --git a/core/java/android/os/FileBridge.java b/core/java/android/os/FileBridge.java
index 022a106..0acf24b 100644
--- a/core/java/android/os/FileBridge.java
+++ b/core/java/android/os/FileBridge.java
@@ -75,6 +75,13 @@
return mClosed;
}
+ public void forceClose() {
+ IoUtils.closeQuietly(mTarget);
+ IoUtils.closeQuietly(mServer);
+ IoUtils.closeQuietly(mClient);
+ mClosed = true;
+ }
+
public void setTargetFile(FileDescriptor target) {
mTarget = target;
}
@@ -89,7 +96,6 @@
try {
while (IoBridge.read(mServer, temp, 0, MSG_LENGTH) == MSG_LENGTH) {
final int cmd = Memory.peekInt(temp, 0, ByteOrder.BIG_ENDIAN);
-
if (cmd == CMD_WRITE) {
// Shuttle data into local file
int len = Memory.peekInt(temp, 4, ByteOrder.BIG_ENDIAN);
@@ -118,15 +124,10 @@
}
}
- } catch (ErrnoException e) {
- Log.wtf(TAG, "Failed during bridge", e);
- } catch (IOException e) {
+ } catch (ErrnoException | IOException e) {
Log.wtf(TAG, "Failed during bridge", e);
} finally {
- IoUtils.closeQuietly(mTarget);
- IoUtils.closeQuietly(mServer);
- IoUtils.closeQuietly(mClient);
- mClosed = true;
+ forceClose();
}
}
@@ -151,6 +152,7 @@
writeCommandAndBlock(CMD_CLOSE, "close()");
} finally {
IoBridge.closeAndSignalBlockedThreads(mClient);
+ IoUtils.closeQuietly(mClientPfd);
}
}
diff --git a/core/java/android/os/Process.java b/core/java/android/os/Process.java
index c3ac012..b2ebc31 100644
--- a/core/java/android/os/Process.java
+++ b/core/java/android/os/Process.java
@@ -468,6 +468,7 @@
* @param targetSdkVersion The target SDK version for the app.
* @param seInfo null-ok SELinux information for the new process.
* @param abi non-null the ABI this app should be started with.
+ * @param instructionSet null-ok the instruction set to use.
* @param zygoteArgs Additional arguments to supply to the zygote process.
*
* @return An object that describes the result of the attempt to start the process.
@@ -482,11 +483,12 @@
int targetSdkVersion,
String seInfo,
String abi,
+ String instructionSet,
String[] zygoteArgs) {
try {
return startViaZygote(processClass, niceName, uid, gid, gids,
debugFlags, mountExternal, targetSdkVersion, seInfo,
- abi, zygoteArgs);
+ abi, instructionSet, zygoteArgs);
} catch (ZygoteStartFailedEx ex) {
Log.e(LOG_TAG,
"Starting VM process through Zygote failed");
@@ -589,6 +591,7 @@
* @param targetSdkVersion The target SDK version for the app.
* @param seInfo null-ok SELinux information for the new process.
* @param abi the ABI the process should use.
+ * @param instructionSet null-ok the instruction set to use.
* @param extraArgs Additional arguments to supply to the zygote process.
* @return An object that describes the result of the attempt to start the process.
* @throws ZygoteStartFailedEx if process start failed for any reason
@@ -601,6 +604,7 @@
int targetSdkVersion,
String seInfo,
String abi,
+ String instructionSet,
String[] extraArgs)
throws ZygoteStartFailedEx {
synchronized(Process.class) {
@@ -660,6 +664,10 @@
argsForZygote.add("--seinfo=" + seInfo);
}
+ if (instructionSet != null) {
+ argsForZygote.add("--instruction-set=" + instructionSet);
+ }
+
argsForZygote.add(processClass);
if (extraArgs != null) {
diff --git a/core/java/android/provider/CallLog.java b/core/java/android/provider/CallLog.java
index 5fa1cc9..a5e86d8 100644
--- a/core/java/android/provider/CallLog.java
+++ b/core/java/android/provider/CallLog.java
@@ -167,8 +167,6 @@
*/
public static final String FEATURES = "features";
- /** Call had no associated features (e.g. voice-only). */
- public static final int FEATURES_NONE = 0x0;
/** Call had video. */
public static final int FEATURES_VIDEO = 0x1;
diff --git a/core/java/android/service/voice/AlwaysOnHotwordDetector.java b/core/java/android/service/voice/AlwaysOnHotwordDetector.java
index 4de5f41..8aa2689 100644
--- a/core/java/android/service/voice/AlwaysOnHotwordDetector.java
+++ b/core/java/android/service/voice/AlwaysOnHotwordDetector.java
@@ -468,19 +468,6 @@
}
/**
- * FIXME: Remove once the prebuilts are updated.
- *
- * @hide
- */
- @Deprecated
- public Intent createIntentToEnroll() {
- if (DBG) Slog.d(TAG, "createIntentToEnroll");
- synchronized (mLock) {
- return getManageIntentLocked(MANAGE_ACTION_ENROLL);
- }
- }
-
- /**
* Creates an intent to start the un-enrollment for the associated keyphrase.
* This intent must be invoked using {@link Activity#startActivityForResult(Intent, int)}.
* Starting re-enrollment is only valid if the keyphrase is already enrolled,
@@ -502,19 +489,6 @@
}
/**
- * FIXME: Remove once the prebuilts are updated.
- *
- * @hide
- */
- @Deprecated
- public Intent createIntentToUnEnroll() {
- if (DBG) Slog.d(TAG, "createIntentToUnEnroll");
- synchronized (mLock) {
- return getManageIntentLocked(MANAGE_ACTION_UN_ENROLL);
- }
- }
-
- /**
* Creates an intent to start the re-enrollment for the associated keyphrase.
* This intent must be invoked using {@link Activity#startActivityForResult(Intent, int)}.
* Starting re-enrollment is only valid if the keyphrase is already enrolled,
@@ -535,19 +509,6 @@
}
}
- /**
- * FIXME: Remove once the prebuilts are updated.
- *
- * @hide
- */
- @Deprecated
- public Intent createIntentToReEnroll() {
- if (DBG) Slog.d(TAG, "createIntentToReEnroll");
- synchronized (mLock) {
- return getManageIntentLocked(MANAGE_ACTION_RE_ENROLL);
- }
- }
-
private Intent getManageIntentLocked(int action) {
if (mAvailability == STATE_INVALID) {
throw new IllegalStateException("getManageIntent called on an invalid detector");
diff --git a/core/java/android/transition/Transition.java b/core/java/android/transition/Transition.java
index 0d1b568..40bb6ec 100644
--- a/core/java/android/transition/Transition.java
+++ b/core/java/android/transition/Transition.java
@@ -1417,9 +1417,9 @@
}
capturePropagationValues(values);
if (start) {
- addViewValues(mStartValues, view, values);
+ addViewValues(mStartValues, view, values, true);
} else {
- addViewValues(mEndValues, view, values);
+ addViewValues(mEndValues, view, values, true);
}
}
}
@@ -1460,7 +1460,7 @@
}
static void addViewValues(TransitionValuesMaps transitionValuesMaps,
- View view, TransitionValues transitionValues) {
+ View view, TransitionValues transitionValues, boolean setTransientState) {
transitionValuesMaps.viewValues.put(view, transitionValues);
int id = view.getId();
if (id >= 0) {
@@ -1489,11 +1489,15 @@
// Duplicate item IDs: cannot match by item ID.
View alreadyMatched = transitionValuesMaps.itemIdValues.get(itemId);
if (alreadyMatched != null) {
- alreadyMatched.setHasTransientState(false);
+ if (setTransientState) {
+ alreadyMatched.setHasTransientState(false);
+ }
transitionValuesMaps.itemIdValues.put(itemId, null);
}
} else {
- view.setHasTransientState(true);
+ if (setTransientState) {
+ view.setHasTransientState(true);
+ }
transitionValuesMaps.itemIdValues.put(itemId, view);
}
}
@@ -1560,9 +1564,9 @@
}
capturePropagationValues(values);
if (start) {
- addViewValues(mStartValues, view, values);
+ addViewValues(mStartValues, view, values, true);
} else {
- addViewValues(mEndValues, view, values);
+ addViewValues(mEndValues, view, values, true);
}
}
if (view instanceof ViewGroup) {
diff --git a/core/java/android/transition/TransitionSet.java b/core/java/android/transition/TransitionSet.java
index f6499ae..56db674 100644
--- a/core/java/android/transition/TransitionSet.java
+++ b/core/java/android/transition/TransitionSet.java
@@ -408,7 +408,7 @@
for (int i = 0; i < numValues; i++) {
View view = values.viewValues.keyAt(i);
if (isValidTarget(view)) {
- addViewValues(included, view, values.viewValues.valueAt(i));
+ addViewValues(included, view, values.viewValues.valueAt(i), false);
}
}
return included;
diff --git a/core/java/android/transition/Visibility.java b/core/java/android/transition/Visibility.java
index 0b02552..d648ca6 100644
--- a/core/java/android/transition/Visibility.java
+++ b/core/java/android/transition/Visibility.java
@@ -358,12 +358,16 @@
overlayView = startView;
} else if (startView.getParent() instanceof View) {
View startParent = (View) startView.getParent();
- if (!isValidTarget(startParent)) {
- if (startView.isAttachedToWindow()) {
- overlayView = copyViewImage(startView);
- } else {
- overlayView = startView;
- }
+ VisibilityInfo parentVisibilityInfo = null;
+ TransitionValues endParentValues = getMatchedTransitionValues(startParent,
+ true);
+ if (endParentValues != null) {
+ TransitionValues startParentValues = getTransitionValues(startParent, true);
+ parentVisibilityInfo =
+ getVisibilityChangeInfo(startParentValues, endParentValues);
+ }
+ if (parentVisibilityInfo == null || !parentVisibilityInfo.visibilityChange) {
+ overlayView = copyViewImage(startView);
} else if (startParent.getParent() == null) {
int id = startParent.getId();
if (id != View.NO_ID && sceneRoot.findViewById(id) != null
diff --git a/core/java/android/view/AccessibilityInteractionController.java b/core/java/android/view/AccessibilityInteractionController.java
index a10dda3..a283b91 100644
--- a/core/java/android/view/AccessibilityInteractionController.java
+++ b/core/java/android/view/AccessibilityInteractionController.java
@@ -19,7 +19,6 @@
import android.graphics.Point;
import android.graphics.Rect;
import android.graphics.Region;
-import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
@@ -101,7 +100,7 @@
IAccessibilityInteractionConnectionCallback callback, int flags, int interrogatingPid,
long interrogatingTid, MagnificationSpec spec) {
Message message = mHandler.obtainMessage();
- message.what = PrivateHandler.MSG_FIND_ACCESSIBLITY_NODE_INFO_BY_ACCESSIBILITY_ID;
+ message.what = PrivateHandler.MSG_FIND_ACCESSIBILITY_NODE_INFO_BY_ACCESSIBILITY_ID;
message.arg1 = flags;
SomeArgs args = SomeArgs.obtain();
@@ -176,7 +175,7 @@
IAccessibilityInteractionConnectionCallback callback, int flags, int interrogatingPid,
long interrogatingTid, MagnificationSpec spec) {
Message message = mHandler.obtainMessage();
- message.what = PrivateHandler.MSG_FIND_ACCESSIBLITY_NODE_INFOS_BY_VIEW_ID;
+ message.what = PrivateHandler.MSG_FIND_ACCESSIBILITY_NODE_INFOS_BY_VIEW_ID;
message.arg1 = flags;
message.arg2 = AccessibilityNodeInfo.getAccessibilityViewId(accessibilityNodeId);
@@ -261,7 +260,7 @@
IAccessibilityInteractionConnectionCallback callback, int flags, int interrogatingPid,
long interrogatingTid, MagnificationSpec spec) {
Message message = mHandler.obtainMessage();
- message.what = PrivateHandler.MSG_FIND_ACCESSIBLITY_NODE_INFO_BY_TEXT;
+ message.what = PrivateHandler.MSG_FIND_ACCESSIBILITY_NODE_INFO_BY_TEXT;
message.arg1 = flags;
SomeArgs args = SomeArgs.obtain();
@@ -637,6 +636,95 @@
}
}
+ public void computeClickPointInScreenClientThread(long accessibilityNodeId,
+ Region interactiveRegion, int interactionId,
+ IAccessibilityInteractionConnectionCallback callback, int interrogatingPid,
+ long interrogatingTid, MagnificationSpec spec) {
+ Message message = mHandler.obtainMessage();
+ message.what = PrivateHandler.MSG_COMPUTE_CLICK_POINT_IN_SCREEN;
+
+ SomeArgs args = SomeArgs.obtain();
+ args.argi1 = AccessibilityNodeInfo.getAccessibilityViewId(accessibilityNodeId);
+ args.argi2 = AccessibilityNodeInfo.getVirtualDescendantId(accessibilityNodeId);
+ args.argi3 = interactionId;
+ args.arg1 = callback;
+ args.arg2 = spec;
+ args.arg3 = interactiveRegion;
+
+ message.obj = args;
+
+ // If the interrogation is performed by the same thread as the main UI
+ // thread in this process, set the message as a static reference so
+ // after this call completes the same thread but in the interrogating
+ // client can handle the message to generate the result.
+ if (interrogatingPid == mMyProcessId && interrogatingTid == mMyLooperThreadId) {
+ AccessibilityInteractionClient.getInstanceForThread(
+ interrogatingTid).setSameThreadMessage(message);
+ } else {
+ mHandler.sendMessage(message);
+ }
+ }
+
+ private void computeClickPointInScreenUiThread(Message message) {
+ SomeArgs args = (SomeArgs) message.obj;
+ final int accessibilityViewId = args.argi1;
+ final int virtualDescendantId = args.argi2;
+ final int interactionId = args.argi3;
+ final IAccessibilityInteractionConnectionCallback callback =
+ (IAccessibilityInteractionConnectionCallback) args.arg1;
+ final MagnificationSpec spec = (MagnificationSpec) args.arg2;
+ final Region interactiveRegion = (Region) args.arg3;
+ args.recycle();
+
+ boolean succeeded = false;
+ Point point = mTempPoint;
+ try {
+ if (mViewRootImpl.mView == null || mViewRootImpl.mAttachInfo == null) {
+ return;
+ }
+ View target = null;
+ if (accessibilityViewId != AccessibilityNodeInfo.UNDEFINED_ITEM_ID) {
+ target = findViewByAccessibilityId(accessibilityViewId);
+ } else {
+ target = mViewRootImpl.mView;
+ }
+ if (target != null && isShown(target)) {
+ AccessibilityNodeProvider provider = target.getAccessibilityNodeProvider();
+ if (provider != null) {
+ // For virtual views just use the center of the bounds in screen.
+ AccessibilityNodeInfo node = null;
+ if (virtualDescendantId != AccessibilityNodeInfo.UNDEFINED_ITEM_ID) {
+ node = provider.createAccessibilityNodeInfo(virtualDescendantId);
+ } else {
+ node = provider.createAccessibilityNodeInfo(
+ AccessibilityNodeProvider.HOST_VIEW_ID);
+ }
+ if (node != null) {
+ succeeded = true;
+ Rect boundsInScreen = mTempRect;
+ node.getBoundsInScreen(boundsInScreen);
+ point.set(boundsInScreen.centerX(), boundsInScreen.centerY());
+ }
+ } else if (virtualDescendantId == AccessibilityNodeInfo.UNDEFINED_ITEM_ID) {
+ // For a real view, ask the view to compute the click point.
+ succeeded = target.computeClickPointInScreenForAccessibility(
+ interactiveRegion, point);
+ }
+ }
+ } finally {
+ try {
+ Point result = null;
+ if (succeeded) {
+ applyAppScaleAndMagnificationSpecIfNeeded(point, spec);
+ result = point;
+ }
+ callback.setComputeClickPointInScreenActionResult(result, interactionId);
+ } catch (RemoteException re) {
+ /* ignore - the other side will time out */
+ }
+ }
+ }
+
private View findViewByAccessibilityId(int accessibilityId) {
View root = mViewRootImpl.mView;
if (root == null) {
@@ -688,6 +776,26 @@
}
}
+ private void applyAppScaleAndMagnificationSpecIfNeeded(Point point,
+ MagnificationSpec spec) {
+ final float applicationScale = mViewRootImpl.mAttachInfo.mApplicationScale;
+ if (!shouldApplyAppScaleAndMagnificationSpec(applicationScale, spec)) {
+ return;
+ }
+
+ if (applicationScale != 1.0f) {
+ point.x *= applicationScale;
+ point.y *= applicationScale;
+ }
+
+ if (spec != null) {
+ point.x *= spec.scale;
+ point.y *= spec.scale;
+ point.x += (int) spec.offsetX;
+ point.y += (int) spec.offsetY;
+ }
+ }
+
private void applyAppScaleAndMagnificationSpecIfNeeded(AccessibilityNodeInfo info,
MagnificationSpec spec) {
if (info == null) {
@@ -1080,11 +1188,12 @@
private class PrivateHandler extends Handler {
private final static int MSG_PERFORM_ACCESSIBILITY_ACTION = 1;
- private final static int MSG_FIND_ACCESSIBLITY_NODE_INFO_BY_ACCESSIBILITY_ID = 2;
- private final static int MSG_FIND_ACCESSIBLITY_NODE_INFOS_BY_VIEW_ID = 3;
- private final static int MSG_FIND_ACCESSIBLITY_NODE_INFO_BY_TEXT = 4;
+ private final static int MSG_FIND_ACCESSIBILITY_NODE_INFO_BY_ACCESSIBILITY_ID = 2;
+ private final static int MSG_FIND_ACCESSIBILITY_NODE_INFOS_BY_VIEW_ID = 3;
+ private final static int MSG_FIND_ACCESSIBILITY_NODE_INFO_BY_TEXT = 4;
private final static int MSG_FIND_FOCUS = 5;
private final static int MSG_FOCUS_SEARCH = 6;
+ private final static int MSG_COMPUTE_CLICK_POINT_IN_SCREEN = 7;
public PrivateHandler(Looper looper) {
super(looper);
@@ -1096,16 +1205,18 @@
switch (type) {
case MSG_PERFORM_ACCESSIBILITY_ACTION:
return "MSG_PERFORM_ACCESSIBILITY_ACTION";
- case MSG_FIND_ACCESSIBLITY_NODE_INFO_BY_ACCESSIBILITY_ID:
- return "MSG_FIND_ACCESSIBLITY_NODE_INFO_BY_ACCESSIBILITY_ID";
- case MSG_FIND_ACCESSIBLITY_NODE_INFOS_BY_VIEW_ID:
- return "MSG_FIND_ACCESSIBLITY_NODE_INFOS_BY_VIEW_ID";
- case MSG_FIND_ACCESSIBLITY_NODE_INFO_BY_TEXT:
- return "MSG_FIND_ACCESSIBLITY_NODE_INFO_BY_TEXT";
+ case MSG_FIND_ACCESSIBILITY_NODE_INFO_BY_ACCESSIBILITY_ID:
+ return "MSG_FIND_ACCESSIBILITY_NODE_INFO_BY_ACCESSIBILITY_ID";
+ case MSG_FIND_ACCESSIBILITY_NODE_INFOS_BY_VIEW_ID:
+ return "MSG_FIND_ACCESSIBILITY_NODE_INFOS_BY_VIEW_ID";
+ case MSG_FIND_ACCESSIBILITY_NODE_INFO_BY_TEXT:
+ return "MSG_FIND_ACCESSIBILITY_NODE_INFO_BY_TEXT";
case MSG_FIND_FOCUS:
return "MSG_FIND_FOCUS";
case MSG_FOCUS_SEARCH:
return "MSG_FOCUS_SEARCH";
+ case MSG_COMPUTE_CLICK_POINT_IN_SCREEN:
+ return "MSG_COMPUTE_CLICK_POINT_IN_SCREEN";
default:
throw new IllegalArgumentException("Unknown message type: " + type);
}
@@ -1115,16 +1226,16 @@
public void handleMessage(Message message) {
final int type = message.what;
switch (type) {
- case MSG_FIND_ACCESSIBLITY_NODE_INFO_BY_ACCESSIBILITY_ID: {
+ case MSG_FIND_ACCESSIBILITY_NODE_INFO_BY_ACCESSIBILITY_ID: {
findAccessibilityNodeInfoByAccessibilityIdUiThread(message);
} break;
case MSG_PERFORM_ACCESSIBILITY_ACTION: {
perfromAccessibilityActionUiThread(message);
} break;
- case MSG_FIND_ACCESSIBLITY_NODE_INFOS_BY_VIEW_ID: {
+ case MSG_FIND_ACCESSIBILITY_NODE_INFOS_BY_VIEW_ID: {
findAccessibilityNodeInfosByViewIdUiThread(message);
} break;
- case MSG_FIND_ACCESSIBLITY_NODE_INFO_BY_TEXT: {
+ case MSG_FIND_ACCESSIBILITY_NODE_INFO_BY_TEXT: {
findAccessibilityNodeInfosByTextUiThread(message);
} break;
case MSG_FIND_FOCUS: {
@@ -1133,6 +1244,9 @@
case MSG_FOCUS_SEARCH: {
focusSearchUiThread(message);
} break;
+ case MSG_COMPUTE_CLICK_POINT_IN_SCREEN: {
+ computeClickPointInScreenUiThread(message);
+ } break;
default:
throw new IllegalArgumentException("Unknown message type: " + type);
}
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 770e78c..82c5425 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -35,6 +35,8 @@
import android.graphics.Matrix;
import android.graphics.Outline;
import android.graphics.Paint;
+import android.graphics.Path;
+import android.graphics.PathMeasure;
import android.graphics.PixelFormat;
import android.graphics.Point;
import android.graphics.PorterDuff;
@@ -5731,6 +5733,136 @@
}
/**
+ * Computes a point on which a sequence of a down/up event can be sent to
+ * trigger clicking this view. This method is for the exclusive use by the
+ * accessibility layer to determine where to send a click event in explore
+ * by touch mode.
+ *
+ * @param interactiveRegion The interactive portion of this window.
+ * @param outPoint The point to populate.
+ * @return True of such a point exists.
+ */
+ boolean computeClickPointInScreenForAccessibility(Region interactiveRegion,
+ Point outPoint) {
+ // Since the interactive portion of the view is a region but as a view
+ // may have a transformation matrix which cannot be applied to a
+ // region we compute the view bounds rectangle and all interactive
+ // predecessor's and sibling's (siblings of predecessors included)
+ // rectangles that intersect the view bounds. At the
+ // end if the view was partially covered by another interactive
+ // view we compute the view's interactive region and pick a point
+ // on its boundary path as regions do not offer APIs to get inner
+ // points. Note that the the code is optimized to fail early and
+ // avoid unnecessary allocations plus computations.
+
+ // The current approach has edge cases that may produce false
+ // positives or false negatives. For example, a portion of the
+ // view may be covered by an interactive descendant of a
+ // predecessor, which we do not compute. Also a view may be handling
+ // raw touch events instead registering click listeners, which
+ // we cannot compute. Despite these limitations this approach will
+ // work most of the time and it is a huge improvement over just
+ // blindly sending the down and up events in the center of the
+ // view.
+
+ // Cannot click on an unattached view.
+ if (mAttachInfo == null) {
+ return false;
+ }
+
+ // Attached to an invisible window means this view is not visible.
+ if (mAttachInfo.mWindowVisibility != View.VISIBLE) {
+ return false;
+ }
+
+ RectF bounds = mAttachInfo.mTmpTransformRect;
+ bounds.set(0, 0, getWidth(), getHeight());
+ List<RectF> intersections = mAttachInfo.mTmpRectList;
+ intersections.clear();
+
+ if (mParent instanceof ViewGroup) {
+ ViewGroup parentGroup = (ViewGroup) mParent;
+ if (!parentGroup.translateBoundsAndIntersectionsInWindowCoordinates(
+ this, bounds, intersections)) {
+ intersections.clear();
+ return false;
+ }
+ }
+
+ // Take into account the window location.
+ final int dx = mAttachInfo.mWindowLeft;
+ final int dy = mAttachInfo.mWindowTop;
+ bounds.offset(dx, dy);
+ offsetRects(intersections, dx, dy);
+
+ if (intersections.isEmpty() && interactiveRegion == null) {
+ outPoint.set((int) bounds.centerX(), (int) bounds.centerY());
+ } else {
+ // This view is partially covered by other views, then compute
+ // the not covered region and pick a point on its boundary.
+ Region region = new Region();
+ region.set((int) bounds.left, (int) bounds.top,
+ (int) bounds.right, (int) bounds.bottom);
+
+ final int intersectionCount = intersections.size();
+ for (int i = intersectionCount - 1; i >= 0; i--) {
+ RectF intersection = intersections.remove(i);
+ region.op((int) intersection.left, (int) intersection.top,
+ (int) intersection.right, (int) intersection.bottom,
+ Region.Op.DIFFERENCE);
+ }
+
+ // If the view is completely covered, done.
+ if (region.isEmpty()) {
+ return false;
+ }
+
+ // Take into account the interactive portion of the window
+ // as the rest is covered by other windows. If no such a region
+ // then the whole window is interactive.
+ if (interactiveRegion != null) {
+ region.op(interactiveRegion, Region.Op.INTERSECT);
+ }
+
+ // If the view is completely covered, done.
+ if (region.isEmpty()) {
+ return false;
+ }
+
+ // Try a shortcut here.
+ if (region.isRect()) {
+ Rect regionBounds = mAttachInfo.mTmpInvalRect;
+ region.getBounds(regionBounds);
+ outPoint.set(regionBounds.centerX(), regionBounds.centerY());
+ return true;
+ }
+
+ // Get the a point on the region boundary path.
+ Path path = region.getBoundaryPath();
+ PathMeasure pathMeasure = new PathMeasure(path, false);
+ final float[] coordinates = mAttachInfo.mTmpTransformLocation;
+
+ // Without loss of generality pick a point.
+ final float point = pathMeasure.getLength() * 0.01f;
+ if (!pathMeasure.getPosTan(point, coordinates, null)) {
+ return false;
+ }
+
+ outPoint.set(Math.round(coordinates[0]), Math.round(coordinates[1]));
+ }
+
+ return true;
+ }
+
+ static void offsetRects(List<RectF> rects, float offsetX, float offsetY) {
+ final int rectCount = rects.size();
+ for (int i = 0; i < rectCount; i++) {
+ RectF intersection = rects.get(i);
+ intersection.offset(offsetX, offsetY);
+ }
+ }
+
+ /**
* Returns the delegate for implementing accessibility support via
* composition. For more details see {@link AccessibilityDelegate}.
*
@@ -20154,6 +20286,16 @@
final RectF mTmpTransformRect = new RectF();
/**
+ * Temporary for use in computing hit areas with transformed views
+ */
+ final RectF mTmpTransformRect1 = new RectF();
+
+ /**
+ * Temporary list of rectanges.
+ */
+ final List<RectF> mTmpRectList = new ArrayList<>();
+
+ /**
* Temporary for use in transforming invalidation rect
*/
final Matrix mTmpMatrix = new Matrix();
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java
index c1e66de..4e1db90 100644
--- a/core/java/android/view/ViewGroup.java
+++ b/core/java/android/view/ViewGroup.java
@@ -771,6 +771,112 @@
}
/**
+ * Translates the given bounds and intersections from child coordinates to
+ * local coordinates. In case any interactive sibling of the calling child
+ * covers the latter, a new intersections is added to the intersection list.
+ * This method is for the exclusive use by the accessibility layer to compute
+ * a point where a sequence of down and up events would click on a view.
+ *
+ * @param child The child making the call.
+ * @param bounds The bounds to translate in child coordinates.
+ * @param intersections The intersections of interactive views covering the child.
+ * @return True if the bounds and intersections were computed, false otherwise.
+ */
+ boolean translateBoundsAndIntersectionsInWindowCoordinates(View child,
+ RectF bounds, List<RectF> intersections) {
+ // Not attached, done.
+ if (mAttachInfo == null) {
+ return false;
+ }
+
+ if (getAlpha() <= 0 || getTransitionAlpha() <= 0 ||
+ getVisibility() != VISIBLE) {
+ // Cannot click on a view with an invisible predecessor.
+ return false;
+ }
+
+ // Compensate for the child transformation.
+ if (!child.hasIdentityMatrix()) {
+ Matrix matrix = child.getMatrix();
+ matrix.mapRect(bounds);
+ final int intersectionCount = intersections.size();
+ for (int i = 0; i < intersectionCount; i++) {
+ RectF intersection = intersections.get(i);
+ matrix.mapRect(intersection);
+ }
+ }
+
+ // Translate the bounds from child to parent coordinates.
+ final int dx = child.mLeft - mScrollX;
+ final int dy = child.mTop - mScrollY;
+ bounds.offset(dx, dy);
+ offsetRects(intersections, dx, dy);
+
+ // If the bounds do not intersect our bounds, done.
+ if (!bounds.intersects(0, 0, getWidth(), getHeight())) {
+ return false;
+ }
+
+ // Check whether any clickable siblings cover the child
+ // view and if so keep track of the intersections. Also
+ // respect Z ordering when iterating over children.
+ ArrayList<View> orderedList = buildOrderedChildList();
+ final boolean useCustomOrder = orderedList == null
+ && isChildrenDrawingOrderEnabled();
+
+ final int childCount = mChildrenCount;
+ for (int i = childCount - 1; i >= 0; i--) {
+ final int childIndex = useCustomOrder
+ ? getChildDrawingOrder(childCount, i) : i;
+ final View sibling = (orderedList == null)
+ ? mChildren[childIndex] : orderedList.get(childIndex);
+
+ // We care only about siblings over the child.
+ if (sibling == child) {
+ break;
+ }
+
+ // If sibling is not interactive we do not care.
+ if (!sibling.isClickable() && !sibling.isLongClickable()) {
+ continue;
+ }
+
+ // Compute the sibling bounds in its coordinates.
+ RectF siblingBounds = mAttachInfo.mTmpTransformRect1;
+ siblingBounds.set(0, 0, sibling.getWidth(), sibling.getHeight());
+
+ // Take into account the sibling transformation matrix.
+ if (!sibling.hasIdentityMatrix()) {
+ sibling.getMatrix().mapRect(siblingBounds);
+ }
+
+ // Offset the sibling to our coordinates.
+ final int siblingDx = sibling.mLeft - mScrollX;
+ final int siblingDy = sibling.mTop - mScrollY;
+ siblingBounds.offset(siblingDx, siblingDy);
+
+ // Compute the intersection between the child and the sibling.
+ if (siblingBounds.intersect(bounds)) {
+ // If an interactive sibling completely covers the child, done.
+ if (siblingBounds.equals(bounds)) {
+ return false;
+ }
+ // Keep track of the intersection rectangle.
+ RectF intersection = new RectF(siblingBounds);
+ intersections.add(intersection);
+ }
+ }
+
+ if (mParent instanceof ViewGroup) {
+ ViewGroup parentGroup = (ViewGroup) mParent;
+ return parentGroup.translateBoundsAndIntersectionsInWindowCoordinates(
+ this, bounds, intersections);
+ }
+
+ return true;
+ }
+
+ /**
* Called when a child view has changed whether or not it is tracking transient state.
*/
public void childHasTransientStateChanged(View child, boolean childHasTransientState) {
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index 4299e2e..80b9ade 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -6679,12 +6679,12 @@
public void performAccessibilityAction(long accessibilityNodeId, int action,
Bundle arguments, int interactionId,
IAccessibilityInteractionConnectionCallback callback, int flags,
- int interogatingPid, long interrogatingTid) {
+ int interrogatingPid, long interrogatingTid) {
ViewRootImpl viewRootImpl = mViewRootImpl.get();
if (viewRootImpl != null && viewRootImpl.mView != null) {
viewRootImpl.getAccessibilityInteractionController()
.performAccessibilityActionClientThread(accessibilityNodeId, action, arguments,
- interactionId, callback, flags, interogatingPid, interrogatingTid);
+ interactionId, callback, flags, interrogatingPid, interrogatingTid);
} else {
// We cannot make the call and notify the caller so it does not wait.
try {
@@ -6696,6 +6696,26 @@
}
@Override
+ public void computeClickPointInScreen(long accessibilityNodeId, Region interactiveRegion,
+ int interactionId, IAccessibilityInteractionConnectionCallback callback,
+ int interrogatingPid, long interrogatingTid, MagnificationSpec spec) {
+ ViewRootImpl viewRootImpl = mViewRootImpl.get();
+ if (viewRootImpl != null && viewRootImpl.mView != null) {
+ viewRootImpl.getAccessibilityInteractionController()
+ .computeClickPointInScreenClientThread(accessibilityNodeId,
+ interactiveRegion, interactionId, callback, interrogatingPid,
+ interrogatingTid, spec);
+ } else {
+ // We cannot make the call and notify the caller so it does not wait.
+ try {
+ callback.setComputeClickPointInScreenActionResult(null, interactionId);
+ } catch (RemoteException re) {
+ /* best effort - ignore */
+ }
+ }
+ }
+
+ @Override
public void findAccessibilityNodeInfosByViewId(long accessibilityNodeId,
String viewId, Region interactiveRegion, int interactionId,
IAccessibilityInteractionConnectionCallback callback, int flags,
diff --git a/core/java/android/view/accessibility/AccessibilityInteractionClient.java b/core/java/android/view/accessibility/AccessibilityInteractionClient.java
index db78ec5..374f7e0 100644
--- a/core/java/android/view/accessibility/AccessibilityInteractionClient.java
+++ b/core/java/android/view/accessibility/AccessibilityInteractionClient.java
@@ -17,6 +17,7 @@
package android.view.accessibility;
import android.accessibilityservice.IAccessibilityServiceConnection;
+import android.graphics.Point;
import android.os.Binder;
import android.os.Build;
import android.os.Bundle;
@@ -98,6 +99,8 @@
private boolean mPerformAccessibilityActionResult;
+ private Point mComputeClickPointResult;
+
private Message mSameThreadMessage;
private static final SparseArray<IAccessibilityServiceConnection> sConnectionCache =
@@ -519,6 +522,43 @@
return false;
}
+ /**
+ * Computes a point in screen coordinates where sending a down/up events would
+ * perform a click on an {@link AccessibilityNodeInfo}.
+ *
+ * @param connectionId The id of a connection for interacting with the system.
+ * @param accessibilityWindowId A unique window id. Use
+ * {@link android.view.accessibility.AccessibilityNodeInfo#ACTIVE_WINDOW_ID}
+ * to query the currently active window.
+ * @param accessibilityNodeId A unique view id or virtual descendant id from
+ * where to start the search. Use
+ * {@link android.view.accessibility.AccessibilityNodeInfo#ROOT_NODE_ID}
+ * to start from the root.
+ * @return Point the click point of null if no such point.
+ */
+ public Point computeClickPointInScreen(int connectionId, int accessibilityWindowId,
+ long accessibilityNodeId) {
+ try {
+ IAccessibilityServiceConnection connection = getConnection(connectionId);
+ if (connection != null) {
+ final int interactionId = mInteractionIdCounter.getAndIncrement();
+ final boolean success = connection.computeClickPointInScreen(
+ accessibilityWindowId, accessibilityNodeId,
+ interactionId, this, Thread.currentThread().getId());
+ if (success) {
+ return getComputeClickPointInScreenResultAndClear(interactionId);
+ }
+ } else {
+ if (DEBUG) {
+ Log.w(LOG_TAG, "No connection for connection id: " + connectionId);
+ }
+ }
+ } catch (RemoteException re) {
+ Log.w(LOG_TAG, "Error while calling remote computeClickPointInScreen", re);
+ }
+ return null;
+ }
+
public void clearCache() {
sAccessibilityCache.clear();
}
@@ -634,6 +674,34 @@
}
/**
+ * Gets the result of a request to compute a point in screen for clicking on a node.
+ *
+ * @param interactionId The interaction id to match the result with the request.
+ * @return The point or null if no such point.
+ */
+ private Point getComputeClickPointInScreenResultAndClear(int interactionId) {
+ synchronized (mInstanceLock) {
+ final boolean success = waitForResultTimedLocked(interactionId);
+ Point result = success ? mComputeClickPointResult : null;
+ clearResultLocked();
+ return result;
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setComputeClickPointInScreenActionResult(Point point, int interactionId) {
+ synchronized (mInstanceLock) {
+ if (interactionId > mInteractionId) {
+ mComputeClickPointResult = point;
+ mInteractionId = interactionId;
+ }
+ mInstanceLock.notifyAll();
+ }
+ }
+
+ /**
* Clears the result state.
*/
private void clearResultLocked() {
@@ -641,6 +709,7 @@
mFindAccessibilityNodeInfoResult = null;
mFindAccessibilityNodeInfosResult = null;
mPerformAccessibilityActionResult = false;
+ mComputeClickPointResult = null;
}
/**
diff --git a/core/java/android/view/accessibility/IAccessibilityInteractionConnection.aidl b/core/java/android/view/accessibility/IAccessibilityInteractionConnection.aidl
index faf7789..66a3f46 100644
--- a/core/java/android/view/accessibility/IAccessibilityInteractionConnection.aidl
+++ b/core/java/android/view/accessibility/IAccessibilityInteractionConnection.aidl
@@ -17,6 +17,7 @@
package android.view.accessibility;
import android.graphics.Region;
+import android.graphics.Point;
import android.os.Bundle;
import android.view.MagnificationSpec;
import android.view.accessibility.AccessibilityNodeInfo;
@@ -53,4 +54,8 @@
void performAccessibilityAction(long accessibilityNodeId, int action, in Bundle arguments,
int interactionId, IAccessibilityInteractionConnectionCallback callback, int flags,
int interrogatingPid, long interrogatingTid);
+
+ void computeClickPointInScreen(long accessibilityNodeId, in Region bounds, int interactionId,
+ IAccessibilityInteractionConnectionCallback callback, int interrogatingPid,
+ long interrogatingTid, in MagnificationSpec spec);
}
diff --git a/core/java/android/view/accessibility/IAccessibilityInteractionConnectionCallback.aidl b/core/java/android/view/accessibility/IAccessibilityInteractionConnectionCallback.aidl
index c1a3ab7..f480216 100644
--- a/core/java/android/view/accessibility/IAccessibilityInteractionConnectionCallback.aidl
+++ b/core/java/android/view/accessibility/IAccessibilityInteractionConnectionCallback.aidl
@@ -16,6 +16,7 @@
package android.view.accessibility;
+import android.graphics.Point;
import android.view.accessibility.AccessibilityNodeInfo;
import java.util.List;
@@ -51,4 +52,12 @@
* @param interactionId The interaction id to match the result with the request.
*/
void setPerformAccessibilityActionResult(boolean succeeded, int interactionId);
+
+ /**
+ * Sets the result of a request to compute a point for clicking in a view.
+ *
+ * @param point The point of null if no such point.
+ * @param interactionId The interaction id to match the result with the request.
+ */
+ void setComputeClickPointInScreenActionResult(in Point point, int interactionId);
}
diff --git a/core/java/android/widget/AbsListView.java b/core/java/android/widget/AbsListView.java
index eef8554..94d52d5 100644
--- a/core/java/android/widget/AbsListView.java
+++ b/core/java/android/widget/AbsListView.java
@@ -3325,8 +3325,8 @@
}
if (dispatchNestedPreScroll(0, -rawDeltaY, mScrollConsumed, mScrollOffset)) {
rawDeltaY += mScrollConsumed[1];
- scrollOffsetCorrection -= mScrollOffset[1];
- scrollConsumedCorrection -= mScrollConsumed[1];
+ scrollOffsetCorrection = -mScrollOffset[1];
+ scrollConsumedCorrection = mScrollConsumed[1];
if (vtev != null) {
vtev.offsetLocation(0, mScrollOffset[1]);
}
@@ -3437,7 +3437,7 @@
}
}
}
- mMotionY = y + scrollOffsetCorrection;
+ mMotionY = y + lastYCorrection + scrollOffsetCorrection;
}
mLastY = y + lastYCorrection + scrollOffsetCorrection;
}
@@ -3505,10 +3505,10 @@
mMotionCorrection = 0;
View motionView = getChildAt(motionPosition - mFirstPosition);
mMotionViewOriginalTop = motionView != null ? motionView.getTop() : 0;
- mMotionY = y;
+ mMotionY = y + scrollOffsetCorrection;
mMotionPosition = motionPosition;
}
- mLastY = y;
+ mLastY = y + lastYCorrection + scrollOffsetCorrection;
mDirection = newDirection;
}
}
@@ -3876,7 +3876,7 @@
if (mPositionScroller != null) {
mPositionScroller.stop();
}
- if (flingVelocity) {
+ if (flingVelocity && !dispatchNestedPreFling(0, -initialVelocity)) {
dispatchNestedFling(0, -initialVelocity, false);
}
}
@@ -4001,14 +4001,15 @@
* <p>Applications can use this method to manually initiate a fling as if the user
* initiated it via touch interaction.</p>
*
- * @param velocityY Vertical velocity in pixels per second
+ * @param velocityY Vertical velocity in pixels per second. Note that this is velocity of
+ * content, not velocity of a touch that initiated the fling.
*/
public void fling(int velocityY) {
if (mFlingRunnable == null) {
mFlingRunnable = new FlingRunnable();
}
reportScrollStateChange(OnScrollListener.SCROLL_STATE_FLING);
- mFlingRunnable.start(-velocityY);
+ mFlingRunnable.start(velocityY);
}
@Override
diff --git a/core/java/com/android/internal/app/ResolverActivity.java b/core/java/com/android/internal/app/ResolverActivity.java
index b6e7353..107e8c6 100644
--- a/core/java/com/android/internal/app/ResolverActivity.java
+++ b/core/java/com/android/internal/app/ResolverActivity.java
@@ -90,7 +90,7 @@
private boolean mSafeForwardingMode;
private boolean mAlwaysUseOption;
private boolean mShowExtended;
- private GridView mGridView;
+ private ListView mListView;
private Button mAlwaysButton;
private Button mOnceButton;
private int mIconDpi;
@@ -228,10 +228,13 @@
mLaunchedFromUid, alwaysUseOption);
final int layoutId;
+ final boolean useHeader;
if (mAdapter.hasFilteredItem()) {
layoutId = R.layout.resolver_list_with_default;
alwaysUseOption = false;
+ useHeader = true;
} else {
+ useHeader = false;
layoutId = R.layout.resolver_list;
}
mAlwaysUseOption = alwaysUseOption;
@@ -243,16 +246,19 @@
return;
} else if (count > 1) {
setContentView(layoutId);
- mGridView = (GridView) findViewById(R.id.resolver_list);
- mGridView.setAdapter(mAdapter);
- mGridView.setOnItemClickListener(this);
- mGridView.setOnItemLongClickListener(new ItemLongClickListener());
+ mListView = (ListView) findViewById(R.id.resolver_list);
+ mListView.setAdapter(mAdapter);
+ mListView.setOnItemClickListener(this);
+ mListView.setOnItemLongClickListener(new ItemLongClickListener());
if (alwaysUseOption) {
- mGridView.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
+ mListView.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
}
- resizeGrid();
+ if (useHeader) {
+ mListView.addHeaderView(LayoutInflater.from(this).inflate(
+ R.layout.resolver_different_item_header, mListView, false));
+ }
} else if (count == 1) {
safelyStartActivity(mAdapter.intentForPosition(0, false));
mPackageMonitor.unregister();
@@ -265,8 +271,8 @@
final TextView empty = (TextView) findViewById(R.id.empty);
empty.setVisibility(View.VISIBLE);
- mGridView = (GridView) findViewById(R.id.resolver_list);
- mGridView.setVisibility(View.GONE);
+ mListView = (ListView) findViewById(R.id.resolver_list);
+ mListView.setVisibility(View.GONE);
}
final ResolverDrawerLayout rdl = (ResolverDrawerLayout) findViewById(R.id.contentPanel);
@@ -340,11 +346,6 @@
}
}
- void resizeGrid() {
- final int itemCount = mAdapter.getCount();
- mGridView.setNumColumns(Math.min(itemCount, mMaxColumns));
- }
-
void dismiss() {
if (!isFinishing()) {
finish();
@@ -419,19 +420,24 @@
protected void onRestoreInstanceState(Bundle savedInstanceState) {
super.onRestoreInstanceState(savedInstanceState);
if (mAlwaysUseOption) {
- final int checkedPos = mGridView.getCheckedItemPosition();
+ final int checkedPos = mListView.getCheckedItemPosition();
final boolean hasValidSelection = checkedPos != ListView.INVALID_POSITION;
mLastSelected = checkedPos;
setAlwaysButtonEnabled(hasValidSelection, checkedPos, true);
mOnceButton.setEnabled(hasValidSelection);
if (hasValidSelection) {
- mGridView.setSelection(checkedPos);
+ mListView.setSelection(checkedPos);
}
}
}
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
+ position -= mListView.getHeaderViewsCount();
+ if (position < 0) {
+ // Header views don't count.
+ return;
+ }
ResolveInfo resolveInfo = mAdapter.resolveInfoForPosition(position, true);
if (mResolvingHome && hasManagedProfile()
&& !supportsManagedProfiles(resolveInfo)) {
@@ -441,13 +447,13 @@
Toast.LENGTH_LONG).show();
return;
}
- final int checkedPos = mGridView.getCheckedItemPosition();
+ final int checkedPos = mListView.getCheckedItemPosition();
final boolean hasValidSelection = checkedPos != ListView.INVALID_POSITION;
if (mAlwaysUseOption && (!hasValidSelection || mLastSelected != checkedPos)) {
setAlwaysButtonEnabled(hasValidSelection, checkedPos, true);
mOnceButton.setEnabled(hasValidSelection);
if (hasValidSelection) {
- mGridView.smoothScrollToPosition(checkedPos);
+ mListView.smoothScrollToPosition(checkedPos);
}
mLastSelected = checkedPos;
} else {
@@ -504,7 +510,7 @@
public void onButtonClick(View v) {
final int id = v.getId();
startSelected(mAlwaysUseOption ?
- mGridView.getCheckedItemPosition() : mAdapter.getFilteredPosition(),
+ mListView.getCheckedItemPosition() : mAdapter.getFilteredPosition(),
id == R.id.button_always,
mAlwaysUseOption);
dismiss();
@@ -714,8 +720,6 @@
if (newItemCount == 0) {
// We no longer have any items... just finish the activity.
finish();
- } else if (newItemCount != oldItemCount) {
- resizeGrid();
}
}
@@ -957,19 +961,13 @@
}
public View getView(int position, View convertView, ViewGroup parent) {
- View view;
- if (convertView == null) {
+ View view = convertView;
+ if (view == null) {
view = mInflater.inflate(
com.android.internal.R.layout.resolve_list_item, parent, false);
final ViewHolder holder = new ViewHolder(view);
view.setTag(holder);
-
- // Fix the icon size even if we have different sized resources
- ViewGroup.LayoutParams lp = holder.icon.getLayoutParams();
- lp.width = lp.height = mIconSize;
- } else {
- view = convertView;
}
bindView(view, getItem(position));
return view;
@@ -1007,6 +1005,11 @@
@Override
public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
+ position -= mListView.getHeaderViewsCount();
+ if (position < 0) {
+ // Header views don't count.
+ return false;
+ }
ResolveInfo ri = mAdapter.resolveInfoForPosition(position, true);
showAppDetails(ri);
return true;
diff --git a/core/java/com/android/internal/content/PackageHelper.java b/core/java/com/android/internal/content/PackageHelper.java
index c17f4ee..7bdb4be 100644
--- a/core/java/com/android/internal/content/PackageHelper.java
+++ b/core/java/com/android/internal/content/PackageHelper.java
@@ -390,7 +390,10 @@
if (!emulated && (checkBoth || prefer == RECOMMEND_INSTALL_EXTERNAL)) {
final File target = new UserEnvironment(UserHandle.USER_OWNER)
.getExternalStorageDirectory();
- fitsOnExternal = (sizeBytes <= storage.getStorageBytesUntilLow(target));
+ // External is only an option when size is known
+ if (sizeBytes > 0) {
+ fitsOnExternal = (sizeBytes <= storage.getStorageBytesUntilLow(target));
+ }
}
if (prefer == RECOMMEND_INSTALL_INTERNAL) {
diff --git a/core/java/com/android/internal/os/Zygote.java b/core/java/com/android/internal/os/Zygote.java
index c5211bb..c579a15 100644
--- a/core/java/com/android/internal/os/Zygote.java
+++ b/core/java/com/android/internal/os/Zygote.java
@@ -78,17 +78,20 @@
* file descriptor numbers that are to be closed by the child
* (and replaced by /dev/null) after forking. An integer value
* of -1 in any entry in the array means "ignore this one".
+ * @param instructionSet null-ok the instruction set to use.
*
* @return 0 if this is the child, pid of the child
* if this is the parent, or -1 on error.
*/
public static int forkAndSpecialize(int uid, int gid, int[] gids, int debugFlags,
- int[][] rlimits, int mountExternal, String seInfo, String niceName, int[] fdsToClose) {
+ int[][] rlimits, int mountExternal, String seInfo, String niceName, int[] fdsToClose,
+ String instructionSet) {
long startTime = SystemClock.elapsedRealtime();
VM_HOOKS.preFork();
checkTime(startTime, "Zygote.preFork");
int pid = nativeForkAndSpecialize(
- uid, gid, gids, debugFlags, rlimits, mountExternal, seInfo, niceName, fdsToClose);
+ uid, gid, gids, debugFlags, rlimits, mountExternal, seInfo, niceName, fdsToClose,
+ instructionSet);
checkTime(startTime, "Zygote.nativeForkAndSpecialize");
VM_HOOKS.postForkCommon();
checkTime(startTime, "Zygote.postForkCommon");
@@ -96,7 +99,8 @@
}
native private static int nativeForkAndSpecialize(int uid, int gid, int[] gids,int debugFlags,
- int[][] rlimits, int mountExternal, String seInfo, String niceName, int[] fdsToClose);
+ int[][] rlimits, int mountExternal, String seInfo, String niceName, int[] fdsToClose,
+ String instructionSet);
/**
* Temporary hack: check time since start time and log if over a fixed threshold.
@@ -145,9 +149,9 @@
native private static int nativeForkSystemServer(int uid, int gid, int[] gids, int debugFlags,
int[][] rlimits, long permittedCapabilities, long effectiveCapabilities);
- private static void callPostForkChildHooks(int debugFlags) {
+ private static void callPostForkChildHooks(int debugFlags, String instructionSet) {
long startTime = SystemClock.elapsedRealtime();
- VM_HOOKS.postForkChild(debugFlags);
+ VM_HOOKS.postForkChild(debugFlags, instructionSet);
checkTime(startTime, "Zygote.callPostForkChildHooks");
}
diff --git a/core/java/com/android/internal/os/ZygoteConnection.java b/core/java/com/android/internal/os/ZygoteConnection.java
index b4c4da6..fb50b25 100644
--- a/core/java/com/android/internal/os/ZygoteConnection.java
+++ b/core/java/com/android/internal/os/ZygoteConnection.java
@@ -245,7 +245,7 @@
checkTime(startTime, "zygoteConnection.runOnce: preForkAndSpecialize");
pid = Zygote.forkAndSpecialize(parsedArgs.uid, parsedArgs.gid, parsedArgs.gids,
parsedArgs.debugFlags, rlimits, parsedArgs.mountExternal, parsedArgs.seInfo,
- parsedArgs.niceName, fdsToClose);
+ parsedArgs.niceName, fdsToClose, parsedArgs.instructionSet);
checkTime(startTime, "zygoteConnection.runOnce: postForkAndSpecialize");
} catch (IOException ex) {
logAndPrintError(newStderr, "Exception creating pipe", ex);
@@ -335,6 +335,7 @@
* [--] <args for RuntimeInit >
* <li> If <code>--runtime-init</code> is absent:
* [--] <classname> [args...]
+ * <li> --instruction-set=<i>instruction-set-string</i> which instruction set to use/emulate.
* </ul>
*/
static class Arguments {
@@ -398,6 +399,11 @@
boolean abiListQuery;
/**
+ * The instruction set to use, or null when not important.
+ */
+ String instructionSet;
+
+ /**
* Constructs instance and parses args
* @param args zygote command-line args
* @throws IllegalArgumentException
@@ -552,6 +558,8 @@
mountExternal = Zygote.MOUNT_EXTERNAL_MULTIUSER_ALL;
} else if (arg.equals("--query-abi-list")) {
abiListQuery = true;
+ } else if (arg.startsWith("--instruction-set=")) {
+ instructionSet = arg.substring(arg.indexOf('=') + 1);
} else {
break;
}
diff --git a/core/java/com/android/internal/util/XmlUtils.java b/core/java/com/android/internal/util/XmlUtils.java
index 7db70ba..45d790b 100644
--- a/core/java/com/android/internal/util/XmlUtils.java
+++ b/core/java/com/android/internal/util/XmlUtils.java
@@ -1440,6 +1440,16 @@
return Boolean.parseBoolean(value);
}
+ public static boolean readBooleanAttribute(XmlPullParser in, String name,
+ boolean defaultValue) {
+ final String value = in.getAttributeValue(null, name);
+ if (value == null) {
+ return defaultValue;
+ } else {
+ return Boolean.parseBoolean(value);
+ }
+ }
+
public static void writeBooleanAttribute(XmlSerializer out, String name, boolean value)
throws IOException {
out.attribute(null, name, Boolean.toString(value));
diff --git a/core/java/com/android/internal/widget/ResolverDrawerLayout.java b/core/java/com/android/internal/widget/ResolverDrawerLayout.java
index e53f9dd..375822f 100644
--- a/core/java/com/android/internal/widget/ResolverDrawerLayout.java
+++ b/core/java/com/android/internal/widget/ResolverDrawerLayout.java
@@ -20,15 +20,15 @@
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Rect;
+import android.os.Parcel;
+import android.os.Parcelable;
import android.util.AttributeSet;
import android.util.Log;
-import android.view.Gravity;
import android.view.MotionEvent;
import android.view.VelocityTracker;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewGroup;
-
import android.view.ViewParent;
import android.view.ViewTreeObserver;
import android.view.animation.AnimationUtils;
@@ -68,6 +68,7 @@
private boolean mIsDragging;
private boolean mOpenOnClick;
+ private boolean mOpenOnLayout;
private final int mTouchSlop;
private final float mMinFlingVelocity;
private final OverScroller mScroller;
@@ -202,6 +203,8 @@
public boolean onTouchEvent(MotionEvent ev) {
final int action = ev.getActionMasked();
+ mVelocityTracker.addMovement(ev);
+
boolean handled = false;
switch (action) {
case MotionEvent.ACTION_DOWN: {
@@ -288,6 +291,10 @@
break;
case MotionEvent.ACTION_CANCEL: {
+ if (mIsDragging) {
+ smoothScrollTo(
+ mCollapseOffset < mCollapsibleHeight / 2 ? 0 : mCollapsibleHeight, 0);
+ }
resetTouch();
return true;
}
@@ -498,28 +505,39 @@
@Override
public void onStopNestedScroll(View child) {
super.onStopNestedScroll(child);
- smoothScrollTo(mCollapseOffset < mCollapsibleHeight / 2 ? 0 : mCollapsibleHeight, 0);
+ if (mScroller.isFinished()) {
+ smoothScrollTo(mCollapseOffset < mCollapsibleHeight / 2 ? 0 : mCollapsibleHeight, 0);
+ }
}
@Override
public void onNestedScroll(View target, int dxConsumed, int dyConsumed,
int dxUnconsumed, int dyUnconsumed) {
- if (dyUnconsumed > 0) {
+ if (dyUnconsumed < 0) {
performDrag(-dyUnconsumed);
}
}
@Override
public void onNestedPreScroll(View target, int dx, int dy, int[] consumed) {
- if (dy < 0) {
- consumed[1] = (int) performDrag(-dy);
+ if (dy > 0) {
+ consumed[1] = (int) -performDrag(-dy);
}
}
@Override
+ public boolean onNestedPreFling(View target, float velocityX, float velocityY) {
+ if (velocityY > mMinFlingVelocity && mCollapseOffset != 0) {
+ smoothScrollTo(0, velocityY);
+ return true;
+ }
+ return false;
+ }
+
+ @Override
public boolean onNestedFling(View target, float velocityX, float velocityY, boolean consumed) {
if (!consumed && Math.abs(velocityY) > mMinFlingVelocity) {
- smoothScrollTo(velocityY < 0 ? 0 : mCollapsibleHeight, velocityY);
+ smoothScrollTo(velocityY > 0 ? 0 : mCollapsibleHeight, velocityY);
return true;
}
return false;
@@ -571,8 +589,8 @@
if (isLaidOut()) {
mCollapseOffset = Math.min(mCollapseOffset, mCollapsibleHeight);
} else {
- // Start out collapsed at first
- mCollapseOffset = mCollapsibleHeight;
+ // Start out collapsed at first unless we restored state for otherwise
+ mCollapseOffset = mOpenOnLayout ? 0 : mCollapsibleHeight;
}
mTopOffset = Math.max(0, heightSize - heightUsed) + (int) mCollapseOffset;
@@ -634,6 +652,20 @@
return new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
}
+ @Override
+ protected Parcelable onSaveInstanceState() {
+ final SavedState ss = new SavedState(super.onSaveInstanceState());
+ ss.open = mCollapsibleHeight > 0 && mCollapseOffset == 0;
+ return ss;
+ }
+
+ @Override
+ protected void onRestoreInstanceState(Parcelable state) {
+ final SavedState ss = (SavedState) state;
+ super.onRestoreInstanceState(ss.getSuperState());
+ mOpenOnLayout = ss.open;
+ }
+
public static class LayoutParams extends MarginLayoutParams {
public boolean alwaysShow;
public boolean ignoreOffset;
@@ -670,4 +702,36 @@
super(source);
}
}
+
+ static class SavedState extends BaseSavedState {
+ boolean open;
+
+ SavedState(Parcelable superState) {
+ super(superState);
+ }
+
+ private SavedState(Parcel in) {
+ super(in);
+ open = in.readInt() != 0;
+ }
+
+ @Override
+ public void writeToParcel(Parcel out, int flags) {
+ super.writeToParcel(out, flags);
+ out.writeInt(open ? 1 : 0);
+ }
+
+ public static final Parcelable.Creator<SavedState> CREATOR =
+ new Parcelable.Creator<SavedState>() {
+ @Override
+ public SavedState createFromParcel(Parcel in) {
+ return new SavedState(in);
+ }
+
+ @Override
+ public SavedState[] newArray(int size) {
+ return new SavedState[size];
+ }
+ };
+ }
}
diff --git a/core/jni/com_android_internal_os_Zygote.cpp b/core/jni/com_android_internal_os_Zygote.cpp
index 3d2d471..451d97a 100644
--- a/core/jni/com_android_internal_os_Zygote.cpp
+++ b/core/jni/com_android_internal_os_Zygote.cpp
@@ -421,7 +421,8 @@
jlong permittedCapabilities, jlong effectiveCapabilities,
jint mount_external,
jstring java_se_info, jstring java_se_name,
- bool is_system_server, jintArray fdsToClose) {
+ bool is_system_server, jintArray fdsToClose,
+ jstring instructionSet) {
uint64_t start = MsTime();
SetSigChldHandler();
ckTime(start, "ForkAndSpecializeCommon:SetSigChldHandler");
@@ -542,7 +543,8 @@
ckTime(start, "ForkAndSpecializeCommon:child process setup");
- env->CallStaticVoidMethod(gZygoteClass, gCallPostForkChildHooks, debug_flags);
+ env->CallStaticVoidMethod(gZygoteClass, gCallPostForkChildHooks, debug_flags,
+ is_system_server ? NULL : instructionSet);
ckTime(start, "ForkAndSpecializeCommon:PostForkChildHooks returns");
if (env->ExceptionCheck()) {
ALOGE("Error calling post fork hooks.");
@@ -561,7 +563,7 @@
JNIEnv* env, jclass, jint uid, jint gid, jintArray gids,
jint debug_flags, jobjectArray rlimits,
jint mount_external, jstring se_info, jstring se_name,
- jintArray fdsToClose) {
+ jintArray fdsToClose, jstring instructionSet) {
// Grant CAP_WAKE_ALARM to the Bluetooth process.
jlong capabilities = 0;
if (uid == AID_BLUETOOTH) {
@@ -570,7 +572,7 @@
return ForkAndSpecializeCommon(env, uid, gid, gids, debug_flags,
rlimits, capabilities, capabilities, mount_external, se_info,
- se_name, false, fdsToClose);
+ se_name, false, fdsToClose, instructionSet);
}
static jint com_android_internal_os_Zygote_nativeForkSystemServer(
@@ -580,7 +582,7 @@
pid_t pid = ForkAndSpecializeCommon(env, uid, gid, gids,
debug_flags, rlimits,
permittedCapabilities, effectiveCapabilities,
- MOUNT_EXTERNAL_NONE, NULL, NULL, true, NULL);
+ MOUNT_EXTERNAL_NONE, NULL, NULL, true, NULL, NULL);
if (pid > 0) {
// The zygote process checks whether the child process has died or not.
ALOGI("System server process %d has been created", pid);
@@ -598,7 +600,8 @@
}
static JNINativeMethod gMethods[] = {
- { "nativeForkAndSpecialize", "(II[II[[IILjava/lang/String;Ljava/lang/String;[I)I",
+ { "nativeForkAndSpecialize",
+ "(II[II[[IILjava/lang/String;Ljava/lang/String;[ILjava/lang/String;)I",
(void *) com_android_internal_os_Zygote_nativeForkAndSpecialize },
{ "nativeForkSystemServer", "(II[II[[IJJ)I",
(void *) com_android_internal_os_Zygote_nativeForkSystemServer }
@@ -609,7 +612,8 @@
if (gZygoteClass == NULL) {
RuntimeAbort(env);
}
- gCallPostForkChildHooks = env->GetStaticMethodID(gZygoteClass, "callPostForkChildHooks", "(I)V");
+ gCallPostForkChildHooks = env->GetStaticMethodID(gZygoteClass, "callPostForkChildHooks",
+ "(ILjava/lang/String;)V");
return AndroidRuntime::registerNativeMethods(env, "com/android/internal/os/Zygote",
gMethods, NELEM(gMethods));
diff --git a/core/res/res/layout/notification_template_material_inbox.xml b/core/res/res/layout/notification_template_material_inbox.xml
index 2382d18..8a66c3f 100644
--- a/core/res/res/layout/notification_template_material_inbox.xml
+++ b/core/res/res/layout/notification_template_material_inbox.xml
@@ -44,6 +44,7 @@
android:layout_width="match_parent"
android:layout_weight="1"
android:layout_height="0dp"
+ android:layout_marginEnd="8dp"
android:orientation="horizontal"
>
<TextView android:id="@+id/inbox_text0"
@@ -60,7 +61,6 @@
android:layout_height="@dimen/notification_badge_size"
android:layout_weight="0"
android:layout_marginStart="4dp"
- android:layout_marginEnd="8dp"
android:scaleType="fitCenter"
android:visibility="gone"
/>
diff --git a/core/res/res/layout/resolve_list_item.xml b/core/res/res/layout/resolve_list_item.xml
index 7aa9a72..37c4270 100644
--- a/core/res/res/layout/resolve_list_item.xml
+++ b/core/res/res/layout/resolve_list_item.xml
@@ -18,9 +18,10 @@
*/
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical"
+ android:orientation="horizontal"
android:layout_height="wrap_content"
android:layout_width="match_parent"
+ android:minHeight="?attr/listPreferredItemHeightSmall"
android:paddingTop="4dp"
android:paddingBottom="4dp"
android:background="?attr/activatedBackgroundIndicator">
@@ -28,37 +29,40 @@
<!-- Activity icon when presenting dialog
Size will be filled in by ResolverActivity -->
<ImageView android:id="@+id/icon"
- android:layout_width="0dp"
- android:layout_height="0dp"
- android:layout_gravity="center"
- android:layout_margin="4dp"
+ android:layout_width="24dp"
+ android:layout_height="24dp"
+ android:layout_gravity="start|center_vertical"
+ android:layout_marginStart="16dp"
+ android:layout_marginEnd="16dp"
+ android:layout_marginTop="12dp"
+ android:layout_marginBottom="12dp"
android:scaleType="fitCenter" />
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:gravity="center"
+ android:gravity="start|center_vertical"
android:orientation="vertical"
+ android:paddingStart="16dp"
+ android:paddingEnd="16dp"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
- android:layout_gravity="center">
+ android:layout_gravity="start|center_vertical">
<!-- Activity name -->
<TextView android:id="@android:id/text1"
- android:textAppearance="?android:attr/textAppearanceSmall"
- android:fontFamily="sans-serif-condensed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:gravity="center"
- android:minLines="2"
- android:maxLines="2" />
+ android:textAppearance="?attr/textAppearanceMedium"
+ android:textColor="?attr/textColorPrimary"
+ android:minLines="1"
+ android:maxLines="1"
+ android:ellipsize="marquee" />
<!-- Extended activity info to distinguish between duplicate activity names -->
<TextView android:id="@android:id/text2"
android:textAppearance="?android:attr/textAppearanceSmall"
- android:fontFamily="sans-serif-condensed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:gravity="center"
- android:minLines="2"
- android:maxLines="2"
- android:paddingTop="4dip" />
+ android:minLines="1"
+ android:maxLines="1"
+ android:ellipsize="marquee" />
</LinearLayout>
</LinearLayout>
diff --git a/core/res/res/layout/resolver_different_item_header.xml b/core/res/res/layout/resolver_different_item_header.xml
new file mode 100644
index 0000000..5889136
--- /dev/null
+++ b/core/res/res/layout/resolver_different_item_header.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+ * Copyright 2014, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+-->
+<TextView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_alwaysShow="true"
+ android:text="@string/use_a_different_app"
+ android:minHeight="56dp"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:gravity="start|center_vertical"
+ android:paddingStart="16dp"
+ android:paddingEnd="16dp"
+ android:paddingTop="8dp"
+ android:paddingBottom="8dp"
+ android:background="@color/white"
+ android:elevation="8dp"
+ />
diff --git a/core/res/res/layout/resolver_list.xml b/core/res/res/layout/resolver_list.xml
index 8e57543..727f9c6 100644
--- a/core/res/res/layout/resolver_list.xml
+++ b/core/res/res/layout/resolver_list.xml
@@ -21,38 +21,36 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:maxWidth="@dimen/resolver_max_width"
- android:maxCollapsedHeight="260dp"
+ android:maxCollapsedHeight="192dp"
android:maxCollapsedHeightSmall="56dp"
android:id="@id/contentPanel"
>
<TextView android:id="@+id/title"
android:layout_width="match_parent"
- android:layout_height="?android:attr/listPreferredItemHeight"
+ android:layout_height="wrap_content"
android:layout_alwaysShow="true"
+ android:minHeight="56dp"
android:textAppearance="?android:attr/textAppearanceMedium"
android:gravity="start|center_vertical"
- android:paddingLeft="32dp"
- android:paddingRight="32dp"
+ android:paddingStart="16dp"
+ android:paddingEnd="16dp"
+ android:paddingTop="8dp"
+ android:paddingBottom="8dp"
android:background="@color/white"
android:elevation="8dp"
/>
- <GridView
+ <ListView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/resolver_list"
- android:numColumns="4"
- android:columnWidth="128dp"
android:clipToPadding="false"
android:scrollbarStyle="outsideOverlay"
- android:paddingLeft="32dp"
- android:paddingRight="32dp"
- android:paddingTop="16dp"
- android:paddingBottom="16dp"
android:background="@color/white"
android:elevation="8dp"
android:nestedScrollingEnabled="true"
+ android:divider="@null"
/>
<TextView android:id="@+id/empty"
@@ -72,14 +70,15 @@
android:layout_height="wrap_content"
android:layout_ignoreOffset="true"
android:layout_alwaysShow="true"
- android:gravity="end"
+ android:gravity="end|center_vertical"
android:orientation="horizontal"
android:layoutDirection="locale"
android:measureWithLargestChild="true"
android:background="@color/white"
- android:paddingBottom="16dp"
- android:paddingStart="32dp"
- android:paddingEnd="32dp"
+ android:paddingTop="8dp"
+ android:paddingBottom="8dp"
+ android:paddingStart="12dp"
+ android:paddingEnd="12dp"
android:elevation="8dp">
<Button android:id="@+id/button_once"
android:layout_width="wrap_content"
diff --git a/core/res/res/layout/resolver_list_with_default.xml b/core/res/res/layout/resolver_list_with_default.xml
index 0bd0e14..884f41e 100644
--- a/core/res/res/layout/resolver_list_with_default.xml
+++ b/core/res/res/layout/resolver_list_with_default.xml
@@ -21,7 +21,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:maxWidth="@dimen/resolver_max_width"
- android:maxCollapsedHeight="48dp"
+ android:maxCollapsedHeight="144dp"
android:id="@id/contentPanel"
>
@@ -35,26 +35,28 @@
<LinearLayout
android:layout_width="match_parent"
- android:layout_height="80dp"
- android:paddingStart="32dp"
- android:paddingEnd="32dp"
+ android:layout_height="64dp"
android:orientation="horizontal"
>
+ <ImageView android:id="@+id/icon"
+ android:layout_width="24dp"
+ android:layout_height="24dp"
+ android:layout_gravity="start|top"
+ android:layout_marginStart="16dp"
+ android:layout_marginEnd="16dp"
+ android:layout_marginTop="20dp"
+ android:scaleType="fitCenter"
+ />
<TextView android:id="@+id/title"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="?android:attr/listPreferredItemHeight"
+ android:layout_marginStart="16dp"
android:textAppearance="?android:attr/textAppearanceMedium"
android:gravity="start|center_vertical"
android:paddingEnd="16dp"
/>
- <ImageView android:id="@+id/icon"
- android:layout_width="56dp"
- android:layout_height="56dp"
- android:layout_gravity="center_vertical"
- android:scaleType="fitCenter"
- />
</LinearLayout>
<LinearLayout
@@ -64,13 +66,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alwaysShow="true"
- android:gravity="end"
+ android:gravity="end|center_vertical"
android:orientation="horizontal"
android:layoutDirection="locale"
android:measureWithLargestChild="true"
- android:paddingBottom="16dp"
- android:paddingStart="32dp"
- android:paddingEnd="32dp"
+ android:paddingTop="8dp"
+ android:paddingBottom="8dp"
+ android:paddingStart="12dp"
+ android:paddingEnd="12dp"
android:background="@color/white"
android:elevation="8dp">
<Button android:id="@+id/button_once"
@@ -99,21 +102,16 @@
android:background="?android:attr/dividerVertical" />
</LinearLayout>
- <GridView
+ <ListView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/resolver_list"
- android:numColumns="4"
- android:columnWidth="128dp"
android:clipToPadding="false"
android:scrollbarStyle="outsideOverlay"
- android:paddingLeft="32dp"
- android:paddingRight="32dp"
- android:paddingTop="16dp"
- android:paddingBottom="16dp"
android:background="@color/white"
android:elevation="8dp"
android:nestedScrollingEnabled="true"
+ android:divider="@null"
/>
</com.android.internal.widget.ResolverDrawerLayout>
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index f1ec5d2..5c932fd 100644
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -3443,6 +3443,9 @@
<string name="whichHomeApplication">Select a home app</string>
<!-- Option to always use the selected application resolution in the future. See the "Complete action using" dialog title-->
<string name="alwaysUse">Use by default for this action.</string>
+ <!-- Title of the list of alternate options to complete an action shown when the
+ last used option is being displayed separately. -->
+ <string name="use_a_different_app">Use a different app</string>
<!-- Text displayed when the user selects the check box for setting default application. See the "Use by default for this action" check box. -->
<string name="clearDefaultHintMsg">Clear default in System settings > Apps > Downloaded.</string>
<!-- Default title for the activity chooser, when one is not given. Android allows multiple activities to perform an action. for example, there may be many ringtone pickers installed. A dialog is shown to the user allowing him to pick which activity should be used. This is the title. -->
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index 01e6e76..ecfbefe 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -2004,4 +2004,5 @@
<java-symbol type="bool" name="config_auto_attach_data_on_creation" />
<java-symbol type="id" name="date_picker_month_day_year_layout" />
<java-symbol type="attr" name="closeItemLayout" />
+ <java-symbol type="layout" name="resolver_different_item_header" />
</resources>
diff --git a/core/tests/inputmethodtests/src/android/os/CursorAnchorInfoTest.java b/core/tests/inputmethodtests/src/android/os/CursorAnchorInfoTest.java
index b6a03d9..d4244ba 100644
--- a/core/tests/inputmethodtests/src/android/os/CursorAnchorInfoTest.java
+++ b/core/tests/inputmethodtests/src/android/os/CursorAnchorInfoTest.java
@@ -116,16 +116,16 @@
assertEquals(TRANSFORM_MATRIX, info.getMatrix());
for (int i = 0; i < MANY_BOUNDS.length; i++) {
final RectF expectedBounds = MANY_BOUNDS[i];
- assertEquals(expectedBounds, info.getCharacterRect(i));
+ assertEquals(expectedBounds, info.getCharacterBounds(i));
}
- assertNull(info.getCharacterRect(-1));
- assertNull(info.getCharacterRect(MANY_BOUNDS.length + 1));
+ assertNull(info.getCharacterBounds(-1));
+ assertNull(info.getCharacterBounds(MANY_BOUNDS.length + 1));
for (int i = 0; i < MANY_FLAGS_ARRAY.length; i++) {
final int expectedFlags = MANY_FLAGS_ARRAY[i];
- assertEquals(expectedFlags, info.getCharacterRectFlags(i));
+ assertEquals(expectedFlags, info.getCharacterBoundsFlags(i));
}
- assertEquals(0, info.getCharacterRectFlags(-1));
- assertEquals(0, info.getCharacterRectFlags(MANY_BOUNDS.length + 1));
+ assertEquals(0, info.getCharacterBoundsFlags(-1));
+ assertEquals(0, info.getCharacterBoundsFlags(MANY_BOUNDS.length + 1));
// Make sure that the builder can reproduce the same object.
final CursorAnchorInfo info2 = builder.build();
@@ -141,16 +141,16 @@
assertEquals(TRANSFORM_MATRIX, info2.getMatrix());
for (int i = 0; i < MANY_BOUNDS.length; i++) {
final RectF expectedBounds = MANY_BOUNDS[i];
- assertEquals(expectedBounds, info2.getCharacterRect(i));
+ assertEquals(expectedBounds, info2.getCharacterBounds(i));
}
- assertNull(info2.getCharacterRect(-1));
- assertNull(info2.getCharacterRect(MANY_BOUNDS.length + 1));
+ assertNull(info2.getCharacterBounds(-1));
+ assertNull(info2.getCharacterBounds(MANY_BOUNDS.length + 1));
for (int i = 0; i < MANY_FLAGS_ARRAY.length; i++) {
final int expectedFlags = MANY_FLAGS_ARRAY[i];
- assertEquals(expectedFlags, info2.getCharacterRectFlags(i));
+ assertEquals(expectedFlags, info2.getCharacterBoundsFlags(i));
}
- assertEquals(0, info2.getCharacterRectFlags(-1));
- assertEquals(0, info2.getCharacterRectFlags(MANY_BOUNDS.length + 1));
+ assertEquals(0, info2.getCharacterBoundsFlags(-1));
+ assertEquals(0, info2.getCharacterBoundsFlags(MANY_BOUNDS.length + 1));
assertEquals(info, info2);
assertEquals(info.hashCode(), info2.hashCode());
@@ -168,16 +168,16 @@
assertEquals(TRANSFORM_MATRIX, info3.getMatrix());
for (int i = 0; i < MANY_BOUNDS.length; i++) {
final RectF expectedBounds = MANY_BOUNDS[i];
- assertEquals(expectedBounds, info3.getCharacterRect(i));
+ assertEquals(expectedBounds, info3.getCharacterBounds(i));
}
- assertNull(info3.getCharacterRect(-1));
- assertNull(info3.getCharacterRect(MANY_BOUNDS.length + 1));
+ assertNull(info3.getCharacterBounds(-1));
+ assertNull(info3.getCharacterBounds(MANY_BOUNDS.length + 1));
for (int i = 0; i < MANY_FLAGS_ARRAY.length; i++) {
final int expectedFlags = MANY_FLAGS_ARRAY[i];
- assertEquals(expectedFlags, info3.getCharacterRectFlags(i));
+ assertEquals(expectedFlags, info3.getCharacterBoundsFlags(i));
}
- assertEquals(0, info3.getCharacterRectFlags(-1));
- assertEquals(0, info3.getCharacterRectFlags(MANY_BOUNDS.length + 1));
+ assertEquals(0, info3.getCharacterBoundsFlags(-1));
+ assertEquals(0, info3.getCharacterBoundsFlags(MANY_BOUNDS.length + 1));
assertEquals(info.hashCode(), info3.hashCode());
builder.reset();
diff --git a/data/keyboards/Generic.kl b/data/keyboards/Generic.kl
index cfc1484..f10ba96 100644
--- a/data/keyboards/Generic.kl
+++ b/data/keyboards/Generic.kl
@@ -405,6 +405,7 @@
# key 504 KEY_BRL_DOT8
key 580 APP_SWITCH
+key 582 VOICE_ASSIST
# Keys defined by HID usages
key usage 0x0c006F BRIGHTNESS_UP
diff --git a/docs/html/google/play/billing/api.jd b/docs/html/google/play/billing/api.jd
index 3d46715..bc710f9 100644
--- a/docs/html/google/play/billing/api.jd
+++ b/docs/html/google/play/billing/api.jd
@@ -1,6 +1,7 @@
-page.title=In-app Billing Version 3
+page.title=In-app Billing API
parent.title=In-app Billing
parent.link=index.html
+page.tags="billing, inapp, iap"
@jd:body
<div id="qv-wrapper">
diff --git a/docs/html/google/play/billing/billing_integrate.jd b/docs/html/google/play/billing/billing_integrate.jd
index dba43cd..052cf75 100644
--- a/docs/html/google/play/billing/billing_integrate.jd
+++ b/docs/html/google/play/billing/billing_integrate.jd
@@ -1,6 +1,7 @@
-page.title=Implementing In-app Billing <span style="font-size:16px;">(IAB Version 3)</span>
+page.title=Implementing In-app Billing
parent.title=In-app Billing
parent.link=index.html
+page.tags="inapp, billing, iap"
@jd:body
<div id="qv-wrapper">
@@ -141,15 +142,17 @@
};
</pre>
-<p>In your activity’s {@link android.app.Activity#onCreate onCreate} method, perform the binding by calling the {@link android.content.Context#bindService bindService} method. Pass the method an {@link android.content.Intent} that references the In-app Billing service and an instance of the {@link android.content.ServiceConnection} that you created.</p>
-<pre>
-@Override
-public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
- bindService(new
- Intent("com.android.vending.billing.InAppBillingService.BIND"),
- mServiceConn, Context.BIND_AUTO_CREATE);
+<p>In your activity’s {@link android.app.Activity#onCreate onCreate} method, perform the binding by calling the {@link android.content.Context#bindService bindService} method. Pass the method an {@link android.content.Intent} that references the In-app Billing service and an instance of the {@link android.content.ServiceConnection} that you created, and explicitly set the Intent's target package name to <code>com.android.vending</code> — the package name of Google Play app.</p>
+
+<p class="caution"><strong>Caution:</strong> To protect the security of billing transactions, always make sure to explicitly set the intent's target package name to <code>com.android.vending</code>, using {@link android.content.Intent#setPackage(java.lang.String) setPackage()} as shown in the example below. Setting the package name explicitly ensures that <em>only</em> the Google Play app can handle billing requests from your app, preventing other apps from intercepting those requests.</p>
+
+<pre>@Override
+public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+ Intent serviceIntent = new Intent("com.android.vending.billing.InAppBillingService.BIND");
+ serviceIntent.setPackage("com.android.vending");
+ bindService(serviceIntent, mServiceConn, Context.BIND_AUTO_CREATE);
</pre>
<p>You can now use the mService reference to communicate with the Google Play service.</p>
<p class="note"><strong>Important:</strong> Remember to unbind from the In-app Billing service when you are done with your {@link android.app.Activity}. If you don’t unbind, the open service connection could cause your device’s performance to degrade. This example shows how to perform the unbind operation on a service connection to In-app Billing called {@code mServiceConn} by overriding the activity’s {@link android.app.Activity#onDestroy onDestroy} method.</p>
@@ -269,7 +272,7 @@
}
}
</pre>
-<p class="note"><strong>Security Recommendation:</strong> When you send a purchase request, create a String token that uniquely identifies this purchase request and include this token in the {@code developerPayload}.You can use a randomly generated string as the token. When you receive the purchase response from Google Play, make sure to check the returned data signature, the {@code orderId}, and the {@code developerPayload} String. For added security, you should perform the checking on your own secure server. Make sure to verify that the {@code orderId} is a unique value that you have not previously processed, and the {@code developerPayload} String matches the token that you sent previously with the purchase request.</p>
+<p class="note"><strong>Security Recommendation:</strong> When you send a purchase request, create a String token that uniquely identifies this purchase request and include this token in the {@code developerPayload}.You can use a randomly generated string as the token. When you receive the purchase response from Google Play, make sure to check the returned data signature, the {@code orderId}, and the {@code developerPayload} String. For added security, you should perform the checking on your own secure server. Make sure to verify that the {@code orderId} is a unique value that you have not previously processed, and the {@code developerPayload} String matches the token that you sent previously with the purchase request.</p>
<h3 id="QueryPurchases">Querying for Purchased Items</h3>
<p>To retrieve information about purchases made by a user from your app, call the {@code getPurchases} method on the In-app Billing Version 3 service. Pass in to the method the In-app Billing API version (“3”), the package name of your calling app, and the purchase type (“inapp” or "subs").</p>
diff --git a/docs/html/google/play/billing/billing_reference.jd b/docs/html/google/play/billing/billing_reference.jd
index 4f5e65c..4d80964 100644
--- a/docs/html/google/play/billing/billing_reference.jd
+++ b/docs/html/google/play/billing/billing_reference.jd
@@ -1,4 +1,4 @@
-page.title=In-app Billing Reference <span style="font-size:16px;">(IAB Version 3)</span>
+page.title=In-app Billing Reference
parent.title=In-app Billing
parent.link=index.html
@jd:body
diff --git a/docs/html/google/play/billing/billing_subscriptions.jd b/docs/html/google/play/billing/billing_subscriptions.jd
index 3c72da1..2b78ab3 100644
--- a/docs/html/google/play/billing/billing_subscriptions.jd
+++ b/docs/html/google/play/billing/billing_subscriptions.jd
@@ -1,9 +1,9 @@
-page.title=Google Play In-App Subscriptions
+page.title=In-App Subscriptions
parent.title=In-app Billing
parent.link=index.html
page.metaDescription=Subscriptions let you sell content or features in your app with automated, recurring billing.
page.image=/images/play_dev.jpg
-page.tags="inapp, iap, billing"
+page.tags="subscriptions, billing, inapp, iap"
meta.tags="monetization, inappbilling, subscriptions"
@jd:body
diff --git a/docs/html/google/play/billing/billing_testing.jd b/docs/html/google/play/billing/billing_testing.jd
index 8a49433..10f5326 100644
--- a/docs/html/google/play/billing/billing_testing.jd
+++ b/docs/html/google/play/billing/billing_testing.jd
@@ -1,6 +1,7 @@
page.title=Testing In-app Billing
parent.title=In-app Billing
parent.link=index.html
+page.tags="inapp, billing, iap"
@jd:body
<div id="qv-wrapper">
diff --git a/docs/html/google/play/billing/index.jd b/docs/html/google/play/billing/index.jd
index 18b1523..875271fe 100644
--- a/docs/html/google/play/billing/index.jd
+++ b/docs/html/google/play/billing/index.jd
@@ -2,7 +2,7 @@
page.metaDescription=In-app Billing lets you sell digital content as one-time purchases or subscriptions.
page.image=/images/play_dev.jpg
meta.tags="monetizing, inappbilling, subscriptions"
-page.tags="inapp, iap, subscriptions"
+page.tags="billing, inapp, iap"
@jd:body
<p>In-app Billing is a Google Play service that lets you sell digital content from inside
diff --git a/docs/html/google/play/billing/versions.jd b/docs/html/google/play/billing/versions.jd
index 1271a15..dbe3ea3 100644
--- a/docs/html/google/play/billing/versions.jd
+++ b/docs/html/google/play/billing/versions.jd
@@ -1,3 +1,4 @@
+excludeFromSuggestions=true
page.title=In-app Billing Version Notes
@jd:body
diff --git a/docs/html/reference/renderscript/rs__matrix_8rsh.html b/docs/html/reference/renderscript/rs__matrix_8rsh.html
index 69cc373..3b8e047 100644
--- a/docs/html/reference/renderscript/rs__matrix_8rsh.html
+++ b/docs/html/reference/renderscript/rs__matrix_8rsh.html
@@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
-<title>/usr/local/google/home/srhines/android_trees/jb-mr2-dev/frameworks/rs/scriptc/rs_matrix.rsh File Reference</title>
+<title>frameworks/rs/scriptc/rs_matrix.rsh File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
@@ -27,18 +27,18 @@
<div class="summary">
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
-<div class="title">/usr/local/google/home/srhines/android_trees/jb-mr2-dev/frameworks/rs/scriptc/rs_matrix.rsh File Reference</div> </div>
+<div class="title">frameworks/rs/scriptc/rs_matrix.rsh File Reference</div> </div>
</div>
<div class="contents">
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#ad6ea242218e0f1a031f754df0317e6e7">rsMatrixSet</a> (<a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *m, <a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> row, <a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> col, float v)</td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#ab69543f85a673f23fbb5f893e5824395">rsMatrixSet</a> (<a class="el" href="structrs__matrix3x3.html">rs_matrix3x3</a> *m, <a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> row, <a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> col, float v)</td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#a0a85c8d3607f1b75019f6991c5b19fca">rsMatrixSet</a> (<a class="el" href="structrs__matrix2x2.html">rs_matrix2x2</a> *m, <a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> row, <a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> col, float v)</td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">float </td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#a22e983b67d3089c5cb97032e249ca335">rsMatrixGet</a> (const <a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *m, <a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> row, <a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> col)</td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">float </td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#ad485084684991796cffdd8a008557569">rsMatrixGet</a> (const <a class="el" href="structrs__matrix3x3.html">rs_matrix3x3</a> *m, <a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> row, <a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> col)</td></tr>
-<tr><td class="memItemLeft" align="right" valign="top">float </td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#aaa86b029d5c5c15fead5338bba02e4c3">rsMatrixGet</a> (const <a class="el" href="structrs__matrix2x2.html">rs_matrix2x2</a> *m, <a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> row, <a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> col)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">_RS_RUNTIME void </td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#aca88832ed720e301780152c60884393e">rsMatrixSet</a> (<a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *m, <a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> col, <a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> row, float v)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">_RS_RUNTIME void </td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#a08a247cdf2e70e78310bf04f9ecd5144">rsMatrixSet</a> (<a class="el" href="structrs__matrix3x3.html">rs_matrix3x3</a> *m, <a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> col, <a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> row, float v)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">_RS_RUNTIME void </td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#af9707d7be5945bf55ed53683624176ff">rsMatrixSet</a> (<a class="el" href="structrs__matrix2x2.html">rs_matrix2x2</a> *m, <a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> col, <a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> row, float v)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">_RS_RUNTIME float </td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#af26fdbf8b8f0ed5d1b53f62b2aef5110">rsMatrixGet</a> (const <a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *m, <a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> col, <a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> row)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">_RS_RUNTIME float </td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#acfebfc7b97e7282b78cd9c65b791932a">rsMatrixGet</a> (const <a class="el" href="structrs__matrix3x3.html">rs_matrix3x3</a> *m, <a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> col, <a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> row)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">_RS_RUNTIME float </td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#a683b4537b98103c50cc66780dfe8cd69">rsMatrixGet</a> (const <a class="el" href="structrs__matrix2x2.html">rs_matrix2x2</a> *m, <a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> col, <a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> row)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#a0ffd9de971cf10d0a663ff565be8d3cc">rsMatrixLoadIdentity</a> (<a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *m)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#a5b31e83553efa947db2198674d5db043">rsMatrixLoadIdentity</a> (<a class="el" href="structrs__matrix3x3.html">rs_matrix3x3</a> *m)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#ad2954a5ac11d2370227296be89e92471">rsMatrixLoadIdentity</a> (<a class="el" href="structrs__matrix2x2.html">rs_matrix2x2</a> *m)</td></tr>
@@ -65,9 +65,9 @@
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#a4c59884a0e534dbbcdc5655842732d43">rsMatrixLoadOrtho</a> (<a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *m, float left, float right, float bottom, float top, float near, float far)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#ad25760aaf01e95d0055237afab41bbb3">rsMatrixLoadFrustum</a> (<a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *m, float left, float right, float bottom, float top, float near, float far)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#aa404c34d7478f2921f7415d2da95d02b">rsMatrixLoadPerspective</a> (<a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *m, float fovy, float aspect, float near, float far)</td></tr>
-<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#a2f11c3d7cc34ddce90ba785b93af8da2">rsMatrixMultiply</a> (const <a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *m, <a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> in)</td></tr>
-<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#a88ae2ed203769cb4a7917f84f6c1a2e2">rsMatrixMultiply</a> (const <a class="el" href="structrs__matrix3x3.html">rs_matrix3x3</a> *m, <a class="el" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> in)</td></tr>
-<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">float2</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#a8d81a7143d5d45f60f7e91f955579bab">rsMatrixMultiply</a> (const <a class="el" href="structrs__matrix2x2.html">rs_matrix2x2</a> *m, <a class="el" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">float2</a> in)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">_RS_RUNTIME <a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#a47b6abbf32ffaf77bb13d96c3f05779f">rsMatrixMultiply</a> (<a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *m, <a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> in)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">_RS_RUNTIME <a class="el" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#a716bc2d29b80eb25388aba3ba8845aef">rsMatrixMultiply</a> (<a class="el" href="structrs__matrix3x3.html">rs_matrix3x3</a> *m, <a class="el" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> in)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">_RS_RUNTIME <a class="el" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">float2</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#a4d9a8bb7c3f5d67b14fa349bdd531d13">rsMatrixMultiply</a> (<a class="el" href="structrs__matrix2x2.html">rs_matrix2x2</a> *m, <a class="el" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">float2</a> in)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#a00b6a334ba5ac94d84850f22ec9f4de5">rsMatrixInverse</a> (<a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *m)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#ac05080d52da2d99a759ef34fa0655e82">rsMatrixInverseTranspose</a> (<a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *m)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#a88095c70f1550c760844b3e32e41a31a">rsMatrixTranspose</a> (<a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *m)</td></tr>
@@ -75,16 +75,30 @@
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="rs__matrix_8rsh.html#a49164dd4d4e85b212196028b1fd89dc1">rsMatrixTranspose</a> (<a class="el" href="structrs__matrix2x2.html">rs_matrix2x2</a> *m)</td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
-<div class="textblock"><p>Matrix routines. </p>
+<div class="textblock"><p>Matrix functions. </p>
+<p>These functions let you manipulate square matrices of rank 2x2, 3x3, and 4x4. They are particularly useful for graphical transformations and are compatible with OpenGL.</p>
+<p>A few general notes:</p>
+<ul>
+<li>We use a zero-based index for rows and columns. E.g. the last element of a <a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> is found at (3, 3).</li>
+</ul>
+<ul>
+<li>RenderScript uses column-based vectors. Transforming a vector is done by postmultiplying the vector, e.g. <em>(matrix * vector)</em>, as provided by <a class="el" href="rs__matrix_8rsh.html#a4d9a8bb7c3f5d67b14fa349bdd531d13">rsMatrixMultiply</a>.</li>
+</ul>
+<ul>
+<li>To create a transformation matrix that performs two transformations at once, multiply the two source matrices, with the first transformation as the right argument. E.g. to create a transformation matrix that applies the transformation <em>s1</em> followed by <em>s2</em>, call rsMatrixLoadMultiply(&combined, &s2, &s1). This derives from <em>s2 * (s1 * v)</em>, which is <em>(s2 * s1) * v</em>.</li>
+</ul>
+<ul>
+<li>We have two style of functions to create transformation matrices: rsMatrixLoad<em>Transformation</em> and rsMatrix<em>Transformation</em>. The former style simply stores the transformation matrix in the first argument. The latter modifies a pre-existing transformation matrix so that the new transformation happens first. E.g. if you call <a class="el" href="rs__matrix_8rsh.html#a4df5f9b5bb6044f3c3426f2f58b94405">rsMatrixTranslate</a> on a matrix that already does a scaling, the resulting matrix when applied to a vector will first do the translation then the scaling. </li>
+</ul>
<p>Definition in file <a class="el" href="rs__matrix_8rsh_source.html">rs_matrix.rsh</a>.</p>
</div><hr/><h2>Function Documentation</h2>
-<a class="anchor" id="a22e983b67d3089c5cb97032e249ca335"></a><!-- doxytag: member="rs_matrix.rsh::rsMatrixGet" ref="a22e983b67d3089c5cb97032e249ca335" args="(const rs_matrix4x4 *m, uint32_t row, uint32_t col)" -->
+<a class="anchor" id="af26fdbf8b8f0ed5d1b53f62b2aef5110"></a><!-- doxytag: member="rs_matrix.rsh::rsMatrixGet" ref="af26fdbf8b8f0ed5d1b53f62b2aef5110" args="(const rs_matrix4x4 *m, uint32_t col, uint32_t row)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
- <td class="memname">float rsMatrixGet </td>
+ <td class="memname">_RS_RUNTIME float rsMatrixGet </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> * </td>
<td class="paramname"><em>m</em>, </td>
@@ -93,13 +107,13 @@
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> </td>
- <td class="paramname"><em>row</em>, </td>
+ <td class="paramname"><em>col</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> </td>
- <td class="paramname"><em>col</em> </td>
+ <td class="paramname"><em>row</em> </td>
</tr>
<tr>
<td></td>
@@ -109,25 +123,26 @@
</table>
</div>
<div class="memdoc">
-<p>Get one element of a matrix.</p>
+<p>Returns one element of a matrix.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
- <tr><td class="paramname">m</td><td>The matrix to read from </td></tr>
- <tr><td class="paramname">row</td><td></td></tr>
- <tr><td class="paramname">col</td><td></td></tr>
+ <tr><td class="paramname">m</td><td>The matrix to extract the element from. </td></tr>
+ <tr><td class="paramname">col</td><td>The zero-based column of the element to be extracted. </td></tr>
+ <tr><td class="paramname">row</td><td>The zero-based row of the element to extracted.</td></tr>
</table>
</dd>
</dl>
+<dl class="warning"><dt><b>Warning:</b></dt><dd>The order of the column and row parameters may be unexpected.</dd></dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>float </dd></dl>
</div>
</div>
-<a class="anchor" id="ad485084684991796cffdd8a008557569"></a><!-- doxytag: member="rs_matrix.rsh::rsMatrixGet" ref="ad485084684991796cffdd8a008557569" args="(const rs_matrix3x3 *m, uint32_t row, uint32_t col)" -->
+<a class="anchor" id="acfebfc7b97e7282b78cd9c65b791932a"></a><!-- doxytag: member="rs_matrix.rsh::rsMatrixGet" ref="acfebfc7b97e7282b78cd9c65b791932a" args="(const rs_matrix3x3 *m, uint32_t col, uint32_t row)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
- <td class="memname">float rsMatrixGet </td>
+ <td class="memname">_RS_RUNTIME float rsMatrixGet </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="structrs__matrix3x3.html">rs_matrix3x3</a> * </td>
<td class="paramname"><em>m</em>, </td>
@@ -136,13 +151,13 @@
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> </td>
- <td class="paramname"><em>row</em>, </td>
+ <td class="paramname"><em>col</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> </td>
- <td class="paramname"><em>col</em> </td>
+ <td class="paramname"><em>row</em> </td>
</tr>
<tr>
<td></td>
@@ -156,12 +171,12 @@
</div>
</div>
-<a class="anchor" id="aaa86b029d5c5c15fead5338bba02e4c3"></a><!-- doxytag: member="rs_matrix.rsh::rsMatrixGet" ref="aaa86b029d5c5c15fead5338bba02e4c3" args="(const rs_matrix2x2 *m, uint32_t row, uint32_t col)" -->
+<a class="anchor" id="a683b4537b98103c50cc66780dfe8cd69"></a><!-- doxytag: member="rs_matrix.rsh::rsMatrixGet" ref="a683b4537b98103c50cc66780dfe8cd69" args="(const rs_matrix2x2 *m, uint32_t col, uint32_t row)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
- <td class="memname">float rsMatrixGet </td>
+ <td class="memname">_RS_RUNTIME float rsMatrixGet </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="structrs__matrix2x2.html">rs_matrix2x2</a> * </td>
<td class="paramname"><em>m</em>, </td>
@@ -170,13 +185,13 @@
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> </td>
- <td class="paramname"><em>row</em>, </td>
+ <td class="paramname"><em>col</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> </td>
- <td class="paramname"><em>col</em> </td>
+ <td class="paramname"><em>row</em> </td>
</tr>
<tr>
<td></td>
@@ -204,10 +219,11 @@
</table>
</div>
<div class="memdoc">
-<p>Returns true if the matrix was successfully inversed</p>
+<p>Inverts a matrix in place.</p>
+<p>Returns true if the matrix was successfully inversed.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
- <tr><td class="paramname">m</td><td></td></tr>
+ <tr><td class="paramname">m</td><td>The matrix to invert. </td></tr>
</table>
</dd>
</dl>
@@ -228,10 +244,11 @@
</table>
</div>
<div class="memdoc">
-<p>Returns true if the matrix was successfully inversed and transposed.</p>
+<p>Inverts and transpose a matrix in place.</p>
+<p>The matrix is first inverted then transposed. Returns true if the matrix was successfully inverted.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
- <tr><td class="paramname">m</td><td></td></tr>
+ <tr><td class="paramname">m</td><td>The matrix to modify. </td></tr>
</table>
</dd>
</dl>
@@ -263,9 +280,11 @@
</div>
<div class="memdoc">
<p>Set the elements of a matrix from an array of floats.</p>
+<p>The array of floats should be in row-major order, i.e. the element a <em>row 0, column 0</em> should be first, followed by the element at <em>row 0, column 1</em>, etc.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
- <tr><td class="paramname">m</td><td></td></tr>
+ <tr><td class="paramname">m</td><td>The matrix to set. </td></tr>
+ <tr><td class="paramname">v</td><td>The array of values to set the matrix to. These arrays should be 4, 9, or 16 floats long, depending on the matrix size. </td></tr>
</table>
</dd>
</dl>
@@ -352,7 +371,20 @@
</table>
</div>
<div class="memdoc">
-<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
+<p>Set the elements of a matrix from another matrix.</p>
+<p>If the source matrix is smaller than the destination, the rest of the destination is filled with elements of the identity matrix. E.g. loading a <a class="el" href="structrs__matrix2x2.html" title="2x2 float matrix">rs_matrix2x2</a> into a <a class="el" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> will give:</p>
+ <table>
+ <tr><td>m00</td><td>m01</td><td>0.0</td><td>0.0</td></tr>
+ <tr><td>m10</td><td>m11</td><td>0.0</td><td>0.0</td></tr>
+ <tr><td>0.0</td><td>0.0</td><td>1.0</td><td>0.0</td></tr>
+ <tr><td>0.0</td><td>0.0</td><td>0.0</td><td>1.0</td></tr>
+ </table><dl><dt><b>Parameters:</b></dt><dd>
+ <table class="params">
+ <tr><td class="paramname">m</td><td>The matrix to set. </td></tr>
+ <tr><td class="paramname">v</td><td>The source matrix. </td></tr>
+ </table>
+ </dd>
+</dl>
</div>
</div>
@@ -408,13 +440,7 @@
</table>
</div>
<div class="memdoc">
-<p>Set the elements of a matrix from another matrix.</p>
-<dl><dt><b>Parameters:</b></dt><dd>
- <table class="params">
- <tr><td class="paramname">m</td><td></td></tr>
- </table>
- </dd>
-</dl>
+<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
</div>
</div>
@@ -528,10 +554,13 @@
</table>
</div>
<div class="memdoc">
-<p>Load an Frustum projection matrix constructed from the 6 planes</p>
+<p>Load a frustum projection matrix.</p>
+<p>Constructs a frustum projection matrix, transforming the box identified by the six clipping planes <em>left, right, bottom, top, near, far</em>.</p>
+<p>To apply this projection to a vector, multiply the vector by the created matrix using <a class="el" href="rs__matrix_8rsh.html#a4d9a8bb7c3f5d67b14fa349bdd531d13">rsMatrixMultiply</a>.</p>
+<p>See <a href="https://www.opengl.org/documentation/specs/version2.0/glspec20.pdf">https://www.opengl.org/documentation/specs/version2.0/glspec20.pdf</a></p>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
- <tr><td class="paramname">m</td><td></td></tr>
+ <tr><td class="paramname">m</td><td>The matrix to set. </td></tr>
<tr><td class="paramname">left</td><td></td></tr>
<tr><td class="paramname">right</td><td></td></tr>
<tr><td class="paramname">bottom</td><td></td></tr>
@@ -561,7 +590,7 @@
<p>Set the elements of a matrix to the identity matrix.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
- <tr><td class="paramname">m</td><td></td></tr>
+ <tr><td class="paramname">m</td><td>The matrix to set. </td></tr>
</table>
</dd>
</dl>
@@ -634,12 +663,15 @@
</table>
</div>
<div class="memdoc">
-<p>Multiply two matrix (lhs, rhs) and place the result in m.</p>
+<p>Multiply two matrices.</p>
+<p>Sets <em>m</em> to the matrix product of <em>lhs * rhs</em>.</p>
+<p>To combine two 4x4 transformaton matrices, multiply the second transformation matrix by the first transformation matrix. E.g. to create a transformation matrix that applies the transformation <em>s1</em> followed by <em>s2</em>, call rsMatrixLoadMultiply(&combined, &s2, &s1).</p>
+<dl class="warning"><dt><b>Warning:</b></dt><dd>As of version 21, storing the result back into right matrix is not supported and will result in undefined behavior. Use rsMatrixMulitply instead. E.g. instead of doing rsMatrixLoadMultiply (&m2r, &m2r, &m2l), use rsMatrixMultiply (&m2r, &m2l). rsMatrixLoadMultiply (&m2l, &m2r, &m2l) works as expected.</dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
- <tr><td class="paramname">m</td><td></td></tr>
- <tr><td class="paramname">lhs</td><td></td></tr>
- <tr><td class="paramname">rhs</td><td></td></tr>
+ <tr><td class="paramname">m</td><td>The matrix to set. </td></tr>
+ <tr><td class="paramname">lhs</td><td>The left matrix of the product. </td></tr>
+ <tr><td class="paramname">rhs</td><td>The right matrix of the product. </td></tr>
</table>
</dd>
</dl>
@@ -768,10 +800,13 @@
</table>
</div>
<div class="memdoc">
-<p>Load an Ortho projection matrix constructed from the 6 planes</p>
+<p>Load an orthographic projection matrix.</p>
+<p>Constructs an orthographic projection matrix, transforming the box identified by the six clipping planes <em>left, right, bottom, top, near, far</em> into a unit cube with a corner at <em>(-1, -1, -1)</em> and the opposite at <em>(1, 1, 1)</em>.</p>
+<p>To apply this projection to a vector, multiply the vector by the created matrix using <a class="el" href="rs__matrix_8rsh.html#a4d9a8bb7c3f5d67b14fa349bdd531d13">rsMatrixMultiply</a>.</p>
+<p>See <a href="https://en.wikipedia.org/wiki/Orthographic_projection">https://en.wikipedia.org/wiki/Orthographic_projection</a> and <a href="https://www.opengl.org/documentation/specs/version2.0/glspec20.pdf">https://www.opengl.org/documentation/specs/version2.0/glspec20.pdf</a></p>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
- <tr><td class="paramname">m</td><td></td></tr>
+ <tr><td class="paramname">m</td><td>The matrix to set. </td></tr>
<tr><td class="paramname">left</td><td></td></tr>
<tr><td class="paramname">right</td><td></td></tr>
<tr><td class="paramname">bottom</td><td></td></tr>
@@ -826,14 +861,17 @@
</table>
</div>
<div class="memdoc">
-<p>Load an perspective projection matrix constructed from the 6 planes</p>
+<p>Load a perspective projection matrix.</p>
+<p>Constructs a perspective projection matrix, assuming a symmetrical field of view.</p>
+<p>To apply this projection to a vector, multiply the vector by the created matrix using <a class="el" href="rs__matrix_8rsh.html#a4d9a8bb7c3f5d67b14fa349bdd531d13">rsMatrixMultiply</a>.</p>
+<p>See <a href="https://www.opengl.org/documentation/specs/version2.0/glspec20.pdf">https://www.opengl.org/documentation/specs/version2.0/glspec20.pdf</a></p>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
- <tr><td class="paramname">m</td><td></td></tr>
+ <tr><td class="paramname">m</td><td>The matrix to set. </td></tr>
<tr><td class="paramname">fovy</td><td>Field of view, in degrees along the Y axis. </td></tr>
<tr><td class="paramname">aspect</td><td>Ratio of x / y. </td></tr>
- <tr><td class="paramname">near</td><td></td></tr>
- <tr><td class="paramname">far</td><td></td></tr>
+ <tr><td class="paramname">near</td><td>The near clipping plane. </td></tr>
+ <tr><td class="paramname">far</td><td>The far clipping plane. </td></tr>
</table>
</dd>
</dl>
@@ -883,13 +921,16 @@
</div>
<div class="memdoc">
<p>Load a rotation matrix.</p>
+<p>This function creates a rotation matrix. The axis of rotation is the <em>(x, y, z)</em> vector.</p>
+<p>To rotate a vector, multiply the vector by the created matrix using <a class="el" href="rs__matrix_8rsh.html#a4d9a8bb7c3f5d67b14fa349bdd531d13">rsMatrixMultiply</a>.</p>
+<p>See <a href="http://en.wikipedia.org/wiki/Rotation_matrix">http://en.wikipedia.org/wiki/Rotation_matrix</a> .</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
- <tr><td class="paramname">m</td><td></td></tr>
- <tr><td class="paramname">rot</td><td></td></tr>
- <tr><td class="paramname">x</td><td></td></tr>
- <tr><td class="paramname">y</td><td></td></tr>
- <tr><td class="paramname">z</td><td></td></tr>
+ <tr><td class="paramname">m</td><td>The matrix to set. </td></tr>
+ <tr><td class="paramname">rot</td><td>How much rotation to do, in degrees. </td></tr>
+ <tr><td class="paramname">x</td><td>The x component of the vector that is the axis of rotation. </td></tr>
+ <tr><td class="paramname">y</td><td>The y component of the vector that is the axis of rotation. </td></tr>
+ <tr><td class="paramname">z</td><td>The z component of the vector that is the axis of rotation. </td></tr>
</table>
</dd>
</dl>
@@ -933,12 +974,14 @@
</div>
<div class="memdoc">
<p>Load a scale matrix.</p>
+<p>This function creates a scaling matrix, where each component of a vector is multiplied by a number. This number can be negative.</p>
+<p>To scale a vector, multiply the vector by the created matrix using <a class="el" href="rs__matrix_8rsh.html#a4d9a8bb7c3f5d67b14fa349bdd531d13">rsMatrixMultiply</a>.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
- <tr><td class="paramname">m</td><td></td></tr>
- <tr><td class="paramname">x</td><td></td></tr>
- <tr><td class="paramname">y</td><td></td></tr>
- <tr><td class="paramname">z</td><td></td></tr>
+ <tr><td class="paramname">m</td><td>The matrix to set. </td></tr>
+ <tr><td class="paramname">x</td><td>The multiple to scale the x components by. </td></tr>
+ <tr><td class="paramname">y</td><td>The multiple to scale the y components by. </td></tr>
+ <tr><td class="paramname">z</td><td>The multiple to scale the z components by. </td></tr>
</table>
</dd>
</dl>
@@ -982,12 +1025,14 @@
</div>
<div class="memdoc">
<p>Load a translation matrix.</p>
+<p>This function creates a translation matrix, where a number is added to each element of a vector.</p>
+<p>To translate a vector, multiply the vector by the created matrix using <a class="el" href="rs__matrix_8rsh.html#a4d9a8bb7c3f5d67b14fa349bdd531d13">rsMatrixMultiply</a>.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
- <tr><td class="paramname">m</td><td></td></tr>
- <tr><td class="paramname">x</td><td></td></tr>
- <tr><td class="paramname">y</td><td></td></tr>
- <tr><td class="paramname">z</td><td></td></tr>
+ <tr><td class="paramname">m</td><td>The matrix to set. </td></tr>
+ <tr><td class="paramname">x</td><td>The number to add to each x component. </td></tr>
+ <tr><td class="paramname">y</td><td>The number to add to each y component. </td></tr>
+ <tr><td class="paramname">z</td><td>The number to add to each z component. </td></tr>
</table>
</dd>
</dl>
@@ -1018,11 +1063,13 @@
</table>
</div>
<div class="memdoc">
-<p>Multiply the matrix m by rhs and place the result back into m.</p>
+<p>Multiply a matrix into another one.</p>
+<p>Sets <em>m</em> to the matrix product <em>m * rhs</em>.</p>
+<p>When combining two 4x4 transformation matrices using this function, the resulting matrix will correspond to performing the <em>rhs</em> transformation first followed by the original <em>m</em> transformation.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
- <tr><td class="paramname">m</td><td>(lhs) </td></tr>
- <tr><td class="paramname">rhs</td><td></td></tr>
+ <tr><td class="paramname">m</td><td>The left matrix of the product and the matrix to be set. </td></tr>
+ <tr><td class="paramname">rhs</td><td>The right matrix of the product. </td></tr>
</table>
</dd>
</dl>
@@ -1085,14 +1132,14 @@
</div>
</div>
-<a class="anchor" id="a2f11c3d7cc34ddce90ba785b93af8da2"></a><!-- doxytag: member="rs_matrix.rsh::rsMatrixMultiply" ref="a2f11c3d7cc34ddce90ba785b93af8da2" args="(const rs_matrix4x4 *m, float4 in)" -->
+<a class="anchor" id="a47b6abbf32ffaf77bb13d96c3f05779f"></a><!-- doxytag: member="rs_matrix.rsh::rsMatrixMultiply" ref="a47b6abbf32ffaf77bb13d96c3f05779f" args="(rs_matrix4x4 *m, float4 in)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
- <td class="memname"><a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> rsMatrixMultiply </td>
+ <td class="memname">_RS_RUNTIME <a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> rsMatrixMultiply </td>
<td>(</td>
- <td class="paramtype">const <a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> * </td>
+ <td class="paramtype"><a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> * </td>
<td class="paramname"><em>m</em>, </td>
</tr>
<tr>
@@ -1109,19 +1156,24 @@
</table>
</div>
<div class="memdoc">
-<p>Multiply a vector by a matrix and return the result vector. API version 14+</p>
+<p>Multiply a vector by a matrix.</p>
+<p>Returns the post-multiplication of the vector by the matrix, ie. <em>m * in</em>.</p>
+<p>When multiplying a <em>float3</em> to a <em><a class="el" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a></em>, the vector is expanded with (1).</p>
+<p>When multiplying a <em>float2</em> to a <em><a class="el" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a></em>, the vector is expanded with (0, 1).</p>
+<p>When multiplying a <em>float2</em> to a <em><a class="el" href="structrs__matrix3x3.html" title="3x3 float matrix">rs_matrix3x3</a></em>, the vector is expanded with (0).</p>
+<p>This function is available in API version 10-13. Starting with API 14, the function takes a const matrix as the first argument.</p>
<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
</div>
</div>
-<a class="anchor" id="a88ae2ed203769cb4a7917f84f6c1a2e2"></a><!-- doxytag: member="rs_matrix.rsh::rsMatrixMultiply" ref="a88ae2ed203769cb4a7917f84f6c1a2e2" args="(const rs_matrix3x3 *m, float3 in)" -->
+<a class="anchor" id="a716bc2d29b80eb25388aba3ba8845aef"></a><!-- doxytag: member="rs_matrix.rsh::rsMatrixMultiply" ref="a716bc2d29b80eb25388aba3ba8845aef" args="(rs_matrix3x3 *m, float3 in)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
- <td class="memname"><a class="el" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> rsMatrixMultiply </td>
+ <td class="memname">_RS_RUNTIME <a class="el" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> rsMatrixMultiply </td>
<td>(</td>
- <td class="paramtype">const <a class="el" href="structrs__matrix3x3.html">rs_matrix3x3</a> * </td>
+ <td class="paramtype"><a class="el" href="structrs__matrix3x3.html">rs_matrix3x3</a> * </td>
<td class="paramname"><em>m</em>, </td>
</tr>
<tr>
@@ -1142,14 +1194,14 @@
</div>
</div>
-<a class="anchor" id="a8d81a7143d5d45f60f7e91f955579bab"></a><!-- doxytag: member="rs_matrix.rsh::rsMatrixMultiply" ref="a8d81a7143d5d45f60f7e91f955579bab" args="(const rs_matrix2x2 *m, float2 in)" -->
+<a class="anchor" id="a4d9a8bb7c3f5d67b14fa349bdd531d13"></a><!-- doxytag: member="rs_matrix.rsh::rsMatrixMultiply" ref="a4d9a8bb7c3f5d67b14fa349bdd531d13" args="(rs_matrix2x2 *m, float2 in)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
- <td class="memname"><a class="el" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">float2</a> rsMatrixMultiply </td>
+ <td class="memname">_RS_RUNTIME <a class="el" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">float2</a> rsMatrixMultiply </td>
<td>(</td>
- <td class="paramtype">const <a class="el" href="structrs__matrix2x2.html">rs_matrix2x2</a> * </td>
+ <td class="paramtype"><a class="el" href="structrs__matrix2x2.html">rs_matrix2x2</a> * </td>
<td class="paramname"><em>m</em>, </td>
</tr>
<tr>
@@ -1212,14 +1264,16 @@
</table>
</div>
<div class="memdoc">
-<p>Multiple matrix m with a rotation matrix</p>
+<p>Multiply the matrix <em>m</em> with a rotation matrix.</p>
+<p>This function modifies a transformation matrix to first do a rotation. The axis of rotation is the <em>(x, y, z)</em> vector.</p>
+<p>To apply this combined transformation to a vector, multiply the vector by the created matrix using <a class="el" href="rs__matrix_8rsh.html#a4d9a8bb7c3f5d67b14fa349bdd531d13">rsMatrixMultiply</a>.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
- <tr><td class="paramname">m</td><td></td></tr>
- <tr><td class="paramname">rot</td><td></td></tr>
- <tr><td class="paramname">x</td><td></td></tr>
- <tr><td class="paramname">y</td><td></td></tr>
- <tr><td class="paramname">z</td><td></td></tr>
+ <tr><td class="paramname">m</td><td>The matrix to modify. </td></tr>
+ <tr><td class="paramname">rot</td><td>How much rotation to do, in degrees. </td></tr>
+ <tr><td class="paramname">x</td><td>The x component of the vector that is the axis of rotation. </td></tr>
+ <tr><td class="paramname">y</td><td>The y component of the vector that is the axis of rotation. </td></tr>
+ <tr><td class="paramname">z</td><td>The z component of the vector that is the axis of rotation. </td></tr>
</table>
</dd>
</dl>
@@ -1262,25 +1316,27 @@
</table>
</div>
<div class="memdoc">
-<p>Multiple matrix m with a scale matrix</p>
+<p>Multiply the matrix <em>m</em> with a scaling matrix.</p>
+<p>This function modifies a transformation matrix to first do a scaling. When scaling, each component of a vector is multiplied by a number. This number can be negative.</p>
+<p>To apply this combined transformation to a vector, multiply the vector by the created matrix using <a class="el" href="rs__matrix_8rsh.html#a4d9a8bb7c3f5d67b14fa349bdd531d13">rsMatrixMultiply</a>.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
- <tr><td class="paramname">m</td><td></td></tr>
- <tr><td class="paramname">x</td><td></td></tr>
- <tr><td class="paramname">y</td><td></td></tr>
- <tr><td class="paramname">z</td><td></td></tr>
+ <tr><td class="paramname">m</td><td>The matrix to modify. </td></tr>
+ <tr><td class="paramname">x</td><td>The multiple to scale the x components by. </td></tr>
+ <tr><td class="paramname">y</td><td>The multiple to scale the y components by. </td></tr>
+ <tr><td class="paramname">z</td><td>The multiple to scale the z components by. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
-<a class="anchor" id="ad6ea242218e0f1a031f754df0317e6e7"></a><!-- doxytag: member="rs_matrix.rsh::rsMatrixSet" ref="ad6ea242218e0f1a031f754df0317e6e7" args="(rs_matrix4x4 *m, uint32_t row, uint32_t col, float v)" -->
+<a class="anchor" id="aca88832ed720e301780152c60884393e"></a><!-- doxytag: member="rs_matrix.rsh::rsMatrixSet" ref="aca88832ed720e301780152c60884393e" args="(rs_matrix4x4 *m, uint32_t col, uint32_t row, float v)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
- <td class="memname">void rsMatrixSet </td>
+ <td class="memname">_RS_RUNTIME void rsMatrixSet </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> * </td>
<td class="paramname"><em>m</em>, </td>
@@ -1289,13 +1345,13 @@
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> </td>
- <td class="paramname"><em>row</em>, </td>
+ <td class="paramname"><em>col</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> </td>
- <td class="paramname"><em>col</em>, </td>
+ <td class="paramname"><em>row</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
@@ -1311,26 +1367,27 @@
</table>
</div>
<div class="memdoc">
-<p>Set one element of a matrix.</p>
+<p>Set an element of a matrix.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
- <tr><td class="paramname">m</td><td>The matrix to be set </td></tr>
- <tr><td class="paramname">row</td><td></td></tr>
- <tr><td class="paramname">col</td><td></td></tr>
- <tr><td class="paramname">v</td><td></td></tr>
+ <tr><td class="paramname">m</td><td>The matrix that will be modified. </td></tr>
+ <tr><td class="paramname">col</td><td>The zero-based column of the element to be set. </td></tr>
+ <tr><td class="paramname">row</td><td>The zero-based row of the element to be set. </td></tr>
+ <tr><td class="paramname">v</td><td>The value to set.</td></tr>
</table>
</dd>
</dl>
+<dl class="warning"><dt><b>Warning:</b></dt><dd>The order of the column and row parameters may be unexpected.</dd></dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>void </dd></dl>
</div>
</div>
-<a class="anchor" id="ab69543f85a673f23fbb5f893e5824395"></a><!-- doxytag: member="rs_matrix.rsh::rsMatrixSet" ref="ab69543f85a673f23fbb5f893e5824395" args="(rs_matrix3x3 *m, uint32_t row, uint32_t col, float v)" -->
+<a class="anchor" id="a08a247cdf2e70e78310bf04f9ecd5144"></a><!-- doxytag: member="rs_matrix.rsh::rsMatrixSet" ref="a08a247cdf2e70e78310bf04f9ecd5144" args="(rs_matrix3x3 *m, uint32_t col, uint32_t row, float v)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
- <td class="memname">void rsMatrixSet </td>
+ <td class="memname">_RS_RUNTIME void rsMatrixSet </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structrs__matrix3x3.html">rs_matrix3x3</a> * </td>
<td class="paramname"><em>m</em>, </td>
@@ -1339,13 +1396,13 @@
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> </td>
- <td class="paramname"><em>row</em>, </td>
+ <td class="paramname"><em>col</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> </td>
- <td class="paramname"><em>col</em>, </td>
+ <td class="paramname"><em>row</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
@@ -1365,12 +1422,12 @@
</div>
</div>
-<a class="anchor" id="a0a85c8d3607f1b75019f6991c5b19fca"></a><!-- doxytag: member="rs_matrix.rsh::rsMatrixSet" ref="a0a85c8d3607f1b75019f6991c5b19fca" args="(rs_matrix2x2 *m, uint32_t row, uint32_t col, float v)" -->
+<a class="anchor" id="af9707d7be5945bf55ed53683624176ff"></a><!-- doxytag: member="rs_matrix.rsh::rsMatrixSet" ref="af9707d7be5945bf55ed53683624176ff" args="(rs_matrix2x2 *m, uint32_t col, uint32_t row, float v)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
- <td class="memname">void rsMatrixSet </td>
+ <td class="memname">_RS_RUNTIME void rsMatrixSet </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structrs__matrix2x2.html">rs_matrix2x2</a> * </td>
<td class="paramname"><em>m</em>, </td>
@@ -1379,13 +1436,13 @@
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> </td>
- <td class="paramname"><em>row</em>, </td>
+ <td class="paramname"><em>col</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> </td>
- <td class="paramname"><em>col</em>, </td>
+ <td class="paramname"><em>row</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
@@ -1441,13 +1498,15 @@
</table>
</div>
<div class="memdoc">
-<p>Multiple matrix m with a translation matrix</p>
+<p>Multiply the matrix <em>m</em> with a translation matrix.</p>
+<p>This function modifies a transformation matrix to first do a translation. When translating, a number is added to each component of a vector.</p>
+<p>To apply this combined transformation to a vector, multiply the vector by the created matrix using <a class="el" href="rs__matrix_8rsh.html#a4d9a8bb7c3f5d67b14fa349bdd531d13">rsMatrixMultiply</a>.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
- <tr><td class="paramname">m</td><td></td></tr>
- <tr><td class="paramname">x</td><td></td></tr>
- <tr><td class="paramname">y</td><td></td></tr>
- <tr><td class="paramname">z</td><td></td></tr>
+ <tr><td class="paramname">m</td><td>The matrix to modify. </td></tr>
+ <tr><td class="paramname">x</td><td>The number to add to each x component. </td></tr>
+ <tr><td class="paramname">y</td><td>The number to add to each y component. </td></tr>
+ <tr><td class="paramname">z</td><td>The number to add to each z component. </td></tr>
</table>
</dd>
</dl>
@@ -1468,10 +1527,10 @@
</table>
</div>
<div class="memdoc">
-<p>Transpose the matrix m.</p>
+<p>Transpose the matrix m in place.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
- <tr><td class="paramname">m</td><td></td></tr>
+ <tr><td class="paramname">m</td><td>The matrix to transpose. </td></tr>
</table>
</dd>
</dl>
diff --git a/docs/html/reference/renderscript/rs__matrix_8rsh_source.html b/docs/html/reference/renderscript/rs__matrix_8rsh_source.html
index c1aaeb2..77144bd 100644
--- a/docs/html/reference/renderscript/rs__matrix_8rsh_source.html
+++ b/docs/html/reference/renderscript/rs__matrix_8rsh_source.html
@@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
-<title>/usr/local/google/home/srhines/android_trees/jb-mr2-dev/frameworks/rs/scriptc/rs_matrix.rsh Source File</title>
+<title>frameworks/rs/scriptc/rs_matrix.rsh Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
@@ -24,7 +24,7 @@
</div>
<div class="header">
<div class="headertitle">
-<div class="title">/usr/local/google/home/srhines/android_trees/jb-mr2-dev/frameworks/rs/scriptc/rs_matrix.rsh</div> </div>
+<div class="title">frameworks/rs/scriptc/rs_matrix.rsh</div> </div>
</div>
<div class="contents">
<a href="rs__matrix_8rsh.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
@@ -43,129 +43,128 @@
<a name="l00014"></a>00014 <span class="comment"> * limitations under the License.</span>
<a name="l00015"></a>00015 <span class="comment"> */</span>
<a name="l00016"></a>00016
-<a name="l00023"></a>00023 <span class="preprocessor">#ifndef __RS_MATRIX_RSH__</span>
-<a name="l00024"></a>00024 <span class="preprocessor"></span><span class="preprocessor">#define __RS_MATRIX_RSH__</span>
-<a name="l00025"></a>00025 <span class="preprocessor"></span>
-<a name="l00036"></a>00036 _RS_RUNTIME <span class="keywordtype">void</span> __attribute__((overloadable))
-<a name="l00037"></a>00037 <a class="code" href="rs__matrix_8rsh.html#ad6ea242218e0f1a031f754df0317e6e7">rsMatrixSet</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> row, <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> col, <span class="keywordtype">float</span> v);
-<a name="l00041"></a>00041 _RS_RUNTIME <span class="keywordtype">void</span> __attribute__((overloadable))
-<a name="l00042"></a>00042 <a class="code" href="rs__matrix_8rsh.html#ad6ea242218e0f1a031f754df0317e6e7">rsMatrixSet</a>(<a class="code" href="structrs__matrix3x3.html" title="3x3 float matrix">rs_matrix3x3</a> *m, <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> row, <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> col, <span class="keywordtype">float</span> v);
-<a name="l00046"></a>00046 _RS_RUNTIME <span class="keywordtype">void</span> __attribute__((overloadable))
-<a name="l00047"></a>00047 <a class="code" href="rs__matrix_8rsh.html#ad6ea242218e0f1a031f754df0317e6e7">rsMatrixSet</a>(<a class="code" href="structrs__matrix2x2.html" title="2x2 float matrix">rs_matrix2x2</a> *m, <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> row, <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> col, <span class="keywordtype">float</span> v);
-<a name="l00048"></a>00048
-<a name="l00058"></a>00058 _RS_RUNTIME <span class="keywordtype">float</span> __attribute__((overloadable))
-<a name="l00059"></a>00059 <a class="code" href="rs__matrix_8rsh.html#a22e983b67d3089c5cb97032e249ca335">rsMatrixGet</a>(const <a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> row, <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> col);
-<a name="l00063"></a>00063 _RS_RUNTIME <span class="keywordtype">float</span> __attribute__((overloadable))
-<a name="l00064"></a>00064 <a class="code" href="rs__matrix_8rsh.html#a22e983b67d3089c5cb97032e249ca335">rsMatrixGet</a>(const <a class="code" href="structrs__matrix3x3.html" title="3x3 float matrix">rs_matrix3x3</a> *m, <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> row, <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> col);
-<a name="l00068"></a>00068 _RS_RUNTIME <span class="keywordtype">float</span> __attribute__((overloadable))
-<a name="l00069"></a>00069 <a class="code" href="rs__matrix_8rsh.html#a22e983b67d3089c5cb97032e249ca335">rsMatrixGet</a>(const <a class="code" href="structrs__matrix2x2.html" title="2x2 float matrix">rs_matrix2x2</a> *m, <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> row, <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> col);
-<a name="l00070"></a>00070
-<a name="l00076"></a>00076 extern <span class="keywordtype">void</span> __attribute__((overloadable)) <a class="code" href="rs__matrix_8rsh.html#a0ffd9de971cf10d0a663ff565be8d3cc">rsMatrixLoadIdentity</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m);
-<a name="l00080"></a>00080 extern <span class="keywordtype">void</span> __attribute__((overloadable)) <a class="code" href="rs__matrix_8rsh.html#a0ffd9de971cf10d0a663ff565be8d3cc">rsMatrixLoadIdentity</a>(<a class="code" href="structrs__matrix3x3.html" title="3x3 float matrix">rs_matrix3x3</a> *m);
-<a name="l00084"></a>00084 extern <span class="keywordtype">void</span> __attribute__((overloadable)) <a class="code" href="rs__matrix_8rsh.html#a0ffd9de971cf10d0a663ff565be8d3cc">rsMatrixLoadIdentity</a>(<a class="code" href="structrs__matrix2x2.html" title="2x2 float matrix">rs_matrix2x2</a> *m);
-<a name="l00085"></a>00085
-<a name="l00091"></a>00091 extern <span class="keywordtype">void</span> __attribute__((overloadable)) <a class="code" href="rs__matrix_8rsh.html#ac380c4117e047da494a74f0dad20fab3">rsMatrixLoad</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, const <span class="keywordtype">float</span> *v);
-<a name="l00095"></a>00095 extern <span class="keywordtype">void</span> __attribute__((overloadable)) <a class="code" href="rs__matrix_8rsh.html#ac380c4117e047da494a74f0dad20fab3">rsMatrixLoad</a>(<a class="code" href="structrs__matrix3x3.html" title="3x3 float matrix">rs_matrix3x3</a> *m, const <span class="keywordtype">float</span> *v);
-<a name="l00099"></a>00099 extern <span class="keywordtype">void</span> __attribute__((overloadable)) <a class="code" href="rs__matrix_8rsh.html#ac380c4117e047da494a74f0dad20fab3">rsMatrixLoad</a>(<a class="code" href="structrs__matrix2x2.html" title="2x2 float matrix">rs_matrix2x2</a> *m, const <span class="keywordtype">float</span> *v);
-<a name="l00103"></a>00103 extern <span class="keywordtype">void</span> __attribute__((overloadable)) <a class="code" href="rs__matrix_8rsh.html#ac380c4117e047da494a74f0dad20fab3">rsMatrixLoad</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, const <a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *v);
-<a name="l00107"></a>00107 extern <span class="keywordtype">void</span> __attribute__((overloadable)) <a class="code" href="rs__matrix_8rsh.html#ac380c4117e047da494a74f0dad20fab3">rsMatrixLoad</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, const <a class="code" href="structrs__matrix3x3.html" title="3x3 float matrix">rs_matrix3x3</a> *v);
-<a name="l00108"></a>00108
-<a name="l00114"></a>00114 extern <span class="keywordtype">void</span> __attribute__((overloadable)) <a class="code" href="rs__matrix_8rsh.html#ac380c4117e047da494a74f0dad20fab3">rsMatrixLoad</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, const <a class="code" href="structrs__matrix2x2.html" title="2x2 float matrix">rs_matrix2x2</a> *v);
-<a name="l00118"></a>00118 extern <span class="keywordtype">void</span> __attribute__((overloadable)) <a class="code" href="rs__matrix_8rsh.html#ac380c4117e047da494a74f0dad20fab3">rsMatrixLoad</a>(<a class="code" href="structrs__matrix3x3.html" title="3x3 float matrix">rs_matrix3x3</a> *m, const <a class="code" href="structrs__matrix3x3.html" title="3x3 float matrix">rs_matrix3x3</a> *v);
-<a name="l00122"></a>00122 extern <span class="keywordtype">void</span> __attribute__((overloadable)) <a class="code" href="rs__matrix_8rsh.html#ac380c4117e047da494a74f0dad20fab3">rsMatrixLoad</a>(<a class="code" href="structrs__matrix2x2.html" title="2x2 float matrix">rs_matrix2x2</a> *m, const <a class="code" href="structrs__matrix2x2.html" title="2x2 float matrix">rs_matrix2x2</a> *v);
-<a name="l00123"></a>00123
-<a name="l00133"></a>00133 extern <span class="keywordtype">void</span> __attribute__((overloadable))
-<a name="l00134"></a>00134 <a class="code" href="rs__matrix_8rsh.html#a268032f3ac6d766b1d7fe72a6cb50464">rsMatrixLoadRotate</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, <span class="keywordtype">float</span> rot, <span class="keywordtype">float</span> x, <span class="keywordtype">float</span> y, <span class="keywordtype">float</span> z);
-<a name="l00135"></a>00135
-<a name="l00144"></a>00144 extern <span class="keywordtype">void</span> __attribute__((overloadable))
-<a name="l00145"></a>00145 <a class="code" href="rs__matrix_8rsh.html#acaf51d1f9ad5041ce01fbf8b7c5923fd">rsMatrixLoadScale</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, <span class="keywordtype">float</span> x, <span class="keywordtype">float</span> y, <span class="keywordtype">float</span> z);
-<a name="l00146"></a>00146
-<a name="l00155"></a>00155 extern <span class="keywordtype">void</span> __attribute__((overloadable))
-<a name="l00156"></a>00156 <a class="code" href="rs__matrix_8rsh.html#a1b521c8a3d1260fa732cbf0a71af0e74">rsMatrixLoadTranslate</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, <span class="keywordtype">float</span> x, <span class="keywordtype">float</span> y, <span class="keywordtype">float</span> z);
-<a name="l00157"></a>00157
-<a name="l00165"></a>00165 extern <span class="keywordtype">void</span> __attribute__((overloadable))
-<a name="l00166"></a>00166 <a class="code" href="rs__matrix_8rsh.html#a79f14c4c0f5ecc1bbd0bf54da8b653ef">rsMatrixLoadMultiply</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, const <a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *lhs, const <a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *rhs);
-<a name="l00170"></a>00170 extern <span class="keywordtype">void</span> __attribute__((overloadable))
-<a name="l00171"></a>00171 <a class="code" href="rs__matrix_8rsh.html#a79f14c4c0f5ecc1bbd0bf54da8b653ef">rsMatrixLoadMultiply</a>(<a class="code" href="structrs__matrix3x3.html" title="3x3 float matrix">rs_matrix3x3</a> *m, const <a class="code" href="structrs__matrix3x3.html" title="3x3 float matrix">rs_matrix3x3</a> *lhs, const <a class="code" href="structrs__matrix3x3.html" title="3x3 float matrix">rs_matrix3x3</a> *rhs);
-<a name="l00175"></a>00175 extern <span class="keywordtype">void</span> __attribute__((overloadable))
-<a name="l00176"></a>00176 <a class="code" href="rs__matrix_8rsh.html#a79f14c4c0f5ecc1bbd0bf54da8b653ef">rsMatrixLoadMultiply</a>(<a class="code" href="structrs__matrix2x2.html" title="2x2 float matrix">rs_matrix2x2</a> *m, const <a class="code" href="structrs__matrix2x2.html" title="2x2 float matrix">rs_matrix2x2</a> *lhs, const <a class="code" href="structrs__matrix2x2.html" title="2x2 float matrix">rs_matrix2x2</a> *rhs);
-<a name="l00177"></a>00177
-<a name="l00184"></a>00184 extern <span class="keywordtype">void</span> __attribute__((overloadable))
-<a name="l00185"></a>00185 <a class="code" href="rs__matrix_8rsh.html#a97953ab2606900a839e5816c619abe66">rsMatrixMultiply</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, const <a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *rhs);
-<a name="l00189"></a>00189 extern <span class="keywordtype">void</span> __attribute__((overloadable))
-<a name="l00190"></a>00190 <a class="code" href="rs__matrix_8rsh.html#a97953ab2606900a839e5816c619abe66">rsMatrixMultiply</a>(<a class="code" href="structrs__matrix3x3.html" title="3x3 float matrix">rs_matrix3x3</a> *m, const <a class="code" href="structrs__matrix3x3.html" title="3x3 float matrix">rs_matrix3x3</a> *rhs);
-<a name="l00194"></a>00194 extern <span class="keywordtype">void</span> __attribute__((overloadable))
-<a name="l00195"></a>00195 <a class="code" href="rs__matrix_8rsh.html#a97953ab2606900a839e5816c619abe66">rsMatrixMultiply</a>(<a class="code" href="structrs__matrix2x2.html" title="2x2 float matrix">rs_matrix2x2</a> *m, const <a class="code" href="structrs__matrix2x2.html" title="2x2 float matrix">rs_matrix2x2</a> *rhs);
-<a name="l00196"></a>00196
-<a name="l00206"></a>00206 extern <span class="keywordtype">void</span> __attribute__((overloadable))
-<a name="l00207"></a>00207 <a class="code" href="rs__matrix_8rsh.html#ad5ed05ca4880397fb29615e3c6798de1">rsMatrixRotate</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, <span class="keywordtype">float</span> rot, <span class="keywordtype">float</span> x, <span class="keywordtype">float</span> y, <span class="keywordtype">float</span> z);
-<a name="l00208"></a>00208
-<a name="l00217"></a>00217 extern <span class="keywordtype">void</span> __attribute__((overloadable))
-<a name="l00218"></a>00218 <a class="code" href="rs__matrix_8rsh.html#a94cc6b22bd1a6c07a9a1c1d21afb392c">rsMatrixScale</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, <span class="keywordtype">float</span> x, <span class="keywordtype">float</span> y, <span class="keywordtype">float</span> z);
-<a name="l00219"></a>00219
-<a name="l00228"></a>00228 extern <span class="keywordtype">void</span> __attribute__((overloadable))
-<a name="l00229"></a>00229 <a class="code" href="rs__matrix_8rsh.html#a4df5f9b5bb6044f3c3426f2f58b94405">rsMatrixTranslate</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, <span class="keywordtype">float</span> x, <span class="keywordtype">float</span> y, <span class="keywordtype">float</span> z);
-<a name="l00230"></a>00230
-<a name="l00242"></a>00242 extern <span class="keywordtype">void</span> __attribute__((overloadable))
-<a name="l00243"></a>00243 <a class="code" href="rs__matrix_8rsh.html#a4c59884a0e534dbbcdc5655842732d43">rsMatrixLoadOrtho</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, <span class="keywordtype">float</span> left, <span class="keywordtype">float</span> right, <span class="keywordtype">float</span> bottom, <span class="keywordtype">float</span> top, <span class="keywordtype">float</span> near, <span class="keywordtype">float</span> far);
-<a name="l00244"></a>00244
-<a name="l00256"></a>00256 extern <span class="keywordtype">void</span> __attribute__((overloadable))
-<a name="l00257"></a>00257 <a class="code" href="rs__matrix_8rsh.html#ad25760aaf01e95d0055237afab41bbb3">rsMatrixLoadFrustum</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, <span class="keywordtype">float</span> left, <span class="keywordtype">float</span> right, <span class="keywordtype">float</span> bottom, <span class="keywordtype">float</span> top, <span class="keywordtype">float</span> near, <span class="keywordtype">float</span> far);
-<a name="l00258"></a>00258
-<a name="l00268"></a>00268 extern <span class="keywordtype">void</span> __attribute__((overloadable))
-<a name="l00269"></a>00269 <a class="code" href="rs__matrix_8rsh.html#aa404c34d7478f2921f7415d2da95d02b">rsMatrixLoadPerspective</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a>* m, <span class="keywordtype">float</span> fovy, <span class="keywordtype">float</span> aspect, <span class="keywordtype">float</span> near, <span class="keywordtype">float</span> far);
-<a name="l00270"></a>00270
-<a name="l00271"></a>00271 <span class="preprocessor">#if !defined(RS_VERSION) || (RS_VERSION < 14)</span>
-<a name="l00272"></a>00272 <span class="preprocessor"></span>
-<a name="l00276"></a>00276 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> __attribute__((overloadable))
-<a name="l00277"></a>00277 <a class="code" href="rs__matrix_8rsh.html#a97953ab2606900a839e5816c619abe66">rsMatrixMultiply</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, <a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> in);
-<a name="l00278"></a>00278
-<a name="l00282"></a>00282 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> __attribute__((overloadable))
-<a name="l00283"></a>00283 <a class="code" href="rs__matrix_8rsh.html#a97953ab2606900a839e5816c619abe66">rsMatrixMultiply</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, <a class="code" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> in);
+<a name="l00050"></a>00050 <span class="preprocessor">#ifndef __RS_MATRIX_RSH__</span>
+<a name="l00051"></a>00051 <span class="preprocessor"></span><span class="preprocessor">#define __RS_MATRIX_RSH__</span>
+<a name="l00052"></a>00052 <span class="preprocessor"></span>
+<a name="l00066"></a>00066 _RS_RUNTIME <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00067"></a>00067 <a class="code" href="rs__matrix_8rsh.html#aca88832ed720e301780152c60884393e">rsMatrixSet</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> col, <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> row, <span class="keywordtype">float</span> v);
+<a name="l00071"></a>00071 _RS_RUNTIME <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00072"></a>00072 <a class="code" href="rs__matrix_8rsh.html#aca88832ed720e301780152c60884393e">rsMatrixSet</a>(<a class="code" href="structrs__matrix3x3.html" title="3x3 float matrix">rs_matrix3x3</a> *m, <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> col, <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> row, <span class="keywordtype">float</span> v);
+<a name="l00076"></a>00076 _RS_RUNTIME <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00077"></a>00077 <a class="code" href="rs__matrix_8rsh.html#aca88832ed720e301780152c60884393e">rsMatrixSet</a>(<a class="code" href="structrs__matrix2x2.html" title="2x2 float matrix">rs_matrix2x2</a> *m, <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> col, <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> row, <span class="keywordtype">float</span> v);
+<a name="l00078"></a>00078
+<a name="l00091"></a>00091 _RS_RUNTIME <span class="keywordtype">float</span> __attribute__((overloadable))
+<a name="l00092"></a>00092 <a class="code" href="rs__matrix_8rsh.html#af26fdbf8b8f0ed5d1b53f62b2aef5110">rsMatrixGet</a>(const <a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> col, <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> row);
+<a name="l00096"></a>00096 _RS_RUNTIME <span class="keywordtype">float</span> __attribute__((overloadable))
+<a name="l00097"></a>00097 <a class="code" href="rs__matrix_8rsh.html#af26fdbf8b8f0ed5d1b53f62b2aef5110">rsMatrixGet</a>(const <a class="code" href="structrs__matrix3x3.html" title="3x3 float matrix">rs_matrix3x3</a> *m, <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> col, <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> row);
+<a name="l00101"></a>00101 _RS_RUNTIME <span class="keywordtype">float</span> __attribute__((overloadable))
+<a name="l00102"></a>00102 <a class="code" href="rs__matrix_8rsh.html#af26fdbf8b8f0ed5d1b53f62b2aef5110">rsMatrixGet</a>(const <a class="code" href="structrs__matrix2x2.html" title="2x2 float matrix">rs_matrix2x2</a> *m, <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> col, <a class="code" href="rs__types_8rsh.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> row);
+<a name="l00103"></a>00103
+<a name="l00109"></a>00109 extern <span class="keywordtype">void</span> __attribute__((overloadable)) <a class="code" href="rs__matrix_8rsh.html#a0ffd9de971cf10d0a663ff565be8d3cc">rsMatrixLoadIdentity</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m);
+<a name="l00113"></a>00113 extern <span class="keywordtype">void</span> __attribute__((overloadable)) <a class="code" href="rs__matrix_8rsh.html#a0ffd9de971cf10d0a663ff565be8d3cc">rsMatrixLoadIdentity</a>(<a class="code" href="structrs__matrix3x3.html" title="3x3 float matrix">rs_matrix3x3</a> *m);
+<a name="l00117"></a>00117 extern <span class="keywordtype">void</span> __attribute__((overloadable)) <a class="code" href="rs__matrix_8rsh.html#a0ffd9de971cf10d0a663ff565be8d3cc">rsMatrixLoadIdentity</a>(<a class="code" href="structrs__matrix2x2.html" title="2x2 float matrix">rs_matrix2x2</a> *m);
+<a name="l00118"></a>00118
+<a name="l00130"></a>00130 extern <span class="keywordtype">void</span> __attribute__((overloadable)) <a class="code" href="rs__matrix_8rsh.html#ac380c4117e047da494a74f0dad20fab3">rsMatrixLoad</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, const <span class="keywordtype">float</span> *v);
+<a name="l00134"></a>00134 extern <span class="keywordtype">void</span> __attribute__((overloadable)) <a class="code" href="rs__matrix_8rsh.html#ac380c4117e047da494a74f0dad20fab3">rsMatrixLoad</a>(<a class="code" href="structrs__matrix3x3.html" title="3x3 float matrix">rs_matrix3x3</a> *m, const <span class="keywordtype">float</span> *v);
+<a name="l00138"></a>00138 extern <span class="keywordtype">void</span> __attribute__((overloadable)) <a class="code" href="rs__matrix_8rsh.html#ac380c4117e047da494a74f0dad20fab3">rsMatrixLoad</a>(<a class="code" href="structrs__matrix2x2.html" title="2x2 float matrix">rs_matrix2x2</a> *m, const <span class="keywordtype">float</span> *v);
+<a name="l00156"></a>00156 extern <span class="keywordtype">void</span> __attribute__((overloadable)) <a class="code" href="rs__matrix_8rsh.html#ac380c4117e047da494a74f0dad20fab3">rsMatrixLoad</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, const <a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *v);
+<a name="l00160"></a>00160 extern <span class="keywordtype">void</span> __attribute__((overloadable)) <a class="code" href="rs__matrix_8rsh.html#ac380c4117e047da494a74f0dad20fab3">rsMatrixLoad</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, const <a class="code" href="structrs__matrix3x3.html" title="3x3 float matrix">rs_matrix3x3</a> *v);
+<a name="l00164"></a>00164 extern <span class="keywordtype">void</span> __attribute__((overloadable)) <a class="code" href="rs__matrix_8rsh.html#ac380c4117e047da494a74f0dad20fab3">rsMatrixLoad</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, const <a class="code" href="structrs__matrix2x2.html" title="2x2 float matrix">rs_matrix2x2</a> *v);
+<a name="l00168"></a>00168 extern <span class="keywordtype">void</span> __attribute__((overloadable)) <a class="code" href="rs__matrix_8rsh.html#ac380c4117e047da494a74f0dad20fab3">rsMatrixLoad</a>(<a class="code" href="structrs__matrix3x3.html" title="3x3 float matrix">rs_matrix3x3</a> *m, const <a class="code" href="structrs__matrix3x3.html" title="3x3 float matrix">rs_matrix3x3</a> *v);
+<a name="l00172"></a>00172 extern <span class="keywordtype">void</span> __attribute__((overloadable)) <a class="code" href="rs__matrix_8rsh.html#ac380c4117e047da494a74f0dad20fab3">rsMatrixLoad</a>(<a class="code" href="structrs__matrix2x2.html" title="2x2 float matrix">rs_matrix2x2</a> *m, const <a class="code" href="structrs__matrix2x2.html" title="2x2 float matrix">rs_matrix2x2</a> *v);
+<a name="l00173"></a>00173
+<a name="l00191"></a>00191 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00192"></a>00192 <a class="code" href="rs__matrix_8rsh.html#a268032f3ac6d766b1d7fe72a6cb50464">rsMatrixLoadRotate</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, <span class="keywordtype">float</span> rot, <span class="keywordtype">float</span> x, <span class="keywordtype">float</span> y, <span class="keywordtype">float</span> z);
+<a name="l00193"></a>00193
+<a name="l00208"></a>00208 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00209"></a>00209 <a class="code" href="rs__matrix_8rsh.html#acaf51d1f9ad5041ce01fbf8b7c5923fd">rsMatrixLoadScale</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, <span class="keywordtype">float</span> x, <span class="keywordtype">float</span> y, <span class="keywordtype">float</span> z);
+<a name="l00210"></a>00210
+<a name="l00225"></a>00225 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00226"></a>00226 <a class="code" href="rs__matrix_8rsh.html#a1b521c8a3d1260fa732cbf0a71af0e74">rsMatrixLoadTranslate</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, <span class="keywordtype">float</span> x, <span class="keywordtype">float</span> y, <span class="keywordtype">float</span> z);
+<a name="l00227"></a>00227
+<a name="l00247"></a>00247 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00248"></a>00248 <a class="code" href="rs__matrix_8rsh.html#a79f14c4c0f5ecc1bbd0bf54da8b653ef">rsMatrixLoadMultiply</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, const <a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *lhs, const <a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *rhs);
+<a name="l00252"></a>00252 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00253"></a>00253 <a class="code" href="rs__matrix_8rsh.html#a79f14c4c0f5ecc1bbd0bf54da8b653ef">rsMatrixLoadMultiply</a>(<a class="code" href="structrs__matrix3x3.html" title="3x3 float matrix">rs_matrix3x3</a> *m, const <a class="code" href="structrs__matrix3x3.html" title="3x3 float matrix">rs_matrix3x3</a> *lhs, const <a class="code" href="structrs__matrix3x3.html" title="3x3 float matrix">rs_matrix3x3</a> *rhs);
+<a name="l00257"></a>00257 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00258"></a>00258 <a class="code" href="rs__matrix_8rsh.html#a79f14c4c0f5ecc1bbd0bf54da8b653ef">rsMatrixLoadMultiply</a>(<a class="code" href="structrs__matrix2x2.html" title="2x2 float matrix">rs_matrix2x2</a> *m, const <a class="code" href="structrs__matrix2x2.html" title="2x2 float matrix">rs_matrix2x2</a> *lhs, const <a class="code" href="structrs__matrix2x2.html" title="2x2 float matrix">rs_matrix2x2</a> *rhs);
+<a name="l00259"></a>00259
+<a name="l00272"></a>00272 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00273"></a>00273 <a class="code" href="rs__matrix_8rsh.html#a97953ab2606900a839e5816c619abe66">rsMatrixMultiply</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, const <a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *rhs);
+<a name="l00277"></a>00277 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00278"></a>00278 <a class="code" href="rs__matrix_8rsh.html#a97953ab2606900a839e5816c619abe66">rsMatrixMultiply</a>(<a class="code" href="structrs__matrix3x3.html" title="3x3 float matrix">rs_matrix3x3</a> *m, const <a class="code" href="structrs__matrix3x3.html" title="3x3 float matrix">rs_matrix3x3</a> *rhs);
+<a name="l00282"></a>00282 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00283"></a>00283 <a class="code" href="rs__matrix_8rsh.html#a97953ab2606900a839e5816c619abe66">rsMatrixMultiply</a>(<a class="code" href="structrs__matrix2x2.html" title="2x2 float matrix">rs_matrix2x2</a> *m, const <a class="code" href="structrs__matrix2x2.html" title="2x2 float matrix">rs_matrix2x2</a> *rhs);
<a name="l00284"></a>00284
-<a name="l00288"></a>00288 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> __attribute__((overloadable))
-<a name="l00289"></a>00289 <a class="code" href="rs__matrix_8rsh.html#a97953ab2606900a839e5816c619abe66">rsMatrixMultiply</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, <a class="code" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">float2</a> in);
-<a name="l00290"></a>00290
-<a name="l00294"></a>00294 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> __attribute__((overloadable))
-<a name="l00295"></a>00295 <a class="code" href="rs__matrix_8rsh.html#a97953ab2606900a839e5816c619abe66">rsMatrixMultiply</a>(<a class="code" href="structrs__matrix3x3.html" title="3x3 float matrix">rs_matrix3x3</a> *m, <a class="code" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> in);
-<a name="l00296"></a>00296
-<a name="l00300"></a>00300 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> __attribute__((overloadable))
-<a name="l00301"></a>00301 <a class="code" href="rs__matrix_8rsh.html#a97953ab2606900a839e5816c619abe66">rsMatrixMultiply</a>(<a class="code" href="structrs__matrix3x3.html" title="3x3 float matrix">rs_matrix3x3</a> *m, <a class="code" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">float2</a> in);
+<a name="l00300"></a>00300 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00301"></a>00301 <a class="code" href="rs__matrix_8rsh.html#ad5ed05ca4880397fb29615e3c6798de1">rsMatrixRotate</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, <span class="keywordtype">float</span> rot, <span class="keywordtype">float</span> x, <span class="keywordtype">float</span> y, <span class="keywordtype">float</span> z);
<a name="l00302"></a>00302
-<a name="l00306"></a>00306 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">float2</a> __attribute__((overloadable))
-<a name="l00307"></a>00307 <a class="code" href="rs__matrix_8rsh.html#a97953ab2606900a839e5816c619abe66">rsMatrixMultiply</a>(<a class="code" href="structrs__matrix2x2.html" title="2x2 float matrix">rs_matrix2x2</a> *m, <a class="code" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">float2</a> in);
-<a name="l00308"></a>00308 <span class="preprocessor">#else</span>
-<a name="l00309"></a>00309 <span class="preprocessor"></span>
-<a name="l00313"></a>00313 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> __attribute__((overloadable))
-<a name="l00314"></a>00314 <a class="code" href="rs__matrix_8rsh.html#a97953ab2606900a839e5816c619abe66">rsMatrixMultiply</a>(const <a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, <a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> in);
-<a name="l00315"></a>00315
-<a name="l00319"></a>00319 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> __attribute__((overloadable))
-<a name="l00320"></a>00320 <a class="code" href="rs__matrix_8rsh.html#a97953ab2606900a839e5816c619abe66">rsMatrixMultiply</a>(const <a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, <a class="code" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> in);
-<a name="l00321"></a>00321
-<a name="l00325"></a>00325 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> __attribute__((overloadable))
-<a name="l00326"></a>00326 <a class="code" href="rs__matrix_8rsh.html#a97953ab2606900a839e5816c619abe66">rsMatrixMultiply</a>(const <a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, <a class="code" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">float2</a> in);
-<a name="l00327"></a>00327
-<a name="l00331"></a>00331 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> __attribute__((overloadable))
-<a name="l00332"></a>00332 <a class="code" href="rs__matrix_8rsh.html#a97953ab2606900a839e5816c619abe66">rsMatrixMultiply</a>(const <a class="code" href="structrs__matrix3x3.html" title="3x3 float matrix">rs_matrix3x3</a> *m, <a class="code" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> in);
-<a name="l00333"></a>00333
-<a name="l00337"></a>00337 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> __attribute__((overloadable))
-<a name="l00338"></a>00338 <a class="code" href="rs__matrix_8rsh.html#a97953ab2606900a839e5816c619abe66">rsMatrixMultiply</a>(const <a class="code" href="structrs__matrix3x3.html" title="3x3 float matrix">rs_matrix3x3</a> *m, <a class="code" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">float2</a> in);
-<a name="l00339"></a>00339
-<a name="l00343"></a>00343 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">float2</a> __attribute__((overloadable))
-<a name="l00344"></a>00344 <a class="code" href="rs__matrix_8rsh.html#a97953ab2606900a839e5816c619abe66">rsMatrixMultiply</a>(const <a class="code" href="structrs__matrix2x2.html" title="2x2 float matrix">rs_matrix2x2</a> *m, <a class="code" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">float2</a> in);
-<a name="l00345"></a>00345 <span class="preprocessor">#endif</span>
-<a name="l00346"></a>00346 <span class="preprocessor"></span>
-<a name="l00347"></a>00347
-<a name="l00353"></a>00353 <span class="keyword">extern</span> <span class="keywordtype">bool</span> __attribute__((overloadable)) <a class="code" href="rs__matrix_8rsh.html#a00b6a334ba5ac94d84850f22ec9f4de5">rsMatrixInverse</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m);
-<a name="l00354"></a>00354
-<a name="l00360"></a>00360 extern <span class="keywordtype">bool</span> __attribute__((overloadable)) <a class="code" href="rs__matrix_8rsh.html#ac05080d52da2d99a759ef34fa0655e82">rsMatrixInverseTranspose</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m);
-<a name="l00361"></a>00361
-<a name="l00367"></a>00367 extern <span class="keywordtype">void</span> __attribute__((overloadable)) <a class="code" href="rs__matrix_8rsh.html#a88095c70f1550c760844b3e32e41a31a">rsMatrixTranspose</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m);
-<a name="l00371"></a>00371 extern <span class="keywordtype">void</span> __attribute__((overloadable)) <a class="code" href="rs__matrix_8rsh.html#a88095c70f1550c760844b3e32e41a31a">rsMatrixTranspose</a>(<a class="code" href="structrs__matrix3x3.html" title="3x3 float matrix">rs_matrix3x3</a> *m);
-<a name="l00375"></a>00375 extern <span class="keywordtype">void</span> __attribute__((overloadable)) <a class="code" href="rs__matrix_8rsh.html#a88095c70f1550c760844b3e32e41a31a">rsMatrixTranspose</a>(<a class="code" href="structrs__matrix2x2.html" title="2x2 float matrix">rs_matrix2x2</a> *m);
-<a name="l00376"></a>00376
-<a name="l00377"></a>00377
-<a name="l00378"></a>00378 <span class="preprocessor">#endif</span>
+<a name="l00318"></a>00318 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00319"></a>00319 <a class="code" href="rs__matrix_8rsh.html#a94cc6b22bd1a6c07a9a1c1d21afb392c">rsMatrixScale</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, <span class="keywordtype">float</span> x, <span class="keywordtype">float</span> y, <span class="keywordtype">float</span> z);
+<a name="l00320"></a>00320
+<a name="l00336"></a>00336 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00337"></a>00337 <a class="code" href="rs__matrix_8rsh.html#a4df5f9b5bb6044f3c3426f2f58b94405">rsMatrixTranslate</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, <span class="keywordtype">float</span> x, <span class="keywordtype">float</span> y, <span class="keywordtype">float</span> z);
+<a name="l00338"></a>00338
+<a name="l00361"></a>00361 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00362"></a>00362 <a class="code" href="rs__matrix_8rsh.html#a4c59884a0e534dbbcdc5655842732d43">rsMatrixLoadOrtho</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, <span class="keywordtype">float</span> left, <span class="keywordtype">float</span> right, <span class="keywordtype">float</span> bottom, <span class="keywordtype">float</span> top, <span class="keywordtype">float</span> near, <span class="keywordtype">float</span> far);
+<a name="l00363"></a>00363
+<a name="l00384"></a>00384 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00385"></a>00385 <a class="code" href="rs__matrix_8rsh.html#ad25760aaf01e95d0055237afab41bbb3">rsMatrixLoadFrustum</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, <span class="keywordtype">float</span> left, <span class="keywordtype">float</span> right, <span class="keywordtype">float</span> bottom, <span class="keywordtype">float</span> top, <span class="keywordtype">float</span> near, <span class="keywordtype">float</span> far);
+<a name="l00386"></a>00386
+<a name="l00403"></a>00403 extern <span class="keywordtype">void</span> __attribute__((overloadable))
+<a name="l00404"></a>00404 <a class="code" href="rs__matrix_8rsh.html#aa404c34d7478f2921f7415d2da95d02b">rsMatrixLoadPerspective</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a>* m, <span class="keywordtype">float</span> fovy, <span class="keywordtype">float</span> aspect, <span class="keywordtype">float</span> near, <span class="keywordtype">float</span> far);
+<a name="l00405"></a>00405
+<a name="l00406"></a>00406 <span class="preprocessor">#if !defined(RS_VERSION) || (RS_VERSION < 14)</span>
+<a name="l00407"></a>00407 <span class="preprocessor"></span>
+<a name="l00421"></a>00421 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> __attribute__((overloadable))
+<a name="l00422"></a>00422 <a class="code" href="rs__matrix_8rsh.html#a97953ab2606900a839e5816c619abe66">rsMatrixMultiply</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, <a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> in);
+<a name="l00423"></a>00423
+<a name="l00427"></a>00427 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> __attribute__((overloadable))
+<a name="l00428"></a>00428 <a class="code" href="rs__matrix_8rsh.html#a97953ab2606900a839e5816c619abe66">rsMatrixMultiply</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, <a class="code" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> in);
+<a name="l00429"></a>00429
+<a name="l00433"></a>00433 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> __attribute__((overloadable))
+<a name="l00434"></a>00434 <a class="code" href="rs__matrix_8rsh.html#a97953ab2606900a839e5816c619abe66">rsMatrixMultiply</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, <a class="code" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">float2</a> in);
+<a name="l00435"></a>00435
+<a name="l00439"></a>00439 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> __attribute__((overloadable))
+<a name="l00440"></a>00440 <a class="code" href="rs__matrix_8rsh.html#a97953ab2606900a839e5816c619abe66">rsMatrixMultiply</a>(<a class="code" href="structrs__matrix3x3.html" title="3x3 float matrix">rs_matrix3x3</a> *m, <a class="code" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> in);
+<a name="l00441"></a>00441
+<a name="l00445"></a>00445 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> __attribute__((overloadable))
+<a name="l00446"></a>00446 <a class="code" href="rs__matrix_8rsh.html#a97953ab2606900a839e5816c619abe66">rsMatrixMultiply</a>(<a class="code" href="structrs__matrix3x3.html" title="3x3 float matrix">rs_matrix3x3</a> *m, <a class="code" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">float2</a> in);
+<a name="l00447"></a>00447
+<a name="l00451"></a>00451 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">float2</a> __attribute__((overloadable))
+<a name="l00452"></a>00452 <a class="code" href="rs__matrix_8rsh.html#a97953ab2606900a839e5816c619abe66">rsMatrixMultiply</a>(<a class="code" href="structrs__matrix2x2.html" title="2x2 float matrix">rs_matrix2x2</a> *m, <a class="code" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">float2</a> in);
+<a name="l00453"></a>00453 <span class="preprocessor">#else</span>
+<a name="l00454"></a>00454 <span class="preprocessor"></span>
+<a name="l00467"></a>00467 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> __attribute__((overloadable))
+<a name="l00468"></a>00468 <a class="code" href="rs__matrix_8rsh.html#a97953ab2606900a839e5816c619abe66">rsMatrixMultiply</a>(const <a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, <a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> in);
+<a name="l00469"></a>00469
+<a name="l00473"></a>00473 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> __attribute__((overloadable))
+<a name="l00474"></a>00474 <a class="code" href="rs__matrix_8rsh.html#a97953ab2606900a839e5816c619abe66">rsMatrixMultiply</a>(const <a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, <a class="code" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> in);
+<a name="l00475"></a>00475
+<a name="l00479"></a>00479 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> __attribute__((overloadable))
+<a name="l00480"></a>00480 <a class="code" href="rs__matrix_8rsh.html#a97953ab2606900a839e5816c619abe66">rsMatrixMultiply</a>(const <a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m, <a class="code" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">float2</a> in);
+<a name="l00481"></a>00481
+<a name="l00485"></a>00485 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> __attribute__((overloadable))
+<a name="l00486"></a>00486 <a class="code" href="rs__matrix_8rsh.html#a97953ab2606900a839e5816c619abe66">rsMatrixMultiply</a>(const <a class="code" href="structrs__matrix3x3.html" title="3x3 float matrix">rs_matrix3x3</a> *m, <a class="code" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> in);
+<a name="l00487"></a>00487
+<a name="l00491"></a>00491 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> __attribute__((overloadable))
+<a name="l00492"></a>00492 <a class="code" href="rs__matrix_8rsh.html#a97953ab2606900a839e5816c619abe66">rsMatrixMultiply</a>(const <a class="code" href="structrs__matrix3x3.html" title="3x3 float matrix">rs_matrix3x3</a> *m, <a class="code" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">float2</a> in);
+<a name="l00493"></a>00493
+<a name="l00497"></a>00497 _RS_RUNTIME <a class="code" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">float2</a> __attribute__((overloadable))
+<a name="l00498"></a>00498 <a class="code" href="rs__matrix_8rsh.html#a97953ab2606900a839e5816c619abe66">rsMatrixMultiply</a>(const <a class="code" href="structrs__matrix2x2.html" title="2x2 float matrix">rs_matrix2x2</a> *m, <a class="code" href="rs__types_8rsh.html#a5086d0fcb71f916c936af486ccf0dd41">float2</a> in);
+<a name="l00499"></a>00499 <span class="preprocessor">#endif</span>
+<a name="l00500"></a>00500 <span class="preprocessor"></span>
+<a name="l00501"></a>00501
+<a name="l00509"></a>00509 <span class="keyword">extern</span> <span class="keywordtype">bool</span> __attribute__((overloadable)) <a class="code" href="rs__matrix_8rsh.html#a00b6a334ba5ac94d84850f22ec9f4de5">rsMatrixInverse</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m);
+<a name="l00510"></a>00510
+<a name="l00519"></a>00519 extern <span class="keywordtype">bool</span> __attribute__((overloadable)) <a class="code" href="rs__matrix_8rsh.html#ac05080d52da2d99a759ef34fa0655e82">rsMatrixInverseTranspose</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m);
+<a name="l00520"></a>00520
+<a name="l00526"></a>00526 extern <span class="keywordtype">void</span> __attribute__((overloadable)) <a class="code" href="rs__matrix_8rsh.html#a88095c70f1550c760844b3e32e41a31a">rsMatrixTranspose</a>(<a class="code" href="structrs__matrix4x4.html" title="4x4 float matrix">rs_matrix4x4</a> *m);
+<a name="l00530"></a>00530 extern <span class="keywordtype">void</span> __attribute__((overloadable)) <a class="code" href="rs__matrix_8rsh.html#a88095c70f1550c760844b3e32e41a31a">rsMatrixTranspose</a>(<a class="code" href="structrs__matrix3x3.html" title="3x3 float matrix">rs_matrix3x3</a> *m);
+<a name="l00534"></a>00534 extern <span class="keywordtype">void</span> __attribute__((overloadable)) <a class="code" href="rs__matrix_8rsh.html#a88095c70f1550c760844b3e32e41a31a">rsMatrixTranspose</a>(<a class="code" href="structrs__matrix2x2.html" title="2x2 float matrix">rs_matrix2x2</a> *m);
+<a name="l00535"></a>00535
+<a name="l00536"></a>00536
+<a name="l00537"></a>00537 <span class="preprocessor">#endif</span>
</pre></div></div>
</div>
diff --git a/docs/html/tools/sdk/ndk/index.jd b/docs/html/tools/sdk/ndk/index.jd
index 71b15d5..e75f451 100644
--- a/docs/html/tools/sdk/ndk/index.jd
+++ b/docs/html/tools/sdk/ndk/index.jd
@@ -2,59 +2,59 @@
page.template=sdk
-ndk.mac64_download=android-ndk32-r10-darwin-x86_64.tar.bz2
-ndk.mac64_bytes=411610468
-ndk.mac64_checksum=3ce1fa3dbe7a188f5d2640fd2f7ca944
+ndk.mac64_download=android-ndk32-r10b-darwin-x86_64.tar.bz2
+ndk.mac64_bytes=413652124
+ndk.mac64_checksum=7ca4a84e9c56c38acdafb007e7cd33c5
-ndk.mac32_download=android-ndk32-r10-darwin-x86.tar.bz2
-ndk.mac32_bytes=404768263
-ndk.mac32_checksum=1824eec1f6749b6cb7bb306a3b924c33
+ndk.mac32_download=android-ndk32-r10b-darwin-x86.tar.bz2
+ndk.mac32_bytes=406998070
+ndk.mac32_checksum=db3626b2c5f3245d90e2724f7bcf4c3e
-ndk.linux64_download=android-ndk32-r10-linux-x86_64.tar.bz2
-ndk.linux64_bytes=420671390
-ndk.linux64_checksum=e3ff629d212a8106a43415862fa39baf
+ndk.linux64_download=android-ndk32-r10b-linux-x86_64.tar.bz2
+ndk.linux64_bytes=422237011
+ndk.linux64_checksum=5c0f301aa789a1a747d5d2aeb8c69ef3
-ndk.linux32_download=android-ndk32-r10-linux-x86.tar.bz2
-ndk.linux32_bytes=420078216
-ndk.linux32_checksum=8d9a5faa6e77b43bfae0f169079b21c4
+ndk.linux32_download=android-ndk32-r10b-linux-x86.tar.bz2
+ndk.linux32_bytes=421052081
+ndk.linux32_checksum=e8f55daa5c9de7ab79aaaf5d7d751b69
-ndk.win64_download=android-ndk32-r10-windows-x86_64.zip
-ndk.win64_bytes=529850429
-ndk.win64_checksum=b11f9239344f7c377ed5b627f0fb236e
+ndk.win64_download=android-ndk32-r10b-windows-x86_64.zip
+ndk.win64_bytes=531912027
+ndk.win64_checksum=e4dd2e0c6f38e3ad936c366bdf6b1d4e
-ndk.win32_download=android-ndk32-r10-windows-x86.zip
-ndk.win32_bytes=500135685
-ndk.win32_checksum=0a3c01147abba945cc4ef5837519ec97
+ndk.win32_download=android-ndk32-r10b-windows-x86.zip
+ndk.win32_bytes=502720425
+ndk.win32_checksum=9fa4f19bca7edd6eefa63fe788737987
-ndk.mac64_64_download=android-ndk64-r10-darwin-x86_64.tar.bz2
-ndk.mac64_64_bytes=327740247
-ndk.mac64_64_checksum=72561b27acc6192a2e81b345ea128a20
+ndk.mac64_64_download=android-ndk64-r10b-darwin-x86_64.tar.bz2
+ndk.mac64_64_bytes=346423776
+ndk.mac64_64_checksum=5bae7feed20ebf0762c0baefe6b84b6d
-ndk.mac32_64_download=android-ndk64-r10-darwin-x86.tar.bz2
-ndk.mac32_64_bytes=323736411
-ndk.mac32_64_checksum=5bbaf9d8051ba5d2c0fff74cfd87c374
+ndk.mac32_64_download=android-ndk64-r10b-darwin-x86.tar.bz2
+ndk.mac32_64_bytes=344052876
+ndk.mac32_64_checksum=4447049ac2b5877176b9b6b1cf3bcdb2
-ndk.linux64_64_download=android-ndk64-r10-linux-x86_64.tar.bz2
-ndk.linux64_64_bytes=339708042
-ndk.linux64_64_checksum=737290195583268b7fbff4aa56465ab6
+ndk.linux64_64_download=android-ndk64-r10b-linux-x86_64.tar.bz2
+ndk.linux64_64_bytes=358835298
+ndk.linux64_64_checksum=2aa12a0d9a70bcab83e42d010a685136
-ndk.linux32_64_download=android-ndk64-r10-linux-x86.tar.bz2
-ndk.linux32_64_bytes=338544906
-ndk.linux32_64_checksum=bea5d027baeb948cbff6af840d26b80d
+ndk.linux32_64_download=android-ndk64-r10b-linux-x86.tar.bz2
+ndk.linux32_64_bytes=358060577
+ndk.linux32_64_checksum=b77eb583626d8c7f5c11e49181fd5eac
-ndk.win64_64_download=android-ndk64-r10-windows-x86_64.zip
-ndk.win64_64_bytes=417411195
-ndk.win64_64_checksum=91879ec85539b45313a21b9526b911a8
+ndk.win64_64_download=android-ndk64-r10b-windows-x86_64.zip
+ndk.win64_64_bytes=437152652
+ndk.win64_64_checksum=df39185e6c5a4d72eb9fca3f9aaabc46
-ndk.win32_64_download=android-ndk64-r10-windows-x86.zip
-ndk.win32_64_bytes=396751892
-ndk.win32_64_checksum=f79070ace2cde9ebf6a2e2be4a61ac7a
+ndk.win32_64_download=android-ndk64-r10b-windows-x86.zip
+ndk.win32_64_bytes=417290468
+ndk.win32_64_checksum=0f0324cb11f04e8b2641e5422ee39c81
-ndk.debug_info_download=android-ndk-r10-cxx-stl-libs-with-debug-info.zip
-ndk.debug_info_bytes=253198908
-ndk.debug_info_checksum=c2a90c43d17dbb5f0609cc8237491788
+ndk.debug_info_download=android-ndk-r10b-cxx-stl-libs-with-debug-info.zip
+ndk.debug_info_bytes=227302317
+ndk.debug_info_checksum=bed1bb855a41bdb572a804dbf6d45aa6
page.title=Android NDK
@@ -357,15 +357,6 @@
</div>
</div>
-
-
-
-
-
-
-
-
-
<div id="qv-wrapper">
<div id="qv">
<h2>In this document</h2>
@@ -418,7 +409,7 @@
<p>With NDK revision 9 and higher, the release packages have been split to reduce download size.
- The first download for each platform contains the default NDK toolchain. The second download
+ The first download for each platform contains the default NDK toolchain. The additional download
contains legacy NDK toolchains for that platform, which is only required if you are not using
the current, recommended toolchain for your NDK builds.</p>
@@ -426,10 +417,91 @@
<p>The following sections provide information about releases of the NDK.</p>
+
<div class="toggle-content opened">
<p>
<a href="#" onclick="return toggleContent(this)"> <img
src="/assets/images/triangle-opened.png" class="toggle-content-img" alt=""
+ >Android NDK, Revision 10b</a> <em>(September 2014)</em>
+ </p>
+ <div class="toggle-content-toggleme">
+ <dl>
+
+ <dt>Important notes:</dt>
+ <dd>
+ <ul>
+ <li>Because of the 512MB size restriction on downloadable packages, the following 32-bit items are not in the 32-bit NDK download packages. Instead, they reside in the 64-bit ones:</li>
+ <ul>
+ <li>Android-L headers</li>
+ <li>GCC 4.9</li>
+ </ul>
+ <li>Currently, the only Renderscript support provided by the NDK is for 32-bit Renderscript with Android 4.4 (API level 19). You cannot build HelloComputeNDK (the only Renderscript sample) with any other combination of Renderscript (32- or 64-bit) and Android version.</li>
+ <li>To compile native-codec, you must use a 64-bit NDK package, which is where all the Android-L headers are located. </li>
+ </ul>
+ </dd>
+
+
+ <dt>Important bug fixes:</dt>
+ <dd>
+ <ul>
+ <li>Fixed gdb 7.6 in GCC 4.8/4.9. (Issues <a href="http://b.android.com/74112">74112</a> and <a href="http://b.android.com/74371">74371</a>.)</li>
+ <li>Fixed GCC 4.8/4.9 for x86, so that they no longer enable <code>-msse4.2</code> and <code>-mpopcnt</code> by default. (Issue <a href="http://b.android.com/73843">73843</a>.)</li>
+ </ul>
+ </dd>
+
+ <dt>Other bug fixes:</dt>
+ <dd>
+ <ul>
+ <li>Removed <code>stdio.h</code> from the <code>include-fixed/</code> directories of all versions of GCC. (Issue <a href="http://b.android.com/73728">73728</a>.)</li>
+ <li>Removed duplicate header files from the Windows packages in the <code>platforms/android-L/arch-*/usr/include/linux/netfilter*/</code> directories. (Issue <a href="https://code.google.com/p/android/issues/detail?id=73704">73704</a>.)</li>
+ <li>Fixed a problem that prevented Clang from building HelloComputeNDK.</li>
+ <li>Fixed atexit. (Issue <a href="http://b.android.com/66595">66595</a>.)</li>
+ <li>Made various fixes to the docs in <code>docs/</code> and <code>sources/third_party/googletest/README.NDK</code>. (Issue <a href="http://b.android.com/74069">74069</a>.)</li>
+ <li>Made the following fixes to the Android-L headers:</li>
+ <ol>
+ <li>Added the following functions to <code>ctype.h</code> and <code>wchar.h</code>: <code>dn_expand()</code>, <code>grantpt()</code>, <code> inet_nsap_addr()</code>, <code>inet_nsap_ntoa()</code>, <code>insque()</code>, <code>nsdispatch()</code>, <code>posix_openpt()</code>, <code>__pthread_cleanup_pop()</code>, <code>__pthread_cleanup_push()</code>, <code>remque()</code>, <code>setfsgid()</code>, <code>setfsuid()</code>, <code>splice()</code>, <code>tee()</code>, <code>twalk()</code> (Issue <a href = "http://b.android.com/73719">73719</a>), and 42 <code>*_l()</code> functions.</li>
+
+ <li>Renamed <code>cmsg_nxthdr</code> to <code>__cmsg_nxthdr</code>.</li>
+
+ <li>Removed <code>__libc_malloc_dispatch</code>.</li>
+
+ <li>Changed the <code>ptrace()</code> prototype to <code>long ptrace(int, ...);</code>.</li>
+
+ <li>Removed <code>sha1.h</code>.</li>
+
+ <li>Extended <code>android_dlextinfo</code> in <code>android/dlext.h</code>.</li>
+
+ <li>Annotated <code>__NDK_FPABI__</code> for functions receiving or returning float- or double-type values in <code>stdlib.h</code>, <code>time.h</code>, <code>wchar.h</code>, and <code>complex.h</code>.</li>
+ </ol>
+ </ul>
+ </dd>
+
+ <dt>Other changes:</dt>
+ <dd>
+ <ul>
+ <li>Updated <code>mipsel-linux-android-4.9</code> and <code>mips64el-linux-android-4.9</code>, implementing a new multilib directory layout, and providing support for gdb-7.7</li>
+ <li>Enhanced <code>cpu-features</code> to detect more arm64 features. (Change list <a href="https://android-review.googlesource.com/#/c/100339">100339</a>.)</li>
+ </dd>
+ </ul>
+
+
+
+ </dl>
+ </div>
+</div>
+
+
+
+
+
+
+
+
+
+<div class="toggle-content closed">
+ <p>
+ <a href="#" onclick="return toggleContent(this)"> <img
+ src="/assets/images/triangle-closed.png" class="toggle-content-img" alt=""
>Android NDK, Revision 10</a> <em>(July 2014)</em>
</p>
<div class="toggle-content-toggleme">
@@ -442,7 +514,7 @@
<li>GCC 4.9 is the default compiler for 64-bit ABIs. Clang is currently version 3.4.
<code>NDK_TOOLCHAIN_VERSION=clang</code>
may not work for arm64-v8a and mips64.</li>
- <li>Android API level L is the first level with 64-bit support. Note that this API
+ <li>Android-L is the first level with 64-bit support. Note that this API
level is a temporary one, and only for L-preview. An actual API level number will replace it at
L-release.</li>
<li>This release includes now includes <code>all32</code> and <code>all64</code>
@@ -479,7 +551,7 @@
<li>For ndk-build, enable 32-bit, GCC 4.9 building either by adding
<code>NDK_TOOLCHAIN_VERSION=4.9</code> to <code>Application.mk</code>, or exporting it as an
environment variable from the command line.</li>
- <li>For a standalone toolchain, use the <code> --toolchain=</code> option in the
+ <li>For a standalone toolchain, use the <code>--toolchain=</code> option in the
<code>make-standalone-toolchain.sh</code> script. For example: <code>--toolchain=arm-linux-androideabi-4.9.</code></li>
</ul>
<li>Upgraded GDB to version 7.6 in GCC 4.8/4.9 and x86*. Since GDB is still at version GDB-7.3.x in
diff --git a/libs/hwui/Layer.cpp b/libs/hwui/Layer.cpp
index 25caae3..91c4aee 100644
--- a/libs/hwui/Layer.cpp
+++ b/libs/hwui/Layer.cpp
@@ -29,15 +29,15 @@
namespace android {
namespace uirenderer {
-Layer::Layer(RenderState& renderState, const uint32_t layerWidth, const uint32_t layerHeight)
+Layer::Layer(Type layerType, RenderState& renderState, const uint32_t layerWidth, const uint32_t layerHeight)
: caches(Caches::getInstance())
, renderState(renderState)
- , texture(caches) {
+ , texture(caches)
+ , type(layerType) {
mesh = NULL;
meshElementCount = 0;
cacheable = true;
dirty = false;
- textureLayer = false;
renderTarget = GL_TEXTURE_2D;
texture.width = layerWidth;
texture.height = layerHeight;
@@ -55,11 +55,17 @@
caches.resourceCache.incrementRefcount(this);
rendererLightPosDirty = true;
wasBuildLayered = false;
- renderState.registerLayer(this);
+ if (!isTextureLayer()) {
+ // track only non-texture layer lifecycles in renderstate,
+ // because texture layers are destroyed via finalizer
+ renderState.registerLayer(this);
+ }
}
Layer::~Layer() {
- renderState.unregisterLayer(this);
+ if (!isTextureLayer()) {
+ renderState.unregisterLayer(this);
+ }
SkSafeUnref(colorFilter);
removeFbo();
deleteTexture();
diff --git a/libs/hwui/Layer.h b/libs/hwui/Layer.h
index 911b99880..36a4ed1 100644
--- a/libs/hwui/Layer.h
+++ b/libs/hwui/Layer.h
@@ -54,7 +54,12 @@
*/
class Layer {
public:
- Layer(RenderState& renderState, const uint32_t layerWidth, const uint32_t layerHeight);
+ enum Type {
+ kType_Texture,
+ kType_DisplayList,
+ };
+
+ Layer(Type type, RenderState& renderState, const uint32_t layerWidth, const uint32_t layerHeight);
~Layer();
static uint32_t computeIdealWidth(uint32_t layerWidth);
@@ -219,11 +224,7 @@
}
inline bool isTextureLayer() const {
- return textureLayer;
- }
-
- inline void setTextureLayer(bool textureLayer) {
- this->textureLayer = textureLayer;
+ return type == kType_Texture;
}
inline SkColorFilter* getColorFilter() const {
@@ -343,10 +344,9 @@
bool cacheable;
/**
- * When set to true, this layer must be treated as a texture
- * layer.
+ * Denotes whether the layer is a DisplayList, or Texture layer.
*/
- bool textureLayer;
+ const Type type;
/**
* When set to true, this layer is dirty and should be cleared
diff --git a/libs/hwui/LayerCache.cpp b/libs/hwui/LayerCache.cpp
index efa30ac..d49daf6 100644
--- a/libs/hwui/LayerCache.cpp
+++ b/libs/hwui/LayerCache.cpp
@@ -112,7 +112,7 @@
} else {
LAYER_LOGD("Creating new layer %dx%d", entry.mWidth, entry.mHeight);
- layer = new Layer(renderState, entry.mWidth, entry.mHeight);
+ layer = new Layer(Layer::kType_DisplayList, renderState, entry.mWidth, entry.mHeight);
layer->setBlend(true);
layer->setEmpty(true);
layer->setFbo(0);
diff --git a/libs/hwui/LayerRenderer.cpp b/libs/hwui/LayerRenderer.cpp
index e3b0daf..103c843 100644
--- a/libs/hwui/LayerRenderer.cpp
+++ b/libs/hwui/LayerRenderer.cpp
@@ -272,9 +272,8 @@
Layer* LayerRenderer::createTextureLayer(RenderState& renderState) {
LAYER_RENDERER_LOGD("Creating new texture layer");
- Layer* layer = new Layer(renderState, 0, 0);
+ Layer* layer = new Layer(Layer::kType_Texture, renderState, 0, 0);
layer->setCacheable(false);
- layer->setTextureLayer(true);
layer->setEmpty(true);
layer->setFbo(0);
layer->setAlpha(255, SkXfermode::kSrcOver_Mode);
diff --git a/libs/hwui/RenderNode.cpp b/libs/hwui/RenderNode.cpp
index a10e70f..254492f 100644
--- a/libs/hwui/RenderNode.cpp
+++ b/libs/hwui/RenderNode.cpp
@@ -872,6 +872,8 @@
handler(new (alloc) DrawLayerOp(mLayer, 0, 0),
renderer.getSaveCount() - 1, properties().getClipToBounds());
} else {
+ const int saveCountOffset = renderer.getSaveCount() - 1;
+ const int projectionReceiveIndex = mDisplayListData->projectionReceiveIndex;
DisplayListLogBuffer& logBuffer = DisplayListLogBuffer::getInstance();
for (size_t chunkIndex = 0; chunkIndex < mDisplayListData->getChunks().size(); chunkIndex++) {
const DisplayListData::Chunk& chunk = mDisplayListData->getChunks()[chunkIndex];
@@ -882,8 +884,6 @@
issueOperationsOf3dChildren(kNegativeZChildren,
initialTransform, zTranslatedNodes, renderer, handler);
- const int saveCountOffset = renderer.getSaveCount() - 1;
- const int projectionReceiveIndex = mDisplayListData->projectionReceiveIndex;
for (int opIndex = chunk.beginOpIndex; opIndex < chunk.endOpIndex; opIndex++) {
DisplayListOp *op = mDisplayListData->displayListOps[opIndex];
diff --git a/location/java/android/location/LocationManager.java b/location/java/android/location/LocationManager.java
index 082a158..2c805bb 100644
--- a/location/java/android/location/LocationManager.java
+++ b/location/java/android/location/LocationManager.java
@@ -1109,9 +1109,9 @@
* {@link #requestLocationUpdates(String, long, float, LocationListener)}.
*
* <p>
- * Before API version 20, this method would throw {@link SecurityException}
- * if the location permissions were not sufficient to use the specified
- * provider.
+ * Before API version {@link android.os.Build.VERSION_CODES#L}, this
+ * method would throw {@link SecurityException} if the location permissions
+ * were not sufficient to use the specified provider.
*
* @param provider the name of the provider
* @return true if the provider exists and is enabled
@@ -1119,7 +1119,6 @@
* @throws IllegalArgumentException if provider is null
*/
public boolean isProviderEnabled(String provider) {
- // STOPSHIP: finalize API version number in javadoc
checkProvider(provider);
try {
diff --git a/location/java/com/android/internal/location/GpsNetInitiatedHandler.java b/location/java/com/android/internal/location/GpsNetInitiatedHandler.java
index 5a286ee..e0901d0 100644
--- a/location/java/com/android/internal/location/GpsNetInitiatedHandler.java
+++ b/location/java/com/android/internal/location/GpsNetInitiatedHandler.java
@@ -21,15 +21,24 @@
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
+import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
+import android.content.IntentFilter;
import android.location.LocationManager;
+import android.location.INetInitiatedListener;
+import android.telephony.TelephonyManager;
+import android.telephony.PhoneNumberUtils;
+import android.telephony.PhoneStateListener;
import android.os.Bundle;
+import android.os.RemoteException;
import android.os.UserHandle;
+import android.os.SystemProperties;
import android.util.Log;
import com.android.internal.R;
import com.android.internal.telephony.GsmAlphabet;
+import com.android.internal.telephony.TelephonyProperties;
/**
* A GPS Network-initiated Handler class used by LocationManager.
@@ -45,55 +54,67 @@
// NI verify activity for bringing up UI (not used yet)
public static final String ACTION_NI_VERIFY = "android.intent.action.NETWORK_INITIATED_VERIFY";
-
+
// string constants for defining data fields in NI Intent
public static final String NI_INTENT_KEY_NOTIF_ID = "notif_id";
public static final String NI_INTENT_KEY_TITLE = "title";
public static final String NI_INTENT_KEY_MESSAGE = "message";
public static final String NI_INTENT_KEY_TIMEOUT = "timeout";
public static final String NI_INTENT_KEY_DEFAULT_RESPONSE = "default_resp";
-
+
// the extra command to send NI response to GpsLocationProvider
public static final String NI_RESPONSE_EXTRA_CMD = "send_ni_response";
-
+
// the extra command parameter names in the Bundle
public static final String NI_EXTRA_CMD_NOTIF_ID = "notif_id";
public static final String NI_EXTRA_CMD_RESPONSE = "response";
-
+
// these need to match GpsNiType constants in gps_ni.h
public static final int GPS_NI_TYPE_VOICE = 1;
public static final int GPS_NI_TYPE_UMTS_SUPL = 2;
public static final int GPS_NI_TYPE_UMTS_CTRL_PLANE = 3;
-
- // these need to match GpsUserResponseType constants in gps_ni.h
+ public static final int GPS_NI_TYPE_EMERGENCY_SUPL = 4;
+
+ // these need to match GpsUserResponseType constants in gps_ni.h
public static final int GPS_NI_RESPONSE_ACCEPT = 1;
public static final int GPS_NI_RESPONSE_DENY = 2;
- public static final int GPS_NI_RESPONSE_NORESP = 3;
-
+ public static final int GPS_NI_RESPONSE_NORESP = 3;
+ public static final int GPS_NI_RESPONSE_IGNORE = 4;
+
// these need to match GpsNiNotifyFlags constants in gps_ni.h
public static final int GPS_NI_NEED_NOTIFY = 0x0001;
public static final int GPS_NI_NEED_VERIFY = 0x0002;
public static final int GPS_NI_PRIVACY_OVERRIDE = 0x0004;
-
+
// these need to match GpsNiEncodingType in gps_ni.h
public static final int GPS_ENC_NONE = 0;
public static final int GPS_ENC_SUPL_GSM_DEFAULT = 1;
public static final int GPS_ENC_SUPL_UTF8 = 2;
public static final int GPS_ENC_SUPL_UCS2 = 3;
public static final int GPS_ENC_UNKNOWN = -1;
-
+
private final Context mContext;
-
+ private final TelephonyManager mTelephonyManager;
+ private final PhoneStateListener mPhoneStateListener;
+
// parent gps location provider
private final LocationManager mLocationManager;
-
+
// configuration of notificaiton behavior
private boolean mPlaySounds = false;
private boolean mPopupImmediately = true;
-
- // Set to true if string from HAL is encoded as Hex, e.g., "3F0039"
+
+ // read the SUPL_ES form gps.conf
+ private volatile boolean mIsSuplEsEnabled;
+
+ // Set to true if the phone is having emergency call.
+ private volatile boolean mIsInEmergency;
+
+ private final INetInitiatedListener mNetInitiatedListener;
+
+ // Set to true if string from HAL is encoded as Hex, e.g., "3F0039"
static private boolean mIsHexInput = true;
-
+
public static class GpsNiNotification
{
public int notificationId;
@@ -109,58 +130,95 @@
public int textEncoding;
public Bundle extras;
};
-
+
public static class GpsNiResponse {
/* User reponse, one of the values in GpsUserResponseType */
int userResponse;
/* Optional extra data to pass with the user response */
Bundle extras;
};
-
+
+ private final BroadcastReceiver mBroadcastReciever = new BroadcastReceiver() {
+
+ @Override public void onReceive(Context context, Intent intent) {
+ String action = intent.getAction();
+ if (action.equals(Intent.ACTION_NEW_OUTGOING_CALL)) {
+ String phoneNumber = intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER);
+ /*
+ Emergency Mode is when during emergency call or in emergency call back mode.
+ For checking if it is during emergency call:
+ mIsInEmergency records if the phone is in emergency call or not. It will
+ be set to true when the phone is having emergency call, and then will
+ be set to false by mPhoneStateListener when the emergency call ends.
+ For checking if it is in emergency call back mode:
+ Emergency call back mode will be checked by reading system properties
+ when necessary: SystemProperties.get(TelephonyProperties.PROPERTY_INECM_MODE)
+ */
+ mIsInEmergency |= PhoneNumberUtils.isEmergencyNumber(phoneNumber);
+ if (DEBUG) Log.v(TAG, "ACTION_NEW_OUTGOING_CALL - " + mIsInEmergency);
+ }
+ }
+ };
+
/**
* The notification that is shown when a network-initiated notification
- * (and verification) event is received.
+ * (and verification) event is received.
* <p>
* This is lazily created, so use {@link #setNINotification()}.
*/
private Notification mNiNotification;
-
- public GpsNetInitiatedHandler(Context context) {
+
+ public GpsNetInitiatedHandler(Context context,
+ INetInitiatedListener netInitiatedListener,
+ boolean isSuplEsEnabled) {
mContext = context;
+
+ if (netInitiatedListener == null) {
+ throw new IllegalArgumentException("netInitiatedListener is null");
+ } else {
+ mNetInitiatedListener = netInitiatedListener;
+ }
+
+ mIsSuplEsEnabled = isSuplEsEnabled;
mLocationManager = (LocationManager)context.getSystemService(Context.LOCATION_SERVICE);
+ mTelephonyManager =
+ (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
+
+ mPhoneStateListener = new PhoneStateListener() {
+ @Override
+ public void onCallStateChanged(int state, String incomingNumber) {
+ if (DEBUG) Log.d(TAG, "onCallStateChanged(): state is "+ state);
+ // listening for emergency call ends
+ if (state == TelephonyManager.CALL_STATE_IDLE) {
+ mIsInEmergency = false;
+ }
+ }
+ };
+ mTelephonyManager.listen(mPhoneStateListener, PhoneStateListener.LISTEN_CALL_STATE);
+
+ IntentFilter intentFilter = new IntentFilter();
+ intentFilter.addAction(Intent.ACTION_NEW_OUTGOING_CALL);
+ mContext.registerReceiver(mBroadcastReciever, intentFilter);
}
-
+
+ public void setSuplEsEnablement(boolean isEnabled)
+ {
+ mIsSuplEsEnabled = isEnabled;
+ }
+
// Handles NI events from HAL
public void handleNiNotification(GpsNiNotification notif)
{
- if (DEBUG) Log.d(TAG, "handleNiNotification" + " notificationId: " + notif.notificationId
- + " requestorId: " + notif.requestorId + " text: " + notif.text);
+ if (DEBUG) Log.d(TAG, "in handleNiNotification () :"
+ + " notificationId: " + notif.notificationId
+ + " requestorId: " + notif.requestorId
+ + " text: " + notif.text
+ + " mIsSuplEsEnabled" + mIsSuplEsEnabled);
- // Notify and verify with immediate pop-up
- if (notif.needNotify && notif.needVerify && mPopupImmediately)
- {
- // Popup the dialog box now
- openNiDialog(notif);
- }
-
- // Notify only, or delayed pop-up (change mPopupImmediately to FALSE)
- if (notif.needNotify && !notif.needVerify ||
- notif.needNotify && notif.needVerify && !mPopupImmediately)
- {
- // Show the notification
-
- // if mPopupImmediately == FALSE and needVerify == TRUE, a dialog will be opened
- // when the user opens the notification message
-
- setNiNotification(notif);
- }
-
- // ACCEPT cases: 1. Notify, no verify; 2. no notify, no verify; 3. privacy override.
- if ( notif.needNotify && !notif.needVerify ||
- !notif.needNotify && !notif.needVerify ||
- notif.privacyOverride)
- {
- mLocationManager.sendNiResponse(notif.notificationId, GPS_NI_RESPONSE_ACCEPT);
+ if (mIsSuplEsEnabled == false) {
+ handleNi(notif);
+ } else {
+ handleNiInEs(notif);
}
//////////////////////////////////////////////////////////////////////////
@@ -176,6 +234,72 @@
//
}
+ // handle NI form HAL when SUPL_ES is disabled.
+ private void handleNi(GpsNiNotification notif) {
+ if (DEBUG) Log.d(TAG, "in handleNi () :"
+ + " needNotify: " + notif.needNotify
+ + " needVerify: " + notif.needVerify
+ + " privacyOverride: " + notif.privacyOverride
+ + " mPopupImmediately: " + mPopupImmediately);
+
+ // legacy behaviour
+ if (notif.needNotify) {
+ // If NI does not need verify or the dialog is not requested
+ // to pop up immediately, the dialog box will not pop up.
+ if (notif.needVerify && mPopupImmediately) {
+ // Popup the dialog box now
+ openNiDialog(notif);
+ } else {
+ // Show the notification
+ setNiNotification(notif);
+ }
+ }
+ // ACCEPT cases: 1. Notify, no verify; 2. no notify, no verify;
+ // 3. privacy override.
+ if (!notif.needVerify || notif.privacyOverride) {
+ try {
+ mNetInitiatedListener.sendNiResponse(notif.notificationId,
+ GPS_NI_RESPONSE_ACCEPT);
+ } catch (RemoteException e) {
+ Log.e(TAG, "RemoteException in sendNiResponse");
+ }
+ }
+ }
+
+ // handle NI from HAL when the SUPL_ES is enabled
+ private void handleNiInEs(GpsNiNotification notif) {
+
+ if (DEBUG) Log.d(TAG, "in handleNiInEs () :"
+ + " niType: " + notif.niType
+ + " notificationId: " + notif.notificationId);
+
+ // UE is in emergency mode when in emergency call mode or in emergency call back mode
+ boolean isUEInEmergencyMode = mIsInEmergency ||
+ Boolean.parseBoolean(SystemProperties.get(TelephonyProperties.PROPERTY_INECM_MODE));
+
+ /*
+ 1. When SUPL ES bit is off and UE is not in emergency mode:
+ Call handleNi() to do legacy behaviour.
+ 2. When SUPL ES bit is on and UE is in emergency mode:
+ Call handleNi() to do acceptance behaviour.
+ 3. When SUPL ES bit is off but UE is in emergency mode:
+ Ignore the emergency SUPL INIT.
+ 4. When SUPL ES bit is on but UE is not in emergency mode:
+ Ignore the emergency SUPL INIT.
+ */
+ boolean isNiTypeES = (notif.niType == GPS_NI_TYPE_EMERGENCY_SUPL);
+ if (isNiTypeES != isUEInEmergencyMode) {
+ try {
+ mNetInitiatedListener.sendNiResponse(notif.notificationId,
+ GPS_NI_RESPONSE_IGNORE);
+ } catch (RemoteException e) {
+ Log.e(TAG, "RemoteException in sendNiResponse");
+ }
+ } else {
+ handleNi(notif);
+ }
+ }
+
// Sets the NI notification.
private synchronized void setNiNotification(GpsNiNotification notif) {
NotificationManager notificationManager = (NotificationManager) mContext
@@ -202,7 +326,7 @@
mNiNotification.defaults |= Notification.DEFAULT_SOUND;
} else {
mNiNotification.defaults &= ~Notification.DEFAULT_SOUND;
- }
+ }
mNiNotification.flags = Notification.FLAG_ONGOING_EVENT | Notification.FLAG_AUTO_CANCEL;
mNiNotification.tickerText = getNotifTicker(notif, mContext);
@@ -230,7 +354,7 @@
mContext.startActivity(intent);
}
- // Construct the intent for bringing up the dialog activity, which shows the
+ // Construct the intent for bringing up the dialog activity, which shows the
// notification and takes user input
private Intent getDlgIntent(GpsNiNotification notif)
{
@@ -239,7 +363,7 @@
String message = getDialogMessage(notif, mContext);
// directly bring up the NI activity
- intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
intent.setClass(mContext, com.android.internal.app.NetInitiatedActivity.class);
// put data in the intent
@@ -409,7 +533,7 @@
decodeString(notif.requestorId, mIsHexInput, notif.requestorIdEncoding),
decodeString(notif.text, mIsHexInput, notif.textEncoding));
return message;
- }
+ }
// change this to configure dialog display (for verification)
static public String getDialogTitle(GpsNiNotification notif, Context context)
diff --git a/media/java/android/media/AudioAttributes.java b/media/java/android/media/AudioAttributes.java
index 9b644f4..d7ede34 100644
--- a/media/java/android/media/AudioAttributes.java
+++ b/media/java/android/media/AudioAttributes.java
@@ -162,16 +162,13 @@
public final static int FLAG_BEACON = 0x1 << 3;
/**
- * @hide
- * CANDIDATE FOR PUBLIC API
* Flag requesting the use of an output stream supporting hardware A/V synchronization.
*/
- // TODO add in FLAG_ALL_PUBLIC when in public API
public final static int FLAG_HW_AV_SYNC = 0x1 << 4;
private final static int FLAG_ALL = FLAG_AUDIBILITY_ENFORCED | FLAG_SECURE | FLAG_SCO |
FLAG_BEACON | FLAG_HW_AV_SYNC;
- private final static int FLAG_ALL_PUBLIC = FLAG_AUDIBILITY_ENFORCED;
+ private final static int FLAG_ALL_PUBLIC = FLAG_AUDIBILITY_ENFORCED | FLAG_HW_AV_SYNC;
private int mUsage = USAGE_UNKNOWN;
private int mContentType = CONTENT_TYPE_UNKNOWN;
diff --git a/media/java/android/media/session/MediaSession.java b/media/java/android/media/session/MediaSession.java
index 8cb039ab..2c38697 100644
--- a/media/java/android/media/session/MediaSession.java
+++ b/media/java/android/media/session/MediaSession.java
@@ -191,11 +191,8 @@
return;
}
if (mCallback != null) {
- if (mCallback.mCallback == callback) {
- Log.w(TAG, "Tried to set same callback, ignoring");
- return;
- }
- // We're changing callbacks, clear the session from the old one.
+ // We're updating the callback, clear the session from the old
+ // one.
mCallback.mCallback.mSession = null;
}
if (handler == null) {
diff --git a/media/java/android/media/session/MediaSessionLegacyHelper.java b/media/java/android/media/session/MediaSessionLegacyHelper.java
index aa196a9..06e40c5 100644
--- a/media/java/android/media/session/MediaSessionLegacyHelper.java
+++ b/media/java/android/media/session/MediaSessionLegacyHelper.java
@@ -467,10 +467,7 @@
mSessions.remove(mPi);
} else if (mCb == null) {
mCb = new SessionCallback();
- Handler handler = null;
- if (Looper.myLooper() == null) {
- handler = new Handler(Looper.getMainLooper());
- }
+ Handler handler = new Handler(Looper.getMainLooper());
mSession.setCallback(mCb, handler);
}
}
diff --git a/packages/SystemUI/res/drawable/stat_sys_vpn_ic.xml b/packages/SystemUI/res/drawable/stat_sys_vpn_ic.xml
new file mode 100644
index 0000000..7ca8c40
--- /dev/null
+++ b/packages/SystemUI/res/drawable/stat_sys_vpn_ic.xml
@@ -0,0 +1,24 @@
+<!--
+Copyright (C) 2014 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="17.0dp"
+ android:height="17.0dp"
+ android:viewportWidth="24.0"
+ android:viewportHeight="24.0">
+ <path
+ android:fillColor="#FFFFFFFF"
+ android:pathData="M12.700000,10.000000c-0.800000,-2.300000 -3.000000,-4.000000 -5.700000,-4.000000c-3.300000,0.000000 -6.000000,2.700000 -6.000000,6.000000s2.700000,6.000000 6.000000,6.000000c2.600000,0.000000 4.800000,-1.700000 5.700000,-4.000000L17.000000,14.000000l0.000000,4.000000l4.000000,0.000000l0.000000,-4.000000l2.000000,0.000000l0.000000,-4.000000L12.700000,10.000000zM7.000000,14.000000c-1.100000,0.000000 -2.000000,-0.900000 -2.000000,-2.000000c0.000000,-1.100000 0.900000,-2.000000 2.000000,-2.000000s2.000000,0.900000 2.000000,2.000000C9.000000,13.100000 8.100000,14.000000 7.000000,14.000000z"/>
+</vector>
diff --git a/packages/SystemUI/res/layout/recents_empty.xml b/packages/SystemUI/res/layout/recents_empty.xml
index 1ef9cad..4b68e77 100644
--- a/packages/SystemUI/res/layout/recents_empty.xml
+++ b/packages/SystemUI/res/layout/recents_empty.xml
@@ -23,6 +23,6 @@
android:textSize="16sp"
android:textColor="#ffffffff"
android:text="@string/recents_empty_message"
- android:fontFamily="sans-serif-light"
+ android:fontFamily="sans-serif"
android:background="#80000000"
android:visibility="gone" />
\ No newline at end of file
diff --git a/packages/SystemUI/res/layout/signal_cluster_view.xml b/packages/SystemUI/res/layout/signal_cluster_view.xml
index 347c8a9..3a8a17d 100644
--- a/packages/SystemUI/res/layout/signal_cluster_view.xml
+++ b/packages/SystemUI/res/layout/signal_cluster_view.xml
@@ -25,6 +25,13 @@
android:gravity="center_vertical"
android:orientation="horizontal"
>
+ <ImageView
+ android:id="@+id/vpn"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:paddingEnd="6dp"
+ android:src="@drawable/stat_sys_vpn_ic"
+ />
<FrameLayout
android:id="@+id/wifi_combo"
android:layout_height="wrap_content"
diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml
index 0e18979..c0e2b10 100644
--- a/packages/SystemUI/res/values/config.xml
+++ b/packages/SystemUI/res/values/config.xml
@@ -134,10 +134,13 @@
<integer name="recents_animate_task_exit_to_home_duration">225</integer>
<!-- The min animation duration for animating the task bar out. -->
<integer name="recents_animate_task_bar_exit_duration">125</integer>
+ <!-- The animation delay for animating the first task in. This should roughly be the animation
+ duration of the transition in to recents from home. -->
+ <integer name="recents_animate_task_enter_from_home_delay">150</integer>
<!-- The min animation duration for animating the task in when transitioning from home. -->
<integer name="recents_animate_task_enter_from_home_duration">275</integer>
<!-- The animation stagger to apply to each task animation when transitioning from home. -->
- <integer name="recents_animate_task_enter_from_home_delay">10</integer>
+ <integer name="recents_animate_task_enter_from_home_stagger_delay">10</integer>
<!-- The short duration when animating in/out the lock to app button. -->
<integer name="recents_animate_lock_to_app_button_short_duration">150</integer>
<!-- The long duration when animating in/out the lock to app button. -->
diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsConfiguration.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsConfiguration.java
index 5d8181c..396be3b 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/RecentsConfiguration.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsConfiguration.java
@@ -74,8 +74,9 @@
public float taskStackOverscrollPct;
/** Task view animation and styles */
- public int taskViewEnterFromHomeDuration;
public int taskViewEnterFromHomeDelay;
+ public int taskViewEnterFromHomeDuration;
+ public int taskViewEnterFromHomeStaggerDelay;
public int taskViewExitToHomeDuration;
public int taskViewRemoveAnimDuration;
public int taskViewRemoveAnimTranslationXPx;
@@ -209,10 +210,12 @@
taskStackTopPaddingPx = res.getDimensionPixelSize(R.dimen.recents_stack_top_padding);
// Task view animation and styles
- taskViewEnterFromHomeDuration =
- res.getInteger(R.integer.recents_animate_task_enter_from_home_duration);
taskViewEnterFromHomeDelay =
res.getInteger(R.integer.recents_animate_task_enter_from_home_delay);
+ taskViewEnterFromHomeDuration =
+ res.getInteger(R.integer.recents_animate_task_enter_from_home_duration);
+ taskViewEnterFromHomeStaggerDelay =
+ res.getInteger(R.integer.recents_animate_task_enter_from_home_stagger_delay);
taskViewExitToHomeDuration =
res.getInteger(R.integer.recents_animate_task_exit_to_home_duration);
taskViewRemoveAnimDuration =
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java
index 49aa52b..6fe86be 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java
@@ -284,7 +284,7 @@
float scaledWindowInsetTop = (int) (taskScale * windowInsetTop);
float scaledTranslationY = taskRect.top + transform.translationY -
(scaledWindowInsetTop + scaledYOffset);
- startDelay = mConfig.taskViewEnterFromHomeDelay;
+ startDelay = mConfig.taskViewEnterFromHomeStaggerDelay;
// Animate the top clip
mViewBounds.animateClipTop(windowInsetTop, duration,
@@ -410,8 +410,8 @@
} else if (mConfig.launchedFromHome) {
// Animate the tasks up
int frontIndex = (ctx.currentStackViewCount - ctx.currentStackViewIndex - 1);
- int delay = mConfig.taskBarEnterAnimDelay +
- frontIndex * mConfig.taskViewEnterFromHomeDelay;
+ int delay = mConfig.taskViewEnterFromHomeDelay +
+ frontIndex * mConfig.taskViewEnterFromHomeStaggerDelay;
if (Constants.DebugFlags.App.EnableShadows) {
animate().translationZ(transform.translationZ);
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
index 1c4556f..f4587db 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
@@ -91,6 +91,7 @@
import com.android.systemui.statusbar.phone.KeyguardTouchDelegate;
import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager;
import com.android.systemui.statusbar.policy.HeadsUpNotificationView;
+import com.android.systemui.statusbar.policy.PreviewInflater;
import com.android.systemui.statusbar.stack.NotificationStackScrollLayout;
import java.util.ArrayList;
@@ -260,10 +261,12 @@
final boolean isActivity = pendingIntent.isActivity();
if (isActivity) {
final boolean keyguardShowing = mStatusBarKeyguardViewManager.isShowing();
+ final boolean afterKeyguardGone = PreviewInflater.wouldLaunchResolverActivity(
+ mContext, pendingIntent.getIntent(), mCurrentUserId);
dismissKeyguardThenExecute(new OnDismissAction() {
@Override
public boolean onDismiss() {
- if (keyguardShowing) {
+ if (keyguardShowing && !afterKeyguardGone) {
try {
ActivityManagerNative.getDefault()
.keyguardWaitingForActivityDrawn();
@@ -277,7 +280,7 @@
}
boolean handled = superOnClickHandler(view, pendingIntent, fillInIntent);
- overrideActivityPendingAppTransition(keyguardShowing);
+ overrideActivityPendingAppTransition(keyguardShowing && !afterKeyguardGone);
// close the shade if it was open
if (handled) {
@@ -287,7 +290,7 @@
// Wait for activity start.
return handled;
}
- }, false /* afterKeyguardGone */);
+ }, afterKeyguardGone);
return true;
} else {
return super.onClickHandler(view, pendingIntent, fillInIntent);
@@ -1440,6 +1443,9 @@
public void onClick(final View v) {
final boolean keyguardShowing = mStatusBarKeyguardViewManager.isShowing();
+ final boolean afterKeyguardGone = mIntent.isActivity()
+ && PreviewInflater.wouldLaunchResolverActivity(mContext, mIntent.getIntent(),
+ mCurrentUserId);
dismissKeyguardThenExecute(new OnDismissAction() {
public boolean onDismiss() {
if (mIsHeadsUp) {
@@ -1448,7 +1454,7 @@
AsyncTask.execute(new Runnable() {
@Override
public void run() {
- if (keyguardShowing) {
+ if (keyguardShowing && !afterKeyguardGone) {
try {
ActivityManagerNative.getDefault()
.keyguardWaitingForActivityDrawn();
@@ -1472,7 +1478,8 @@
// TODO: Dismiss Keyguard.
}
if (mIntent.isActivity()) {
- overrideActivityPendingAppTransition(keyguardShowing);
+ overrideActivityPendingAppTransition(keyguardShowing
+ && !afterKeyguardGone);
}
}
@@ -1490,7 +1497,7 @@
return mIntent != null && mIntent.isActivity();
}
- }, false /* afterKeyguardGone */);
+ }, afterKeyguardGone);
}
}
@@ -1625,7 +1632,7 @@
}
}
boolean showOnKeyguard = shouldShowOnKeyguard(entry.notification);
- if ((isLockscreenPublicMode() && !showOnKeyguard) ||
+ if ((isLockscreenPublicMode() && !mShowLockscreenNotifications) ||
(onKeyguard && (visibleNotifications >= maxKeyguardNotifications
|| !showOnKeyguard))) {
entry.row.setVisibility(View.GONE);
@@ -1776,7 +1783,7 @@
oldEntry.notification.getNotification().tickerText);
final boolean shouldInterrupt = shouldInterrupt(notification);
- final boolean alertAgain = alertAgain(oldEntry);
+ final boolean alertAgain = alertAgain(oldEntry, n);
boolean updateSuccessful = false;
if (contentsUnchanged && bigContentsUnchanged && headsUpContentsUnchanged
&& publicUnchanged) {
@@ -1940,10 +1947,9 @@
}
}
- private boolean alertAgain(Entry entry) {
- final StatusBarNotification sbn = entry.notification;
- return entry == null || !entry.hasInterrupted()
- || (sbn.getNotification().flags & Notification.FLAG_ONLY_ALERT_ONCE) == 0;
+ private boolean alertAgain(Entry oldEntry, Notification newNotification) {
+ return oldEntry == null || !oldEntry.hasInterrupted()
+ || (newNotification.flags & Notification.FLAG_ONLY_ALERT_ONCE) == 0;
}
protected boolean shouldInterrupt(StatusBarNotification sbn) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java b/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java
index 5883c26..740211f 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java
@@ -27,17 +27,21 @@
import com.android.systemui.R;
import com.android.systemui.statusbar.policy.NetworkControllerImpl;
+import com.android.systemui.statusbar.policy.SecurityController;
// Intimately tied to the design of res/layout/signal_cluster_view.xml
public class SignalClusterView
extends LinearLayout
- implements NetworkControllerImpl.SignalCluster {
+ implements NetworkControllerImpl.SignalCluster,
+ SecurityController.SecurityControllerCallback {
static final String TAG = "SignalClusterView";
static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
NetworkControllerImpl mNC;
+ SecurityController mSC;
+ private boolean mVpnVisible = false;
private boolean mWifiVisible = false;
private int mWifiStrengthId = 0;
private boolean mMobileVisible = false;
@@ -48,7 +52,7 @@
private boolean mRoaming;
ViewGroup mWifiGroup, mMobileGroup;
- ImageView mWifi, mMobile, mMobileType, mAirplane;
+ ImageView mVpn, mWifi, mMobile, mMobileType, mAirplane;
View mWifiAirplaneSpacer;
public SignalClusterView(Context context) {
@@ -68,10 +72,18 @@
mNC = nc;
}
+ public void setSecurityController(SecurityController sc) {
+ if (DEBUG) Log.d(TAG, "SecurityController=" + sc);
+ mSC = sc;
+ mSC.addCallback(this);
+ mVpnVisible = mSC.isVpnEnabled();
+ }
+
@Override
protected void onAttachedToWindow() {
super.onAttachedToWindow();
+ mVpn = (ImageView) findViewById(R.id.vpn);
mWifiGroup = (ViewGroup) findViewById(R.id.wifi_combo);
mWifi = (ImageView) findViewById(R.id.wifi_signal);
mMobileGroup = (ViewGroup) findViewById(R.id.mobile_combo);
@@ -85,6 +97,7 @@
@Override
protected void onDetachedFromWindow() {
+ mVpn = null;
mWifiGroup = null;
mWifi = null;
mMobileGroup = null;
@@ -95,6 +108,18 @@
super.onDetachedFromWindow();
}
+ // From SecurityController.
+ @Override
+ public void onStateChanged() {
+ post(new Runnable() {
+ @Override
+ public void run() {
+ mVpnVisible = mSC.isVpnEnabled();
+ apply();
+ }
+ });
+ }
+
@Override
public void setWifiIndicators(boolean visible, int strengthIcon, String contentDescription) {
mWifiVisible = visible;
@@ -168,6 +193,8 @@
private void apply() {
if (mWifiGroup == null) return;
+ mVpn.setVisibility(mVpnVisible ? View.VISIBLE : View.GONE);
+ if (DEBUG) Log.d(TAG, String.format("vpn: %s", mVpnVisible ? "VISIBLE" : "GONE"));
if (mWifiVisible) {
mWifi.setImageResource(mWifiStrengthId);
mWifiGroup.setContentDescription(mWifiDescription);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ActivityStarter.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ActivityStarter.java
index 9dfbb27..23810f9 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ActivityStarter.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ActivityStarter.java
@@ -24,5 +24,5 @@
* Keyguard.
*/
public interface ActivityStarter {
- public void startActivity(Intent intent, boolean dismissShade, boolean afterKeyguardGone);
+ public void startActivity(Intent intent, boolean dismissShade);
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
index f9da30f..e84ca52 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
@@ -315,15 +315,15 @@
public void launchCamera() {
mFlashlightController.killFlashlight();
Intent intent = getCameraIntent();
- boolean wouldLaunchResolverActivity = mPreviewInflater.wouldLaunchResolverActivity(intent);
+ boolean wouldLaunchResolverActivity = PreviewInflater.wouldLaunchResolverActivity(
+ mContext, intent, mLockPatternUtils.getCurrentUser());
if (intent == SECURE_CAMERA_INTENT && !wouldLaunchResolverActivity) {
mContext.startActivityAsUser(intent, UserHandle.CURRENT);
} else {
// We need to delay starting the activity because ResolverActivity finishes itself if
// launched behind lockscreen.
- mActivityStarter.startActivity(intent, false /* dismissShade */,
- wouldLaunchResolverActivity /* afterKeyguardGone */);
+ mActivityStarter.startActivity(intent, false /* dismissShade */);
}
}
@@ -337,8 +337,7 @@
}
});
} else {
- mActivityStarter.startActivity(PHONE_INTENT, false /* dismissShade */,
- mPreviewInflater.wouldLaunchResolverActivity(PHONE_INTENT));
+ mActivityStarter.startActivity(PHONE_INTENT, false /* dismissShade */);
}
}
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 861bf4a..128c687 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -149,6 +149,7 @@
import com.android.systemui.statusbar.policy.LocationControllerImpl;
import com.android.systemui.statusbar.policy.NetworkControllerImpl;
import com.android.systemui.statusbar.policy.NextAlarmController;
+import com.android.systemui.statusbar.policy.PreviewInflater;
import com.android.systemui.statusbar.policy.RotationLockControllerImpl;
import com.android.systemui.statusbar.policy.SecurityControllerImpl;
import com.android.systemui.statusbar.policy.UserInfoController;
@@ -786,8 +787,11 @@
mNetworkController.addSignalCluster(signalCluster);
mNetworkController.addSignalCluster(signalClusterKeyguard);
mNetworkController.addSignalCluster(signalClusterQs);
+ signalCluster.setSecurityController(mSecurityController);
signalCluster.setNetworkController(mNetworkController);
+ signalClusterKeyguard.setSecurityController(mSecurityController);
signalClusterKeyguard.setNetworkController(mNetworkController);
+ signalClusterQs.setSecurityController(mSecurityController);
signalClusterQs.setNetworkController(mNetworkController);
final boolean isAPhone = mNetworkController.hasVoiceCallingFeature();
if (isAPhone) {
@@ -2067,8 +2071,8 @@
}
@Override
- public void startActivity(Intent intent, boolean dismissShade, boolean afterKeyguardGone) {
- startActivityDismissingKeyguard(intent, false, dismissShade, afterKeyguardGone);
+ public void startActivity(Intent intent, boolean dismissShade) {
+ startActivityDismissingKeyguard(intent, false, dismissShade);
}
public ScrimController getScrimController() {
@@ -2957,9 +2961,11 @@
}
public void startActivityDismissingKeyguard(final Intent intent, boolean onlyProvisioned,
- final boolean dismissShade, final boolean afterKeyguardGone) {
+ final boolean dismissShade) {
if (onlyProvisioned && !isDeviceProvisioned()) return;
+ final boolean afterKeyguardGone = PreviewInflater.wouldLaunchResolverActivity(
+ mContext, intent, mCurrentUserId);
final boolean keyguardShowing = mStatusBarKeyguardViewManager.isShowing();
dismissKeyguardThenExecute(new OnDismissAction() {
@Override
@@ -3308,8 +3314,7 @@
}
private void handleStartSettingsActivity(Intent intent, boolean onlyProvisioned) {
- startActivityDismissingKeyguard(intent, onlyProvisioned, true /* dismissShade */,
- false /* afterKeyguardGone */);
+ startActivityDismissingKeyguard(intent, onlyProvisioned, true /* dismissShade */);
}
private static class FastColorDrawable extends Drawable {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeaderView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeaderView.java
index eeb97e3..15a7229 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeaderView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeaderView.java
@@ -497,20 +497,19 @@
} else if (v == mAlarmStatus && mNextAlarm != null) {
PendingIntent showIntent = mNextAlarm.getShowIntent();
if (showIntent != null && showIntent.isActivity()) {
- mActivityStarter.startActivity(showIntent.getIntent(), true /* dismissShade */,
- false /* afterKeyguardGone */);
+ mActivityStarter.startActivity(showIntent.getIntent(), true /* dismissShade */);
}
}
}
private void startSettingsActivity() {
mActivityStarter.startActivity(new Intent(android.provider.Settings.ACTION_SETTINGS),
- true /* dismissShade */, false /* afterKeyguardGone */);
+ true /* dismissShade */);
}
private void startBatteryActivity() {
mActivityStarter.startActivity(new Intent(Intent.ACTION_POWER_USAGE_SUMMARY),
- true /* dismissShade */, false /* afterKeyguardGone */);
+ true /* dismissShade */);
}
public void setQSPanel(QSPanel qsp) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java
index 4a6f1a8..f04d6a5 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java
@@ -928,8 +928,8 @@
intent.getParcelableExtra(WifiManager.EXTRA_NETWORK_INFO);
boolean wasConnected = mWifiConnected;
mWifiConnected = networkInfo != null && networkInfo.isConnected();
- // If we just connected, grab the inintial signal strength and ssid
- if (mWifiConnected && !wasConnected) {
+ // If Connected grab the signal strength and ssid
+ if (mWifiConnected) {
// try getting it out of the intent first
WifiInfo info = (WifiInfo) intent.getParcelableExtra(WifiManager.EXTRA_WIFI_INFO);
if (info == null) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/PreviewInflater.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/PreviewInflater.java
index cdbe494..030cd6d 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/PreviewInflater.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/PreviewInflater.java
@@ -20,14 +20,12 @@
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
-import android.content.pm.UserInfo;
import android.os.UserHandle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import com.android.internal.widget.LockPatternUtils;
-import com.android.keyguard.KeyguardActivityLauncher;
import com.android.systemui.statusbar.phone.KeyguardPreviewContainer;
import java.util.List;
@@ -107,20 +105,21 @@
return info;
}
- public boolean wouldLaunchResolverActivity(Intent intent) {
- PackageManager packageManager = mContext.getPackageManager();
+ public static boolean wouldLaunchResolverActivity(Context ctx, Intent intent,
+ int currentUserId) {
+ PackageManager packageManager = ctx.getPackageManager();
final List<ResolveInfo> appList = packageManager.queryIntentActivitiesAsUser(
- intent, PackageManager.MATCH_DEFAULT_ONLY, mLockPatternUtils.getCurrentUser());
+ intent, PackageManager.MATCH_DEFAULT_ONLY, currentUserId);
if (appList.size() == 0) {
return false;
}
ResolveInfo resolved = packageManager.resolveActivityAsUser(intent,
- PackageManager.MATCH_DEFAULT_ONLY | PackageManager.GET_META_DATA,
- mLockPatternUtils.getCurrentUser());
+ PackageManager.MATCH_DEFAULT_ONLY | PackageManager.GET_META_DATA, currentUserId);
return wouldLaunchResolverActivity(resolved, appList);
}
- private boolean wouldLaunchResolverActivity(ResolveInfo resolved, List<ResolveInfo> appList) {
+ private static boolean wouldLaunchResolverActivity(
+ ResolveInfo resolved, List<ResolveInfo> appList) {
// If the list contains the above resolved activity, then it can't be
// ResolverActivity itself.
for (int i = 0; i < appList.size(); i++) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/SecurityControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/SecurityControllerImpl.java
index a15ddaf..2fbb812 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/SecurityControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/SecurityControllerImpl.java
@@ -139,14 +139,14 @@
}
@Override
- public void addCallback(SecurityControllerCallback callback) {
+ public void removeCallback(SecurityControllerCallback callback) {
if (callback == null) return;
if (DEBUG) Log.d(TAG, "removeCallback " + callback);
mCallbacks.remove(callback);
}
@Override
- public void removeCallback(SecurityControllerCallback callback) {
+ public void addCallback(SecurityControllerCallback callback) {
if (callback == null || mCallbacks.contains(callback)) return;
if (DEBUG) Log.d(TAG, "addCallback " + callback);
mCallbacks.add(callback);
diff --git a/packages/SystemUI/src/com/android/systemui/volume/VolumeUI.java b/packages/SystemUI/src/com/android/systemui/volume/VolumeUI.java
index acb4827..0586a83 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/VolumeUI.java
+++ b/packages/SystemUI/src/com/android/systemui/volume/VolumeUI.java
@@ -140,8 +140,7 @@
@Override
public void run() {
getComponent(PhoneStatusBar.class).startActivityDismissingKeyguard(
- ZenModePanel.ZEN_SETTINGS, true /* onlyProvisioned */, true /* dismissShade */,
- false /* afterKeyguardGone */);
+ ZenModePanel.ZEN_SETTINGS, true /* onlyProvisioned */, true /* dismissShade */);
mPanel.postDismiss(mDismissDelay);
}
};
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
index cd3eab5..ab311c04 100644
--- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -4240,14 +4240,17 @@
int result;
boolean isWakeKey = (policyFlags & WindowManagerPolicy.FLAG_WAKE) != 0
|| event.isWakeKey();
- if (interactive
- || (isInjected && !isWakeKey)
- || (!interactive && shouldDispatchInputWhenNonInteractive())) {
- // When the device is interactive, the key is injected, or we're currently dozing in a
- // non-interactive state with the screen on and the keyguard showing, pass the key to
- // the application.
+ if (interactive || (isInjected && !isWakeKey)) {
+ // When the device is interactive or the key is injected pass the key to the
+ // application.
result = ACTION_PASS_TO_USER;
isWakeKey = false;
+ } else if (!interactive && shouldDispatchInputWhenNonInteractive()) {
+ // If we're currently dozing with the screen on and the keyguard showing, pass the key
+ // to the application but preserve its wake key status to make sure we still move
+ // from dozing to fully interactive if we would normally go from off to fully
+ // interactive.
+ result = ACTION_PASS_TO_USER;
} else {
// When the screen is off and the key is not injected, determine whether
// to wake the device but don't pass the key to the application.
diff --git a/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java b/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java
index a43a2a6..ebe21ff 100644
--- a/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java
+++ b/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java
@@ -746,14 +746,16 @@
}
/**
- * Gets the bounds of the accessibility focus in the active window.
+ * Gets a point within the accessibility focused node where we can send down
+ * and up events to perform a click.
*
- * @param outBounds The output to which to write the focus bounds.
- * @return Whether accessibility focus was found and the bounds are populated.
+ * @param outPoint The click point to populate.
+ * @return Whether accessibility a click point was found and set.
*/
// TODO: (multi-display) Make sure this works for multiple displays.
- boolean getAccessibilityFocusBounds(Rect outBounds) {
- return getInteractionBridgeLocked().getAccessibilityFocusBoundsNotLocked(outBounds);
+ boolean getAccessibilityFocusClickPointInScreen(Point outPoint) {
+ return getInteractionBridgeLocked()
+ .getAccessibilityFocusClickPointInScreenNotLocked(outPoint);
}
/**
@@ -2196,8 +2198,8 @@
MagnificationSpec spec = getCompatibleMagnificationSpecLocked(resolvedWindowId);
try {
connection.findAccessibilityNodeInfosByViewId(accessibilityNodeId, viewIdResName,
- partialInteractiveRegion, interactionId, callback, mFetchFlags, interrogatingPid,
- interrogatingTid, spec);
+ partialInteractiveRegion, interactionId, callback, mFetchFlags,
+ interrogatingPid, interrogatingTid, spec);
return true;
} catch (RemoteException re) {
if (DEBUG) {
@@ -2248,8 +2250,8 @@
MagnificationSpec spec = getCompatibleMagnificationSpecLocked(resolvedWindowId);
try {
connection.findAccessibilityNodeInfosByText(accessibilityNodeId, text,
- partialInteractiveRegion, interactionId, callback, mFetchFlags, interrogatingPid,
- interrogatingTid, spec);
+ partialInteractiveRegion, interactionId, callback, mFetchFlags,
+ interrogatingPid, interrogatingTid, spec);
return true;
} catch (RemoteException re) {
if (DEBUG) {
@@ -2352,8 +2354,9 @@
final long identityToken = Binder.clearCallingIdentity();
MagnificationSpec spec = getCompatibleMagnificationSpecLocked(resolvedWindowId);
try {
- connection.findFocus(accessibilityNodeId, focusType, partialInteractiveRegion, interactionId,
- callback, mFetchFlags, interrogatingPid, interrogatingTid, spec);
+ connection.findFocus(accessibilityNodeId, focusType, partialInteractiveRegion,
+ interactionId, callback, mFetchFlags, interrogatingPid, interrogatingTid,
+ spec);
return true;
} catch (RemoteException re) {
if (DEBUG) {
@@ -2403,8 +2406,9 @@
final long identityToken = Binder.clearCallingIdentity();
MagnificationSpec spec = getCompatibleMagnificationSpecLocked(resolvedWindowId);
try {
- connection.focusSearch(accessibilityNodeId, direction, partialInteractiveRegion, interactionId,
- callback, mFetchFlags, interrogatingPid, interrogatingTid, spec);
+ connection.focusSearch(accessibilityNodeId, direction, partialInteractiveRegion,
+ interactionId, callback, mFetchFlags, interrogatingPid, interrogatingTid,
+ spec);
return true;
} catch (RemoteException re) {
if (DEBUG) {
@@ -2460,6 +2464,7 @@
return true;
}
+ @Override
public boolean performGlobalAction(int action) {
synchronized (mLock) {
// We treat calls from a profile as if made by its parent as profiles
@@ -2501,6 +2506,57 @@
}
@Override
+ public boolean computeClickPointInScreen(int accessibilityWindowId,
+ long accessibilityNodeId, int interactionId,
+ IAccessibilityInteractionConnectionCallback callback, long interrogatingTid)
+ throws RemoteException {
+ final int resolvedWindowId;
+ IAccessibilityInteractionConnection connection = null;
+ Region partialInteractiveRegion = mTempRegion;
+ synchronized (mLock) {
+ // We treat calls from a profile as if made by its parent as profiles
+ // share the accessibility state of the parent. The call below
+ // performs the current profile parent resolution.
+ final int resolvedUserId = mSecurityPolicy
+ .resolveCallingUserIdEnforcingPermissionsLocked(
+ UserHandle.getCallingUserId());
+ if (resolvedUserId != mCurrentUserId) {
+ return false;
+ }
+ resolvedWindowId = resolveAccessibilityWindowIdLocked(accessibilityWindowId);
+ final boolean permissionGranted =
+ mSecurityPolicy.canRetrieveWindowContentLocked(this);
+ if (!permissionGranted) {
+ return false;
+ } else {
+ connection = getConnectionLocked(resolvedWindowId);
+ if (connection == null) {
+ return false;
+ }
+ }
+ if (!mSecurityPolicy.computePartialInteractiveRegionForWindowLocked(
+ resolvedWindowId, partialInteractiveRegion)) {
+ partialInteractiveRegion = null;
+ }
+ }
+ final int interrogatingPid = Binder.getCallingPid();
+ final long identityToken = Binder.clearCallingIdentity();
+ MagnificationSpec spec = getCompatibleMagnificationSpecLocked(resolvedWindowId);
+ try {
+ connection.computeClickPointInScreen(accessibilityNodeId, partialInteractiveRegion,
+ interactionId, callback, interrogatingPid, interrogatingTid, spec);
+ return true;
+ } catch (RemoteException re) {
+ if (DEBUG) {
+ Slog.e(LOG_TAG, "Error computeClickPointInScreen().");
+ }
+ } finally {
+ Binder.restoreCallingIdentity(identityToken);
+ }
+ return false;
+ }
+
+ @Override
public void dump(FileDescriptor fd, final PrintWriter pw, String[] args) {
mSecurityPolicy.enforceCallingPermission(Manifest.permission.DUMP, FUNCTION_DUMP);
synchronized (mLock) {
@@ -3119,30 +3175,43 @@
}
}
- public boolean getAccessibilityFocusBoundsNotLocked(Rect outBounds) {
+ public boolean getAccessibilityFocusClickPointInScreenNotLocked(Point outPoint) {
AccessibilityNodeInfo focus = getAccessibilityFocusNotLocked();
if (focus == null) {
return false;
}
synchronized (mLock) {
- focus.getBoundsInScreen(outBounds);
+ Point point = mClient.computeClickPointInScreen(mConnectionId,
+ focus.getWindowId(), focus.getSourceNodeId());
+
+ if (point == null) {
+ return false;
+ }
MagnificationSpec spec = getCompatibleMagnificationSpecLocked(focus.getWindowId());
if (spec != null && !spec.isNop()) {
- outBounds.offset((int) -spec.offsetX, (int) -spec.offsetY);
- outBounds.scale(1 / spec.scale);
+ point.offset((int) -spec.offsetX, (int) -spec.offsetY);
+ point.x = (int) (point.x * (1 / spec.scale));
+ point.y = (int) (point.y * (1 / spec.scale));
}
- // Clip to the window rectangle.
+ // Make sure the point is within the window.
Rect windowBounds = mTempRect;
getActiveWindowBounds(windowBounds);
- outBounds.intersect(windowBounds);
+ if (!windowBounds.contains(point.x, point.y)) {
+ return false;
+ }
- // Clip to the screen rectangle.
- mDefaultDisplay.getRealSize(mTempPoint);
- outBounds.intersect(0, 0, mTempPoint.x, mTempPoint.y);
+ // Make sure the point is within the screen.
+ Point screenSize = mTempPoint;
+ mDefaultDisplay.getRealSize(screenSize);
+ if (point.x < 0 || point.x > screenSize.x
+ || point.y < 0 || point.y > screenSize.y) {
+ return false;
+ }
+ outPoint.set(point.x, point.y);
return true;
}
}
diff --git a/services/accessibility/java/com/android/server/accessibility/TouchExplorer.java b/services/accessibility/java/com/android/server/accessibility/TouchExplorer.java
index ac0ca0a..9e63433 100644
--- a/services/accessibility/java/com/android/server/accessibility/TouchExplorer.java
+++ b/services/accessibility/java/com/android/server/accessibility/TouchExplorer.java
@@ -24,6 +24,7 @@
import android.gesture.GestureStore;
import android.gesture.GestureStroke;
import android.gesture.Prediction;
+import android.graphics.Point;
import android.graphics.Rect;
import android.os.Handler;
import android.os.SystemClock;
@@ -171,6 +172,9 @@
// Temporary rectangle to avoid instantiation.
private final Rect mTempRect = new Rect();
+ // Temporary point to avoid instantiation.
+ private final Point mTempPoint = new Point();
+
// Context in which this explorer operates.
private final Context mContext;
@@ -1157,18 +1161,18 @@
mInjectedPointerTracker.getLastInjectedHoverEventForClick();
if (lastExploreEvent == null) {
// No last touch explored event but there is accessibility focus in
- // the active window. We click in the middle of the focus bounds.
- Rect focusBounds = mTempRect;
- if (mAms.getAccessibilityFocusBounds(focusBounds)) {
- clickLocationX = focusBounds.centerX();
- clickLocationY = focusBounds.centerY();
+ // the active window. We click in the focus bounds.
+ Point point = mTempPoint;
+ if (mAms.getAccessibilityFocusClickPointInScreen(point)) {
+ clickLocationX = point.x;
+ clickLocationY = point.y;
} else {
// Out of luck - do nothing.
return;
}
} else {
// If the click is within the active window but not within the
- // accessibility focus bounds we click in the focus center.
+ // accessibility focus bounds we click in the focus bounds.
final int lastExplorePointerIndex = lastExploreEvent.getActionIndex();
clickLocationX = (int) lastExploreEvent.getX(lastExplorePointerIndex);
clickLocationY = (int) lastExploreEvent.getY(lastExplorePointerIndex);
@@ -1176,12 +1180,10 @@
if (mLastTouchedWindowId == mAms.getActiveWindowId()) {
mAms.getActiveWindowBounds(activeWindowBounds);
if (activeWindowBounds.contains(clickLocationX, clickLocationY)) {
- Rect focusBounds = mTempRect;
- if (mAms.getAccessibilityFocusBounds(focusBounds)) {
- if (!focusBounds.contains(clickLocationX, clickLocationY)) {
- clickLocationX = focusBounds.centerX();
- clickLocationY = focusBounds.centerY();
- }
+ Point point = mTempPoint;
+ if (mAms.getAccessibilityFocusClickPointInScreen(point)) {
+ clickLocationX = point.x;
+ clickLocationY = point.y;
}
}
}
@@ -1330,18 +1332,18 @@
mInjectedPointerTracker.getLastInjectedHoverEventForClick();
if (lastExploreEvent == null) {
// No last touch explored event but there is accessibility focus in
- // the active window. We click in the middle of the focus bounds.
- Rect focusBounds = mTempRect;
- if (mAms.getAccessibilityFocusBounds(focusBounds)) {
- clickLocationX = focusBounds.centerX();
- clickLocationY = focusBounds.centerY();
+ // the active window. We click in the focus bounds.
+ Point point = mTempPoint;
+ if (mAms.getAccessibilityFocusClickPointInScreen(point)) {
+ clickLocationX = point.x;
+ clickLocationY = point.y;
} else {
// Out of luck - do nothing.
return;
}
} else {
// If the click is within the active window but not within the
- // accessibility focus bounds we click in the focus center.
+ // accessibility focus bounds we click in the focus bounds.
final int lastExplorePointerIndex = lastExploreEvent.getActionIndex();
clickLocationX = (int) lastExploreEvent.getX(lastExplorePointerIndex);
clickLocationY = (int) lastExploreEvent.getY(lastExplorePointerIndex);
@@ -1349,12 +1351,10 @@
if (mLastTouchedWindowId == mAms.getActiveWindowId()) {
mAms.getActiveWindowBounds(activeWindowBounds);
if (activeWindowBounds.contains(clickLocationX, clickLocationY)) {
- Rect focusBounds = mTempRect;
- if (mAms.getAccessibilityFocusBounds(focusBounds)) {
- if (!focusBounds.contains(clickLocationX, clickLocationY)) {
- clickLocationX = focusBounds.centerX();
- clickLocationY = focusBounds.centerY();
- }
+ Point point = mTempPoint;
+ if (mAms.getAccessibilityFocusClickPointInScreen(point)) {
+ clickLocationX = point.x;
+ clickLocationY = point.y;
}
}
}
diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java
index 3bab1bf..9412465 100644
--- a/services/core/java/com/android/server/ConnectivityService.java
+++ b/services/core/java/com/android/server/ConnectivityService.java
@@ -425,8 +425,8 @@
TelephonyManager mTelephonyManager;
- // sequence number for Networks
- private final static int MIN_NET_ID = 10; // some reserved marks
+ // sequence number for Networks; keep in sync with system/netd/NetworkController.cpp
+ private final static int MIN_NET_ID = 100; // some reserved marks
private final static int MAX_NET_ID = 65535;
private int mNextNetId = MIN_NET_ID;
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index 1397ea4..a9a4732 100755
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -196,6 +196,7 @@
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;
+import dalvik.system.VMRuntime;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
@@ -3124,6 +3125,11 @@
requiredAbi = Build.SUPPORTED_ABIS[0];
}
+ String instructionSet = null;
+ if (app.info.primaryCpuAbi != null) {
+ instructionSet = VMRuntime.getInstructionSet(app.info.primaryCpuAbi);
+ }
+
// Start the process. It will either succeed and return a result containing
// the PID of the new process, or else throw a RuntimeException.
boolean isActivityProcess = (entryPoint == null);
@@ -3131,7 +3137,8 @@
checkTime(startTime, "startProcess: asking zygote to start proc");
Process.ProcessStartResult startResult = Process.start(entryPoint,
app.processName, uid, uid, gids, debugFlags, mountExternal,
- app.info.targetSdkVersion, app.info.seinfo, requiredAbi, entryPointArgs);
+ app.info.targetSdkVersion, app.info.seinfo, requiredAbi, instructionSet,
+ entryPointArgs);
checkTime(startTime, "startProcess: returned from zygote!");
if (app.isolated) {
diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java
index 6168546..bcf3b17 100755
--- a/services/core/java/com/android/server/am/ActivityStack.java
+++ b/services/core/java/com/android/server/am/ActivityStack.java
@@ -425,13 +425,13 @@
}
final ActivityRecord topActivity() {
- // Iterate to find the first non-empty task stack. Note that this code can
- // be simplified once we stop storing tasks with empty mActivities lists.
for (int taskNdx = mTaskHistory.size() - 1; taskNdx >= 0; --taskNdx) {
ArrayList<ActivityRecord> activities = mTaskHistory.get(taskNdx).mActivities;
- final int topActivityNdx = activities.size() - 1;
- if (topActivityNdx >= 0) {
- return activities.get(topActivityNdx);
+ for (int activityNdx = activities.size() - 1; activityNdx >= 0; --activityNdx) {
+ final ActivityRecord r = activities.get(activityNdx);
+ if (!r.finishing) {
+ return r;
+ }
}
}
return null;
diff --git a/services/core/java/com/android/server/am/ActivityStackSupervisor.java b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
index f821daf..b8261a4 100644
--- a/services/core/java/com/android/server/am/ActivityStackSupervisor.java
+++ b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
@@ -1772,7 +1772,7 @@
if (intentActivity != null) {
if (isLockTaskModeViolation(intentActivity.task)) {
showLockTaskToast();
- Slog.e(TAG, "moveTaskToFront: Attempt to violate Lock Task Mode");
+ Slog.e(TAG, "startActivityUnchecked: Attempt to violate Lock Task Mode");
return ActivityManager.START_RETURN_LOCK_TASK_MODE_VIOLATION;
}
if (r.task == null) {
@@ -2783,9 +2783,8 @@
}
// A non-top activity is reporting a visibility change.
- if ((visible && (top.fullscreen || top.state != ActivityState.RESUMED)) ||
- top.app == null || top.app.thread == null) {
- // Can't carry out this request.
+ if (visible && top.fullscreen) {
+ // Let the caller know that it can't be seen.
if (DEBUG_VISIBLE_BEHIND) Slog.d(TAG, "requestVisibleBehind: returning top.fullscreen="
+ top.fullscreen + " top.state=" + top.state + " top.app=" + top.app +
" top.app.thread=" + top.app.thread);
@@ -2807,9 +2806,12 @@
mService.convertFromTranslucent(next.appToken);
}
}
- try {
- top.app.thread.scheduleBackgroundVisibleBehindChanged(top.appToken, visible);
- } catch (RemoteException e) {
+ if (top.app != null && top.app.thread != null) {
+ // Notify the top app of the change.
+ try {
+ top.app.thread.scheduleBackgroundVisibleBehindChanged(top.appToken, visible);
+ } catch (RemoteException e) {
+ }
}
return true;
}
diff --git a/services/core/java/com/android/server/input/InputManagerService.java b/services/core/java/com/android/server/input/InputManagerService.java
index bbb8371..9c567ac 100644
--- a/services/core/java/com/android/server/input/InputManagerService.java
+++ b/services/core/java/com/android/server/input/InputManagerService.java
@@ -697,7 +697,9 @@
synchronized (mDataStore) {
for (int i = 0; i < numFullKeyboards; i++) {
final InputDevice inputDevice = mTempFullKeyboards.get(i);
- if (mDataStore.getCurrentKeyboardLayout(inputDevice.getDescriptor()) == null) {
+ final String layout =
+ getCurrentKeyboardLayoutForInputDevice(inputDevice.getIdentifier());
+ if (layout == null) {
missingLayoutForExternalKeyboard = true;
if (i < numFullKeyboardsAdded) {
missingLayoutForExternalKeyboardAdded = true;
diff --git a/services/core/java/com/android/server/location/GpsLocationProvider.java b/services/core/java/com/android/server/location/GpsLocationProvider.java
index 0cb8eb8..11818d8 100644
--- a/services/core/java/com/android/server/location/GpsLocationProvider.java
+++ b/services/core/java/com/android/server/location/GpsLocationProvider.java
@@ -331,6 +331,7 @@
private int mSuplServerPort;
private String mC2KServerHost;
private int mC2KServerPort;
+ private boolean mSuplEsEnabled = false;
private final Context mContext;
private final NtpTrustedTime mNtpTime;
@@ -493,6 +494,7 @@
Log.d(TAG, "SIM STATE is ready, SIM MCC/MNC is " + mccMnc);
synchronized (mLock) {
reloadGpsProperties(context, mProperties);
+ mNIHandler.setSuplEsEnablement(mSuplEsEnabled);
}
}
}
@@ -570,6 +572,16 @@
} catch (IOException ex) {
Log.w(TAG, "failed to dump properties contents");
}
+
+ // SUPL_ES configuration.
+ String suplESProperty = mProperties.getProperty("SUPL_ES");
+ if (suplESProperty != null) {
+ try {
+ mSuplEsEnabled = (Integer.parseInt(suplESProperty) == 1);
+ } catch (NumberFormatException e) {
+ Log.e(TAG, "unable to parse SUPL_ES: " + suplESProperty);
+ }
+ }
}
private void loadPropertiesFromResource(Context context,
@@ -611,7 +623,6 @@
mContext = context;
mNtpTime = NtpTrustedTime.getInstance(context);
mILocationManager = ilocationManager;
- mNIHandler = new GpsNetInitiatedHandler(context);
mLocation.setExtras(mLocationExtras);
@@ -638,6 +649,11 @@
mProperties = new Properties();
reloadGpsProperties(mContext, mProperties);
+ // Create a GPS net-initiated handler.
+ mNIHandler = new GpsNetInitiatedHandler(context,
+ mNetInitiatedListener,
+ mSuplEsEnabled);
+
// construct handler, listen for events
mHandler = new ProviderHandler(looper);
listenForBroadcasts();
diff --git a/services/core/java/com/android/server/notification/DowntimeConditionProvider.java b/services/core/java/com/android/server/notification/DowntimeConditionProvider.java
index 317ebef..b71bad8 100644
--- a/services/core/java/com/android/server/notification/DowntimeConditionProvider.java
+++ b/services/core/java/com/android/server/notification/DowntimeConditionProvider.java
@@ -43,6 +43,7 @@
import java.util.Date;
import java.util.Locale;
import java.util.Objects;
+import java.util.TimeZone;
/** Built-in zen condition provider for managing downtime */
public class DowntimeConditionProvider extends ConditionProviderService {
@@ -275,6 +276,9 @@
final long schTime = intent.getLongExtra(EXTRA_TIME, 0);
if (DEBUG) Slog.d(TAG, String.format("%s scheduled for %s, fired at %s, delta=%s",
action, ts(schTime), ts(now), now - schTime));
+ } else if (Intent.ACTION_TIMEZONE_CHANGED.equals(action)) {
+ if (DEBUG) Slog.d(TAG, "timezone changed to " + TimeZone.getDefault());
+ mCalendar.setTimeZone(TimeZone.getDefault());
} else {
if (DEBUG) Slog.d(TAG, action + " fired at " + now);
}
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java
index 54f043d..a56f783 100644
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -2648,6 +2648,11 @@
if (speedBumpIndex == -1 &&
// Intrusiveness trumps priority, hence ignore intrusives.
!record.isRecentlyIntrusive() &&
+ // Currently, package priority is either PRIORITY_DEFAULT or PRIORITY_MAX, so
+ // scanning for PRIORITY_MIN within the package bucket PRIORITY_DEFAULT
+ // (or lower as a safeguard) is sufficient to find the speedbump index.
+ // We'll have to revisit this when more package priority buckets are introduced.
+ record.getPackagePriority() <= Notification.PRIORITY_DEFAULT &&
record.sbn.getNotification().priority == Notification.PRIORITY_MIN) {
speedBumpIndex = keys.size() - 1;
}
diff --git a/services/core/java/com/android/server/notification/ZenModeHelper.java b/services/core/java/com/android/server/notification/ZenModeHelper.java
index 168328f..5639dad 100644
--- a/services/core/java/com/android/server/notification/ZenModeHelper.java
+++ b/services/core/java/com/android/server/notification/ZenModeHelper.java
@@ -18,7 +18,6 @@
import static android.media.AudioAttributes.USAGE_ALARM;
import static android.media.AudioAttributes.USAGE_NOTIFICATION_RINGTONE;
-import static android.media.AudioAttributes.USAGE_UNKNOWN;
import android.app.AppOpsManager;
import android.app.Notification;
@@ -225,11 +224,6 @@
muteCalls ? AppOpsManager.MODE_IGNORED : AppOpsManager.MODE_ALLOWED,
exceptionPackages);
- // restrict vibrations with no hints
- mAppOps.setRestriction(AppOpsManager.OP_VIBRATE, USAGE_UNKNOWN,
- zen ? AppOpsManager.MODE_IGNORED : AppOpsManager.MODE_ALLOWED,
- exceptionPackages);
-
// alarm restrictions
final boolean muteAlarms = mZenMode == Global.ZEN_MODE_NO_INTERRUPTIONS;
mAppOps.setRestriction(AppOpsManager.OP_VIBRATE, USAGE_ALARM,
diff --git a/services/core/java/com/android/server/pm/PackageInstallerService.java b/services/core/java/com/android/server/pm/PackageInstallerService.java
index 89ea905..496c136 100644
--- a/services/core/java/com/android/server/pm/PackageInstallerService.java
+++ b/services/core/java/com/android/server/pm/PackageInstallerService.java
@@ -42,7 +42,6 @@
import android.content.Intent;
import android.content.IntentSender;
import android.content.IntentSender.SendIntentException;
-import android.content.pm.ApplicationInfo;
import android.content.pm.IPackageInstaller;
import android.content.pm.IPackageInstallerCallback;
import android.content.pm.IPackageInstallerSession;
@@ -50,15 +49,11 @@
import android.content.pm.PackageInstaller.SessionInfo;
import android.content.pm.PackageInstaller.SessionParams;
import android.content.pm.PackageManager;
-import android.content.pm.PackageParser;
-import android.content.pm.PackageParser.PackageLite;
-import android.content.pm.PackageParser.PackageParserException;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Binder;
import android.os.Bundle;
import android.os.Environment;
-import android.os.Environment.UserEnvironment;
import android.os.FileUtils;
import android.os.Handler;
import android.os.HandlerThread;
@@ -70,7 +65,6 @@
import android.os.SELinux;
import android.os.UserHandle;
import android.os.UserManager;
-import android.os.storage.StorageManager;
import android.system.ErrnoException;
import android.system.Os;
import android.text.TextUtils;
@@ -126,6 +120,7 @@
private static final String ATTR_CREATED_MILLIS = "createdMillis";
private static final String ATTR_SESSION_STAGE_DIR = "sessionStageDir";
private static final String ATTR_SESSION_STAGE_CID = "sessionStageCid";
+ private static final String ATTR_PREPARED = "prepared";
private static final String ATTR_SEALED = "sealed";
private static final String ATTR_MODE = "mode";
private static final String ATTR_INSTALL_FLAGS = "installFlags";
@@ -148,7 +143,6 @@
private final Context mContext;
private final PackageManagerService mPm;
private final AppOpsManager mAppOps;
- private final StorageManager mStorage;
private final File mStagingDir;
private final HandlerThread mInstallThread;
@@ -190,7 +184,6 @@
mContext = context;
mPm = pm;
mAppOps = (AppOpsManager) mContext.getSystemService(Context.APP_OPS_SERVICE);
- mStorage = StorageManager.from(mContext);
mStagingDir = stagingDir;
@@ -266,7 +259,9 @@
try {
final int sessionId = allocateSessionIdLocked();
mLegacySessions.put(sessionId, true);
- return prepareInternalStageDir(sessionId);
+ final File stageDir = buildInternalStageDir(sessionId);
+ prepareInternalStageDir(stageDir);
+ return stageDir;
} catch (IllegalStateException e) {
throw new IOException(e);
}
@@ -345,6 +340,7 @@
final String stageDirRaw = readStringAttribute(in, ATTR_SESSION_STAGE_DIR);
final File stageDir = (stageDirRaw != null) ? new File(stageDirRaw) : null;
final String stageCid = readStringAttribute(in, ATTR_SESSION_STAGE_CID);
+ final boolean prepared = readBooleanAttribute(in, ATTR_PREPARED, true);
final boolean sealed = readBooleanAttribute(in, ATTR_SEALED);
final SessionParams params = new SessionParams(
@@ -362,7 +358,7 @@
return new PackageInstallerSession(mInternalCallback, mContext, mPm,
mInstallThread.getLooper(), sessionId, userId, installerPackageName, params,
- createdMillis, stageDir, stageCid, sealed);
+ createdMillis, stageDir, stageCid, prepared, sealed);
}
private void writeSessionsLocked() {
@@ -410,6 +406,7 @@
if (session.stageCid != null) {
writeStringAttribute(out, ATTR_SESSION_STAGE_CID, session.stageCid);
}
+ writeBooleanAttribute(out, ATTR_PREPARED, session.isPrepared());
writeBooleanAttribute(out, ATTR_SEALED, session.isSealed());
writeIntAttribute(out, ATTR_MODE, params.mode);
@@ -483,14 +480,10 @@
}
}
- // TODO: treat INHERIT_EXISTING as install for user
-
- // Figure out where we're going to be staging session data
- final boolean stageInternal;
-
- if (params.mode == SessionParams.MODE_FULL_INSTALL) {
- // Brand new install, use best resolved location. This also verifies
- // that target has enough free space for the install.
+ if (params.mode == SessionParams.MODE_FULL_INSTALL
+ || params.mode == SessionParams.MODE_INHERIT_EXISTING) {
+ // Resolve best location for install, based on combination of
+ // requested install flags, delta size, and manifest settings.
final long ident = Binder.clearCallingIdentity();
try {
final int resolved = PackageHelper.resolveInstallLocation(mContext,
@@ -498,46 +491,15 @@
params.installFlags);
if (resolved == PackageHelper.RECOMMEND_INSTALL_INTERNAL) {
- stageInternal = true;
+ params.setInstallFlagsInternal();
} else if (resolved == PackageHelper.RECOMMEND_INSTALL_EXTERNAL) {
- stageInternal = false;
+ params.setInstallFlagsExternal();
} else {
throw new IOException("No storage with enough free space; res=" + resolved);
}
} finally {
Binder.restoreCallingIdentity(ident);
}
- } else if (params.mode == SessionParams.MODE_INHERIT_EXISTING) {
- // Inheriting existing install, so stay on the same storage medium.
- final ApplicationInfo existingApp = mPm.getApplicationInfo(params.appPackageName, 0,
- userId);
- if (existingApp == null) {
- throw new IllegalStateException(
- "Missing existing app " + params.appPackageName);
- }
-
- final long existingSize;
- try {
- final PackageLite existingPkg = PackageParser.parsePackageLite(
- new File(existingApp.getCodePath()), 0);
- existingSize = PackageHelper.calculateInstalledSize(existingPkg, false,
- params.abiOverride);
- } catch (PackageParserException e) {
- throw new IllegalStateException(
- "Failed to calculate size of " + params.appPackageName);
- }
-
- if ((existingApp.flags & ApplicationInfo.FLAG_EXTERNAL_STORAGE) == 0) {
- // Internal we can link existing install into place, so we only
- // need enough space for the new data.
- checkInternalStorage(params.sizeBytes);
- stageInternal = true;
- } else {
- // External we're going to copy existing install into our
- // container, so we need footprint of both.
- checkExternalStorage(params.sizeBytes + existingSize);
- stageInternal = false;
- }
} else {
throw new IllegalArgumentException("Invalid install mode: " + params.mode);
}
@@ -563,15 +525,15 @@
// We're staging to exactly one location
File stageDir = null;
String stageCid = null;
- if (stageInternal) {
- stageDir = prepareInternalStageDir(sessionId);
+ if ((params.installFlags & PackageManager.INSTALL_INTERNAL) != 0) {
+ stageDir = buildInternalStageDir(sessionId);
} else {
- stageCid = prepareExternalStageCid(sessionId, params.sizeBytes);
+ stageCid = buildExternalStageCid(sessionId);
}
session = new PackageInstallerSession(mInternalCallback, mContext, mPm,
mInstallThread.getLooper(), sessionId, userId, installerPackageName, params,
- createdMillis, stageDir, stageCid, false);
+ createdMillis, stageDir, stageCid, false, false);
mSessions.put(sessionId, session);
}
@@ -615,32 +577,16 @@
}
}
- private void checkInternalStorage(long sizeBytes) throws IOException {
- if (sizeBytes <= 0) return;
-
- final File target = Environment.getDataDirectory();
- final long targetBytes = sizeBytes + mStorage.getStorageLowBytes(target);
-
- mPm.freeStorage(targetBytes);
- if (target.getUsableSpace() < targetBytes) {
- throw new IOException("Not enough internal space to write " + sizeBytes + " bytes");
- }
- }
-
- private void checkExternalStorage(long sizeBytes) throws IOException {
- if (sizeBytes <= 0) return;
-
- final File target = new UserEnvironment(UserHandle.USER_OWNER)
- .getExternalStorageDirectory();
- final long targetBytes = sizeBytes + mStorage.getStorageLowBytes(target);
-
- if (target.getUsableSpace() < targetBytes) {
- throw new IOException("Not enough external space to write " + sizeBytes + " bytes");
- }
- }
-
@Override
public IPackageInstallerSession openSession(int sessionId) {
+ try {
+ return openSessionInternal(sessionId);
+ } catch (IOException e) {
+ throw ExceptionUtils.wrap(e);
+ }
+ }
+
+ private IPackageInstallerSession openSessionInternal(int sessionId) throws IOException {
synchronized (mSessions) {
final PackageInstallerSession session = mSessions.get(sessionId);
if (session == null || !isCallingUidOwner(session)) {
@@ -665,40 +611,37 @@
throw new IllegalStateException("Failed to allocate session ID");
}
- private File prepareInternalStageDir(int sessionId) throws IOException {
- final File file = new File(mStagingDir, "vmdl" + sessionId + ".tmp");
+ private File buildInternalStageDir(int sessionId) {
+ return new File(mStagingDir, "vmdl" + sessionId + ".tmp");
+ }
- if (file.exists()) {
- throw new IOException("Session dir already exists: " + file);
+ static void prepareInternalStageDir(File stageDir) throws IOException {
+ if (stageDir.exists()) {
+ throw new IOException("Session dir already exists: " + stageDir);
}
try {
- Os.mkdir(file.getAbsolutePath(), 0755);
- Os.chmod(file.getAbsolutePath(), 0755);
+ Os.mkdir(stageDir.getAbsolutePath(), 0755);
+ Os.chmod(stageDir.getAbsolutePath(), 0755);
} catch (ErrnoException e) {
// This purposefully throws if directory already exists
- throw new IOException("Failed to prepare session dir", e);
+ throw new IOException("Failed to prepare session dir: " + stageDir, e);
}
- if (!SELinux.restorecon(file)) {
- throw new IOException("Failed to restorecon session dir");
+ if (!SELinux.restorecon(stageDir)) {
+ throw new IOException("Failed to restorecon session dir: " + stageDir);
}
-
- return file;
}
- private String prepareExternalStageCid(int sessionId, long sizeBytes) throws IOException {
- if (sizeBytes <= 0) {
- throw new IOException("Session must provide valid size for ASEC");
- }
+ private String buildExternalStageCid(int sessionId) {
+ return "smdl" + sessionId + ".tmp";
+ }
- final String cid = "smdl" + sessionId + ".tmp";
- if (PackageHelper.createSdDir(sizeBytes, cid, PackageManagerService.getEncryptKey(),
+ static void prepareExternalStageCid(String stageCid, long sizeBytes) throws IOException {
+ if (PackageHelper.createSdDir(sizeBytes, stageCid, PackageManagerService.getEncryptKey(),
Process.SYSTEM_UID, true) == null) {
- throw new IOException("Failed to create ASEC");
+ throw new IOException("Failed to create session cid: " + stageCid);
}
-
- return cid;
}
@Override
@@ -1031,6 +974,12 @@
writeSessionsAsync();
}
+ public void onSessionPrepared(PackageInstallerSession session) {
+ // We prepared the destination to write into; we want to persist
+ // this, but it's not critical enough to block for.
+ writeSessionsAsync();
+ }
+
public void onSessionSealed(PackageInstallerSession session) {
// It's very important that we block until we've recorded the
// session as being sealed, since we never want to allow mutation
diff --git a/services/core/java/com/android/server/pm/PackageInstallerSession.java b/services/core/java/com/android/server/pm/PackageInstallerSession.java
index f8273c0..adca46a 100644
--- a/services/core/java/com/android/server/pm/PackageInstallerSession.java
+++ b/services/core/java/com/android/server/pm/PackageInstallerSession.java
@@ -17,15 +17,15 @@
package com.android.server.pm;
import static android.content.pm.PackageManager.INSTALL_FAILED_ABORTED;
-import static android.content.pm.PackageManager.INSTALL_FAILED_ALREADY_EXISTS;
import static android.content.pm.PackageManager.INSTALL_FAILED_CONTAINER_ERROR;
import static android.content.pm.PackageManager.INSTALL_FAILED_INSUFFICIENT_STORAGE;
import static android.content.pm.PackageManager.INSTALL_FAILED_INTERNAL_ERROR;
import static android.content.pm.PackageManager.INSTALL_FAILED_INVALID_APK;
-import static android.content.pm.PackageManager.INSTALL_FAILED_PACKAGE_CHANGED;
import static android.system.OsConstants.O_CREAT;
import static android.system.OsConstants.O_RDONLY;
import static android.system.OsConstants.O_WRONLY;
+import static com.android.server.pm.PackageInstallerService.prepareExternalStageCid;
+import static com.android.server.pm.PackageInstallerService.prepareInternalStageDir;
import android.content.Context;
import android.content.Intent;
@@ -88,8 +88,6 @@
// TODO: enforce INSTALL_ALLOW_TEST
// TODO: enforce INSTALL_ALLOW_DOWNGRADE
- // TODO: treat INHERIT_EXISTING as installExistingPackage()
-
private final PackageInstallerService.InternalCallback mCallback;
private final Context mContext;
private final PackageManagerService mPm;
@@ -108,18 +106,23 @@
/** Note that UID is not persisted; it's always derived at runtime. */
final int installerUid;
- private final AtomicInteger mOpenCount = new AtomicInteger();
+ private final AtomicInteger mActiveCount = new AtomicInteger();
private final Object mLock = new Object();
@GuardedBy("mLock")
private float mClientProgress = 0;
@GuardedBy("mLock")
+ private float mInternalProgress = 0;
+
+ @GuardedBy("mLock")
private float mProgress = 0;
@GuardedBy("mLock")
private float mReportedProgress = -1;
@GuardedBy("mLock")
+ private boolean mPrepared = false;
+ @GuardedBy("mLock")
private boolean mSealed = false;
@GuardedBy("mLock")
private boolean mPermissionsAccepted = false;
@@ -184,7 +187,7 @@
public PackageInstallerSession(PackageInstallerService.InternalCallback callback,
Context context, PackageManagerService pm, Looper looper, int sessionId, int userId,
String installerPackageName, SessionParams params, long createdMillis,
- File stageDir, String stageCid, boolean sealed) {
+ File stageDir, String stageCid, boolean prepared, boolean sealed) {
mCallback = callback;
mContext = context;
mPm = pm;
@@ -203,6 +206,7 @@
"Exactly one of stageDir or stageCid stage must be set");
}
+ mPrepared = prepared;
mSealed = sealed;
// Always derived at runtime
@@ -214,8 +218,6 @@
} else {
mPermissionsAccepted = false;
}
-
- computeProgressLocked();
}
public SessionInfo generateInfo() {
@@ -227,7 +229,7 @@
mResolvedBaseFile.getAbsolutePath() : null;
info.progress = mProgress;
info.sealed = mSealed;
- info.active = mOpenCount.get() > 0;
+ info.active = mActiveCount.get() > 0;
info.mode = params.mode;
info.sizeBytes = params.sizeBytes;
@@ -238,14 +240,23 @@
return info;
}
+ public boolean isPrepared() {
+ synchronized (mLock) {
+ return mPrepared;
+ }
+ }
+
public boolean isSealed() {
synchronized (mLock) {
return mSealed;
}
}
- private void assertNotSealed(String cookie) {
+ private void assertPreparedAndNotSealed(String cookie) {
synchronized (mLock) {
+ if (!mPrepared) {
+ throw new IllegalStateException(cookie + " before prepared");
+ }
if (mSealed) {
throw new SecurityException(cookie + " not allowed after commit");
}
@@ -278,30 +289,26 @@
@Override
public void setClientProgress(float progress) {
synchronized (mLock) {
+ // Always publish first staging movement
+ final boolean forcePublish = (mClientProgress == 0);
mClientProgress = progress;
- computeProgressLocked();
+ computeProgressLocked(forcePublish);
}
- maybePublishProgress();
}
@Override
public void addClientProgress(float progress) {
synchronized (mLock) {
- mClientProgress += progress;
- computeProgressLocked();
- }
- maybePublishProgress();
- }
-
- private void computeProgressLocked() {
- if (mProgress <= 0.8f) {
- mProgress = MathUtils.constrain(mClientProgress * 0.8f, 0f, 0.8f);
+ setClientProgress(mClientProgress + progress);
}
}
- private void maybePublishProgress() {
+ private void computeProgressLocked(boolean forcePublish) {
+ mProgress = MathUtils.constrain(mClientProgress * 0.8f, 0f, 0.8f)
+ + MathUtils.constrain(mInternalProgress * 0.2f, 0f, 0.2f);
+
// Only publish when meaningful change
- if (Math.abs(mProgress - mReportedProgress) > 0.01) {
+ if (forcePublish || Math.abs(mProgress - mReportedProgress) >= 0.01) {
mReportedProgress = mProgress;
mCallback.onSessionProgressChanged(this, mProgress);
}
@@ -309,7 +316,7 @@
@Override
public String[] getNames() {
- assertNotSealed("getNames");
+ assertPreparedAndNotSealed("getNames");
try {
return resolveStageDir().list();
} catch (IOException e) {
@@ -333,7 +340,7 @@
// will block any attempted install transitions.
final FileBridge bridge;
synchronized (mLock) {
- assertNotSealed("openWrite");
+ assertPreparedAndNotSealed("openWrite");
bridge = new FileBridge();
mBridges.add(bridge);
@@ -387,7 +394,7 @@
}
private ParcelFileDescriptor openReadInternal(String name) throws IOException {
- assertNotSealed("openRead");
+ assertPreparedAndNotSealed("openRead");
try {
if (!FileUtils.isValidExtFilename(name)) {
@@ -407,6 +414,30 @@
public void commit(IntentSender statusReceiver) {
Preconditions.checkNotNull(statusReceiver);
+ synchronized (mLock) {
+ if (!mSealed) {
+ // Verify that all writers are hands-off
+ for (FileBridge bridge : mBridges) {
+ if (!bridge.isClosed()) {
+ throw new SecurityException("Files still open");
+ }
+ }
+
+ // Persist the fact that we've sealed ourselves to prevent
+ // mutations of any hard links we create.
+ mSealed = true;
+ mCallback.onSessionSealed(this);
+ }
+ }
+
+ // Client staging is fully done at this point
+ mClientProgress = 1f;
+ computeProgressLocked(true);
+
+ // This ongoing commit should keep session active, even though client
+ // will probably close their end.
+ mActiveCount.incrementAndGet();
+
final PackageInstallObserverAdapter adapter = new PackageInstallObserverAdapter(mContext,
statusReceiver, sessionId);
mHandler.obtainMessage(MSG_COMMIT, adapter.getBinder()).sendToTarget();
@@ -414,22 +445,10 @@
private void commitLocked() throws PackageManagerException {
if (mDestroyed) {
- throw new PackageManagerException(INSTALL_FAILED_ALREADY_EXISTS, "Invalid session");
+ throw new PackageManagerException(INSTALL_FAILED_INTERNAL_ERROR, "Session destroyed");
}
-
- // Verify that all writers are hands-off
if (!mSealed) {
- for (FileBridge bridge : mBridges) {
- if (!bridge.isClosed()) {
- throw new PackageManagerException(INSTALL_FAILED_PACKAGE_CHANGED,
- "Files still open");
- }
- }
- mSealed = true;
-
- // Persist the fact that we've sealed ourselves to prevent mutations
- // of any hard links we create below.
- mCallback.onSessionSealed(this);
+ throw new PackageManagerException(INSTALL_FAILED_INTERNAL_ERROR, "Session not sealed");
}
try {
@@ -458,6 +477,10 @@
mRemoteObserver.onUserActionRequired(intent);
} catch (RemoteException ignored) {
}
+
+ // Commit was keeping session marked as active until now; release
+ // that extra refcount so session appears idle.
+ close();
return;
}
@@ -487,8 +510,8 @@
}
// TODO: surface more granular state from dexopt
- mProgress = 0.9f;
- maybePublishProgress();
+ mInternalProgress = 0.5f;
+ computeProgressLocked(true);
// Unpack native libraries
extractNativeLibraries(mResolvedStageDir, params.abiOverride);
@@ -831,15 +854,35 @@
}
}
- public void open() {
- if (mOpenCount.getAndIncrement() == 0) {
+ public void open() throws IOException {
+ if (mActiveCount.getAndIncrement() == 0) {
mCallback.onSessionActiveChanged(this, true);
}
+
+ synchronized (mLock) {
+ if (!mPrepared) {
+ if (stageDir != null) {
+ prepareInternalStageDir(stageDir);
+ } else if (stageCid != null) {
+ prepareExternalStageCid(stageCid, params.sizeBytes);
+
+ // TODO: deliver more granular progress for ASEC allocation
+ mInternalProgress = 0.25f;
+ computeProgressLocked(true);
+ } else {
+ throw new IllegalArgumentException(
+ "Exactly one of stageDir or stageCid stage must be set");
+ }
+
+ mPrepared = true;
+ mCallback.onSessionPrepared(this);
+ }
+ }
}
@Override
public void close() {
- if (mOpenCount.decrementAndGet() == 0) {
+ if (mActiveCount.decrementAndGet() == 0) {
mCallback.onSessionActiveChanged(this, false);
}
}
@@ -869,6 +912,11 @@
synchronized (mLock) {
mSealed = true;
mDestroyed = true;
+
+ // Force shut down all bridges
+ for (FileBridge bridge : mBridges) {
+ bridge.forceClose();
+ }
}
if (stageDir != null) {
FileUtils.deleteContents(stageDir);
diff --git a/services/core/jni/com_android_server_UsbHostManager.cpp b/services/core/jni/com_android_server_UsbHostManager.cpp
index bc866d3..65a28c0 100644
--- a/services/core/jni/com_android_server_UsbHostManager.cpp
+++ b/services/core/jni/com_android_server_UsbHostManager.cpp
@@ -21,7 +21,6 @@
#include "JNIHelp.h"
#include "android_runtime/AndroidRuntime.h"
#include "android_runtime/Log.h"
-#include "utils/Vector.h"
#include <usbhost/usbhost.h>
@@ -68,8 +67,6 @@
JNIEnv* env = AndroidRuntime::getJNIEnv();
jobject thiz = (jobject)client_data;
- Vector<int> interfaceValues;
- Vector<int> endpointValues;
const usb_device_descriptor* deviceDesc = usb_device_get_device_descriptor(device);
char *manufacturer = usb_device_get_manufacturer_name(device);
diff --git a/telecomm/java/android/telecomm/AudioState.java b/telecomm/java/android/telecomm/AudioState.java
index a5fda79..314704b 100644
--- a/telecomm/java/android/telecomm/AudioState.java
+++ b/telecomm/java/android/telecomm/AudioState.java
@@ -34,7 +34,7 @@
/** Direct the audio stream through a wired headset. */
public static final int ROUTE_WIRED_HEADSET = 0x00000004;
- /** Direct the audio stream through the device's spakerphone. */
+ /** Direct the audio stream through the device's speakerphone. */
public static final int ROUTE_SPEAKER = 0x00000008;
/**
@@ -43,7 +43,10 @@
*/
public static final int ROUTE_WIRED_OR_EARPIECE = ROUTE_EARPIECE | ROUTE_WIRED_HEADSET;
- /** Bit mask of all possible audio routes. */
+ /** Bit mask of all possible audio routes.
+ *
+ * @hide
+ */
public static final int ROUTE_ALL = ROUTE_EARPIECE | ROUTE_BLUETOOTH | ROUTE_WIRED_HEADSET |
ROUTE_SPEAKER;
diff --git a/telecomm/java/android/telecomm/Conference.java b/telecomm/java/android/telecomm/Conference.java
index c838b48..f9c3ac3 100644
--- a/telecomm/java/android/telecomm/Conference.java
+++ b/telecomm/java/android/telecomm/Conference.java
@@ -54,7 +54,7 @@
mPhoneAccount = phoneAccount;
}
- public final PhoneAccountHandle getPhoneAccount() {
+ public final PhoneAccountHandle getPhoneAccountHandle() {
return mPhoneAccount;
}
@@ -183,7 +183,7 @@
}
/**
- * Tears down the conference object and any of it's current connections.
+ * Tears down the conference object and any of its current connections.
*/
public final void destroy() {
Log.d(this, "destroying conference : %s", this);
diff --git a/telecomm/java/android/telecomm/Connection.java b/telecomm/java/android/telecomm/Connection.java
index 6df117e..03db1c3 100644
--- a/telecomm/java/android/telecomm/Connection.java
+++ b/telecomm/java/android/telecomm/Connection.java
@@ -139,7 +139,7 @@
*/
public static final int SESSION_MODIFY_REQUEST_INVALID = 3;
- private static final int MSG_SET_VIDEO_LISTENER = 1;
+ private static final int MSG_SET_VIDEO_CALLBACK = 1;
private static final int MSG_SET_CAMERA = 2;
private static final int MSG_SET_PREVIEW_SURFACE = 3;
private static final int MSG_SET_DISPLAY_SURFACE = 4;
@@ -154,7 +154,7 @@
private final VideoProvider.VideoProviderHandler
mMessageHandler = new VideoProvider.VideoProviderHandler();
private final VideoProvider.VideoProviderBinder mBinder;
- private IVideoCallback mVideoListener;
+ private IVideoCallback mVideoCallback;
/**
* Default handler used to consolidate binder method calls onto a single thread.
@@ -163,8 +163,8 @@
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
- case MSG_SET_VIDEO_LISTENER:
- mVideoListener = IVideoCallback.Stub.asInterface((IBinder) msg.obj);
+ case MSG_SET_VIDEO_CALLBACK:
+ mVideoCallback = IVideoCallback.Stub.asInterface((IBinder) msg.obj);
break;
case MSG_SET_CAMERA:
onSetCamera((String) msg.obj);
@@ -206,9 +206,9 @@
* IVideoProvider stub implementation.
*/
private final class VideoProviderBinder extends IVideoProvider.Stub {
- public void setVideoListener(IBinder videoListenerBinder) {
+ public void setVideoCallback(IBinder videoCallbackBinder) {
mMessageHandler.obtainMessage(
- MSG_SET_VIDEO_LISTENER, videoListenerBinder).sendToTarget();
+ MSG_SET_VIDEO_CALLBACK, videoCallbackBinder).sendToTarget();
}
public void setCamera(String cameraId) {
@@ -350,9 +350,9 @@
* @param videoProfile The requested video call profile.
*/
public void receiveSessionModifyRequest(VideoProfile videoProfile) {
- if (mVideoListener != null) {
+ if (mVideoCallback != null) {
try {
- mVideoListener.receiveSessionModifyRequest(videoProfile);
+ mVideoCallback.receiveSessionModifyRequest(videoProfile);
} catch (RemoteException ignored) {
}
}
@@ -370,9 +370,9 @@
*/
public void receiveSessionModifyResponse(int status,
VideoProfile requestedProfile, VideoProfile responseProfile) {
- if (mVideoListener != null) {
+ if (mVideoCallback != null) {
try {
- mVideoListener.receiveSessionModifyResponse(
+ mVideoCallback.receiveSessionModifyResponse(
status, requestedProfile, responseProfile);
} catch (RemoteException ignored) {
}
@@ -390,9 +390,9 @@
* @param event The event.
*/
public void handleCallSessionEvent(int event) {
- if (mVideoListener != null) {
+ if (mVideoCallback != null) {
try {
- mVideoListener.handleCallSessionEvent(event);
+ mVideoCallback.handleCallSessionEvent(event);
} catch (RemoteException ignored) {
}
}
@@ -405,9 +405,9 @@
* @param height The updated peer video height.
*/
public void changePeerDimensions(int width, int height) {
- if (mVideoListener != null) {
+ if (mVideoCallback != null) {
try {
- mVideoListener.changePeerDimensions(width, height);
+ mVideoCallback.changePeerDimensions(width, height);
} catch (RemoteException ignored) {
}
}
@@ -419,9 +419,9 @@
* @param dataUsage The updated data usage.
*/
public void changeCallDataUsage(int dataUsage) {
- if (mVideoListener != null) {
+ if (mVideoCallback != null) {
try {
- mVideoListener.changeCallDataUsage(dataUsage);
+ mVideoCallback.changeCallDataUsage(dataUsage);
} catch (RemoteException ignored) {
}
}
@@ -433,9 +433,9 @@
* @param cameraCapabilities The changed camera capabilities.
*/
public void changeCameraCapabilities(CameraCapabilities cameraCapabilities) {
- if (mVideoListener != null) {
+ if (mVideoCallback != null) {
try {
- mVideoListener.changeCameraCapabilities(cameraCapabilities);
+ mVideoCallback.changeCameraCapabilities(cameraCapabilities);
} catch (RemoteException ignored) {
}
}
diff --git a/telecomm/java/android/telecomm/ConnectionRequest.java b/telecomm/java/android/telecomm/ConnectionRequest.java
index 39ae59a..d5a6aa5 100644
--- a/telecomm/java/android/telecomm/ConnectionRequest.java
+++ b/telecomm/java/android/telecomm/ConnectionRequest.java
@@ -29,31 +29,25 @@
// TODO: Token to limit recursive invocations
private final PhoneAccountHandle mAccountHandle;
- private final Uri mHandle;
- private final int mHandlePresentation;
+ private final Uri mAddress;
private final Bundle mExtras;
private final int mVideoState;
/**
* @param accountHandle The accountHandle which should be used to place the call.
* @param handle The handle (e.g., phone number) to which the {@link Connection} is to connect.
- * @param handlePresentation The {@link PropertyPresentation} which controls how the handle
- * is shown.
* @param extras Application-specific extra data.
*/
public ConnectionRequest(
PhoneAccountHandle accountHandle,
Uri handle,
- int handlePresentation,
Bundle extras) {
- this(accountHandle, handle, handlePresentation, extras, VideoProfile.VideoState.AUDIO_ONLY);
+ this(accountHandle, handle, extras, VideoProfile.VideoState.AUDIO_ONLY);
}
/**
* @param accountHandle The accountHandle which should be used to place the call.
* @param handle The handle (e.g., phone number) to which the {@link Connection} is to connect.
- * @param handlePresentation The {@link PropertyPresentation} which controls how the handle
- * is shown.
* @param extras Application-specific extra data.
* @param videoState Determines the video state for the connection.
* @hide
@@ -61,20 +55,17 @@
public ConnectionRequest(
PhoneAccountHandle accountHandle,
Uri handle,
- int handlePresentation,
Bundle extras,
int videoState) {
mAccountHandle = accountHandle;
- mHandle = handle;
- mHandlePresentation = handlePresentation;
+ mAddress = handle;
mExtras = extras;
mVideoState = videoState;
}
private ConnectionRequest(Parcel in) {
mAccountHandle = in.readParcelable(getClass().getClassLoader());
- mHandle = in.readParcelable(getClass().getClassLoader());
- mHandlePresentation = in.readInt();
+ mAddress = in.readParcelable(getClass().getClassLoader());
mExtras = in.readParcelable(getClass().getClassLoader());
mVideoState = in.readInt();
}
@@ -87,12 +78,7 @@
/**
* The handle (e.g., phone number) to which the {@link Connection} is to connect.
*/
- public Uri getHandle() { return mHandle; }
-
- /**
- * The {@link PropertyPresentation} which controls how the handle is shown.
- */
- public int getHandlePresentation() { return mHandlePresentation; }
+ public Uri getAddress() { return mAddress; }
/**
* Application-specific extra data. Used for passing back information from an incoming
@@ -118,9 +104,9 @@
@Override
public String toString() {
return String.format("ConnectionRequest %s %s",
- mHandle == null
+ mAddress == null
? Uri.EMPTY
- : Connection.toLogSafePhoneNumber(mHandle.toString()),
+ : Connection.toLogSafePhoneNumber(mAddress.toString()),
mExtras == null ? "" : mExtras);
}
@@ -147,8 +133,7 @@
@Override
public void writeToParcel(Parcel destination, int flags) {
destination.writeParcelable(mAccountHandle, 0);
- destination.writeParcelable(mHandle, 0);
- destination.writeInt(mHandlePresentation);
+ destination.writeParcelable(mAddress, 0);
destination.writeParcelable(mExtras, 0);
destination.writeInt(mVideoState);
}
diff --git a/telecomm/java/android/telecomm/ConnectionService.java b/telecomm/java/android/telecomm/ConnectionService.java
index 833aa26..39365b6 100644
--- a/telecomm/java/android/telecomm/ConnectionService.java
+++ b/telecomm/java/android/telecomm/ConnectionService.java
@@ -781,7 +781,7 @@
}
}
ParcelableConference parcelableConference = new ParcelableConference(
- conference.getPhoneAccount(),
+ conference.getPhoneAccountHandle(),
conference.getState(),
conference.getCapabilities(),
connectionIds);
diff --git a/telecomm/java/android/telecomm/PhoneAccount.java b/telecomm/java/android/telecomm/PhoneAccount.java
index 1d61a6e..d3da2ec 100644
--- a/telecomm/java/android/telecomm/PhoneAccount.java
+++ b/telecomm/java/android/telecomm/PhoneAccount.java
@@ -98,8 +98,8 @@
public static final String SCHEME_SIP = "sip";
private final PhoneAccountHandle mAccountHandle;
- private final Uri mHandle;
- private final String mSubscriptionNumber;
+ private final Uri mAddress;
+ private final Uri mSubscriptionAddress;
private final int mCapabilities;
private final int mIconResId;
private final CharSequence mLabel;
@@ -108,47 +108,40 @@
public static class Builder {
private PhoneAccountHandle mAccountHandle;
- private Uri mHandle;
- private String mSubscriptionNumber;
+ private Uri mAddress;
+ private Uri mSubscriptionAddress;
private int mCapabilities;
private int mIconResId;
private CharSequence mLabel;
private CharSequence mShortDescription;
private List<String> mSupportedUriSchemes = new ArrayList<String>();
- public Builder() {}
+ public Builder(PhoneAccountHandle accountHandle, CharSequence label) {
+ this.mAccountHandle = accountHandle;
+ this.mLabel = label;
+ }
- public Builder withAccountHandle(PhoneAccountHandle value) {
- this.mAccountHandle = value;
+ public Builder setAddress(Uri value) {
+ this.mAddress = value;
return this;
}
- public Builder withHandle(Uri value) {
- this.mHandle = value;
+ public Builder setSubscriptionAddress(Uri value) {
+ this.mSubscriptionAddress = value;
return this;
}
- public Builder withSubscriptionNumber(String value) {
- this.mSubscriptionNumber = value;
- return this;
- }
-
- public Builder withCapabilities(int value) {
+ public Builder setCapabilities(int value) {
this.mCapabilities = value;
return this;
}
- public Builder withIconResId(int value) {
+ public Builder setIconResId(int value) {
this.mIconResId = value;
return this;
}
- public Builder withLabel(CharSequence value) {
- this.mLabel = value;
- return this;
- }
-
- public Builder withShortDescription(CharSequence value) {
+ public Builder setShortDescription(CharSequence value) {
this.mShortDescription = value;
return this;
}
@@ -158,8 +151,9 @@
*
* @param uriScheme The URI scheme.
* @return The Builder.
+ * @hide
*/
- public Builder withSupportedUriScheme(String uriScheme) {
+ public Builder addSupportedUriScheme(String uriScheme) {
if (!TextUtils.isEmpty(uriScheme) && !mSupportedUriSchemes.contains(uriScheme)) {
this.mSupportedUriSchemes.add(uriScheme);
}
@@ -167,15 +161,17 @@
}
/**
- * Specifies additional URI schemes supported by the {@link PhoneAccount}.
+ * Specifies the URI schemes supported by the {@link PhoneAccount}.
*
* @param uriSchemes The URI schemes.
* @return The Builder.
*/
- public Builder withSupportedUriSchemes(List<String> uriSchemes) {
+ public Builder setSupportedUriSchemes(List<String> uriSchemes) {
+ mSupportedUriSchemes.clear();
+
if (uriSchemes != null && !uriSchemes.isEmpty()) {
for (String uriScheme : uriSchemes) {
- withSupportedUriScheme(uriScheme);
+ addSupportedUriScheme(uriScheme);
}
}
return this;
@@ -184,13 +180,13 @@
public PhoneAccount build() {
// If no supported URI schemes were defined, assume "tel" is supported.
if (mSupportedUriSchemes.isEmpty()) {
- withSupportedUriScheme(SCHEME_TEL);
+ addSupportedUriScheme(SCHEME_TEL);
}
return new PhoneAccount(
mAccountHandle,
- mHandle,
- mSubscriptionNumber,
+ mAddress,
+ mSubscriptionAddress,
mCapabilities,
mIconResId,
mLabel,
@@ -201,16 +197,16 @@
private PhoneAccount(
PhoneAccountHandle account,
- Uri handle,
- String subscriptionNumber,
+ Uri address,
+ Uri subscriptionAddress,
int capabilities,
int iconResId,
CharSequence label,
CharSequence shortDescription,
List<String> supportedUriSchemes) {
mAccountHandle = account;
- mHandle = handle;
- mSubscriptionNumber = subscriptionNumber;
+ mAddress = address;
+ mSubscriptionAddress = subscriptionAddress;
mCapabilities = capabilities;
mIconResId = iconResId;
mLabel = label;
@@ -218,7 +214,11 @@
mSupportedUriSchemes = Collections.unmodifiableList(supportedUriSchemes);
}
- public static Builder builder() { return new Builder(); }
+ public static Builder builder(
+ PhoneAccountHandle accountHandle,
+ CharSequence label) {
+ return new Builder(accountHandle, label);
+ }
/**
* The unique identifier of this {@code PhoneAccount}.
@@ -230,32 +230,30 @@
}
/**
- * The handle (e.g., a phone number) associated with this {@code PhoneAccount}. This
+ * The address (e.g., a phone number) associated with this {@code PhoneAccount}. This
* represents the destination from which outgoing calls using this {@code PhoneAccount}
* will appear to come, if applicable, and the destination to which incoming calls using this
* {@code PhoneAccount} may be addressed.
*
- * @return A handle expressed as a {@code Uri}, for example, a phone number.
+ * @return A address expressed as a {@code Uri}, for example, a phone number.
*/
- public Uri getHandle() {
- return mHandle;
+ public Uri getAddress() {
+ return mAddress;
}
/**
* The raw callback number used for this {@code PhoneAccount}, as distinct from
- * {@link #getHandle()}. For the majority of {@code PhoneAccount}s this should be registered
+ * {@link #getAddress()}. For the majority of {@code PhoneAccount}s this should be registered
* as {@code null}. It is used by the system for SIM-based {@code PhoneAccount} registration
* where {@link android.telephony.TelephonyManager#setLine1NumberForDisplay(String, String)}
* or {@link android.telephony.TelephonyManager#setLine1NumberForDisplay(long, String, String)}
* has been used to alter the callback number.
* <p>
- * TODO: Should this also be a URI, for consistency? Should it be called the
- * "subscription handle"?
*
* @return The subscription number, suitable for display to the user.
*/
- public String getSubscriptionNumber() {
- return mSubscriptionNumber;
+ public Uri getSubscriptionAddress() {
+ return mSubscriptionAddress;
}
/**
@@ -295,11 +293,11 @@
}
/**
- * Determines if the {@link PhoneAccount} supports calls to/from handles with a specified URI
+ * Determines if the {@link PhoneAccount} supports calls to/from addresses with a specified URI
* scheme.
*
* @param uriScheme The URI scheme to check.
- * @return {@code True} if the {@code PhoneAccount} supports calls to/from handles with the
+ * @return {@code True} if the {@code PhoneAccount} supports calls to/from addresses with the
* specified URI scheme.
*/
public boolean supportsUriScheme(String uriScheme) {
@@ -363,8 +361,8 @@
@Override
public void writeToParcel(Parcel out, int flags) {
out.writeParcelable(mAccountHandle, 0);
- out.writeParcelable(mHandle, 0);
- out.writeString(mSubscriptionNumber);
+ out.writeParcelable(mAddress, 0);
+ out.writeParcelable(mSubscriptionAddress, 0);
out.writeInt(mCapabilities);
out.writeInt(mIconResId);
out.writeCharSequence(mLabel);
@@ -389,8 +387,8 @@
ClassLoader classLoader = PhoneAccount.class.getClassLoader();
mAccountHandle = in.readParcelable(getClass().getClassLoader());
- mHandle = in.readParcelable(getClass().getClassLoader());
- mSubscriptionNumber = in.readString();
+ mAddress = in.readParcelable(getClass().getClassLoader());
+ mSubscriptionAddress = in.readParcelable(getClass().getClassLoader());
mCapabilities = in.readInt();
mIconResId = in.readInt();
mLabel = in.readCharSequence();
diff --git a/telecomm/java/android/telecomm/RemoteConnection.java b/telecomm/java/android/telecomm/RemoteConnection.java
index 31afb4b..8ad8d19 100644
--- a/telecomm/java/android/telecomm/RemoteConnection.java
+++ b/telecomm/java/android/telecomm/RemoteConnection.java
@@ -17,15 +17,18 @@
package android.telecomm;
import com.android.internal.telecomm.IConnectionService;
+import com.android.internal.telecomm.IVideoCallback;
+import com.android.internal.telecomm.IVideoProvider;
import android.app.PendingIntent;
import android.net.Uri;
+import android.os.IBinder;
import android.os.RemoteException;
import android.telephony.DisconnectCause;
+import android.view.Surface;
import java.util.ArrayList;
import java.util.Collections;
-import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
@@ -183,6 +186,18 @@
List<RemoteConnection> conferenceableConnections) {}
/**
+ * Indicates that the {@code VideoProvider} associated with this {@code RemoteConnection}
+ * has changed.
+ *
+ * @param connection The {@code RemoteConnection} invoking this method.
+ * @param videoProvider The new {@code VideoProvider} associated with this
+ * {@code RemoteConnection}.
+ * @hide
+ */
+ public void onVideoProviderChanged(
+ RemoteConnection connection, VideoProvider videoProvider) {}
+
+ /**
* Indicates that the {@code RemoteConference} that this {@code RemoteConnection} is a part
* of has changed.
*
@@ -195,6 +210,185 @@
RemoteConference conference) {}
}
+ /** {@hide} */
+ public static class VideoProvider {
+
+ public abstract static class Listener {
+ public void onReceiveSessionModifyRequest(
+ VideoProvider videoProvider,
+ VideoProfile videoProfile) {}
+
+ public void onReceiveSessionModifyResponse(
+ VideoProvider videoProvider,
+ int status,
+ VideoProfile requestedProfile,
+ VideoProfile responseProfile) {}
+
+ public void onHandleCallSessionEvent(VideoProvider videoProvider, int event) {}
+
+ public void onPeerDimensionsChanged(VideoProvider videoProvider, int width, int height) {}
+
+ public void onCallDataUsageChanged(VideoProvider videoProvider, int dataUsage) {}
+
+ public void onCameraCapabilitiesChanged(
+ VideoProvider videoProvider,
+ CameraCapabilities cameraCapabilities) {}
+ }
+
+ private final IVideoCallback mVideoCallbackDelegate = new IVideoCallback() {
+ @Override
+ public void receiveSessionModifyRequest(VideoProfile videoProfile) {
+ for (Listener l : mListeners) {
+ l.onReceiveSessionModifyRequest(VideoProvider.this, videoProfile);
+ }
+ }
+
+ @Override
+ public void receiveSessionModifyResponse(int status, VideoProfile requestedProfile,
+ VideoProfile responseProfile) {
+ for (Listener l : mListeners) {
+ l.onReceiveSessionModifyResponse(
+ VideoProvider.this,
+ status,
+ requestedProfile,
+ responseProfile);
+ }
+ }
+
+ @Override
+ public void handleCallSessionEvent(int event) {
+ for (Listener l : mListeners) {
+ l.onHandleCallSessionEvent(VideoProvider.this, event);
+ }
+ }
+
+ @Override
+ public void changePeerDimensions(int width, int height) {
+ for (Listener l : mListeners) {
+ l.onPeerDimensionsChanged(VideoProvider.this, width, height);
+ }
+ }
+
+ @Override
+ public void changeCallDataUsage(int dataUsage) {
+ for (Listener l : mListeners) {
+ l.onCallDataUsageChanged(VideoProvider.this, dataUsage);
+ }
+ }
+
+ @Override
+ public void changeCameraCapabilities(CameraCapabilities cameraCapabilities) {
+ for (Listener l : mListeners) {
+ l.onCameraCapabilitiesChanged(VideoProvider.this, cameraCapabilities);
+ }
+ }
+
+ @Override
+ public IBinder asBinder() {
+ return null;
+ }
+ };
+
+ private final VideoCallbackServant mVideoCallbackServant =
+ new VideoCallbackServant(mVideoCallbackDelegate);
+
+ private final IVideoProvider mVideoProviderBinder;
+
+ /**
+ * ConcurrentHashMap constructor params: 8 is initial table size, 0.9f is
+ * load factor before resizing, 1 means we only expect a single thread to
+ * access the map so make only a single shard
+ */
+ private final Set<Listener> mListeners = Collections.newSetFromMap(
+ new ConcurrentHashMap<Listener, Boolean>(8, 0.9f, 1));
+
+ public VideoProvider(IVideoProvider videoProviderBinder) {
+ mVideoProviderBinder = videoProviderBinder;
+ try {
+ mVideoProviderBinder.setVideoCallback(mVideoCallbackServant.getStub().asBinder());
+ } catch (RemoteException e) {
+ }
+ }
+
+ public void addListener(Listener l) {
+ mListeners.add(l);
+ }
+
+ public void removeListener(Listener l) {
+ mListeners.remove(l);
+ }
+
+ public void setCamera(String cameraId) {
+ try {
+ mVideoProviderBinder.setCamera(cameraId);
+ } catch (RemoteException e) {
+ }
+ }
+
+ public void setPreviewSurface(Surface surface) {
+ try {
+ mVideoProviderBinder.setPreviewSurface(surface);
+ } catch (RemoteException e) {
+ }
+ }
+
+ public void setDisplaySurface(Surface surface) {
+ try {
+ mVideoProviderBinder.setDisplaySurface(surface);
+ } catch (RemoteException e) {
+ }
+ }
+
+ public void setDeviceOrientation(int rotation) {
+ try {
+ mVideoProviderBinder.setDeviceOrientation(rotation);
+ } catch (RemoteException e) {
+ }
+ }
+
+ public void setZoom(float value) {
+ try {
+ mVideoProviderBinder.setZoom(value);
+ } catch (RemoteException e) {
+ }
+ }
+
+ public void sendSessionModifyRequest(VideoProfile reqProfile) {
+ try {
+ mVideoProviderBinder.sendSessionModifyRequest(reqProfile);
+ } catch (RemoteException e) {
+ }
+ }
+
+ public void sendSessionModifyResponse(VideoProfile responseProfile) {
+ try {
+ mVideoProviderBinder.sendSessionModifyResponse(responseProfile);
+ } catch (RemoteException e) {
+ }
+ }
+
+ public void requestCameraCapabilities() {
+ try {
+ mVideoProviderBinder.requestCameraCapabilities();
+ } catch (RemoteException e) {
+ }
+ }
+
+ public void requestCallDataUsage() {
+ try {
+ mVideoProviderBinder.requestCallDataUsage();
+ } catch (RemoteException e) {
+ }
+ }
+
+ public void setPauseImage(String uri) {
+ try {
+ mVideoProviderBinder.setPauseImage(uri);
+ } catch (RemoteException e) {
+ }
+ }
+ }
+
private IConnectionService mConnectionService;
private final String mConnectionId;
/**
@@ -215,6 +409,7 @@
private boolean mConnected;
private int mCallCapabilities;
private int mVideoState;
+ private VideoProvider mVideoProvider;
private boolean mAudioModeIsVoip;
private StatusHints mStatusHints;
private Uri mHandle;
@@ -380,6 +575,14 @@
}
/**
+ * @return The video provider associated with this {@code RemoteConnection}.
+ * @hide
+ */
+ public final VideoProvider getVideoProvider() {
+ return mVideoProvider;
+ }
+
+ /**
* @return The failure code ({@see DisconnectCause}) associated with this failed
* {@code RemoteConnection}.
*/
@@ -684,6 +887,16 @@
}
}
+ /**
+ * @hide
+ */
+ void setVideoProvider(VideoProvider videoProvider) {
+ mVideoProvider = videoProvider;
+ for (Listener l : mListeners) {
+ l.onVideoProviderChanged(this, videoProvider);
+ }
+ }
+
/** @hide */
void setAudioModeIsVoip(boolean isVoip) {
mAudioModeIsVoip = isVoip;
diff --git a/telecomm/java/android/telecomm/RemoteConnectionService.java b/telecomm/java/android/telecomm/RemoteConnectionService.java
index 79193c2..348c36c 100644
--- a/telecomm/java/android/telecomm/RemoteConnectionService.java
+++ b/telecomm/java/android/telecomm/RemoteConnectionService.java
@@ -74,7 +74,7 @@
}
}
connection.setConferenceableConnections(conferenceable);
- // TODO: Do we need to support video providers for remote connections?
+ connection.setVideoState(parcel.getVideoState());
if (connection.getState() == Connection.STATE_DISCONNECTED) {
// ... then, if it was created in a disconnected state, that indicates
// failure on the providing end, so immediately mark it destroyed
@@ -226,7 +226,8 @@
@Override
public void setVideoProvider(String callId, IVideoProvider videoProvider) {
- // not supported for remote connections.
+ findConnectionForAction(callId, "setVideoProvider")
+ .setVideoProvider(new RemoteConnection.VideoProvider(videoProvider));
}
@Override
@@ -325,8 +326,7 @@
final String id = UUID.randomUUID().toString();
final ConnectionRequest newRequest = new ConnectionRequest(
request.getAccountHandle(),
- request.getHandle(),
- request.getHandlePresentation(),
+ request.getAddress(),
request.getExtras(),
request.getVideoState());
try {
diff --git a/telecomm/java/android/telecomm/StatusHints.java b/telecomm/java/android/telecomm/StatusHints.java
index f7c4f2f..ff96a5b 100644
--- a/telecomm/java/android/telecomm/StatusHints.java
+++ b/telecomm/java/android/telecomm/StatusHints.java
@@ -32,23 +32,24 @@
*/
public final class StatusHints implements Parcelable {
- private final ComponentName mComponentName;
+ private final ComponentName mPackageName;
private final CharSequence mLabel;
private final int mIconResId;
private final Bundle mExtras;
- public StatusHints(ComponentName componentName, CharSequence label, int iconResId, Bundle extras) {
- mComponentName = componentName;
+ public StatusHints(ComponentName packageName, CharSequence label, int iconResId,
+ Bundle extras) {
+ mPackageName = packageName;
mLabel = label;
mIconResId = iconResId;
mExtras = extras;
}
/**
- * @return A component used to load the icon.
+ * @return A package used to load the icon.
*/
- public ComponentName getComponentName() {
- return mComponentName;
+ public ComponentName getPackageName() {
+ return mPackageName;
}
/**
@@ -88,7 +89,7 @@
@Override
public void writeToParcel(Parcel out, int flags) {
- out.writeParcelable(mComponentName, flags);
+ out.writeParcelable(mPackageName, flags);
out.writeCharSequence(mLabel);
out.writeInt(mIconResId);
out.writeParcelable(mExtras, 0);
@@ -106,7 +107,7 @@
};
private StatusHints(Parcel in) {
- mComponentName = in.readParcelable(getClass().getClassLoader());
+ mPackageName = in.readParcelable(getClass().getClassLoader());
mLabel = in.readCharSequence();
mIconResId = in.readInt();
mExtras = in.readParcelable(getClass().getClassLoader());
@@ -115,16 +116,16 @@
private Drawable getIcon(Context context, int resId) {
Context packageContext;
try {
- packageContext = context.createPackageContext(mComponentName.getPackageName(), 0);
+ packageContext = context.createPackageContext(mPackageName.getPackageName(), 0);
} catch (PackageManager.NameNotFoundException e) {
- Log.e(this, e, "Cannot find package %s", mComponentName.getPackageName());
+ Log.e(this, e, "Cannot find package %s", mPackageName.getPackageName());
return null;
}
try {
return packageContext.getDrawable(resId);
} catch (MissingResourceException e) {
Log.e(this, e, "Cannot find icon %d in package %s",
- resId, mComponentName.getPackageName());
+ resId, mPackageName.getPackageName());
return null;
}
}
@@ -133,7 +134,7 @@
public boolean equals(Object other) {
if (other != null && other instanceof StatusHints) {
StatusHints otherHints = (StatusHints) other;
- return Objects.equals(otherHints.getComponentName(), getComponentName()) &&
+ return Objects.equals(otherHints.getPackageName(), getPackageName()) &&
Objects.equals(otherHints.getLabel(), getLabel()) &&
otherHints.getIconResId() == getIconResId() &&
Objects.equals(otherHints.getExtras(), getExtras());
@@ -143,7 +144,7 @@
@Override
public int hashCode() {
- return Objects.hashCode(mComponentName) + Objects.hashCode(mLabel) + mIconResId +
+ return Objects.hashCode(mPackageName) + Objects.hashCode(mLabel) + mIconResId +
Objects.hashCode(mExtras);
}
}
diff --git a/telecomm/java/android/telecomm/VideoCallImpl.java b/telecomm/java/android/telecomm/VideoCallImpl.java
index c10865f..d33a351 100644
--- a/telecomm/java/android/telecomm/VideoCallImpl.java
+++ b/telecomm/java/android/telecomm/VideoCallImpl.java
@@ -157,7 +157,7 @@
mVideoProvider.asBinder().linkToDeath(mDeathRecipient, 0);
mBinder = new VideoCallListenerBinder();
- mVideoProvider.setVideoListener(mBinder);
+ mVideoProvider.setVideoCallback(mBinder);
}
/** {@inheritDoc} */
diff --git a/telecomm/java/android/telecomm/VideoCallbackServant.java b/telecomm/java/android/telecomm/VideoCallbackServant.java
new file mode 100644
index 0000000..060b8a9
--- /dev/null
+++ b/telecomm/java/android/telecomm/VideoCallbackServant.java
@@ -0,0 +1,160 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ R* limitations under the License.
+ */
+
+package android.telecomm;
+
+import com.android.internal.os.SomeArgs;
+import com.android.internal.telecomm.IVideoCallback;
+
+import android.os.Handler;
+import android.os.Message;
+import android.os.RemoteException;
+
+/**
+ * A component that provides an RPC servant implementation of {@link IVideoCallback},
+ * posting incoming messages on the main thread on a client-supplied delegate object.
+ *
+ * TODO: Generate this and similar classes using a compiler starting from AIDL interfaces.
+ *
+ * @hide
+ */
+final class VideoCallbackServant {
+ private static final int MSG_RECEIVE_SESSION_MODIFY_REQUEST = 0;
+ private static final int MSG_RECEIVE_SESSION_MODIFY_RESPONSE = 1;
+ private static final int MSG_HANDLE_CALL_SESSION_EVENT = 2;
+ private static final int MSG_CHANGE_PEER_DIMENSIONS = 3;
+ private static final int MSG_CHANGE_CALL_DATA_USAGE = 4;
+ private static final int MSG_CHANGE_CAMERA_CAPABILITIES = 5;
+
+ private final IVideoCallback mDelegate;
+
+ private final Handler mHandler = new Handler() {
+ @Override
+ public void handleMessage(Message msg) {
+ try {
+ internalHandleMessage(msg);
+ } catch (RemoteException e) {
+ }
+ }
+
+ // Internal method defined to centralize handling of RemoteException
+ private void internalHandleMessage(Message msg) throws RemoteException {
+ switch (msg.what) {
+ case MSG_RECEIVE_SESSION_MODIFY_REQUEST: {
+ mDelegate.receiveSessionModifyRequest((VideoProfile) msg.obj);
+ break;
+ }
+ case MSG_RECEIVE_SESSION_MODIFY_RESPONSE: {
+ SomeArgs args = (SomeArgs) msg.obj;
+ try {
+ mDelegate.receiveSessionModifyResponse(
+ args.argi1,
+ (VideoProfile) args.arg1,
+ (VideoProfile) args.arg2);
+ } finally {
+ args.recycle();
+ }
+ break;
+ }
+ case MSG_HANDLE_CALL_SESSION_EVENT: {
+ SomeArgs args = (SomeArgs) msg.obj;
+ try {
+ mDelegate.handleCallSessionEvent(args.argi1);
+ } finally {
+ args.recycle();
+ }
+ break;
+ }
+ case MSG_CHANGE_PEER_DIMENSIONS: {
+ SomeArgs args = (SomeArgs) msg.obj;
+ try {
+ mDelegate.changePeerDimensions(args.argi1, args.argi2);
+ } finally {
+ args.recycle();
+ }
+ break;
+ }
+ case MSG_CHANGE_CALL_DATA_USAGE: {
+ SomeArgs args = (SomeArgs) msg.obj;
+ try {
+ mDelegate.changeCallDataUsage(args.argi1);
+ } finally {
+ args.recycle();
+ }
+ break;
+ }
+ case MSG_CHANGE_CAMERA_CAPABILITIES: {
+ mDelegate.changeCameraCapabilities((CameraCapabilities) msg.obj);
+ break;
+ }
+ }
+ }
+ };
+
+ private final IVideoCallback mStub = new IVideoCallback.Stub() {
+ @Override
+ public void receiveSessionModifyRequest(VideoProfile videoProfile) throws RemoteException {
+ mHandler.obtainMessage(MSG_RECEIVE_SESSION_MODIFY_REQUEST, videoProfile).sendToTarget();
+ }
+
+ @Override
+ public void receiveSessionModifyResponse(int status, VideoProfile requestedProfile,
+ VideoProfile responseProfile) throws RemoteException {
+ SomeArgs args = SomeArgs.obtain();
+ args.argi1 = status;
+ args.arg1 = requestedProfile;
+ args.arg2 = responseProfile;
+ mHandler.obtainMessage(MSG_RECEIVE_SESSION_MODIFY_RESPONSE, args).sendToTarget();
+ }
+
+ @Override
+ public void handleCallSessionEvent(int event) throws RemoteException {
+ SomeArgs args = SomeArgs.obtain();
+ args.argi1 = event;
+ mHandler.obtainMessage(MSG_HANDLE_CALL_SESSION_EVENT, args).sendToTarget();
+ }
+
+ @Override
+ public void changePeerDimensions(int width, int height) throws RemoteException {
+ SomeArgs args = SomeArgs.obtain();
+ args.argi1 = width;
+ args.argi2 = height;
+ mHandler.obtainMessage(MSG_CHANGE_PEER_DIMENSIONS, args).sendToTarget();
+ }
+
+ @Override
+ public void changeCallDataUsage(int dataUsage) throws RemoteException {
+ SomeArgs args = SomeArgs.obtain();
+ args.argi1 = dataUsage;
+ mHandler.obtainMessage(MSG_CHANGE_CALL_DATA_USAGE, args).sendToTarget();
+ }
+
+ @Override
+ public void changeCameraCapabilities(CameraCapabilities cameraCapabilities)
+ throws RemoteException {
+ mHandler.obtainMessage(MSG_CHANGE_CAMERA_CAPABILITIES, cameraCapabilities)
+ .sendToTarget();
+ }
+ };
+
+ public VideoCallbackServant(IVideoCallback delegate) {
+ mDelegate = delegate;
+ }
+
+ public IVideoCallback getStub() {
+ return mStub;
+ }
+}
diff --git a/telecomm/java/com/android/internal/telecomm/IVideoProvider.aidl b/telecomm/java/com/android/internal/telecomm/IVideoProvider.aidl
index 9d3ad7f..b0aa988 100644
--- a/telecomm/java/com/android/internal/telecomm/IVideoProvider.aidl
+++ b/telecomm/java/com/android/internal/telecomm/IVideoProvider.aidl
@@ -25,7 +25,7 @@
* @hide
*/
oneway interface IVideoProvider {
- void setVideoListener(IBinder videoListenerBinder);
+ void setVideoCallback(IBinder videoCallbackBinder);
void setCamera(String cameraId);
diff --git a/telephony/java/android/telephony/PhoneNumberUtils.java b/telephony/java/android/telephony/PhoneNumberUtils.java
index 1d9e6a9..30799f8 100644
--- a/telephony/java/android/telephony/PhoneNumberUtils.java
+++ b/telephony/java/android/telephony/PhoneNumberUtils.java
@@ -2316,8 +2316,9 @@
/**
* This function checks if the passed in string conforms to the NANP format
* i.e. NXX-NXX-XXXX, N is any digit 2-9 and X is any digit 0-9
+ * @hide
*/
- private static boolean isNanp (String dialStr) {
+ public static boolean isNanp (String dialStr) {
boolean retVal = false;
if (dialStr != null) {
if (dialStr.length() == NANP_LENGTH) {
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index 93c49ba..38b61ae 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -772,6 +772,7 @@
*
* {@hide}
*/
+ @SystemApi
public int getCurrentPhoneType() {
return getCurrentPhoneType(getDefaultSubscription());
}
@@ -786,6 +787,7 @@
* @param subId for which phone type is returned
*/
/** {@hide} */
+ @SystemApi
public int getCurrentPhoneType(long subId) {
try{
diff --git a/telephony/java/com/android/internal/telephony/TelephonyProperties.java b/telephony/java/com/android/internal/telephony/TelephonyProperties.java
index 34992b8..c89208d 100644
--- a/telephony/java/com/android/internal/telephony/TelephonyProperties.java
+++ b/telephony/java/com/android/internal/telephony/TelephonyProperties.java
@@ -124,7 +124,7 @@
static final String PROPERTY_ECM_EXIT_TIMER = "ro.cdma.ecmexittimer";
/** the international dialing prefix of current operator network */
- static final String PROPERTY_OPERATOR_IDP_STRING = "telephony.operator.idpstring";
+ static final String PROPERTY_OPERATOR_IDP_STRING = "gsm.operator.idpstring";
/**
* Defines the schema for the carrier specified OTASP number
diff --git a/tools/layoutlib/.idea/codeStyleSettings.xml b/tools/layoutlib/.idea/codeStyleSettings.xml
index 33937b3..b324213 100644
--- a/tools/layoutlib/.idea/codeStyleSettings.xml
+++ b/tools/layoutlib/.idea/codeStyleSettings.xml
@@ -27,12 +27,12 @@
<package name="" withSubpackages="true" static="true" />
</value>
</option>
+ <option name="RIGHT_MARGIN" value="100" />
<option name="WRAP_WHEN_TYPING_REACHES_RIGHT_MARGIN" value="true" />
<option name="JD_ALIGN_PARAM_COMMENTS" value="false" />
<option name="JD_ADD_BLANK_AFTER_PARM_COMMENTS" value="true" />
<option name="JD_ADD_BLANK_AFTER_RETURN" value="true" />
<option name="JD_DO_NOT_WRAP_ONE_LINE_COMMENTS" value="true" />
- <option name="RIGHT_MARGIN" value="100" />
<option name="WRAP_COMMENTS" value="true" />
<XML>
<option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" />
diff --git a/tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java b/tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java
index fbe21a8..aaba545 100644
--- a/tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java
+++ b/tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java
@@ -809,11 +809,6 @@
return new CharSequence[] { value };
}
- Bridge.getLog().warning(LayoutLog.TAG_RESOURCES_FORMAT,
- String.format(
- String.format("Unknown value for getTextArray(%d) => %s", //DEBUG
- index, mResourceData[index].getName())), null);
-
return null;
}
diff --git a/tools/layoutlib/bridge/tests/Android.mk b/tools/layoutlib/bridge/tests/Android.mk
index 7a9e067..5e47c8c 100644
--- a/tools/layoutlib/bridge/tests/Android.mk
+++ b/tools/layoutlib/bridge/tests/Android.mk
@@ -34,5 +34,8 @@
include $(BUILD_HOST_JAVA_LIBRARY)
+# Copy the jar to DIST_DIR for sdk builds
+$(call dist-for-goals, sdk win_sdk, $(LOCAL_INSTALLED_MODULE))
+
# Build all sub-directories
include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tools/layoutlib/create/Android.mk b/tools/layoutlib/create/Android.mk
index 9bd48ab..e6f0bc3 100644
--- a/tools/layoutlib/create/Android.mk
+++ b/tools/layoutlib/create/Android.mk
@@ -26,3 +26,6 @@
include $(BUILD_HOST_JAVA_LIBRARY)
+# Build all sub-directories
+include $(call all-makefiles-under,$(LOCAL_PATH))
+
diff --git a/tools/layoutlib/create/tests/Android.mk b/tools/layoutlib/create/tests/Android.mk
index 0052ec2..c197d57 100644
--- a/tools/layoutlib/create/tests/Android.mk
+++ b/tools/layoutlib/create/tests/Android.mk
@@ -28,5 +28,8 @@
include $(BUILD_HOST_JAVA_LIBRARY)
+# Copy the jar to DIST_DIR for sdk builds
+$(call dist-for-goals, sdk win_sdk, $(LOCAL_INSTALLED_MODULE))
+
# Build all sub-directories
include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/wifi/java/android/net/wifi/IWifiScanner.aidl b/wifi/java/android/net/wifi/IWifiScanner.aidl
index fef2d117..3984934 100644
--- a/wifi/java/android/net/wifi/IWifiScanner.aidl
+++ b/wifi/java/android/net/wifi/IWifiScanner.aidl
@@ -17,6 +17,7 @@
package android.net.wifi;
import android.os.Messenger;
+import android.os.Bundle;
/**
* {@hide}
@@ -24,4 +25,6 @@
interface IWifiScanner
{
Messenger getMessenger();
+
+ Bundle getAvailableChannels(int band);
}
diff --git a/wifi/java/android/net/wifi/WifiConfiguration.java b/wifi/java/android/net/wifi/WifiConfiguration.java
index ac2a176..21f200f 100644
--- a/wifi/java/android/net/wifi/WifiConfiguration.java
+++ b/wifi/java/android/net/wifi/WifiConfiguration.java
@@ -341,6 +341,12 @@
/**
* @hide
+ * last time we connected, this configuration had no internet access
+ */
+ public boolean noInternetAccess;
+
+ /**
+ * @hide
* Uid of app creating the configuration
*/
@SystemApi
@@ -673,6 +679,49 @@
@SystemApi
public int numAssociation;
+ /**
+ * @hide
+ * Number of time user disabled WiFi while associated to this configuration with Low RSSI.
+ */
+ public int numUserTriggeredWifiDisableLowRSSI;
+
+ /**
+ * @hide
+ * Number of time user disabled WiFi while associated to this configuration with Bad RSSI.
+ */
+ public int numUserTriggeredWifiDisableBadRSSI;
+
+ /**
+ * @hide
+ * Number of time user disabled WiFi while associated to this configuration
+ * and RSSI was not HIGH.
+ */
+ public int numUserTriggeredWifiDisableNotHighRSSI;
+
+ /**
+ * @hide
+ * Number of ticks associated to this configuration with Low RSSI.
+ */
+ public int numTicksAtLowRSSI;
+
+ /**
+ * @hide
+ * Number of ticks associated to this configuration with Bad RSSI.
+ */
+ public int numTicksAtBadRSSI;
+
+ /**
+ * @hide
+ * Number of ticks associated to this configuration
+ * and RSSI was not HIGH.
+ */
+ public int numTicksAtNotHighRSSI;
+ /**
+ * @hide
+ * Number of time user (WifiManager) triggered association to this configuration.
+ * TODO: count this only for Wifi Settings uuid, so as to not count 3rd party apps
+ */
+ public int numUserTriggeredJoinAttempts;
/**
* @hide
@@ -725,6 +774,7 @@
selfAdded = false;
didSelfAdd = false;
ephemeral = false;
+ noInternetAccess = false;
mIpConfiguration = new IpConfiguration();
}
@@ -824,8 +874,10 @@
sbuf.append(" autoJoinStatus ").append(this.numConnectionFailures).append("\n");
}
if (this.didSelfAdd || this.selfAdded) {
- if (this.didSelfAdd) sbuf.append(" didSelfAdd ");
- if (this.selfAdded) sbuf.append(" selfAdded ");
+ if (this.didSelfAdd) sbuf.append(" didSelfAdd");
+ if (this.selfAdded) sbuf.append(" selfAdded");
+ if (this.noInternetAccess) sbuf.append(" noInternetAccess");
+
sbuf.append("\n");
}
sbuf.append(" KeyMgmt:");
@@ -896,18 +948,44 @@
sbuf.append(mIpConfiguration.toString());
- if (selfAdded) sbuf.append("selfAdded");
- if (creatorUid != 0) sbuf.append("uid=" + Integer.toString(creatorUid));
+ if (this.creatorUid != 0) sbuf.append("uid=" + Integer.toString(creatorUid));
- if (blackListTimestamp != 0) {
+ if (this.blackListTimestamp != 0) {
long now_ms = System.currentTimeMillis();
- long diff = now_ms - blackListTimestamp;
+ long diff = now_ms - this.blackListTimestamp;
if (diff <= 0) {
sbuf.append("blackListed since <incorrect>");
} else {
sbuf.append("blackListed since ").append(Long.toString(diff/1000)).append( "sec");
}
}
+ sbuf.append('\n');
+ if (this.linkedConfigurations != null) {
+ for(String key : this.linkedConfigurations.keySet()) {
+ sbuf.append(" linked: ").append(key);
+ sbuf.append('\n');
+ }
+ }
+ if (this.connectChoices != null) {
+ for(String key : this.connectChoices.keySet()) {
+ Integer choice = this.connectChoices.get(key);
+ if (choice != null) {
+ sbuf.append(" choice: ").append(key);
+ sbuf.append(" = ").append(choice);
+ sbuf.append('\n');
+ }
+ }
+ }
+ sbuf.append(" triggeredLow: ").append(numUserTriggeredWifiDisableLowRSSI);
+ sbuf.append(" triggeredBad: ").append(numUserTriggeredWifiDisableBadRSSI);
+ sbuf.append(" triggeredNotHigh: ").append(numUserTriggeredWifiDisableNotHighRSSI);
+ sbuf.append('\n');
+ sbuf.append(" ticksLow: ").append(numTicksAtLowRSSI);
+ sbuf.append(" ticksBad: ").append(numTicksAtBadRSSI);
+ sbuf.append(" ticksNotHigh: ").append(numTicksAtNotHighRSSI);
+ sbuf.append('\n');
+ sbuf.append(" triggeredJoin: ").append(numUserTriggeredJoinAttempts);
+ sbuf.append('\n');
return sbuf.toString();
}
@@ -1197,7 +1275,7 @@
mCachedConfigKey = null; //force null configKey
autoJoinStatus = source.autoJoinStatus;
selfAdded = source.selfAdded;
-
+ noInternetAccess = source.noInternetAccess;
if (source.visibility != null) {
visibility = new Visibility(source.visibility);
}
@@ -1217,6 +1295,13 @@
numScorerOverride = source.numScorerOverride;
numScorerOverrideAndSwitchedNetwork = source.numScorerOverrideAndSwitchedNetwork;
numAssociation = source.numAssociation;
+ numUserTriggeredWifiDisableLowRSSI = source.numUserTriggeredWifiDisableLowRSSI;
+ numUserTriggeredWifiDisableBadRSSI = source.numUserTriggeredWifiDisableBadRSSI;
+ numUserTriggeredWifiDisableNotHighRSSI = source.numUserTriggeredWifiDisableNotHighRSSI;
+ numTicksAtLowRSSI = source.numTicksAtLowRSSI;
+ numTicksAtBadRSSI = source.numTicksAtBadRSSI;
+ numTicksAtNotHighRSSI = source.numTicksAtNotHighRSSI;
+ numUserTriggeredJoinAttempts = source.numUserTriggeredJoinAttempts;
}
}
@@ -1259,6 +1344,7 @@
dest.writeInt(autoJoinStatus);
dest.writeInt(selfAdded ? 1 : 0);
dest.writeInt(didSelfAdd ? 1 : 0);
+ dest.writeInt(noInternetAccess ? 1 : 0);
dest.writeInt(creatorUid);
dest.writeInt(lastConnectUid);
dest.writeInt(lastUpdateUid);
@@ -1269,6 +1355,14 @@
dest.writeInt(numScorerOverride);
dest.writeInt(numScorerOverrideAndSwitchedNetwork);
dest.writeInt(numAssociation);
+ dest.writeInt(numUserTriggeredWifiDisableLowRSSI);
+ dest.writeInt(numUserTriggeredWifiDisableBadRSSI);
+ dest.writeInt(numUserTriggeredWifiDisableNotHighRSSI);
+ dest.writeInt(numTicksAtLowRSSI);
+ dest.writeInt(numTicksAtBadRSSI);
+ dest.writeInt(numTicksAtNotHighRSSI);
+ dest.writeInt(numUserTriggeredJoinAttempts);
+
}
/** Implement the Parcelable interface {@hide} */
@@ -1307,6 +1401,7 @@
config.autoJoinStatus = in.readInt();
config.selfAdded = in.readInt() != 0;
config.didSelfAdd = in.readInt() != 0;
+ config.noInternetAccess = in.readInt() != 0;
config.creatorUid = in.readInt();
config.lastConnectUid = in.readInt();
config.lastUpdateUid = in.readInt();
@@ -1317,6 +1412,13 @@
config.numScorerOverride = in.readInt();
config.numScorerOverrideAndSwitchedNetwork = in.readInt();
config.numAssociation = in.readInt();
+ config.numUserTriggeredWifiDisableLowRSSI = in.readInt();
+ config.numUserTriggeredWifiDisableBadRSSI = in.readInt();
+ config.numUserTriggeredWifiDisableNotHighRSSI = in.readInt();
+ config.numTicksAtLowRSSI = in.readInt();
+ config.numTicksAtBadRSSI = in.readInt();
+ config.numTicksAtNotHighRSSI = in.readInt();
+ config.numUserTriggeredJoinAttempts = in.readInt();
return config;
}
diff --git a/wifi/java/android/net/wifi/WifiScanner.java b/wifi/java/android/net/wifi/WifiScanner.java
index e7bcb23..65c00bd 100644
--- a/wifi/java/android/net/wifi/WifiScanner.java
+++ b/wifi/java/android/net/wifi/WifiScanner.java
@@ -18,6 +18,7 @@
import android.annotation.SystemApi;
import android.content.Context;
+import android.os.Bundle;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.Looper;
@@ -76,6 +77,9 @@
/** Invalid request */
public static final int REASON_INVALID_REQUEST = -3;
+ /** @hide */
+ public static final String GET_AVAILABLE_CHANNELS_EXTRA = "Channels";
+
/**
* Generic action callback invocation interface
* @hide
@@ -92,7 +96,12 @@
* @hide
*/
public List<Integer> getAvailableChannels(int band) {
- return null;
+ try {
+ Bundle bundle = mService.getAvailableChannels(band);
+ return bundle.getIntegerArrayList(GET_AVAILABLE_CHANNELS_EXTRA);
+ } catch (RemoteException e) {
+ return null;
+ }
}
/**