summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--api/current.txt17
-rw-r--r--api/system-current.txt17
-rw-r--r--core/java/android/app/ApplicationThreadNative.java12
-rw-r--r--core/java/android/app/usage/UsageStatsManagerInternal.java8
-rw-r--r--core/java/android/content/ContentResolver.java15
-rw-r--r--core/java/android/content/IContentService.aidl2
-rw-r--r--core/java/android/content/IntentFilter.java6
-rw-r--r--core/java/android/content/SyncAdaptersCache.java62
-rw-r--r--core/java/android/content/pm/ApplicationInfo.java7
-rw-r--r--core/java/android/content/pm/PackageManagerInternal.java58
-rw-r--r--core/java/android/content/pm/PackageParser.java7
-rw-r--r--core/java/android/content/pm/RegisteredServicesCache.java12
-rw-r--r--core/java/android/hardware/camera2/CameraMetadata.java42
-rw-r--r--core/java/android/hardware/camera2/CaptureRequest.java6
-rw-r--r--core/java/android/hardware/camera2/CaptureResult.java6
-rw-r--r--core/java/android/hardware/camera2/legacy/SurfaceTextureRenderer.java2
-rw-r--r--core/java/android/os/BatteryStats.java32
-rw-r--r--core/java/android/os/Process.java4
-rw-r--r--core/java/android/provider/CallLog.java5
-rw-r--r--core/java/android/webkit/WebViewClient.java21
-rw-r--r--core/java/android/widget/ListPopupWindow.java3
-rw-r--r--core/java/android/widget/RelativeLayout.java18
-rw-r--r--core/java/com/android/internal/os/BatteryStatsImpl.java40
-rw-r--r--core/java/com/android/internal/os/Zygote.java4
-rw-r--r--core/java/com/android/internal/os/ZygoteConnection.java6
-rw-r--r--core/java/com/android/internal/statusbar/IStatusBar.aidl2
-rw-r--r--core/java/com/android/internal/widget/FloatingToolbar.java56
-rw-r--r--core/jni/AndroidRuntime.cpp12
-rw-r--r--docs/html/design/wear/context.jd16
-rw-r--r--docs/html/design/wear/creative-vision.jd13
-rw-r--r--docs/html/design/wear/patterns.jd9
-rw-r--r--docs/html/design/wear/style.jd38
-rw-r--r--docs/html/design/wear/watchfaces.jd140
-rw-r--r--docs/html/tools/building/building-cmdline.jd7
-rw-r--r--graphics/java/android/graphics/drawable/RippleDrawable.java1
-rw-r--r--keystore/java/android/security/keystore/AndroidKeyStoreKeyFactorySpi.java98
-rw-r--r--media/java/android/media/MediaDrm.java21
-rw-r--r--media/java/android/media/MediaDrmResetException.java28
-rw-r--r--media/jni/android_media_ImageReader.cpp5
-rw-r--r--media/jni/android_media_MediaDrm.cpp4
-rw-r--r--media/jni/audioeffect/android_media_AudioEffect.cpp2
-rw-r--r--media/jni/audioeffect/android_media_Visualizer.cpp2
-rw-r--r--packages/SystemUI/res/values/dimens.xml6
-rw-r--r--packages/SystemUI/src/com/android/systemui/assist/AssistDisclosure.java251
-rw-r--r--packages/SystemUI/src/com/android/systemui/assist/AssistManager.java16
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/QSPanel.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/QSTile.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/tiles/DndTile.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/tiles/IntentTile.java6
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/tiles/WifiTile.java4
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java7
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java12
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java6
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/QSTileHost.java4
-rw-r--r--rs/java/android/renderscript/ScriptIntrinsicBLAS.java1737
-rw-r--r--services/core/java/com/android/server/InputMethodManagerService.java34
-rw-r--r--services/core/java/com/android/server/LocationManagerService.java14
-rw-r--r--services/core/java/com/android/server/am/ActivityManagerService.java131
-rw-r--r--services/core/java/com/android/server/am/ActivityStackSupervisor.java25
-rw-r--r--services/core/java/com/android/server/am/UserState.java (renamed from services/core/java/com/android/server/am/UserStartedState.java)11
-rw-r--r--services/core/java/com/android/server/content/ContentService.java15
-rw-r--r--services/core/java/com/android/server/content/SyncManager.java4
-rw-r--r--services/core/java/com/android/server/pm/DefaultPermissionGrantPolicy.java521
-rw-r--r--services/core/java/com/android/server/pm/PackageManagerService.java195
-rw-r--r--services/core/java/com/android/server/pm/PackageSettingBase.java2
-rw-r--r--services/core/java/com/android/server/pm/SettingBase.java22
-rw-r--r--services/core/java/com/android/server/pm/Settings.java97
-rw-r--r--services/core/java/com/android/server/statusbar/StatusBarManagerInternal.java1
-rw-r--r--services/core/java/com/android/server/statusbar/StatusBarManagerService.java10
-rw-r--r--services/core/java/com/android/server/wm/WindowStateAnimator.java19
-rw-r--r--services/usage/java/com/android/server/usage/UsageStatsService.java48
-rw-r--r--services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java17
-rw-r--r--services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerServiceImpl.java2
-rw-r--r--services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionSessionConnection.java24
-rw-r--r--telephony/java/android/telephony/CarrierConfigManager.java17
76 files changed, 3613 insertions, 519 deletions
diff --git a/api/current.txt b/api/current.txt
index 8c32371..73a252b 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -15863,6 +15863,10 @@ package android.media {
ctor public MediaDrmException(java.lang.String);
}
+ public class MediaDrmResetException extends java.lang.IllegalStateException {
+ ctor public MediaDrmResetException(java.lang.String);
+ }
+
public final class MediaExtractor {
ctor public MediaExtractor();
method public boolean advance();
@@ -28070,18 +28074,6 @@ package android.renderscript {
field public static final int UPPER = 121; // 0x79
}
- public static abstract class ScriptIntrinsicBLAS.Diag implements java.lang.annotation.Annotation {
- }
-
- public static abstract class ScriptIntrinsicBLAS.Side implements java.lang.annotation.Annotation {
- }
-
- public static abstract class ScriptIntrinsicBLAS.Transpose implements java.lang.annotation.Annotation {
- }
-
- public static abstract class ScriptIntrinsicBLAS.Uplo implements java.lang.annotation.Annotation {
- }
-
public class ScriptIntrinsicBlend extends android.renderscript.ScriptIntrinsic {
method public static android.renderscript.ScriptIntrinsicBlend create(android.renderscript.RenderScript, android.renderscript.Element);
method public void forEachAdd(android.renderscript.Allocation, android.renderscript.Allocation);
@@ -30624,6 +30616,7 @@ package android.telephony {
field public static final java.lang.String KEY_CARRIER_WFC_IMS_AVAILABLE_BOOL = "carrier_wfc_ims_available_bool";
field public static final java.lang.String KEY_CDMA_NONROAMING_NETWORKS_STRING_ARRAY = "cdma_nonroaming_networks_string_array";
field public static final java.lang.String KEY_CDMA_ROAMING_NETWORKS_STRING_ARRAY = "cdma_roaming_networks_string_array";
+ field public static final java.lang.String KEY_CSP_ENABLED_BOOL = "csp_enabled_bool";
field public static final java.lang.String KEY_DEFAULT_SIM_CALL_MANAGER_STRING = "default_sim_call_manager_string";
field public static final java.lang.String KEY_DISABLE_CDMA_ACTIVATION_CODE_BOOL = "disable_cdma_activation_code_bool";
field public static final java.lang.String KEY_DTMF_TYPE_ENABLED_BOOL = "dtmf_type_enabled_bool";
diff --git a/api/system-current.txt b/api/system-current.txt
index 2b5c9d8..9cfdf5f 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -17118,6 +17118,10 @@ package android.media {
ctor public MediaDrmException(java.lang.String);
}
+ public class MediaDrmResetException extends java.lang.IllegalStateException {
+ ctor public MediaDrmResetException(java.lang.String);
+ }
+
public final class MediaExtractor {
ctor public MediaExtractor();
method public boolean advance();
@@ -30118,18 +30122,6 @@ package android.renderscript {
field public static final int UPPER = 121; // 0x79
}
- public static abstract class ScriptIntrinsicBLAS.Diag implements java.lang.annotation.Annotation {
- }
-
- public static abstract class ScriptIntrinsicBLAS.Side implements java.lang.annotation.Annotation {
- }
-
- public static abstract class ScriptIntrinsicBLAS.Transpose implements java.lang.annotation.Annotation {
- }
-
- public static abstract class ScriptIntrinsicBLAS.Uplo implements java.lang.annotation.Annotation {
- }
-
public class ScriptIntrinsicBlend extends android.renderscript.ScriptIntrinsic {
method public static android.renderscript.ScriptIntrinsicBlend create(android.renderscript.RenderScript, android.renderscript.Element);
method public void forEachAdd(android.renderscript.Allocation, android.renderscript.Allocation);
@@ -32847,6 +32839,7 @@ package android.telephony {
field public static final java.lang.String KEY_CARRIER_WFC_IMS_AVAILABLE_BOOL = "carrier_wfc_ims_available_bool";
field public static final java.lang.String KEY_CDMA_NONROAMING_NETWORKS_STRING_ARRAY = "cdma_nonroaming_networks_string_array";
field public static final java.lang.String KEY_CDMA_ROAMING_NETWORKS_STRING_ARRAY = "cdma_roaming_networks_string_array";
+ field public static final java.lang.String KEY_CSP_ENABLED_BOOL = "csp_enabled_bool";
field public static final java.lang.String KEY_DEFAULT_SIM_CALL_MANAGER_STRING = "default_sim_call_manager_string";
field public static final java.lang.String KEY_DISABLE_CDMA_ACTIVATION_CODE_BOOL = "disable_cdma_activation_code_bool";
field public static final java.lang.String KEY_DTMF_TYPE_ENABLED_BOOL = "dtmf_type_enabled_bool";
diff --git a/core/java/android/app/ApplicationThreadNative.java b/core/java/android/app/ApplicationThreadNative.java
index 1461380..e178087 100644
--- a/core/java/android/app/ApplicationThreadNative.java
+++ b/core/java/android/app/ApplicationThreadNative.java
@@ -35,6 +35,9 @@ import android.os.RemoteException;
import android.os.IBinder;
import android.os.Parcel;
import android.os.ParcelFileDescriptor;
+import android.os.TransactionTooLargeException;
+import android.util.Log;
+
import com.android.internal.app.IVoiceInteractor;
import com.android.internal.content.ReferrerIntent;
@@ -921,8 +924,13 @@ class ApplicationThreadProxy implements IApplicationThread {
info.writeToParcel(data, 0);
compatInfo.writeToParcel(data, 0);
data.writeInt(processState);
- mRemote.transact(SCHEDULE_CREATE_SERVICE_TRANSACTION, data, null,
- IBinder.FLAG_ONEWAY);
+ try {
+ mRemote.transact(SCHEDULE_CREATE_SERVICE_TRANSACTION, data, null,
+ IBinder.FLAG_ONEWAY);
+ } catch (TransactionTooLargeException e) {
+ Log.e("CREATE_SERVICE", "Binder failure starting service; service=" + info);
+ throw e;
+ }
data.recycle();
}
diff --git a/core/java/android/app/usage/UsageStatsManagerInternal.java b/core/java/android/app/usage/UsageStatsManagerInternal.java
index 7bcc038..8a31390 100644
--- a/core/java/android/app/usage/UsageStatsManagerInternal.java
+++ b/core/java/android/app/usage/UsageStatsManagerInternal.java
@@ -54,6 +54,14 @@ public abstract class UsageStatsManagerInternal {
public abstract void reportConfigurationChange(Configuration config, int userId);
/**
+ * Reports that a content provider has been accessed by a foreground app.
+ * @param name The authority of the content provider
+ * @param pkgName The package name of the content provider
+ * @param userId The user in which the content provider was accessed.
+ */
+ public abstract void reportContentProviderUsage(String name, String pkgName, int userId);
+
+ /**
* Prepares the UsageStatsService for shutdown.
*/
public abstract void prepareShutdown();
diff --git a/core/java/android/content/ContentResolver.java b/core/java/android/content/ContentResolver.java
index 057001c..d37dda0 100644
--- a/core/java/android/content/ContentResolver.java
+++ b/core/java/android/content/ContentResolver.java
@@ -48,6 +48,7 @@ import android.util.Log;
import dalvik.system.CloseGuard;
+import com.android.internal.util.ArrayUtils;
import com.android.internal.util.Preconditions;
import java.io.File;
@@ -57,6 +58,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import java.util.Random;
@@ -1936,6 +1938,19 @@ public abstract class ContentResolver {
}
/**
+ * @hide
+ * Returns the package names of syncadapters that match a given user and authority.
+ */
+ public static String[] getSyncAdapterPackagesForAuthorityAsUser(String authority,
+ int userId) {
+ try {
+ return getContentService().getSyncAdapterPackagesForAuthorityAsUser(authority, userId);
+ } catch (RemoteException e) {
+ }
+ return ArrayUtils.emptyArray(String.class);
+ }
+
+ /**
* Check if the provider should be synced when a network tickle is received
* <p>This method requires the caller to hold the permission
* {@link android.Manifest.permission#READ_SYNC_SETTINGS}.
diff --git a/core/java/android/content/IContentService.aidl b/core/java/android/content/IContentService.aidl
index 9998f08..8b471a0 100644
--- a/core/java/android/content/IContentService.aidl
+++ b/core/java/android/content/IContentService.aidl
@@ -143,6 +143,8 @@ interface IContentService {
SyncAdapterType[] getSyncAdapterTypes();
SyncAdapterType[] getSyncAdapterTypesAsUser(int userId);
+ String[] getSyncAdapterPackagesForAuthorityAsUser(String authority, int userId);
+
/**
* Returns true if there is currently a operation for the given account/authority or service
* actively being processed.
diff --git a/core/java/android/content/IntentFilter.java b/core/java/android/content/IntentFilter.java
index 08c5236..d83dfc5 100644
--- a/core/java/android/content/IntentFilter.java
+++ b/core/java/android/content/IntentFilter.java
@@ -1480,7 +1480,11 @@ public class IntentFilter implements Parcelable {
* Write the contents of the IntentFilter as an XML stream.
*/
public void writeToXml(XmlSerializer serializer) throws IOException {
- serializer.attribute(null, AUTO_VERIFY_STR, Boolean.toString(getAutoVerify()));
+
+ if (getAutoVerify()) {
+ serializer.attribute(null, AUTO_VERIFY_STR, Boolean.toString(true));
+ }
+
int N = countActions();
for (int i=0; i<N; i++) {
serializer.startTag(null, ACTION_STR);
diff --git a/core/java/android/content/SyncAdaptersCache.java b/core/java/android/content/SyncAdaptersCache.java
index 8bb3ee7..6704b75 100644
--- a/core/java/android/content/SyncAdaptersCache.java
+++ b/core/java/android/content/SyncAdaptersCache.java
@@ -20,12 +20,19 @@ import android.content.pm.RegisteredServicesCache;
import android.content.pm.XmlSerializerAndParser;
import android.content.res.Resources;
import android.content.res.TypedArray;
+import android.util.ArrayMap;
import android.util.AttributeSet;
+import android.util.SparseArray;
+
+import com.android.internal.annotations.GuardedBy;
+
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlSerializer;
import org.xmlpull.v1.XmlPullParserException;
import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
/**
* A cache of services that export the {@link android.content.ISyncAdapter} interface.
@@ -39,6 +46,10 @@ public class SyncAdaptersCache extends RegisteredServicesCache<SyncAdapterType>
private static final String ATTRIBUTES_NAME = "sync-adapter";
private static final MySerializer sSerializer = new MySerializer();
+ @GuardedBy("mServicesLock")
+ private SparseArray<ArrayMap<String,String[]>> mAuthorityToSyncAdapters
+ = new SparseArray<>();
+
public SyncAdaptersCache(Context context) {
super(context, SERVICE_INTERFACE, SERVICE_META_DATA, ATTRIBUTES_NAME, sSerializer);
}
@@ -76,6 +87,57 @@ public class SyncAdaptersCache extends RegisteredServicesCache<SyncAdapterType>
}
}
+ @Override
+ protected void onServicesChangedLocked(int userId) {
+ synchronized (mServicesLock) {
+ ArrayMap<String,String[]> adapterMap = mAuthorityToSyncAdapters.get(userId);
+ if (adapterMap != null) {
+ adapterMap.clear();
+ }
+ }
+
+ super.onServicesChangedLocked(userId);
+ }
+
+ public String[] getSyncAdapterPackagesForAuthority(String authority, int userId) {
+ synchronized (mServicesLock) {
+ ArrayMap<String,String[]> adapterMap = mAuthorityToSyncAdapters.get(userId);
+ if (adapterMap == null) {
+ adapterMap = new ArrayMap<>();
+ mAuthorityToSyncAdapters.put(userId, adapterMap);
+ }
+ // If the mapping exists, return it
+ if (adapterMap.containsKey(authority)) {
+ return adapterMap.get(authority);
+ }
+ // Create the mapping and cache it
+ String[] syncAdapterPackages;
+ final Collection<RegisteredServicesCache.ServiceInfo<SyncAdapterType>> serviceInfos;
+ serviceInfos = getAllServices(userId);
+ ArrayList<String> packages = new ArrayList<>();
+ for (RegisteredServicesCache.ServiceInfo<SyncAdapterType> serviceInfo : serviceInfos) {
+ if (authority.equals(serviceInfo.type.authority)
+ && serviceInfo.componentName != null) {
+ packages.add(serviceInfo.componentName.getPackageName());
+ }
+ }
+ syncAdapterPackages = new String[packages.size()];
+ packages.toArray(syncAdapterPackages);
+ adapterMap.put(authority, syncAdapterPackages);
+
+ return syncAdapterPackages;
+ }
+ }
+
+ @Override
+ protected void onUserRemoved(int userId) {
+ synchronized (mServicesLock) {
+ mAuthorityToSyncAdapters.remove(userId);
+ }
+
+ super.onUserRemoved(userId);
+ }
+
static class MySerializer implements XmlSerializerAndParser<SyncAdapterType> {
public void writeAsXml(SyncAdapterType item, XmlSerializer out) throws IOException {
out.attribute(null, "authority", item.authority);
diff --git a/core/java/android/content/pm/ApplicationInfo.java b/core/java/android/content/pm/ApplicationInfo.java
index 9fb6f4d..6feb860 100644
--- a/core/java/android/content/pm/ApplicationInfo.java
+++ b/core/java/android/content/pm/ApplicationInfo.java
@@ -962,6 +962,13 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
/**
* @hide
*/
+ public boolean isPrivilegedApp() {
+ return (privateFlags & ApplicationInfo.PRIVATE_FLAG_PRIVILEGED) != 0;
+ }
+
+ /**
+ * @hide
+ */
public boolean isUpdatedSystemApp() {
return (flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0;
}
diff --git a/core/java/android/content/pm/PackageManagerInternal.java b/core/java/android/content/pm/PackageManagerInternal.java
new file mode 100644
index 0000000..7599bd6
--- /dev/null
+++ b/core/java/android/content/pm/PackageManagerInternal.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.content.pm;
+
+import android.annotation.NonNull;
+
+/**
+ * Package manager local system service interface.
+ *
+ * @hide Only for use within the system server.
+ */
+public abstract class PackageManagerInternal {
+
+ /**
+ * Provider for package names.
+ */
+ public interface PackagesProvider {
+
+ /**
+ * Gets the packages for a given user.
+ * @param userId The user id.
+ * @return The package names.
+ */
+ public String[] getPackages(int userId);
+ }
+
+ /**
+ * Sets the location provider packages provider.
+ * @param provider The packages provider.
+ */
+ public abstract void setLocationPackagesProvider(PackagesProvider provider);
+
+ /**
+ * Sets the input method packages provider.
+ * @param provider The packages provider.
+ */
+ public abstract void setImePackagesProvider(PackagesProvider provider);
+
+ /**
+ * Sets the voice interaction packages provider.
+ * @param provider The packages provider.
+ */
+ public abstract void setVoiceInteractionPackagesProvider(PackagesProvider provider);
+}
diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java
index 287e0c5..faf71ee 100644
--- a/core/java/android/content/pm/PackageParser.java
+++ b/core/java/android/content/pm/PackageParser.java
@@ -4508,6 +4508,13 @@ public class PackageParser {
/**
* @hide
*/
+ public boolean isPrivilegedApp() {
+ return applicationInfo.isPrivilegedApp();
+ }
+
+ /**
+ * @hide
+ */
public boolean isUpdatedSystemApp() {
return applicationInfo.isUpdatedSystemApp();
}
diff --git a/core/java/android/content/pm/RegisteredServicesCache.java b/core/java/android/content/pm/RegisteredServicesCache.java
index 0bd2a3b..b293e2a 100644
--- a/core/java/android/content/pm/RegisteredServicesCache.java
+++ b/core/java/android/content/pm/RegisteredServicesCache.java
@@ -84,7 +84,7 @@ public abstract class RegisteredServicesCache<V> {
private final String mAttributesName;
private final XmlSerializerAndParser<V> mSerializerAndParser;
- private final Object mServicesLock = new Object();
+ protected final Object mServicesLock = new Object();
@GuardedBy("mServicesLock")
private final SparseArray<UserServices<V>> mUserServices = new SparseArray<UserServices<V>>(2);
@@ -232,6 +232,7 @@ public abstract class RegisteredServicesCache<V> {
synchronized (mServicesLock) {
final UserServices<V> user = findOrCreateUserLocked(userId);
user.services = null;
+ onServicesChangedLocked(userId);
}
}
@@ -489,11 +490,16 @@ public abstract class RegisteredServicesCache<V> {
}
}
if (changed) {
+ onServicesChangedLocked(userId);
writePersistentServicesLocked(user, userId);
}
}
}
+ protected void onServicesChangedLocked(int userId) {
+ // Feel free to override
+ }
+
/**
* Returns true if the list of changed uids is null (wildcard) or the specified uid
* is contained in the list of changed uids.
@@ -687,7 +693,9 @@ public abstract class RegisteredServicesCache<V> {
@VisibleForTesting
protected void onUserRemoved(int userId) {
- mUserServices.remove(userId);
+ synchronized (mServicesLock) {
+ mUserServices.remove(userId);
+ }
}
@VisibleForTesting
diff --git a/core/java/android/hardware/camera2/CameraMetadata.java b/core/java/android/hardware/camera2/CameraMetadata.java
index f8db6d9..c656fb8 100644
--- a/core/java/android/hardware/camera2/CameraMetadata.java
+++ b/core/java/android/hardware/camera2/CameraMetadata.java
@@ -667,7 +667,7 @@ public abstract class CameraMetadata<TKey> {
* {@link android.hardware.camera2.params.StreamConfigurationMap#getHighSpeedVideoSizes }.
* The fps range can be controlled via {@link CaptureRequest#CONTROL_AE_TARGET_FPS_RANGE android.control.aeTargetFpsRange}.</p>
* <p>In this capability, the camera device will override aeMode, awbMode, and afMode to
- * ON, ON, and CONTINUOUS_VIDEO, respectively. All post-processing block mode
+ * ON, AUTO, and CONTINUOUS_VIDEO, respectively. All post-processing block mode
* controls will be overridden to be FAST. Therefore, no manual control of capture
* and post-processing parameters is possible. All other controls operate the
* same as when {@link CaptureRequest#CONTROL_MODE android.control.mode} == AUTO. This means that all other
@@ -1666,9 +1666,9 @@ public abstract class CameraMetadata<TKey> {
* <p>Enabling this disables control.aeMode, control.awbMode and
* control.afMode controls; the camera device will ignore
* those settings while USE_SCENE_MODE is active (except for
- * FACE_PRIORITY scene mode). Other control entries are still
- * active. This setting can only be used if scene mode is
- * supported (i.e. {@link CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES android.control.availableSceneModes}
+ * FACE_PRIORITY scene mode). Other control entries are still active.
+ * This setting can only be used if scene mode is supported (i.e.
+ * {@link CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES android.control.availableSceneModes}
* contain some modes other than DISABLED).</p>
*
* @see CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES
@@ -1940,6 +1940,40 @@ public abstract class CameraMetadata<TKey> {
*/
public static final int CONTROL_SCENE_MODE_HDR = 18;
+ /**
+ * <p>Same as FACE_PRIORITY scene mode, except that the camera
+ * device will choose higher sensivity values ({@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity})
+ * under low light conditions.</p>
+ * <p>The camera device may be tuned to expose the images in a reduced
+ * sensitivity range to produce the best quality images. For example,
+ * if the {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange} gives range of [100, 1600],
+ * the camera device auto-exposure routine tuning process may limit the actual
+ * exposure sensivity range to [100, 1200] to ensure that the noise level isn't
+ * exessive to compromise the image quality. Under this situation, the image under
+ * low light may be under-exposed when the sensor max exposure time (bounded by the
+ * {@link CaptureRequest#CONTROL_AE_TARGET_FPS_RANGE android.control.aeTargetFpsRange} when {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is one of the
+ * ON_* modes) and effecitve max sensitivity are reached. This scene mode allows the
+ * camera device auto-exposure routine to increase the sensitivity up to the max
+ * sensitivity specified by {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange} when the scene is too
+ * dark and the max exposure time is reached. The captured images may be noisier
+ * compared with the images captured in normal FACE_PRIORITY mode, therefore, it is
+ * recommended that the application only use this scene mode when it is capable of
+ * reducing the noise level of the captured images.</p>
+ * <p>Unlike the other scene modes, {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode},
+ * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}, and {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}
+ * remain active when FACE_PRIORITY_LOW_LIGHT is set.</p>
+ *
+ * @see CaptureRequest#CONTROL_AE_MODE
+ * @see CaptureRequest#CONTROL_AE_TARGET_FPS_RANGE
+ * @see CaptureRequest#CONTROL_AF_MODE
+ * @see CaptureRequest#CONTROL_AWB_MODE
+ * @see CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE
+ * @see CaptureRequest#SENSOR_SENSITIVITY
+ * @see CaptureRequest#CONTROL_SCENE_MODE
+ * @hide
+ */
+ public static final int CONTROL_SCENE_MODE_FACE_PRIORITY_LOW_LIGHT = 19;
+
//
// Enumeration values for CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE
//
diff --git a/core/java/android/hardware/camera2/CaptureRequest.java b/core/java/android/hardware/camera2/CaptureRequest.java
index bc625dd..9fa6687 100644
--- a/core/java/android/hardware/camera2/CaptureRequest.java
+++ b/core/java/android/hardware/camera2/CaptureRequest.java
@@ -1448,9 +1448,9 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>>
* <p>Scene modes are custom camera modes optimized for a certain set of conditions and
* capture settings.</p>
* <p>This is the mode that that is active when
- * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code>. Aside from FACE_PRIORITY,
- * these modes will disable {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode},
- * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}, and {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} while in use.</p>
+ * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code>. Aside from FACE_PRIORITY, these modes will
+ * disable {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}, {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}, and {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}
+ * while in use.</p>
* <p>The interpretation and implementation of these scene modes is left
* to the implementor of the camera device. Their behavior will not be
* consistent across all devices, and any given device may only implement
diff --git a/core/java/android/hardware/camera2/CaptureResult.java b/core/java/android/hardware/camera2/CaptureResult.java
index da216aa..b1fb615 100644
--- a/core/java/android/hardware/camera2/CaptureResult.java
+++ b/core/java/android/hardware/camera2/CaptureResult.java
@@ -1960,9 +1960,9 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> {
* <p>Scene modes are custom camera modes optimized for a certain set of conditions and
* capture settings.</p>
* <p>This is the mode that that is active when
- * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code>. Aside from FACE_PRIORITY,
- * these modes will disable {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode},
- * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}, and {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} while in use.</p>
+ * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code>. Aside from FACE_PRIORITY, these modes will
+ * disable {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}, {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}, and {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}
+ * while in use.</p>
* <p>The interpretation and implementation of these scene modes is left
* to the implementor of the camera device. Their behavior will not be
* consistent across all devices, and any given device may only implement
diff --git a/core/java/android/hardware/camera2/legacy/SurfaceTextureRenderer.java b/core/java/android/hardware/camera2/legacy/SurfaceTextureRenderer.java
index f928a55..bc80fc1 100644
--- a/core/java/android/hardware/camera2/legacy/SurfaceTextureRenderer.java
+++ b/core/java/android/hardware/camera2/legacy/SurfaceTextureRenderer.java
@@ -630,8 +630,6 @@ public class SurfaceTextureRenderer {
holder.width = surfaceSize.getWidth();
holder.height = surfaceSize.getHeight();
if (LegacyCameraDevice.needsConversion(s)) {
- // Always override to YV12 output for YUV surface formats.
- LegacyCameraDevice.setSurfaceFormat(s, ImageFormat.YV12);
mConversionSurfaces.add(holder);
} else {
mSurfaces.add(holder);
diff --git a/core/java/android/os/BatteryStats.java b/core/java/android/os/BatteryStats.java
index eb6e1c2..593f804 100644
--- a/core/java/android/os/BatteryStats.java
+++ b/core/java/android/os/BatteryStats.java
@@ -65,7 +65,7 @@ public abstract class BatteryStats implements Parcelable {
* A constant indicating a window wake lock timer.
*/
public static final int WAKE_TYPE_WINDOW = 2;
-
+
/**
* A constant indicating a sensor timer.
*/
@@ -142,6 +142,11 @@ public abstract class BatteryStats implements Parcelable {
public static final int CAMERA_TURNED_ON = 17;
/**
+ * A constant indicating a doze wake lock timer.
+ */
+ public static final int WAKE_TYPE_DOZE = 18;
+
+ /**
* Include all of the data in the stats, including previously saved data.
*/
public static final int STATS_SINCE_CHARGED = 0;
@@ -3834,6 +3839,7 @@ public abstract class BatteryStats implements Parcelable {
final ArrayMap<String, ? extends BatteryStats.Uid.Wakelock> wakelocks
= u.getWakelockStats();
long totalFullWakelock = 0, totalPartialWakelock = 0, totalWindowWakelock = 0;
+ long totalDozeWakelock = 0;
int countWakelock = 0;
for (int iw=wakelocks.size()-1; iw>=0; iw--) {
final Uid.Wakelock wl = wakelocks.valueAt(iw);
@@ -3848,19 +3854,21 @@ public abstract class BatteryStats implements Parcelable {
"partial", which, linePrefix);
linePrefix = printWakeLock(sb, wl.getWakeTime(WAKE_TYPE_WINDOW), rawRealtime,
"window", which, linePrefix);
- if (true || !linePrefix.equals(": ")) {
- sb.append(" realtime");
- // Only print out wake locks that were held
- pw.println(sb.toString());
- uidActivity = true;
- countWakelock++;
- }
+ linePrefix = printWakeLock(sb, wl.getWakeTime(WAKE_TYPE_DOZE), rawRealtime,
+ "doze", which, linePrefix);
+ sb.append(" realtime");
+ pw.println(sb.toString());
+ uidActivity = true;
+ countWakelock++;
+
totalFullWakelock += computeWakeLock(wl.getWakeTime(WAKE_TYPE_FULL),
rawRealtime, which);
totalPartialWakelock += computeWakeLock(wl.getWakeTime(WAKE_TYPE_PARTIAL),
rawRealtime, which);
totalWindowWakelock += computeWakeLock(wl.getWakeTime(WAKE_TYPE_WINDOW),
rawRealtime, which);
+ totalDozeWakelock += computeWakeLock(wl.getWakeTime(WAKE_TYPE_DOZE),
+ rawRealtime, which);
}
if (countWakelock > 1) {
if (totalFullWakelock != 0 || totalPartialWakelock != 0
@@ -3890,6 +3898,14 @@ public abstract class BatteryStats implements Parcelable {
formatTimeMs(sb, totalWindowWakelock);
sb.append("window");
}
+ if (totalDozeWakelock != 0) {
+ if (needComma) {
+ sb.append(",");
+ }
+ needComma = true;
+ formatTimeMs(sb, totalDozeWakelock);
+ sb.append("doze");
+ }
sb.append(" realtime");
pw.println(sb.toString());
}
diff --git a/core/java/android/os/Process.java b/core/java/android/os/Process.java
index dbb5146..f9c50f3 100644
--- a/core/java/android/os/Process.java
+++ b/core/java/android/os/Process.java
@@ -635,8 +635,8 @@ public class Process {
if ((debugFlags & Zygote.DEBUG_ENABLE_JIT) != 0) {
argsForZygote.add("--enable-jit");
}
- if ((debugFlags & Zygote.DEBUG_GENERATE_CFI) != 0) {
- argsForZygote.add("--generate-cfi");
+ if ((debugFlags & Zygote.DEBUG_GENERATE_DEBUG_INFO) != 0) {
+ argsForZygote.add("--generate-debug-info");
}
if ((debugFlags & Zygote.DEBUG_ENABLE_ASSERT) != 0) {
argsForZygote.add("--enable-assert");
diff --git a/core/java/android/provider/CallLog.java b/core/java/android/provider/CallLog.java
index 7d57233..23555d6 100644
--- a/core/java/android/provider/CallLog.java
+++ b/core/java/android/provider/CallLog.java
@@ -518,11 +518,6 @@ public class CallLog {
if (callType == MISSED_TYPE) {
values.put(IS_READ, Integer.valueOf(0));
}
- if (ci != null) {
- values.put(CACHED_NAME, ci.name);
- values.put(CACHED_NUMBER_TYPE, ci.numberType);
- values.put(CACHED_NUMBER_LABEL, ci.numberLabel);
- }
if ((ci != null) && (ci.contactIdOrZero > 0)) {
// Update usage information for the number associated with the contact ID.
diff --git a/core/java/android/webkit/WebViewClient.java b/core/java/android/webkit/WebViewClient.java
index 2f5c9e2..7db88af 100644
--- a/core/java/android/webkit/WebViewClient.java
+++ b/core/java/android/webkit/WebViewClient.java
@@ -298,14 +298,27 @@ public class WebViewClient {
* Notify the host application to handle a SSL client certificate
* request. The host application is responsible for showing the UI
* if desired and providing the keys. There are three ways to
- * respond: proceed(), cancel() or ignore(). Webview remembers the
- * response if proceed() or cancel() is called and does not
- * call onReceivedClientCertRequest() again for the same host and port
- * pair. Webview does not remember the response if ignore() is called.
+ * respond: proceed(), cancel() or ignore(). Webview stores the response
+ * in memory (for the life of the application) if proceed() or cancel() is
+ * called and does not call onReceivedClientCertRequest() again for the
+ * same host and port pair. Webview does not store the response if ignore()
+ * is called.
*
* This method is called on the UI thread. During the callback, the
* connection is suspended.
*
+ * For most use cases, the application program should implement the
+ * {@link android.security.KeyChainAliasCallback} interface and pass it to
+ * {@link android.security.KeyChain.choosePrivateKeyAlias} to start an
+ * activity for the user to choose the proper alias. The keychain activity will
+ * provide the alias through the callback method in the implemented interface. Next
+ * the application should create an async task to call
+ * {@link android.security.KeyChain.getPrivateKey} to receive the key.
+ *
+ * An example implementation of client certificates can be seen at
+ * <A href="https://android.googlesource.com/platform/packages/apps/Browser/+/android-5.1.1_r1/src/com/android/browser/Tab.java">
+ * AOSP Browser</a>
+ *
* The default behavior is to cancel, returning no client certificate.
*
* @param view The WebView that is initiating the callback
diff --git a/core/java/android/widget/ListPopupWindow.java b/core/java/android/widget/ListPopupWindow.java
index afc683a..534bfad 100644
--- a/core/java/android/widget/ListPopupWindow.java
+++ b/core/java/android/widget/ListPopupWindow.java
@@ -105,7 +105,7 @@ public class ListPopupWindow {
private final ListSelectorHider mHideSelector = new ListSelectorHider();
private Runnable mShowDropDownRunnable;
- private Handler mHandler = new Handler();
+ private final Handler mHandler;
private Rect mTempRect = new Rect();
@@ -212,6 +212,7 @@ public class ListPopupWindow {
*/
public ListPopupWindow(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
mContext = context;
+ mHandler = new Handler(context.getMainLooper());
final TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.ListPopupWindow,
defStyleAttr, defStyleRes);
diff --git a/core/java/android/widget/RelativeLayout.java b/core/java/android/widget/RelativeLayout.java
index 339038e..affc5da 100644
--- a/core/java/android/widget/RelativeLayout.java
+++ b/core/java/android/widget/RelativeLayout.java
@@ -522,7 +522,7 @@ public class RelativeLayout extends ViewGroup {
View baselineView = null;
LayoutParams baselineParams = null;
for (int i = 0; i < count; i++) {
- final View child = views[i];
+ final View child = getChildAt(i);
if (child.getVisibility() != GONE) {
final LayoutParams childParams = (LayoutParams) child.getLayoutParams();
if (baselineView == null || baselineParams == null
@@ -548,9 +548,9 @@ public class RelativeLayout extends ViewGroup {
if (offsetHorizontalAxis) {
for (int i = 0; i < count; i++) {
- final View child = views[i];
+ View child = getChildAt(i);
if (child.getVisibility() != GONE) {
- final LayoutParams params = (LayoutParams) child.getLayoutParams();
+ LayoutParams params = (LayoutParams) child.getLayoutParams();
final int[] rules = params.getRules(layoutDirection);
if (rules[CENTER_IN_PARENT] != 0 || rules[CENTER_HORIZONTAL] != 0) {
centerHorizontal(child, params, width);
@@ -578,9 +578,9 @@ public class RelativeLayout extends ViewGroup {
if (offsetVerticalAxis) {
for (int i = 0; i < count; i++) {
- final View child = views[i];
+ View child = getChildAt(i);
if (child.getVisibility() != GONE) {
- final LayoutParams params = (LayoutParams) child.getLayoutParams();
+ LayoutParams params = (LayoutParams) child.getLayoutParams();
final int[] rules = params.getRules(layoutDirection);
if (rules[CENTER_IN_PARENT] != 0 || rules[CENTER_VERTICAL] != 0) {
centerVertical(child, params, height);
@@ -607,9 +607,9 @@ public class RelativeLayout extends ViewGroup {
final int verticalOffset = contentBounds.top - top;
if (horizontalOffset != 0 || verticalOffset != 0) {
for (int i = 0; i < count; i++) {
- final View child = views[i];
+ View child = getChildAt(i);
if (child.getVisibility() != GONE && child != ignore) {
- final LayoutParams params = (LayoutParams) child.getLayoutParams();
+ LayoutParams params = (LayoutParams) child.getLayoutParams();
if (horizontalGravity) {
params.mLeft += horizontalOffset;
params.mRight += horizontalOffset;
@@ -626,9 +626,9 @@ public class RelativeLayout extends ViewGroup {
if (isLayoutRtl()) {
final int offsetWidth = myWidth - width;
for (int i = 0; i < count; i++) {
- final View child = views[i];
+ View child = getChildAt(i);
if (child.getVisibility() != GONE) {
- final LayoutParams params = (LayoutParams) child.getLayoutParams();
+ LayoutParams params = (LayoutParams) child.getLayoutParams();
params.mLeft -= offsetWidth;
params.mRight -= offsetWidth;
}
diff --git a/core/java/com/android/internal/os/BatteryStatsImpl.java b/core/java/com/android/internal/os/BatteryStatsImpl.java
index 229079f..83ce5f6 100644
--- a/core/java/com/android/internal/os/BatteryStatsImpl.java
+++ b/core/java/com/android/internal/os/BatteryStatsImpl.java
@@ -106,7 +106,7 @@ public final class BatteryStatsImpl extends BatteryStats {
private static final int MAGIC = 0xBA757475; // 'BATSTATS'
// Current on-disk Parcel version
- private static final int VERSION = 128 + (USE_OLD_HISTORY ? 1000 : 0);
+ private static final int VERSION = 129 + (USE_OLD_HISTORY ? 1000 : 0);
// Maximum number of items we will record in the history.
private static final int MAX_HISTORY_ITEMS = 2000;
@@ -208,6 +208,7 @@ public final class BatteryStatsImpl extends BatteryStats {
final ArrayList<StopwatchTimer> mPartialTimers = new ArrayList<>();
final ArrayList<StopwatchTimer> mFullTimers = new ArrayList<>();
final ArrayList<StopwatchTimer> mWindowTimers = new ArrayList<>();
+ final ArrayList<StopwatchTimer> mDozeTimers = new ArrayList<>();
final SparseArray<ArrayList<StopwatchTimer>> mSensorTimers = new SparseArray<>();
final ArrayList<StopwatchTimer> mWifiRunningTimers = new ArrayList<>();
final ArrayList<StopwatchTimer> mFullWifiLockTimers = new ArrayList<>();
@@ -5648,6 +5649,11 @@ public final class BatteryStatsImpl extends BatteryStats {
StopwatchTimer mTimerWindow;
/**
+ * How long (in ms) this uid has had a doze wake lock.
+ */
+ StopwatchTimer mTimerDoze;
+
+ /**
* Reads a possibly null Timer from a Parcel. The timer is associated with the
* proper timer pool from the given BatteryStatsImpl object.
*
@@ -5674,6 +5680,9 @@ public final class BatteryStatsImpl extends BatteryStats {
if (mTimerWindow != null) {
wlactive |= !mTimerWindow.reset(false);
}
+ if (mTimerDoze != null) {
+ wlactive |= !mTimerDoze.reset(false);
+ }
if (!wlactive) {
if (mTimerFull != null) {
mTimerFull.detach();
@@ -5687,6 +5696,10 @@ public final class BatteryStatsImpl extends BatteryStats {
mTimerWindow.detach();
mTimerWindow = null;
}
+ if (mTimerDoze != null) {
+ mTimerDoze.detach();
+ mTimerDoze = null;
+ }
}
return !wlactive;
}
@@ -5694,16 +5707,16 @@ public final class BatteryStatsImpl extends BatteryStats {
void readFromParcelLocked(TimeBase timeBase, TimeBase screenOffTimeBase, Parcel in) {
mTimerPartial = readTimerFromParcel(WAKE_TYPE_PARTIAL,
mPartialTimers, screenOffTimeBase, in);
- mTimerFull = readTimerFromParcel(WAKE_TYPE_FULL,
- mFullTimers, timeBase, in);
- mTimerWindow = readTimerFromParcel(WAKE_TYPE_WINDOW,
- mWindowTimers, timeBase, in);
+ mTimerFull = readTimerFromParcel(WAKE_TYPE_FULL, mFullTimers, timeBase, in);
+ mTimerWindow = readTimerFromParcel(WAKE_TYPE_WINDOW, mWindowTimers, timeBase, in);
+ mTimerDoze = readTimerFromParcel(WAKE_TYPE_DOZE, mDozeTimers, timeBase, in);
}
void writeToParcelLocked(Parcel out, long elapsedRealtimeUs) {
Timer.writeTimerToParcel(out, mTimerPartial, elapsedRealtimeUs);
Timer.writeTimerToParcel(out, mTimerFull, elapsedRealtimeUs);
Timer.writeTimerToParcel(out, mTimerWindow, elapsedRealtimeUs);
+ Timer.writeTimerToParcel(out, mTimerDoze, elapsedRealtimeUs);
}
@Override
@@ -5712,6 +5725,7 @@ public final class BatteryStatsImpl extends BatteryStats {
case WAKE_TYPE_FULL: return mTimerFull;
case WAKE_TYPE_PARTIAL: return mTimerPartial;
case WAKE_TYPE_WINDOW: return mTimerWindow;
+ case WAKE_TYPE_DOZE: return mTimerDoze;
default: throw new IllegalArgumentException("type = " + type);
}
}
@@ -5743,6 +5757,13 @@ public final class BatteryStatsImpl extends BatteryStats {
mTimerWindow = t;
}
return t;
+ case WAKE_TYPE_DOZE:
+ t = mTimerDoze;
+ if (t == null) {
+ t = new StopwatchTimer(Uid.this, WAKE_TYPE_DOZE,
+ mDozeTimers, mOnBatteryTimeBase);
+ mTimerDoze = t;
+ }
default:
throw new IllegalArgumentException("type=" + type);
}
@@ -6599,6 +6620,9 @@ public final class BatteryStatsImpl extends BatteryStats {
if (in.readInt() != 0) {
wl.getStopwatchTimer(WAKE_TYPE_WINDOW).readSummaryFromParcelLocked(in);
}
+ if (in.readInt() != 0) {
+ wl.getStopwatchTimer(WAKE_TYPE_DOZE).readSummaryFromParcelLocked(in);
+ }
}
public StopwatchTimer getSensorTimerLocked(int sensor, boolean create) {
@@ -9586,6 +9610,12 @@ public final class BatteryStatsImpl extends BatteryStats {
} else {
out.writeInt(0);
}
+ if (wl.mTimerDoze != null) {
+ out.writeInt(1);
+ wl.mTimerDoze.writeSummaryFromParcelLocked(out, NOWREAL_SYS);
+ } else {
+ out.writeInt(0);
+ }
}
final ArrayMap<String, StopwatchTimer> syncStats = u.mSyncStats.getMap();
diff --git a/core/java/com/android/internal/os/Zygote.java b/core/java/com/android/internal/os/Zygote.java
index 4f6d781..c97fdf4 100644
--- a/core/java/com/android/internal/os/Zygote.java
+++ b/core/java/com/android/internal/os/Zygote.java
@@ -41,8 +41,8 @@ public final class Zygote {
public static final int DEBUG_ENABLE_JNI_LOGGING = 1 << 4;
/** enable the JIT compiler */
public static final int DEBUG_ENABLE_JIT = 1 << 5;
- /** Force generation of CFI code */
- public static final int DEBUG_GENERATE_CFI = 1 << 6;
+ /** Force generation of native debugging information. */
+ public static final int DEBUG_GENERATE_DEBUG_INFO = 1 << 6;
/** No external storage should be mounted. */
public static final int MOUNT_EXTERNAL_NONE = 0;
diff --git a/core/java/com/android/internal/os/ZygoteConnection.java b/core/java/com/android/internal/os/ZygoteConnection.java
index 1a0345b..fa870b9 100644
--- a/core/java/com/android/internal/os/ZygoteConnection.java
+++ b/core/java/com/android/internal/os/ZygoteConnection.java
@@ -322,7 +322,7 @@ class ZygoteConnection {
/**
* From --enable-debugger, --enable-checkjni, --enable-assert,
- * --enable-safemode, --enable-jit, --generate-cfi and --enable-jni-logging.
+ * --enable-safemode, --enable-jit, --generate-debug-info and --enable-jni-logging.
*/
int debugFlags;
@@ -434,8 +434,8 @@ class ZygoteConnection {
debugFlags |= Zygote.DEBUG_ENABLE_CHECKJNI;
} else if (arg.equals("--enable-jit")) {
debugFlags |= Zygote.DEBUG_ENABLE_JIT;
- } else if (arg.equals("--generate-cfi")) {
- debugFlags |= Zygote.DEBUG_GENERATE_CFI;
+ } else if (arg.equals("--generate-debug-info")) {
+ debugFlags |= Zygote.DEBUG_GENERATE_DEBUG_INFO;
} else if (arg.equals("--enable-jni-logging")) {
debugFlags |= Zygote.DEBUG_ENABLE_JNI_LOGGING;
} else if (arg.equals("--enable-assert")) {
diff --git a/core/java/com/android/internal/statusbar/IStatusBar.aidl b/core/java/com/android/internal/statusbar/IStatusBar.aidl
index 9f99f62..0732add 100644
--- a/core/java/com/android/internal/statusbar/IStatusBar.aidl
+++ b/core/java/com/android/internal/statusbar/IStatusBar.aidl
@@ -64,5 +64,7 @@ oneway interface IStatusBar
* bar caused by this app transition in millis
*/
void appTransitionStarting(long statusBarAnimationsStartTime, long statusBarAnimationsDuration);
+
+ void showAssistDisclosure();
}
diff --git a/core/java/com/android/internal/widget/FloatingToolbar.java b/core/java/com/android/internal/widget/FloatingToolbar.java
index 65f2f53f..523663c 100644
--- a/core/java/com/android/internal/widget/FloatingToolbar.java
+++ b/core/java/com/android/internal/widget/FloatingToolbar.java
@@ -546,25 +546,25 @@ public final class FloatingToolbar {
private void refreshCoordinatesAndOverflowDirection(Rect contentRect) {
refreshViewPort();
- int availableHeightAboveContent =
- contentRect.top - mViewPort.top - 2 * mMarginVertical;
- int availableHeightBelowContent =
- mViewPort.bottom - contentRect.bottom - 2 * mMarginVertical;
- int availableHeightThroughContent =
- mViewPort.bottom - contentRect.top + getToolbarHeightWithVerticalMargin();
-
int x = contentRect.centerX() - getWidth() / 2;
// Update x so that the toolbar isn't rendered behind the nav bar in landscape.
x = Math.max(0, Math.min(x, mViewPort.right - getWidth()));
int y;
+
+ int availableHeightAboveContent = contentRect.top - mViewPort.top;
+ int availableHeightBelowContent = mViewPort.bottom - contentRect.bottom;
+
if (mOverflowPanel == null) { // There is no overflow.
- if (availableHeightAboveContent > getToolbarHeightWithVerticalMargin()) {
+ if (availableHeightAboveContent >= getToolbarHeightWithVerticalMargin()) {
// There is enough space at the top of the content.
y = contentRect.top - getToolbarHeightWithVerticalMargin();
- } else if (availableHeightBelowContent > getToolbarHeightWithVerticalMargin()) {
+ } else if (availableHeightBelowContent >= getToolbarHeightWithVerticalMargin()) {
// There is enough space at the bottom of the content.
y = contentRect.bottom;
+ } else if (availableHeightBelowContent >= getEstimatedToolbarHeight(getContext())) {
+ // Just enough space to fit the toolbar with no vertical margins.
+ y = contentRect.bottom - mMarginVertical;
} else {
// Not enough space. Prefer to position as high as possible.
y = Math.max(
@@ -572,32 +572,47 @@ public final class FloatingToolbar {
contentRect.top - getToolbarHeightWithVerticalMargin());
}
} else { // There is an overflow.
- if (availableHeightAboveContent > mOverflowPanel.getMinimumHeight()) {
+ int margin = 2 * mMarginVertical;
+ int minimumOverflowHeightWithMargin = mOverflowPanel.getMinimumHeight() + margin;
+ int availableHeightThroughContentDown =
+ mViewPort.bottom - contentRect.top + getToolbarHeightWithVerticalMargin();
+ int availableHeightThroughContentUp =
+ contentRect.bottom - mViewPort.top + getToolbarHeightWithVerticalMargin();
+
+ if (availableHeightAboveContent >= minimumOverflowHeightWithMargin) {
// There is enough space at the top of the content rect for the overflow.
// Position above and open upwards.
- updateOverflowHeight(availableHeightAboveContent);
+ updateOverflowHeight(availableHeightAboveContent - margin);
y = contentRect.top - getHeight();
mOverflowDirection = OVERFLOW_DIRECTION_UP;
- } else if (availableHeightAboveContent > getToolbarHeightWithVerticalMargin()
- && availableHeightThroughContent > mOverflowPanel.getMinimumHeight()) {
+ } else if (availableHeightAboveContent >= getToolbarHeightWithVerticalMargin()
+ && availableHeightThroughContentDown >= minimumOverflowHeightWithMargin) {
// There is enough space at the top of the content rect for the main panel
// but not the overflow.
// Position above but open downwards.
- updateOverflowHeight(availableHeightThroughContent);
+ updateOverflowHeight(availableHeightThroughContentDown - margin);
y = contentRect.top - getToolbarHeightWithVerticalMargin();
mOverflowDirection = OVERFLOW_DIRECTION_DOWN;
- } else if (availableHeightBelowContent > mOverflowPanel.getMinimumHeight()) {
+ } else if (availableHeightBelowContent >= minimumOverflowHeightWithMargin) {
// There is enough space at the bottom of the content rect for the overflow.
// Position below and open downwards.
- updateOverflowHeight(availableHeightBelowContent);
+ updateOverflowHeight(availableHeightBelowContent - margin);
y = contentRect.bottom;
mOverflowDirection = OVERFLOW_DIRECTION_DOWN;
+ } else if (availableHeightBelowContent >= getToolbarHeightWithVerticalMargin()
+ && mViewPort.height() >= minimumOverflowHeightWithMargin) {
+ // There is enough space at the bottom of the content rect for the main panel
+ // but not the overflow.
+ // Position below but open upwards.
+ updateOverflowHeight(availableHeightThroughContentUp - margin);
+ y = contentRect.bottom + getToolbarHeightWithVerticalMargin() - getHeight();
+ mOverflowDirection = OVERFLOW_DIRECTION_UP;
} else {
// Not enough space.
- // Position at the bottom of the view port and open upwards.
- updateOverflowHeight(mViewPort.height());
- y = mViewPort.bottom - getHeight();
- mOverflowDirection = OVERFLOW_DIRECTION_UP;
+ // Position at the top of the view port and open downwards.
+ updateOverflowHeight(mViewPort.height() - margin);
+ y = mViewPort.top;
+ mOverflowDirection = OVERFLOW_DIRECTION_DOWN;
}
mOverflowPanel.setOverflowDirection(mOverflowDirection);
}
@@ -1422,7 +1437,6 @@ public final class FloatingToolbar {
PopupWindow popupWindow = new PopupWindow(popupContentHolder);
popupWindow.setWindowLayoutType(
WindowManager.LayoutParams.TYPE_APPLICATION_ABOVE_SUB_PANEL);
- popupWindow.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED);
popupWindow.setAnimationStyle(0);
popupWindow.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
content.setLayoutParams(new ViewGroup.LayoutParams(
diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp
index 7c2b28d..2c35a8b 100644
--- a/core/jni/AndroidRuntime.cpp
+++ b/core/jni/AndroidRuntime.cpp
@@ -876,16 +876,16 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv)
"-Xzygote-max-boot-retry=");
/*
- * When running with debug.gencfi, add --include-cfi to the compiler options so that the boot
- * image, if it is compiled on device, will include CFI info, as well as other compilations
- * started by the runtime.
+ * When running with debug.generate-debug-info, add --generate-debug-info to
+ * the compiler options so that the boot image, if it is compiled on device,
+ * will include native debugging information.
*/
- property_get("debug.gencfi", propBuf, "");
+ property_get("debug.generate-debug-info", propBuf, "");
if (strcmp(propBuf, "true") == 0) {
addOption("-Xcompiler-option");
- addOption("--include-cfi");
+ addOption("--generate-debug-info");
addOption("-Ximage-compiler-option");
- addOption("--include-cfi");
+ addOption("--generate-debug-info");
}
initArgs.version = JNI_VERSION_1_4;
diff --git a/docs/html/design/wear/context.jd b/docs/html/design/wear/context.jd
index 688806f..7a0baf8 100644
--- a/docs/html/design/wear/context.jd
+++ b/docs/html/design/wear/context.jd
@@ -2,19 +2,19 @@ page.title=Context Awareness on Android Wear
@jd:body
<style>
-div.slide-wrapper {
+.slide-wrapper {
width:780px;
overflow:visible;
}
-div.slide {
+.slide {
width:370px;
float:left;
margin:0 20px 0 0;
}
-div.slide p {
+.slide p {
height:40px;
}
-div.slide img {
+.slide img {
height: 208px;
}
</style>
@@ -140,8 +140,8 @@ app.</p>
<div class="slide">
<h2>Location-based Query</h2>
-<p>Ask things like, "Are there any picnic tables free at the park?" and get answers from
-people who are there.</p>
+<p>Ask questions like, "Are there any picnic tables free at the park?" and get answers in real-time
+from people in the area.</p>
<img src="{@docRoot}design/media/wear/ContextualExample.015.png" alt=""
srcset="{@docRoot}design/media/wear/ContextualExample.015.png 1x,
{@docRoot}design/media/wear/ContextualExample.015_2x.png 2x" />
@@ -149,4 +149,6 @@ people who are there.</p>
-</div> \ No newline at end of file
+</div>
+
+<p style="clear:both;height:0">&nbsp;</p> \ No newline at end of file
diff --git a/docs/html/design/wear/creative-vision.jd b/docs/html/design/wear/creative-vision.jd
index 0955240..36a87eb 100644
--- a/docs/html/design/wear/creative-vision.jd
+++ b/docs/html/design/wear/creative-vision.jd
@@ -25,34 +25,29 @@ Wear experiences are:</p>
<div class="page-vision">
- <img src="{@docRoot}design/media/wear/vision_traffic.png" width="147" height="147" />
-
<h2 id="Launched">Launched automatically</h2>
+ <img src="{@docRoot}design/media/wear/vision_traffic.png" width="147" height="147" />
<p>Most people are used to launching apps by clicking an icon. Android Wear is different. Wearable apps are aware of the user’s context - time, location, physical activity, and so on. The apps use this information to insert cards into the stream when they become relevant. This makes Android Wear timely, relevant and very specific.</p>
</div>
<div class="page-vision">
- <img src="{@docRoot}design/media/wear/vision_navigation.png" width="147" height="147" />
-
<h2 id="Glanceable">Glanceable</h2>
+ <img src="{@docRoot}design/media/wear/vision_navigation.png" width="147" height="147" />
<p>A classic wrist watch is designed to let you see the time in a split second and get on with what you were doing. Designing for Android Wear is no different. The less time it takes to use your software, the more time the user can be present in whatever they are doing. Android wear is fast, sharp, and immediate.</p>
</div>
<div class="page-vision">
- <img src="{@docRoot}design/media/wear/vision_voice.png" width="147" height="147" style="border: 1px solid #ddd;" />
-
<h2 id="SuggestDemand">All about suggest and demand</h2>
+ <img src="{@docRoot}design/media/wear/vision_voice.png" width="147" height="147" style="border: 1px solid #ddd;" />
<p>Android Wear is like a great personal assistant: it knows you and your preferences, it only interrupts you when absolutely necessary, and it’s always on hand to provide a ready answer. Android Wear is helpful, respectful, and responsive.</p>
</div>
<div class="page-vision">
- <img src="{@docRoot}design/media/wear/vision_music.png" width="147" height="147" />
-
<h2 id="Interaction">Zero or low interaction</h2>
+ <img src="{@docRoot}design/media/wear/vision_music.png" width="147" height="147" />
<p>Staying true to the strengths afforded by a smaller form factor, Android Wear focuses on simple interactions, only requiring input by the user when absolutely necessary. Most inputs are based around touch swipes or voice, and inputs requiring fine-grained finger movements are avoided. Android Wear is gestural, simple, and fast.</p>
</div>
<p>By providing a smart connection to the rest of the world while respecting the user’s attention, Android Wear feels personal and global, simple and smart, unobtrusive and ever-ready. Applications that represent these principles will feel most at home in the overall Android Wear experience.</p>
<p>Third party apps extend Android Wear to be more specialized and helpful throughout the day. Installing apps are a way for the user to tell the Android Wear how to do that.</p>
-
diff --git a/docs/html/design/wear/patterns.jd b/docs/html/design/wear/patterns.jd
index e56ac2d..0436cf5 100644
--- a/docs/html/design/wear/patterns.jd
+++ b/docs/html/design/wear/patterns.jd
@@ -46,11 +46,9 @@ page.title=UI Patterns for Android Wear
<h2 id="Dismissing" style="clear:both">Dismissing cards</h2>
- <img src="{@docRoot}design/media/wear/dismiss_cards.png" height="147">
-
<p>Swiping from left to right on a card causes it to be dismissed from the stream. Dismissed cards may return when they next have relevant information. State is synced between the Android Wear context stream and the notifications on the Android handheld device, so dismissing from one causes an automatic dismissal from the other.</p>
-
+<img src="{@docRoot}design/media/wear/dismiss_cards.png" height="147">
<h2 id="Actions" style="clear:both">Action buttons</h2>
@@ -162,12 +160,11 @@ to check-in to.</p>
<h2 id="Selection" style="clear:both">Selection List</h2>
- <img src="{@docRoot}design/media/wear/selection_list.png" width="147" height="147" style="float:right;margin:0 0 20px 40px;border:1px solid #ddd">
+ <img src="{@docRoot}design/media/wear/selection_list.png" width="147" height="147" style="float:left;margin:0 0 20px 40px;border:1px solid #ddd">
<p>Choosing an item from a list is a common interaction. The Selection List pattern (available as the <a
href="{@docRoot}training/wearables/apps/layouts.html#UiLibrary"><code>WearableListView</code></a> component) creates a simple list optimized for ease of use on a small screen where the focused item snaps to the center of the screen and a single tap selects. This widget is recommended as a common pattern for selecting items. It is used throughout the system UI, including in the list that can be accessed by swiping up on the cue card.</p>
-
<p>Of course, it is possible for Android Wear apps to extend themselves beyond the familiarities of these patterns. For a deeper look at the options available, see the <a href="{@docRoot}design/wear/structure.html">App Structure</a> guide.</p>
<a class="notice-developers left" href="{@docRoot}training/wearables/ui/lists.html">
@@ -176,3 +173,5 @@ href="{@docRoot}training/wearables/apps/layouts.html#UiLibrary"><code>WearableLi
<p>Creating Lists</p>
</div>
</a>
+
+<p style="clear:both;height:0">&nbsp;</p>
diff --git a/docs/html/design/wear/style.jd b/docs/html/design/wear/style.jd
index bb559fe..75bd65f 100644
--- a/docs/html/design/wear/style.jd
+++ b/docs/html/design/wear/style.jd
@@ -48,19 +48,18 @@ href="{@docRoot}training/wearables/apps/layouts.html#UiLibrary"><code>WatchViewS
</div>
-
- <img src="{@docRoot}design/media/wear/low_info_card.png" width="147" height="147"
- style="float:right;margin:29px 0 20px 40px">
-
<h2 id="InfoDensity" style="margin-top:0" >Low Information Density</h2>
+<img src="{@docRoot}design/media/wear/low_info_card.png" width="147" height="147"
+style="float:left;margin:5px 20px 20px 0">
+
<p>Cards should be designed to be glanceable in a split second, just like reading the time on a traditional watch. In most cases a pairing of an icon and value, or a title and short caption should be enough to convey a meaningful message. Note that the background photo should also be used to convey information; backgrounds that change to reflect and support the primary message in the card work great. For example, in the case illustrated to the right, a suitable background image is chosen to reflect the severity of current traffic conditions. This is not just a nice piece of attention to detail; the background actually reinforces the message and makes the content more glanceable.</p>
-<img src="{@docRoot}design/media/wear/separate_info_cards.jpg" height="147"
- style="float:right;margin:29px 0 20px 40px">
<h2 id="Chunks">Separate Information into Chunks</h2>
+<img src="{@docRoot}design/media/wear/separate_info_cards.jpg" height="147"
+ style="float:right;margin:5px 0 20px 20px">
<p>In cases where additional information is absolutely necessary, don’t crowd out a card layout to the point where glanceability is affected. Instead, add an additional <a href="{@docRoot}design/wear/patterns.html#Pages">page</a> (or multiple pages, if needed) to the right of the main card in the stream to which the user can swipe for more information. See also <a
href="{@docRoot}design/wear/patterns.html#Continuing">Continuing activities on phone</a>.</p>
@@ -73,21 +72,19 @@ href="{@docRoot}design/wear/patterns.html#Continuing">Continuing activities on p
-<img src="{@docRoot}design/media/wear/clear_bold_type.jpg" height="147"
- style="float:left;margin:19px 40px 20px 0">
-
<h2 id="Typography" >Use Clear, Bold Typography</h2>
+<img src="{@docRoot}design/media/wear/clear_bold_type.jpg" height="147"
+ style="float:left;margin:5px 20px 20px 0">
<p>The system font is Roboto Condensed, with Regular and Light variants. Text should adhere to the size and color recommendations (see the UI Toolkit in the <a href="{@docRoot}design/downloads/index.html#Wear">Downloads</a> page). In general, text should be displayed as large as possible. Your goal should be to convey maximum information with minimum fuss.</p>
<h2 id="Branding" style="clear:both" >Use Consistent Branding and Color</h2>
-<p>The app icon is used to identify and brand your application. The icon is optional but when present always appears in the same location, overhanging the top right edge of the card. Note that app icons or branding should not be displayed in the background photo, which is reserved to display an image relevant to the information on the card.</p>
-
-
<img src="{@docRoot}design/media/wear/copywrite.png" height="147"
- style="float:left;margin:19px 40px 20px 0">
+ style="float:right;margin:0 20px 0 20px">
+
+<p style="margin-bottom: 60px">The app icon is used to identify and brand your application. The icon is optional but when present always appears in the same location, overhanging the top right edge of the card. Note that app icons or branding should not be displayed in the background photo, which is reserved to display an image relevant to the information on the card.</p>
<h2 id="Copywrite" >Copywrite Sparingly</h2>
@@ -98,18 +95,11 @@ href="{@docRoot}design/wear/patterns.html#Continuing">Continuing activities on p
<p>Wearables are personal devices by nature, but they are not completely private. If your notification serves content that may be particularly sensitive or embarrassing (such as notifications from a dating app or a medical status report), consider not displaying all of the information in a peek card. A notification could place the sensitive information on a second page that must be swiped to, or an application could show different amounts of detail in peek and focused card positions.</p>
-
- <img src="{@docRoot}design/media/wear/confirmation.png" height="147"
- style="float:left;margin:29px 40px 20px 0">
-
-
<h2 id="ConfirmAnim">Confirmation Animations</h2>
-<p>If your app allows the user to perform an action, it is necessary to provide positive feedback. Show a generic confirmation animation or create your own. A confirmation animation is an opportunity to express your app’s character and insert a moment of delight for your user. Keep animations short (less than 1000ms) and simple. Animating the confirmation icon is an effective way of transitioning the user to a new state after completing an action.</p>
-
-
-
-
-
+<img src="{@docRoot}design/media/wear/confirmation.png" height="147"
+ style="float:left;margin:5px 20px 20px 0">
+<p>If your app allows the user to perform an action, it is necessary to provide positive feedback. Show a generic confirmation animation or create your own. A confirmation animation is an opportunity to express your app’s character and insert a moment of delight for your user. Keep animations short (less than 1000ms) and simple. Animating the confirmation icon is an effective way of transitioning the user to a new state after completing an action.</p>
+<p style="clear:both;height:0">&nbsp;</p> \ No newline at end of file
diff --git a/docs/html/design/wear/watchfaces.jd b/docs/html/design/wear/watchfaces.jd
index 2def05b..e018523 100644
--- a/docs/html/design/wear/watchfaces.jd
+++ b/docs/html/design/wear/watchfaces.jd
@@ -4,7 +4,7 @@ page.title=Watch Faces for Android Wear
<!-- developer docs box -->
<a class="notice-developers right" href="{@docRoot}training/wearables/watch-faces/index.html"
- style="clear:left;margin-bottom:90px">
+ style="clear:left">
<div>
<h3>Developer Docs</h3>
<p>Creating Watch Faces</p>
@@ -22,7 +22,7 @@ ambient modes, and consider how system user interface elements will interact wit
<p>Follow the guidelines in this page to design your custom watch faces.</p>
<!-- H2 creative vision -->
-<div style="float:right;margin-top:-100px;margin-bottom:20px;margin-left:20px">
+<div style="float:right;margin-bottom:20px;margin-left:20px">
<img src="{@docRoot}design/media/wear/Render_Next.png"
width="200" height="195" alt="" style="margin-right:5px"/><br/>
<img src="{@docRoot}design/media/wear/Render_Interactive.png"
@@ -137,44 +137,39 @@ You can configure your watch face to display different ambient designs depending
of screen available on the device. Consider the best design for your watch faces on all
screens.</p>
-<div class="cols" style="margin-top:20px">
-<div class="col-9">
- <h3>Reduced color space</h3>
- <p>Some displays use a reduced color space in ambient mode to save power.</p>
- <p>One reduced color space power saving method is to use a "low-bit" mode. In low-bit mode,
- the available colors are limited to black, white, blue, red, magenta, green, cyan, and yellow.
- When designing for low-bit ambient mode, use a black or a white background. For OLED screens,
- you must use a black background. Non-background pixels must be less than 10 percent of total
- pixels. You can use low-bit color for up to 5 percent of pixels on screens that support it.
- You should also disable antialiasing in your paint styles for this mode. Make sure to test
- your design on devices with low-bit ambient mode.</p>
- <p>Other displays save power in ambient mode by not producing any color. When designing for
- displays which do not use color in ambient mode, the background may be either black or
- white.</p>
-</div>
-<div class="col-4">
+<div style="float:right;margin-bottom:20px;margin-left:20px">
<img src="{@docRoot}design/media/wear/Render_LowBit.png" width="200"
height="" alt="" style="margin-top:45px;margin-left:13px">
</div>
-</div>
+<h3>Reduced color space</h3>
-<div class="cols" style="margin-top:20px">
-<div class="col-9">
- <h3>Burn protection techniques</h3>
- <p>When designing for OLED screens, you should consider power efficiency and the screen
- burn-in effect. When these screens are in ambient mode, the system shifts the contents of
- the screen periodically by a few pixels to avoid pixel burn-in. Do not use large blocks of
- pixels in your ambient mode designs and keep 95% of the pixels black. Replace solid shapes in
- your regular ambient mode designs with outlined shapes in burn-protected ambient mode. Also
- replace filled images with pixel patterns. For analog watch face designs, hollow out the center
- where the hands meet to avoid pixel burn-in in this mode.</p>
-</div>
-<div class="col-4">
+<p>Some displays use a reduced color space in ambient mode to save power.</p>
+<p>One reduced color space power saving method is to use a "low-bit" mode. In low-bit mode,
+the available colors are limited to black, white, blue, red, magenta, green, cyan, and yellow.
+When designing for low-bit ambient mode, use a black or a white background. For OLED screens,
+you must use a black background. Non-background pixels must be less than 10 percent of total
+pixels. You can use low-bit color for up to 5 percent of pixels on screens that support it.
+You should also disable antialiasing in your paint styles for this mode. Make sure to test
+your design on devices with low-bit ambient mode.</p>
+<p>Other displays save power in ambient mode by not producing any color. When designing for
+displays which do not use color in ambient mode, the background may be either black or
+white.</p>
+
+
+<h3>Burn protection techniques</h3>
+
+<div style="float:right;margin-bottom:20px;margin-left:20px">
<img src="{@docRoot}design/media/wear/Render_1Bit.png" width="200"
height="" alt="" style="margin-top:-10px;margin-left:13px">
</div>
-</div>
+<p>When designing for OLED screens, you should consider power efficiency and the screen
+burn-in effect. When these screens are in ambient mode, the system shifts the contents of
+the screen periodically by a few pixels to avoid pixel burn-in. Do not use large blocks of
+pixels in your ambient mode designs and keep 95% of the pixels black. Replace solid shapes in
+your regular ambient mode designs with outlined shapes in burn-protected ambient mode. Also
+replace filled images with pixel patterns. For analog watch face designs, hollow out the center
+where the hands meet to avoid pixel burn-in in this mode.</p>
<h2 id="SystemUI">Accomodate System UI Elements</h2>
@@ -183,9 +178,11 @@ screens.</p>
user the status of the wearable and show notifications from services on the user's phone. Try
to keep critical elements in your watch face designs from being obscured by the UI elements.</p>
-<div class="cols" style="margin-top:20px">
-<div class="col-9">
- <h3>Cards</h3>
+<div style="float:right;margin-bottom:20px;margin-left:20px">
+ <img src="{@docRoot}design/media/wear/CardsRender_Build.png" width="200"
+ height="" alt="" style="margin-top:20px;margin-left:13px">
+</div>
+<h3>Cards</h3>
<p>Cards are the notification system that bridges information between the wearable and a
mobile device. Cards are also how most applications communicate with users. The user will be
notified on the wearable about items such as emails and messages. As a watch face developer,
@@ -201,16 +198,13 @@ variable peek card is that it displays more notification information. Faces with
the bottom half of the face should leverage the small peek card instead.</p>
<p>The system notifies your watch face when the bounds of a peek card change, so you can
rearrange the elements in your design if necessary.</p>
-</div>
-<div class="col-4">
- <img src="{@docRoot}design/media/wear/CardsRender_Build.png" width="200"
- height="" alt="" style="margin-top:20px;margin-left:13px">
-</div>
-</div>
-<div class="cols" style="margin-top:20px">
-<div class="col-9">
- <h3>Indicators</h3>
+
+<div style="float:right;margin-bottom:20px;margin-left:20px">
+ <img src="{@docRoot}design/media/wear/Indicators_Cropped.png" width="200"
+ height="" alt="" style="margin-top:0px;margin-left:13px">
+</div>
+<h3>Indicators</h3>
<p>Indicators tell the user the status of the wearable, such as charging and airplane mode.
When designing a watch face, consider how the indicator will fall over the watch face.</p>
<p>The indicators can be placed in several fixed locations on the wearable. If you have a
@@ -218,16 +212,12 @@ large peek card, the indicators should go on the top or on the center of the scr
position the status icons or the hotword on the bottom of the screen, the system forces small
peek cards. If the edge of the watch face contains strong visual elements, such as
ticks or numbers, place the indicators on the center of the screen.</p>
-</div>
-<div class="col-4">
- <img src="{@docRoot}design/media/wear/Indicators_Cropped.png" width="200"
+
+<div style="float:right;margin-bottom:20px;margin-left:20px">
+ <img src="{@docRoot}design/media/wear/Hotword_Cropped.png" width="200"
height="" alt="" style="margin-top:0px;margin-left:13px">
</div>
-</div>
-
-<div class="cols" style="margin-top:20px">
-<div class="col-9">
- <h3>The hotword</h3>
+<h3>The hotword</h3>
<p>The hotword is the phrase "OK Google", which tells the user that they can interact with
the watch using voice commands. When a user turns on the wearable, the hotword appears on
the screen for a few seconds.</p>
@@ -236,12 +226,6 @@ this element is not as critical. You should still avoid covering up elements of
watch face. Finally, background protection for the hotword and the indicators should be
turned on unless your design is tailored to have these elements appear on top of them, for example
using dark solid colors with no patterns.</p>
-</div>
-<div class="col-4">
- <img src="{@docRoot}design/media/wear/Hotword_Cropped.png" width="200"
- height="" alt="" style="margin-top:0px;margin-left:13px">
-</div>
-</div>
<p>For more information about measurements and positioning of system UI elements, see
<a href="#SpecsAssets">Specifications and Assets</a>.</p>
@@ -253,24 +237,27 @@ using dark solid colors with no patterns.</p>
<p>Your watch face can show users contextually relevant data and react to it by changing styles
and colors in your design.</p>
-<div class="cols" style="margin-top:20px">
-<div class="col-9">
- <h3>What do you want your user to know?</h3>
+<h3>What do you want your user to know?</h3>
+
+<div style="float:right;margin-bottom:20px;margin-left:20px">
+ <img src="{@docRoot}design/media/wear/Render_Saturn.png" width="200"
+ height="" alt="" style="margin-top:-10px;margin-left:13px">
+</div>
+
<p>The first step in designing a data-integrated watch face is to define a conceptual user
outcome based on available data. First, generate a strong concept or outcome you believe is
supported by real user needs. What do you want your users to know after they have glanced
at your design? Once you have identified your outcome, you need to determine how to obtain
the required data.</p>
-</div>
-<div class="col-4">
- <img src="{@docRoot}design/media/wear/Render_Saturn.png" width="200"
+
+<div style="clear:both;"/>
+
+<div style="float:right;margin-bottom:20px;margin-left:20px">
+ <img src="{@docRoot}design/media/wear/Render_Episode.png" width="200"
height="" alt="" style="margin-top:-10px;margin-left:13px">
</div>
-</div>
-<div class="cols" style="margin-top:20px">
-<div class="col-9">
- <h3>A watch dial is a timeline; add data to it</h3>
+<h3>A watch dial is a timeline; add data to it</h3>
<p>Your watch face concept may include use of data beyond time, such as weather, calendar
and fitness data. Consider the inclusion of data integration creatively. Avoid simply
overlaying a time-based watch face with extra data. Rather, think about how the data can
@@ -278,16 +265,13 @@ be expressed through the lens of time. For example, instead of designing a weath
watch face as a clock with an indication of the current temperature in degrees overlayed,
you might design a watch face that describes how the temperature will change over the
course of the day.</p>
-</div>
-<div class="col-4">
- <img src="{@docRoot}design/media/wear/Render_Episode.png" width="200"
+
+<div style="float:right;margin-bottom:20px;margin-left:20px">
+ <img src="{@docRoot}design/media/wear/Render_Albumem.png" width="200"
height="" alt="" style="margin-top:-10px;margin-left:13px">
</div>
-</div>
-<div class="cols" style="margin-top:20px">
-<div class="col-9">
- <h3>Stick to one message</h3>
+<h3>Stick to one message</h3>
<p>Once you have solidified your conceptual direction or desired outcome, you will need to
begin visualizing your watch face. The strongest watch face designs are highly glanceable
and deliver a singular expression of data. In order to identify your singular message, you
@@ -295,12 +279,6 @@ must identify the most important supporting data point. For instance, instead of
an entire month of calendar events, you might decide to display only the next
upcoming event. By a process of reduction, you should arrive at a powerful singular
expression of data to include in your design.</p>
-</div>
-<div class="col-4">
- <img src="{@docRoot}design/media/wear/Render_Albumem.png" width="200"
- height="" alt="" style="margin-top:-10px;margin-left:13px">
-</div>
-</div>
<h3>Begin with some insight and test as you go</h3>
<p>Make sure your approach begins with insight into the needs and expectations of your users.
diff --git a/docs/html/tools/building/building-cmdline.jd b/docs/html/tools/building/building-cmdline.jd
index 0e4c8b2..bf3e873 100644
--- a/docs/html/tools/building/building-cmdline.jd
+++ b/docs/html/tools/building/building-cmdline.jd
@@ -353,13 +353,6 @@ adb -d install <em>path/to/your/app</em>.apk
to publish your application, you <strong>must</strong> sign the application with your own private
key, rather than the debug key generated by the SDK tools.</p>
- <p>Android Studio helps you get started quickly by signing your .apk files with a debug key,
- prior to installing them on an emulator or development device. This means that you can quickly
- run your application from Android Studio without having to generate your own private key. No
- specific action on your part is needed, provided ADT has access to Keytool. However, please note
- that if you intend to publish your application, you <strong>must</strong> sign the application
- with your own private key, rather than the debug key generated by the SDK tools.</p>
-
<p>Please read <a href="{@docRoot}tools/publishing/app-signing.html">Signing Your
Applications</a>, which provides a thorough guide to application signing on Android and what it
means to you as an Android application developer. The document also includes a guide to publishing
diff --git a/graphics/java/android/graphics/drawable/RippleDrawable.java b/graphics/java/android/graphics/drawable/RippleDrawable.java
index 134451b..6369833 100644
--- a/graphics/java/android/graphics/drawable/RippleDrawable.java
+++ b/graphics/java/android/graphics/drawable/RippleDrawable.java
@@ -423,6 +423,7 @@ public class RippleDrawable extends LayerDrawable {
if (super.setDrawableByLayerId(id, drawable)) {
if (id == R.id.mask) {
mMask = drawable;
+ mHasValidMask = false;
}
return true;
diff --git a/keystore/java/android/security/keystore/AndroidKeyStoreKeyFactorySpi.java b/keystore/java/android/security/keystore/AndroidKeyStoreKeyFactorySpi.java
index 20db41b..250bad7 100644
--- a/keystore/java/android/security/keystore/AndroidKeyStoreKeyFactorySpi.java
+++ b/keystore/java/android/security/keystore/AndroidKeyStoreKeyFactorySpi.java
@@ -24,9 +24,12 @@ import java.security.Key;
import java.security.KeyFactorySpi;
import java.security.PrivateKey;
import java.security.PublicKey;
+import java.security.spec.ECPublicKeySpec;
import java.security.spec.InvalidKeySpecException;
import java.security.spec.KeySpec;
import java.security.spec.PKCS8EncodedKeySpec;
+import java.security.spec.RSAPublicKeySpec;
+import java.security.spec.X509EncodedKeySpec;
/**
* {@link KeyFactorySpi} backed by Android KeyStore.
@@ -40,32 +43,83 @@ public class AndroidKeyStoreKeyFactorySpi extends KeyFactorySpi {
@Override
protected <T extends KeySpec> T engineGetKeySpec(Key key, Class<T> keySpecClass)
throws InvalidKeySpecException {
- if (keySpecClass == null) {
- throw new InvalidKeySpecException("keySpecClass == null");
- }
- if (!(key instanceof AndroidKeyStorePrivateKey)) {
- throw new InvalidKeySpecException("Only Android KeyStore private keys supported: " +
- ((key != null) ? key.getClass().getName() : "null"));
- }
- if (PKCS8EncodedKeySpec.class.isAssignableFrom(keySpecClass)) {
+ if (key == null) {
+ throw new InvalidKeySpecException("key == null");
+ } else if ((!(key instanceof AndroidKeyStorePrivateKey))
+ && (!(key instanceof AndroidKeyStorePublicKey))) {
throw new InvalidKeySpecException(
- "Key material export of Android KeyStore keys is not supported");
- }
- if (!KeyInfo.class.equals(keySpecClass)) {
- throw new InvalidKeySpecException("Unsupported key spec: " + keySpecClass.getName());
+ "Unsupported key type: " + key.getClass().getName()
+ + ". This KeyFactory supports only Android Keystore asymmetric keys");
}
- String keyAliasInKeystore = ((AndroidKeyStoreKey) key).getAlias();
- String entryAlias;
- if (keyAliasInKeystore.startsWith(Credentials.USER_PRIVATE_KEY)) {
- entryAlias = keyAliasInKeystore.substring(Credentials.USER_PRIVATE_KEY.length());
+
+ // key is an Android Keystore private or public key
+
+ if (keySpecClass == null) {
+ throw new InvalidKeySpecException("keySpecClass == null");
+ } else if (KeyInfo.class.equals(keySpecClass)) {
+ if (!(key instanceof AndroidKeyStorePrivateKey)) {
+ throw new InvalidKeySpecException(
+ "Unsupported key type: " + key.getClass().getName()
+ + ". KeyInfo can be obtained only for Android Keystore private keys");
+ }
+ String keyAliasInKeystore = ((AndroidKeyStorePrivateKey) key).getAlias();
+ String entryAlias;
+ if (keyAliasInKeystore.startsWith(Credentials.USER_PRIVATE_KEY)) {
+ entryAlias = keyAliasInKeystore.substring(Credentials.USER_PRIVATE_KEY.length());
+ } else {
+ throw new InvalidKeySpecException("Invalid key alias: " + keyAliasInKeystore);
+ }
+ @SuppressWarnings("unchecked")
+ T result = (T) AndroidKeyStoreSecretKeyFactorySpi.getKeyInfo(
+ mKeyStore, entryAlias, keyAliasInKeystore);
+ return result;
+ } else if (X509EncodedKeySpec.class.equals(keySpecClass)) {
+ if (!(key instanceof AndroidKeyStorePublicKey)) {
+ throw new InvalidKeySpecException(
+ "Unsupported key type: " + key.getClass().getName()
+ + ". X509EncodedKeySpec can be obtained only for Android Keystore public"
+ + " keys");
+ }
+ @SuppressWarnings("unchecked")
+ T result = (T) new X509EncodedKeySpec(((AndroidKeyStorePublicKey) key).getEncoded());
+ return result;
+ } else if (PKCS8EncodedKeySpec.class.equals(keySpecClass)) {
+ if (key instanceof AndroidKeyStorePrivateKey) {
+ throw new InvalidKeySpecException(
+ "Key material export of Android Keystore private keys is not supported");
+ } else {
+ throw new InvalidKeySpecException(
+ "Cannot export key material of public key in PKCS#8 format."
+ + " Only X.509 format (X509EncodedKeySpec) supported for public keys.");
+ }
+ } else if (RSAPublicKeySpec.class.equals(keySpecClass)) {
+ if (key instanceof AndroidKeyStoreRSAPublicKey) {
+ AndroidKeyStoreRSAPublicKey rsaKey = (AndroidKeyStoreRSAPublicKey) key;
+ @SuppressWarnings("unchecked")
+ T result =
+ (T) new RSAPublicKeySpec(rsaKey.getModulus(), rsaKey.getPublicExponent());
+ return result;
+ } else {
+ throw new InvalidKeySpecException(
+ "Obtaining RSAPublicKeySpec not supported for " + key.getAlgorithm() + " "
+ + ((key instanceof AndroidKeyStorePrivateKey) ? "private" : "public")
+ + " key");
+ }
+ } else if (ECPublicKeySpec.class.equals(keySpecClass)) {
+ if (key instanceof AndroidKeyStoreECPublicKey) {
+ AndroidKeyStoreECPublicKey ecKey = (AndroidKeyStoreECPublicKey) key;
+ @SuppressWarnings("unchecked")
+ T result = (T) new ECPublicKeySpec(ecKey.getW(), ecKey.getParams());
+ return result;
+ } else {
+ throw new InvalidKeySpecException(
+ "Obtaining RSAPublicKeySpec not supported for " + key.getAlgorithm() + " "
+ + ((key instanceof AndroidKeyStorePrivateKey) ? "private" : "public")
+ + " key");
+ }
} else {
- throw new InvalidKeySpecException("Invalid key alias: " + keyAliasInKeystore);
+ throw new InvalidKeySpecException("Unsupported key spec: " + keySpecClass.getName());
}
-
- @SuppressWarnings("unchecked")
- T result = (T) AndroidKeyStoreSecretKeyFactorySpi.getKeyInfo(
- mKeyStore, entryAlias, keyAliasInKeystore);
- return result;
}
@Override
diff --git a/media/java/android/media/MediaDrm.java b/media/java/android/media/MediaDrm.java
index 9acfee2..ab61e2b 100644
--- a/media/java/android/media/MediaDrm.java
+++ b/media/java/android/media/MediaDrm.java
@@ -89,10 +89,23 @@ import android.util.Log;
* encrypted content, the samples returned from the extractor remain encrypted, they
* are only decrypted when the samples are delivered to the decoder.
* <p>
- * MediaDrm methods throw {@link java.lang.IllegalStateException}
- * when a method is called on a MediaDrm object that is in an invalid or inoperable
- * state. This is typically due to incorrect application API usage, but may also
- * be due to an unrecoverable failure in the DRM plugin or security hardware.
+ * MediaDrm methods throw {@link android.media.MediaDrm.MediaDrmStateException}
+ * when a method is called on a MediaDrm object that has had an unrecoverable failure
+ * in the DRM plugin or security hardware.
+ * {@link android.media.MediaDrm.MediaDrmStateException} extends
+ * {@link java.lang.IllegalStateException} with the addition of a developer-readable
+ * diagnostic information string associated with the exception.
+ * <p>
+ * In the event of a mediaserver process crash or restart while a MediaDrm object
+ * is active, MediaDrm methods may throw {@link android.media.MediaDrmResetException}.
+ * To recover, the app must release the MediaDrm object, then create and initialize
+ * a new one.
+ * <p>
+ * As {@link android.media.MediaDrmResetException} and
+ * {@link android.media.MediaDrm.MediaDrmStateException} both extend
+ * {@link java.lang.IllegalStateException}, they should be in an earlier catch()
+ * block than {@link java.lang.IllegalStateException} if handled separately.
+ * <p>
* <a name="Callbacks"></a>
* <h3>Callbacks</h3>
* <p>Applications should register for informational events in order
diff --git a/media/java/android/media/MediaDrmResetException.java b/media/java/android/media/MediaDrmResetException.java
new file mode 100644
index 0000000..3b2da1e
--- /dev/null
+++ b/media/java/android/media/MediaDrmResetException.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.media;
+
+/**
+ * This exception is thrown when the MediaDrm instance has become unusable
+ * due to a restart of the mediaserver process. To continue, the app must
+ * release the MediaDrm object, then create and initialize a new one.
+ */
+public class MediaDrmResetException extends IllegalStateException {
+ public MediaDrmResetException(String detailMessage) {
+ super(detailMessage);
+ }
+}
diff --git a/media/jni/android_media_ImageReader.cpp b/media/jni/android_media_ImageReader.cpp
index 635fa11..0034b07 100644
--- a/media/jni/android_media_ImageReader.cpp
+++ b/media/jni/android_media_ImageReader.cpp
@@ -1240,8 +1240,11 @@ static jint Image_getFormat(JNIEnv* env, jobject thiz, jint readerFormat)
return static_cast<jint>(PublicFormat::PRIVATE);
} else {
CpuConsumer::LockedBuffer* buffer = Image_getLockedBuffer(env, thiz);
+ int readerHalFormat = android_view_Surface_mapPublicFormatToHalFormat(
+ static_cast<PublicFormat>(readerFormat));
+ int32_t fmt = applyFormatOverrides(buffer->flexFormat, readerHalFormat);
PublicFormat publicFmt = android_view_Surface_mapHalFormatDataspaceToPublicFormat(
- buffer->flexFormat, buffer->dataSpace);
+ fmt, buffer->dataSpace);
return static_cast<jint>(publicFmt);
}
}
diff --git a/media/jni/android_media_MediaDrm.cpp b/media/jni/android_media_MediaDrm.cpp
index d456dc1..9ec0312 100644
--- a/media/jni/android_media_MediaDrm.cpp
+++ b/media/jni/android_media_MediaDrm.cpp
@@ -308,6 +308,10 @@ static bool throwExceptionAsNecessary(
} else if (err == ERROR_DRM_DEVICE_REVOKED) {
jniThrowException(env, "android/media/DeniedByServerException", msg);
return true;
+ } else if (err == DEAD_OBJECT) {
+ jniThrowException(env, "android/media/MediaDrmResetException",
+ "mediaserver died");
+ return true;
} else if (err != OK) {
String8 errbuf;
if (drmMessage != NULL) {
diff --git a/media/jni/audioeffect/android_media_AudioEffect.cpp b/media/jni/audioeffect/android_media_AudioEffect.cpp
index fdc586b..aba4bbe 100644
--- a/media/jni/audioeffect/android_media_AudioEffect.cpp
+++ b/media/jni/audioeffect/android_media_AudioEffect.cpp
@@ -472,6 +472,8 @@ static void android_media_AudioEffect_native_release(JNIEnv *env, jobject thiz)
if (lpJniStorage) {
ALOGV("deleting pJniStorage: %p\n", lpJniStorage);
+ env->DeleteGlobalRef(lpJniStorage->mCallbackData.audioEffect_class);
+ env->DeleteGlobalRef(lpJniStorage->mCallbackData.audioEffect_ref);
delete lpJniStorage;
}
}
diff --git a/media/jni/audioeffect/android_media_Visualizer.cpp b/media/jni/audioeffect/android_media_Visualizer.cpp
index 6098b4a..0557019 100644
--- a/media/jni/audioeffect/android_media_Visualizer.cpp
+++ b/media/jni/audioeffect/android_media_Visualizer.cpp
@@ -450,6 +450,8 @@ static void android_media_visualizer_native_release(JNIEnv *env, jobject thiz)
if (lpJniStorage) {
ALOGV("deleting pJniStorage: %p\n", lpJniStorage);
+ env->DeleteGlobalRef(lpJniStorage->mCallbackData.visualizer_class);
+ env->DeleteGlobalRef(lpJniStorage->mCallbackData.visualizer_ref);
delete lpJniStorage;
}
}
diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml
index 7af8b80..869b03a 100644
--- a/packages/SystemUI/res/values/dimens.xml
+++ b/packages/SystemUI/res/values/dimens.xml
@@ -578,4 +578,10 @@
<!-- Padding between icon and text for managed profile toast -->
<dimen name="managed_profile_toast_padding">4dp</dimen>
+
+ <!-- Thickness of the assist disclosure beams -->
+ <dimen name="assist_disclosure_thickness">4dp</dimen>
+
+ <!-- Thickness of the shadows of the assist disclosure beams -->
+ <dimen name="assist_disclosure_shadow_thickness">1.5dp</dimen>
</resources>
diff --git a/packages/SystemUI/src/com/android/systemui/assist/AssistDisclosure.java b/packages/SystemUI/src/com/android/systemui/assist/AssistDisclosure.java
new file mode 100644
index 0000000..234a699
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/assist/AssistDisclosure.java
@@ -0,0 +1,251 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+package com.android.systemui.assist;
+
+import com.android.systemui.R;
+
+import android.animation.Animator;
+import android.animation.AnimatorListenerAdapter;
+import android.animation.AnimatorSet;
+import android.animation.ValueAnimator;
+import android.content.Context;
+import android.graphics.Canvas;
+import android.graphics.Color;
+import android.graphics.Paint;
+import android.graphics.PixelFormat;
+import android.graphics.PorterDuff;
+import android.graphics.PorterDuffXfermode;
+import android.os.Handler;
+import android.view.View;
+import android.view.WindowManager;
+import android.view.animation.AnimationUtils;
+
+/**
+ * Visually discloses that contextual data was provided to an assistant.
+ */
+public class AssistDisclosure {
+ private final Context mContext;
+ private final WindowManager mWm;
+ private final Handler mHandler;
+
+ private AssistDisclosureView mView;
+ private boolean mViewAdded;
+
+ public AssistDisclosure(Context context, Handler handler) {
+ mContext = context;
+ mHandler = handler;
+ mWm = mContext.getSystemService(WindowManager.class);
+ }
+
+ public void postShow() {
+ mHandler.removeCallbacks(mShowRunnable);
+ mHandler.post(mShowRunnable);
+ }
+
+ private void show() {
+ if (mView == null) {
+ mView = new AssistDisclosureView(mContext);
+ }
+ if (!mViewAdded) {
+ WindowManager.LayoutParams lp = new WindowManager.LayoutParams(
+ WindowManager.LayoutParams.TYPE_SECURE_SYSTEM_OVERLAY,
+ WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
+ | WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED
+ | WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN
+ | WindowManager.LayoutParams.FLAG_FULLSCREEN
+ | WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED,
+ PixelFormat.TRANSLUCENT);
+ lp.setTitle("AssistDisclosure");
+
+ mWm.addView(mView, lp);
+ mViewAdded = true;
+ }
+ }
+
+ private void hide() {
+ if (mViewAdded) {
+ mWm.removeView(mView);
+ mViewAdded = false;
+ }
+ }
+
+ private Runnable mShowRunnable = new Runnable() {
+ @Override
+ public void run() {
+ show();
+ }
+ };
+
+ private class AssistDisclosureView extends View
+ implements ValueAnimator.AnimatorUpdateListener {
+
+ public static final int TRACING_ANIMATION_DURATION = 300;
+ public static final int ALPHA_ANIMATION_DURATION = 200;
+
+ private float mThickness;
+ private float mShadowThickness;
+ private final Paint mPaint = new Paint();
+ private final Paint mShadowPaint = new Paint();
+
+ private final ValueAnimator mTracingAnimator;
+ private final ValueAnimator mAlphaAnimator;
+ private final AnimatorSet mAnimator;
+
+ private float mTracingProgress = 0;
+ private int mAlpha = 255;
+
+ public AssistDisclosureView(Context context) {
+ super(context);
+
+ mTracingAnimator = ValueAnimator.ofFloat(0, 1).setDuration(TRACING_ANIMATION_DURATION);
+ mTracingAnimator.addUpdateListener(this);
+ mTracingAnimator.setInterpolator(AnimationUtils.loadInterpolator(mContext,
+ android.R.interpolator.fast_out_slow_in));
+ mAlphaAnimator = ValueAnimator.ofInt(255, 0).setDuration(ALPHA_ANIMATION_DURATION);
+ mAlphaAnimator.addUpdateListener(this);
+ mAlphaAnimator.setInterpolator(AnimationUtils.loadInterpolator(mContext,
+ android.R.interpolator.fast_out_linear_in));
+ mAnimator = new AnimatorSet();
+ mAnimator.play(mTracingAnimator).before(mAlphaAnimator);
+ mAnimator.addListener(new AnimatorListenerAdapter() {
+ boolean mCancelled;
+
+ @Override
+ public void onAnimationStart(Animator animation) {
+ mCancelled = false;
+ }
+
+ @Override
+ public void onAnimationCancel(Animator animation) {
+ mCancelled = true;
+ }
+
+ @Override
+ public void onAnimationEnd(Animator animation) {
+ if (!mCancelled) {
+ hide();
+ }
+ }
+ });
+
+ PorterDuffXfermode srcMode = new PorterDuffXfermode(PorterDuff.Mode.SRC);
+ mPaint.setColor(Color.WHITE);
+ mPaint.setXfermode(srcMode);
+ mShadowPaint.setColor(Color.DKGRAY);
+ mShadowPaint.setXfermode(srcMode);
+
+ mThickness = getResources().getDimension(R.dimen.assist_disclosure_thickness);
+ mShadowThickness = getResources().getDimension(
+ R.dimen.assist_disclosure_shadow_thickness);
+ }
+
+ @Override
+ protected void onAttachedToWindow() {
+ super.onAttachedToWindow();
+
+ startAnimation();
+ }
+
+ @Override
+ protected void onDetachedFromWindow() {
+ super.onDetachedFromWindow();
+
+ mAnimator.cancel();
+
+ mTracingProgress = 0;
+ mAlpha = 255;
+ }
+
+ private void startAnimation() {
+ mAnimator.cancel();
+ mAnimator.start();
+ }
+
+ @Override
+ protected void onDraw(Canvas canvas) {
+ mPaint.setAlpha(mAlpha);
+ mShadowPaint.setAlpha(mAlpha / 4);
+
+ drawGeometry(canvas, mShadowPaint, mShadowThickness);
+ drawGeometry(canvas, mPaint, 0);
+ }
+
+ private void drawGeometry(Canvas canvas, Paint paint, float padding) {
+ final int width = getWidth();
+ final int height = getHeight();
+ float thickness = mThickness;
+ final float pixelProgress = mTracingProgress * (width + height - 2 * thickness);
+
+ float bottomProgress = Math.min(pixelProgress, width / 2f);
+ if (bottomProgress > 0) {
+ drawBeam(canvas,
+ width / 2f - bottomProgress,
+ height - thickness,
+ width / 2f + bottomProgress,
+ height, paint, padding);
+ }
+
+ float sideProgress = Math.min(pixelProgress - bottomProgress, height - thickness);
+ if (sideProgress > 0) {
+ drawBeam(canvas,
+ 0,
+ (height - thickness) - sideProgress,
+ thickness,
+ height - thickness, paint, padding);
+ drawBeam(canvas,
+ width - thickness,
+ (height - thickness) - sideProgress,
+ width,
+ height - thickness, paint, padding);
+ }
+
+ float topProgress = Math.min(pixelProgress - bottomProgress - sideProgress,
+ width / 2 - thickness);
+ if (sideProgress > 0 && topProgress > 0) {
+ drawBeam(canvas,
+ thickness,
+ 0,
+ thickness + topProgress,
+ thickness, paint, padding);
+ drawBeam(canvas,
+ (width - thickness) - topProgress,
+ 0,
+ width - thickness,
+ thickness, paint, padding);
+ }
+ }
+
+ private void drawBeam(Canvas canvas, float left, float top, float right, float bottom,
+ Paint paint, float padding) {
+ canvas.drawRect(left - padding,
+ top - padding,
+ right + padding,
+ bottom + padding,
+ paint);
+ }
+
+ @Override
+ public void onAnimationUpdate(ValueAnimator animation) {
+ if (animation == mAlphaAnimator) {
+ mAlpha = (int) mAlphaAnimator.getAnimatedValue();
+ } else if (animation == mTracingAnimator) {
+ mTracingProgress = (float) mTracingAnimator.getAnimatedValue();
+ }
+ invalidate();
+ }
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/assist/AssistManager.java b/packages/SystemUI/src/com/android/systemui/assist/AssistManager.java
index 445ecb6..674356b 100644
--- a/packages/SystemUI/src/com/android/systemui/assist/AssistManager.java
+++ b/packages/SystemUI/src/com/android/systemui/assist/AssistManager.java
@@ -55,6 +55,8 @@ public class AssistManager {
private final Context mContext;
private final WindowManager mWindowManager;
+ private final AssistDisclosure mAssistDisclosure;
+
private AssistOrbContainer mView;
private final PhoneStatusBar mBar;
private final AssistUtils mAssistUtils;
@@ -100,6 +102,7 @@ public class AssistManager {
Settings.Secure.getUriFor(Settings.Secure.ASSISTANT), false,
mAssistSettingsObserver);
mAssistSettingsObserver.onChange(false);
+ mAssistDisclosure = new AssistDisclosure(context, new Handler());
}
public void onConfigurationChanged() {
@@ -187,8 +190,11 @@ public class AssistManager {
mBar.animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_SEARCH_PANEL |
CommandQueue.FLAG_EXCLUDE_RECENTS_PANEL);
+ boolean structureEnabled = Settings.Secure.getIntForUser(mContext.getContentResolver(),
+ Settings.Secure.ASSIST_STRUCTURE_ENABLED, 1, UserHandle.USER_CURRENT) != 0;
+
final Intent intent = ((SearchManager) mContext.getSystemService(Context.SEARCH_SERVICE))
- .getAssistIntent(mContext, true, UserHandle.USER_CURRENT);
+ .getAssistIntent(mContext, structureEnabled, UserHandle.USER_CURRENT);
if (intent == null) {
return;
}
@@ -196,6 +202,10 @@ public class AssistManager {
intent.setComponent(mAssistComponent);
}
+ if (structureEnabled) {
+ showDisclosure();
+ }
+
try {
final ActivityOptions opts = ActivityOptions.makeCustomAnimation(mContext,
R.anim.search_launch_enter, R.anim.search_launch_exit);
@@ -297,4 +307,8 @@ public class AssistManager {
pw.println("AssistManager state:");
pw.print(" mAssistComponent="); pw.println(mAssistComponent);
}
+
+ public void showDisclosure() {
+ mAssistDisclosure.postShow();
+ }
}
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java
index 9761cd1..4b1453d 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java
@@ -390,7 +390,7 @@ public class QSPanel extends ViewGroup {
mDetailSettingsButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
- mHost.startSettingsActivity(settingsIntent);
+ mHost.startActivityDismissingKeyguard(settingsIntent);
}
});
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSTile.java b/packages/SystemUI/src/com/android/systemui/qs/QSTile.java
index 72bb136..38fade2 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSTile.java
@@ -306,7 +306,7 @@ public abstract class QSTile<TState extends State> implements Listenable {
}
public interface Host {
- void startSettingsActivity(Intent intent);
+ void startActivityDismissingKeyguard(Intent intent);
void warn(String message, Throwable t);
void collapsePanels();
Looper getLooper();
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java
index a9e8b38..07406b9 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java
@@ -82,7 +82,7 @@ public class CellularTile extends QSTile<QSTile.SignalState> {
if (mDataController.isMobileDataSupported()) {
showDetail(true);
} else {
- mHost.startSettingsActivity(CELLULAR_SETTINGS);
+ mHost.startActivityDismissingKeyguard(CELLULAR_SETTINGS);
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/DndTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/DndTile.java
index f97f519..1b74eb6 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/DndTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/DndTile.java
@@ -263,7 +263,7 @@ public class DndTile extends QSTile<QSTile.BooleanState> {
private final ZenModePanel.Callback mZenModePanelCallback = new ZenModePanel.Callback() {
@Override
public void onPrioritySettings() {
- mHost.startSettingsActivity(ZEN_PRIORITY_SETTINGS);
+ mHost.startActivityDismissingKeyguard(ZEN_PRIORITY_SETTINGS);
}
@Override
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/IntentTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/IntentTile.java
index 19f4df6..f7f7acb 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/IntentTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/IntentTile.java
@@ -96,7 +96,11 @@ public class IntentTile extends QSTile<QSTile.State> {
private void sendIntent(String type, PendingIntent pi, String uri) {
try {
if (pi != null) {
- pi.send();
+ if (pi.isActivity()) {
+ getHost().startActivityDismissingKeyguard(pi.getIntent());
+ } else {
+ pi.send();
+ }
} else if (uri != null) {
final Intent intent = Intent.parseUri(uri, Intent.URI_INTENT_SCHEME);
mContext.sendBroadcastAsUser(intent, new UserHandle(mCurrentUserId));
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/WifiTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/WifiTile.java
index 9bc5b75..c33ef7c 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/WifiTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/WifiTile.java
@@ -104,7 +104,7 @@ public class WifiTile extends QSTile<QSTile.SignalState> {
@Override
protected void handleSecondaryClick() {
if (!mWifiController.canConfigWifi()) {
- mHost.startSettingsActivity(new Intent(Settings.ACTION_WIFI_SETTINGS));
+ mHost.startActivityDismissingKeyguard(new Intent(Settings.ACTION_WIFI_SETTINGS));
return;
}
if (!mState.enabled) {
@@ -290,7 +290,7 @@ public class WifiTile extends QSTile<QSTile.SignalState> {
@Override
public void onSettingsActivityTriggered(Intent settingsIntent) {
- mHost.startSettingsActivity(settingsIntent);
+ mHost.startActivityDismissingKeyguard(settingsIntent);
}
@Override
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
index f8a1385..295fdc8 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
@@ -2101,4 +2101,11 @@ public abstract class BaseStatusBar extends SystemUI implements
}
return mStatusBarKeyguardViewManager.isSecure();
}
+
+ @Override
+ public void showAssistDisclosure() {
+ if (mAssistManager != null) {
+ mAssistManager.showDisclosure();
+ }
+ }
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java b/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
index 80fdd28..0deff08 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
@@ -61,6 +61,7 @@ public class CommandQueue extends IStatusBar.Stub {
private static final int MSG_APP_TRANSITION_PENDING = 19 << MSG_SHIFT;
private static final int MSG_APP_TRANSITION_CANCELLED = 20 << MSG_SHIFT;
private static final int MSG_APP_TRANSITION_STARTING = 21 << MSG_SHIFT;
+ private static final int MSG_ASSIST_DISCLOSURE = 22 << MSG_SHIFT;
public static final int FLAG_EXCLUDE_NONE = 0;
public static final int FLAG_EXCLUDE_SEARCH_PANEL = 1 << 0;
@@ -104,6 +105,7 @@ public class CommandQueue extends IStatusBar.Stub {
public void appTransitionPending();
public void appTransitionCancelled();
public void appTransitionStarting(long startTime, long duration);
+ public void showAssistDisclosure();
}
public CommandQueue(Callbacks callbacks, StatusBarIconList list) {
@@ -274,6 +276,13 @@ public class CommandQueue extends IStatusBar.Stub {
}
}
+ public void showAssistDisclosure() {
+ synchronized (mList) {
+ mHandler.removeMessages(MSG_ASSIST_DISCLOSURE);
+ mHandler.obtainMessage(MSG_ASSIST_DISCLOSURE).sendToTarget();
+ }
+ }
+
private final class H extends Handler {
public void handleMessage(Message msg) {
final int what = msg.what & MSG_MASK;
@@ -366,6 +375,9 @@ public class CommandQueue extends IStatusBar.Stub {
Pair<Long, Long> data = (Pair<Long, Long>) msg.obj;
mCallbacks.appTransitionStarting(data.first, data.second);
break;
+ case MSG_ASSIST_DISCLOSURE:
+ mCallbacks.showAssistDisclosure();
+ break;
}
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
index cd90d27..ade40e5 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -3101,16 +3101,16 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|| (mDisabled1 & StatusBarManager.DISABLE_SEARCH) != 0;
}
- public void postStartSettingsActivity(final Intent intent, int delay) {
+ public void postStartActivityDismissingKeyguard(final Intent intent, int delay) {
mHandler.postDelayed(new Runnable() {
@Override
public void run() {
- handleStartSettingsActivity(intent, true /*onlyProvisioned*/);
+ handleStartActivityDismissingKeyguard(intent, true /*onlyProvisioned*/);
}
}, delay);
}
- private void handleStartSettingsActivity(Intent intent, boolean onlyProvisioned) {
+ private void handleStartActivityDismissingKeyguard(Intent intent, boolean onlyProvisioned) {
startActivityDismissingKeyguard(intent, onlyProvisioned, true /* dismissShade */);
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QSTileHost.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QSTileHost.java
index 25a93dd..12434ac 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QSTileHost.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QSTileHost.java
@@ -129,8 +129,8 @@ public class QSTileHost implements QSTile.Host, Tunable {
}
@Override
- public void startSettingsActivity(final Intent intent) {
- mStatusBar.postStartSettingsActivity(intent, 0);
+ public void startActivityDismissingKeyguard(final Intent intent) {
+ mStatusBar.postStartActivityDismissingKeyguard(intent, 0);
}
@Override
diff --git a/rs/java/android/renderscript/ScriptIntrinsicBLAS.java b/rs/java/android/renderscript/ScriptIntrinsicBLAS.java
index f7e81b0..aa72fba 100644
--- a/rs/java/android/renderscript/ScriptIntrinsicBLAS.java
+++ b/rs/java/android/renderscript/ScriptIntrinsicBLAS.java
@@ -22,7 +22,12 @@ import java.lang.annotation.RetentionPolicy;
/**
*
- * BLAS
+ * ScriptIntrinsicBLAS class provides high performance RenderScript APIs to BLAS.
+ *
+ * The BLAS (Basic Linear Algebra Subprograms) are routines that provide standard
+ * building blocks for performing basic vector and matrix operations.
+ *
+ * For detailed description of BLAS, please refer to http://www.netlib.org/blas/
*
**/
public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
@@ -179,24 +184,40 @@ public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
private static final int RsBlas_bnnm = 1000;
/**
+ * Create an intrinsic to access BLAS subroutines.
+ *
+ * @param rs The RenderScript context
+ * @return ScriptIntrinsicBLAS
*/
public static ScriptIntrinsicBLAS create(RenderScript rs) {
long id = rs.nScriptIntrinsicCreate(13, Element.U32(rs).getID(rs));
return new ScriptIntrinsicBLAS(id, rs);
}
+ /**
+ * @hide
+ */
@IntDef({NO_TRANSPOSE, TRANSPOSE, CONJ_TRANSPOSE})
@Retention(RetentionPolicy.SOURCE)
public @interface Transpose {}
+ /**
+ * @hide
+ */
@IntDef({UPPER, LOWER})
@Retention(RetentionPolicy.SOURCE)
public @interface Uplo {}
+ /**
+ * @hide
+ */
@IntDef({NON_UNIT, UNIT})
@Retention(RetentionPolicy.SOURCE)
public @interface Diag {}
+ /**
+ * @hide
+ */
@IntDef({LEFT, RIGHT})
@Retention(RetentionPolicy.SOURCE)
public @interface Side {}
@@ -280,24 +301,88 @@ public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
throw new RSRuntimeException("Incorrect vector dimensions for GEMV");
}
}
+
+ /**
+ * SGEMV performs one of the matrix-vector operations
+ * y := alpha*A*x + beta*y or y := alpha*A**T*x + beta*y
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/db/d58/sgemv_8f.html
+ *
+ * @param TransA The type of transpose applied to matrix A.
+ * @param alpha The scalar alpha.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F32}.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F32}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ * @param beta The scalar beta.
+ * @param Y The input allocation contains vector y, supported elements type {@link Element#F32}.
+ * @param incY The increment for the elements of vector y, must be larger than zero.
+ */
public void SGEMV(@Transpose int TransA, float alpha, Allocation A, Allocation X, int incX, float beta, Allocation Y, int incY) {
validateGEMV(Element.F32(mRS), TransA, A, X, incX, Y, incY);
int M = A.getType().getY();
int N = A.getType().getX();
mRS.nScriptIntrinsicBLAS_Single(getID(mRS), RsBlas_sgemv, TransA, 0, 0, 0, 0, M, N, 0, alpha, A.getID(mRS), X.getID(mRS), beta, Y.getID(mRS), incX, incY, 0, 0);
}
+
+ /**
+ * DGEMV performs one of the matrix-vector operations
+ * y := alpha*A*x + beta*y or y := alpha*A**T*x + beta*y
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/dc/da8/dgemv_8f.html
+ *
+ * @param TransA The type of transpose applied to matrix A.
+ * @param alpha The scalar alpha.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F64}.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F64}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ * @param beta The scalar beta.
+ * @param Y The input allocation contains vector y, supported elements type {@link Element#F64}.
+ * @param incY The increment for the elements of vector y, must be larger than zero.
+ */
public void DGEMV(@Transpose int TransA, double alpha, Allocation A, Allocation X, int incX, double beta, Allocation Y, int incY) {
validateGEMV(Element.F64(mRS), TransA, A, X, incX, Y, incY);
int M = A.getType().getY();
int N = A.getType().getX();
mRS.nScriptIntrinsicBLAS_Double(getID(mRS), RsBlas_dgemv, TransA, 0, 0, 0, 0, M, N, 0, alpha, A.getID(mRS), X.getID(mRS), beta, Y.getID(mRS), incX, incY, 0, 0);
}
+
+ /**
+ * CGEMV performs one of the matrix-vector operations
+ * y := alpha*A*x + beta*y or y := alpha*A**T*x + beta*y or y := alpha*A**H*x + beta*y
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d4/d8a/cgemv_8f.html
+ *
+ * @param TransA The type of transpose applied to matrix A.
+ * @param alpha The scalar alpha.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F32_2}.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F32_2}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ * @param beta The scalar beta.
+ * @param Y The input allocation contains vector y, supported elements type {@link Element#F32_2}.
+ * @param incY The increment for the elements of vector y, must be larger than zero.
+ */
public void CGEMV(@Transpose int TransA, Float2 alpha, Allocation A, Allocation X, int incX, Float2 beta, Allocation Y, int incY) {
validateGEMV(Element.F32_2(mRS), TransA, A, X, incX, Y, incY);
int M = A.getType().getY();
int N = A.getType().getX();
mRS.nScriptIntrinsicBLAS_Complex(getID(mRS), RsBlas_cgemv, TransA, 0, 0, 0, 0, M, N, 0, alpha.x, alpha.y, A.getID(mRS), X.getID(mRS), beta.x, beta.y, Y.getID(mRS), incX, incY, 0, 0);
}
+
+ /**
+ * ZGEMV performs one of the matrix-vector operations
+ * y := alpha*A*x + beta*y or y := alpha*A**T*x + beta*y or y := alpha*A**H*x + beta*y
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/db/d40/zgemv_8f.html
+ *
+ * @param TransA The type of transpose applied to matrix A.
+ * @param alpha The scalar alpha.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F64_2}.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F64_2}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ * @param beta The scalar beta.
+ * @param Y The input allocation contains vector y, supported elements type {@link Element#F64_2}.
+ * @param incY The increment for the elements of vector y, must be larger than zero.
+ */
public void ZGEMV(@Transpose int TransA, Double2 alpha, Allocation A, Allocation X, int incX, Double2 beta, Allocation Y, int incY) {
validateGEMV(Element.F64_2(mRS), TransA, A, X, incX, Y, incY);
int M = A.getType().getY();
@@ -305,6 +390,30 @@ public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
mRS.nScriptIntrinsicBLAS_Z(getID(mRS), RsBlas_zgemv, TransA, 0, 0, 0, 0, M, N, 0, alpha.x, alpha.y, A.getID(mRS), X.getID(mRS), beta.x, beta.y, Y.getID(mRS), incX, incY, 0, 0);
}
+ /**
+ * SGBMV performs one of the matrix-vector operations
+ * y := alpha*A*x + beta*y or y := alpha*A**T*x + beta*y
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d6/d46/sgbmv_8f.html
+ *
+ * Note: For a M*N matrix, the input Allocation should also be of size M*N (dimY = M, dimX = N),
+ * but only the region M*(KL+KU+1) will be referenced. The following subroutine can is an
+ * example showing how to convert the original matrix 'a' to row-based band matrix 'b'.
+ * for i in range(0, m):
+ * for j in range(max(0, i-kl), min(i+ku+1, n)):
+ * b[i, j-i+kl] = a[i, j]
+ *
+ * @param TransA The type of transpose applied to matrix A.
+ * @param KL The number of sub-diagonals of the matrix A.
+ * @param KU The number of super-diagonals of the matrix A.
+ * @param alpha The scalar alpha.
+ * @param A The input allocation contains the band matrix A, supported elements type {@link Element#F32}.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F32}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ * @param beta The scalar beta.
+ * @param Y The input allocation contains vector y, supported elements type {@link Element#F32}.
+ * @param incY The increment for the elements of vector y, must be larger than zero.
+ */
public void SGBMV(@Transpose int TransA, int KL, int KU, float alpha, Allocation A, Allocation X, int incX, float beta, Allocation Y, int incY) {
// GBMV has the same validation requirements as GEMV + KL and KU >= 0
validateGEMV(Element.F32(mRS), TransA, A, X, incX, Y, incY);
@@ -315,6 +424,31 @@ public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
int N = A.getType().getX();
mRS.nScriptIntrinsicBLAS_Single(getID(mRS), RsBlas_sgbmv, TransA, 0, 0, 0, 0, M, N, 0, alpha, A.getID(mRS), X.getID(mRS), beta, Y.getID(mRS), incX, incY, KL, KU);
}
+
+ /**
+ * DGBMV performs one of the matrix-vector operations
+ * y := alpha*A*x + beta*y or y := alpha*A**T*x + beta*y
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d2/d3f/dgbmv_8f.html
+ *
+ * Note: For a M*N matrix, the input Allocation should also be of size M*N (dimY = M, dimX = N),
+ * but only the region M*(KL+KU+1) will be referenced. The following subroutine can is an
+ * example showing how to convert the original matrix 'a' to row-based band matrix 'b'.
+ * for i in range(0, m):
+ * for j in range(max(0, i-kl), min(i+ku+1, n)):
+ * b[i, j-i+kl] = a[i, j]
+ *
+ * @param TransA The type of transpose applied to matrix A.
+ * @param KL The number of sub-diagonals of the matrix A.
+ * @param KU The number of super-diagonals of the matrix A.
+ * @param alpha The scalar alpha.
+ * @param A The input allocation contains the band matrix A, supported elements type {@link Element#F64}.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F64}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ * @param beta The scalar beta.
+ * @param Y The input allocation contains vector y, supported elements type {@link Element#F64}.
+ * @param incY The increment for the elements of vector y, must be larger than zero.
+ */
public void DGBMV(@Transpose int TransA, int KL, int KU, double alpha, Allocation A, Allocation X, int incX, double beta, Allocation Y, int incY) {
// GBMV has the same validation requirements as GEMV + KL and KU >= 0
validateGEMV(Element.F64(mRS), TransA, A, X, incX, Y, incY);
@@ -325,6 +459,31 @@ public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
int N = A.getType().getX();
mRS.nScriptIntrinsicBLAS_Double(getID(mRS), RsBlas_dgbmv, TransA, 0, 0, 0, 0, M, N, 0, alpha, A.getID(mRS), X.getID(mRS), beta, Y.getID(mRS), incX, incY, KL, KU);
}
+
+ /**
+ * CGBMV performs one of the matrix-vector operations
+ * y := alpha*A*x + beta*y or y := alpha*A**T*x + beta*y or y := alpha*A**H*x + beta*y
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d0/d75/cgbmv_8f.html
+ *
+ * Note: For a M*N matrix, the input Allocation should also be of size M*N (dimY = M, dimX = N),
+ * but only the region M*(KL+KU+1) will be referenced. The following subroutine can is an
+ * example showing how to convert the original matrix 'a' to row-based band matrix 'b'.
+ * for i in range(0, m):
+ * for j in range(max(0, i-kl), min(i+ku+1, n)):
+ * b[i, j-i+kl] = a[i, j]
+ *
+ * @param TransA The type of transpose applied to matrix A.
+ * @param KL The number of sub-diagonals of the matrix A.
+ * @param KU The number of super-diagonals of the matrix A.
+ * @param alpha The scalar alpha.
+ * @param A The input allocation contains the band matrix A, supported elements type {@link Element#F32_2}.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F32_2}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ * @param beta The scalar beta.
+ * @param Y The input allocation contains vector y, supported elements type {@link Element#F32_2}.
+ * @param incY The increment for the elements of vector y, must be larger than zero.
+ */
public void CGBMV(@Transpose int TransA, int KL, int KU, Float2 alpha, Allocation A, Allocation X, int incX, Float2 beta, Allocation Y, int incY) {
// GBMV has the same validation requirements as GEMV + KL and KU >= 0
validateGEMV(Element.F32_2(mRS), TransA, A, X, incX, Y, incY);
@@ -335,6 +494,31 @@ public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
int N = A.getType().getX();
mRS.nScriptIntrinsicBLAS_Complex(getID(mRS), RsBlas_cgbmv, TransA, 0, 0, 0, 0, M, N, 0, alpha.x, alpha.y, A.getID(mRS), X.getID(mRS), beta.x, beta.y, Y.getID(mRS), incX, incY, KL, KU);
}
+
+ /**
+ * ZGBMV performs one of the matrix-vector operations
+ * y := alpha*A*x + beta*y or y := alpha*A**T*x + beta*y or y := alpha*A**H*x + beta*y
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d9/d46/zgbmv_8f.html
+ *
+ * Note: For a M*N matrix, the input Allocation should also be of size M*N (dimY = M, dimX = N),
+ * but only the region M*(KL+KU+1) will be referenced. The following subroutine can is an
+ * example showing how to convert the original matrix 'a' to row-based band matrix 'b'.
+ * for i in range(0, m):
+ * for j in range(max(0, i-kl), min(i+ku+1, n)):
+ * b[i, j-i+kl] = a[i, j]
+ *
+ * @param TransA The type of transpose applied to matrix A.
+ * @param KL The number of sub-diagonals of the matrix A.
+ * @param KU The number of super-diagonals of the matrix A.
+ * @param alpha The scalar alpha.
+ * @param A The input allocation contains the band matrix A, supported elements type {@link Element#F64_2}.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F64_2}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ * @param beta The scalar beta.
+ * @param Y The input allocation contains vector y, supported elements type {@link Element#F64_2}.
+ * @param incY The increment for the elements of vector y, must be larger than zero.
+ */
public void ZGBMV(@Transpose int TransA, int KL, int KU, Double2 alpha, Allocation A, Allocation X, int incX, Double2 beta, Allocation Y, int incY) {
// GBMV has the same validation requirements as GEMV + KL and KU >= 0
validateGEMV(Element.F64_2(mRS), TransA, A, X, incX, Y, incY);
@@ -403,27 +587,103 @@ public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
return N;
}
+ /**
+ * STRMV performs one of the matrix-vector operations
+ * x := A*x or x := A**T*x
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/de/d45/strmv_8f.html
+ *
+ * @param Uplo Specifies whether the matrix is an upper or lower triangular matrix.
+ * @param TransA The type of transpose applied to matrix A.
+ * @param Diag Specifies whether or not A is unit triangular.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F32}.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F32}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ */
public void STRMV(@Uplo int Uplo, @Transpose int TransA, @Diag int Diag, Allocation A, Allocation X, int incX) {
validateTRMV(Element.F32(mRS), Uplo, TransA, Diag, A, X, incX);
int N = A.getType().getY();
mRS.nScriptIntrinsicBLAS_Single(getID(mRS), RsBlas_strmv, TransA, 0, 0, Uplo, Diag, 0, N, 0, 0, A.getID(mRS), X.getID(mRS), 0, 0, incX, 0, 0, 0);
}
+
+ /**
+ * DTRMV performs one of the matrix-vector operations
+ * x := A*x or x := A**T*x
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/dc/d7e/dtrmv_8f.html
+ *
+ * @param Uplo Specifies whether the matrix is an upper or lower triangular matrix.
+ * @param TransA The type of transpose applied to matrix A.
+ * @param Diag Specifies whether or not A is unit triangular.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F64}.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F64}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ */
public void DTRMV(@Uplo int Uplo, @Transpose int TransA, @Diag int Diag, Allocation A, Allocation X, int incX) {
validateTRMV(Element.F64(mRS), Uplo, TransA, Diag, A, X, incX);
int N = A.getType().getY();
mRS.nScriptIntrinsicBLAS_Double(getID(mRS), RsBlas_dtrmv, TransA, 0, 0, Uplo, Diag, 0, N, 0, 0, A.getID(mRS), X.getID(mRS), 0, 0, incX, 0, 0, 0);
}
+
+ /**
+ * CTRMV performs one of the matrix-vector operations
+ * x := A*x or x := A**T*x or x := A**H*x
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/df/d78/ctrmv_8f.html
+ *
+ * @param Uplo Specifies whether the matrix is an upper or lower triangular matrix.
+ * @param TransA The type of transpose applied to matrix A.
+ * @param Diag Specifies whether or not A is unit triangular.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F32_2}.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F32_2}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ */
public void CTRMV(@Uplo int Uplo, @Transpose int TransA, @Diag int Diag, Allocation A, Allocation X, int incX) {
validateTRMV(Element.F32_2(mRS), Uplo, TransA, Diag, A, X, incX);
int N = A.getType().getY();
mRS.nScriptIntrinsicBLAS_Complex(getID(mRS), RsBlas_ctrmv, TransA, 0, 0, Uplo, Diag, 0, N, 0, 0, 0, A.getID(mRS), X.getID(mRS), 0, 0, 0, incX, 0, 0, 0);
}
+
+ /**
+ * ZTRMV performs one of the matrix-vector operations
+ * x := A*x or x := A**T*x or x := A**H*x
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d0/dd1/ztrmv_8f.html
+ *
+ * @param Uplo Specifies whether the matrix is an upper or lower triangular matrix.
+ * @param TransA The type of transpose applied to matrix A.
+ * @param Diag Specifies whether or not A is unit triangular.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F64_2}.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F64_2}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ */
public void ZTRMV(@Uplo int Uplo, @Transpose int TransA, @Diag int Diag, Allocation A, Allocation X, int incX) {
validateTRMV(Element.F64_2(mRS), Uplo, TransA, Diag, A, X, incX);
int N = A.getType().getY();
mRS.nScriptIntrinsicBLAS_Z(getID(mRS), RsBlas_ztrmv, TransA, 0, 0, Uplo, Diag, 0, N, 0, 0, 0, A.getID(mRS), X.getID(mRS), 0, 0, 0, incX, 0, 0, 0);
}
+ /**
+ * STBMV performs one of the matrix-vector operations
+ * x := A*x or x := A**T*x
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d6/d7d/stbmv_8f.html
+ *
+ * Note: For a N*N matrix, the input Allocation should also be of size N*N (dimY = N, dimX = N),
+ * but only the region N*(K+1) will be referenced. The following subroutine can is an
+ * example showing how to convert a UPPER trianglar matrix 'a' to row-based band matrix 'b'.
+ * for i in range(0, n):
+ * for j in range(i, min(i+k+1, n)):
+ * b[i, j-i] = a[i, j]
+ *
+ * @param Uplo Specifies whether the matrix is an upper or lower triangular matrix.
+ * @param TransA The type of transpose applied to matrix A.
+ * @param Diag Specifies whether or not A is unit triangular.
+ * @param K The number of off-diagonals of the matrix A
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F32}.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F32}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ */
public void STBMV(@Uplo int Uplo, @Transpose int TransA, @Diag int Diag, int K, Allocation A, Allocation X, int incX) {
// TBMV has the same requirements as TRMV + K >= 0
if (K < 0) {
@@ -433,6 +693,28 @@ public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
int N = A.getType().getY();
mRS.nScriptIntrinsicBLAS_Single(getID(mRS), RsBlas_stbmv, TransA, 0, 0, Uplo, Diag, 0, N, K, 0, A.getID(mRS), X.getID(mRS), 0, 0, incX, 0, 0, 0);
}
+
+ /**
+ * DTBMV performs one of the matrix-vector operations
+ * x := A*x or x := A**T*x
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/df/d29/dtbmv_8f.html
+ *
+ * Note: For a N*N matrix, the input Allocation should also be of size N*N (dimY = N, dimX = N),
+ * but only the region N*(K+1) will be referenced. The following subroutine can is an
+ * example showing how to convert a UPPER trianglar matrix 'a' to row-based band matrix 'b'.
+ * for i in range(0, n):
+ * for j in range(i, min(i+k+1, n)):
+ * b[i, j-i] = a[i, j]
+ *
+ * @param Uplo Specifies whether the matrix is an upper or lower triangular matrix.
+ * @param TransA The type of transpose applied to matrix A.
+ * @param Diag Specifies whether or not A is unit triangular.
+ * @param K The number of off-diagonals of the matrix A
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F64}.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F64}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ */
public void DTBMV(@Uplo int Uplo, @Transpose int TransA, @Diag int Diag, int K, Allocation A, Allocation X, int incX) {
// TBMV has the same requirements as TRMV + K >= 0
if (K < 0) {
@@ -442,6 +724,28 @@ public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
int N = A.getType().getY();
mRS.nScriptIntrinsicBLAS_Double(getID(mRS), RsBlas_dtbmv, TransA, 0, 0, Uplo, Diag, 0, N, K, 0, A.getID(mRS), X.getID(mRS), 0, 0, incX, 0, 0, 0);
}
+
+ /**
+ * CTBMV performs one of the matrix-vector operations
+ * x := A*x or x := A**T*x or x := A**H*x
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d3/dcd/ctbmv_8f.html
+ *
+ * Note: For a N*N matrix, the input Allocation should also be of size N*N (dimY = N, dimX = N),
+ * but only the region N*(K+1) will be referenced. The following subroutine can is an
+ * example showing how to convert a UPPER trianglar matrix 'a' to row-based band matrix 'b'.
+ * for i in range(0, n):
+ * for j in range(i, min(i+k+1, n)):
+ * b[i, j-i] = a[i, j]
+ *
+ * @param Uplo Specifies whether the matrix is an upper or lower triangular matrix.
+ * @param TransA The type of transpose applied to matrix A.
+ * @param Diag Specifies whether or not A is unit triangular.
+ * @param K The number of off-diagonals of the matrix A
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F32_2}.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F32_2}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ */
public void CTBMV(@Uplo int Uplo, @Transpose int TransA, @Diag int Diag, int K, Allocation A, Allocation X, int incX) {
// TBMV has the same requirements as TRMV + K >= 0
if (K < 0) {
@@ -451,6 +755,28 @@ public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
int N = A.getType().getY();
mRS.nScriptIntrinsicBLAS_Complex(getID(mRS), RsBlas_ctbmv, TransA, 0, 0, Uplo, Diag, 0, N, K, 0, 0, A.getID(mRS), X.getID(mRS), 0, 0, 0, incX, 0, 0, 0);
}
+
+ /**
+ * ZTBMV performs one of the matrix-vector operations
+ * x := A*x or x := A**T*x or x := A**H*x
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d3/d39/ztbmv_8f.html
+ *
+ * Note: For a N*N matrix, the input Allocation should also be of size N*N (dimY = N, dimX = N),
+ * but only the region N*(K+1) will be referenced. The following subroutine can is an
+ * example showing how to convert a UPPER trianglar matrix 'a' to row-based band matrix 'b'.
+ * for i in range(0, n):
+ * for j in range(i, min(i+k+1, n)):
+ * b[i, j-i] = a[i, j]
+ *
+ * @param Uplo Specifies whether the matrix is an upper or lower triangular matrix.
+ * @param TransA The type of transpose applied to matrix A.
+ * @param Diag Specifies whether or not A is unit triangular.
+ * @param K The number of off-diagonals of the matrix A
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F64_2}.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F64_2}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ */
public void ZTBMV(@Uplo int Uplo, @Transpose int TransA, @Diag int Diag, int K, Allocation A, Allocation X, int incX) {
// TBMV has the same requirements as TRMV + K >= 0
if (K < 0) {
@@ -460,22 +786,124 @@ public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
int N = A.getType().getY();
mRS.nScriptIntrinsicBLAS_Z(getID(mRS), RsBlas_ztbmv, TransA, 0, 0, Uplo, Diag, 0, N, K, 0, 0, A.getID(mRS), X.getID(mRS), 0, 0, 0, incX, 0, 0, 0);
}
+
+ /**
+ * STPMV performs one of the matrix-vector operations
+ * x := A*x or x := A**T*x
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/db/db1/stpmv_8f.html
+ *
+ * Note: For a N*N matrix, the input Allocation should be a 1D allocation of size dimX = N*(N+1)/2,
+ * The following subroutine can is an example showing how to convert a UPPER trianglar matrix
+ * 'a' to packed matrix 'b'.
+ * k = 0
+ * for i in range(0, n):
+ * for j in range(i, n):
+ * b[k++] = a[i, j]
+ *
+ * @param Uplo Specifies whether the matrix is an upper or lower triangular matrix.
+ * @param TransA The type of transpose applied to matrix A.
+ * @param Diag Specifies whether or not A is unit triangular.
+ * @param Ap The input allocation contains packed matrix A, supported elements type {@link Element#F32}.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F32}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ */
public void STPMV(@Uplo int Uplo, @Transpose int TransA, @Diag int Diag, Allocation Ap, Allocation X, int incX) {
int N = validateTPMV(Element.F32(mRS), Uplo, TransA, Diag, Ap, X, incX);
mRS.nScriptIntrinsicBLAS_Single(getID(mRS), RsBlas_stpmv, TransA, 0, 0, Uplo, Diag, 0, N, 0, 0, Ap.getID(mRS), X.getID(mRS), 0, 0, incX, 0, 0, 0);
}
+
+ /**
+ * DTPMV performs one of the matrix-vector operations
+ * x := A*x or x := A**T*x
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/dc/dcd/dtpmv_8f.html
+ *
+ * Note: For a N*N matrix, the input Allocation should be a 1D allocation of size dimX = N*(N+1)/2,
+ * The following subroutine can is an example showing how to convert a UPPER trianglar matrix
+ * 'a' to packed matrix 'b'.
+ * k = 0
+ * for i in range(0, n):
+ * for j in range(i, n):
+ * b[k++] = a[i, j]
+ *
+ * @param Uplo Specifies whether the matrix is an upper or lower triangular matrix.
+ * @param TransA The type of transpose applied to matrix A.
+ * @param Diag Specifies whether or not A is unit triangular.
+ * @param Ap The input allocation contains packed matrix A, supported elements type {@link Element#F64}.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F64}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ */
public void DTPMV(@Uplo int Uplo, @Transpose int TransA, @Diag int Diag, Allocation Ap, Allocation X, int incX) {
int N = validateTPMV(Element.F64(mRS), Uplo, TransA, Diag, Ap, X, incX);
mRS.nScriptIntrinsicBLAS_Double(getID(mRS), RsBlas_dtpmv, TransA, 0, 0, Uplo, Diag, 0, N, 0, 0, Ap.getID(mRS), X.getID(mRS), 0, 0, incX, 0, 0, 0);
}
+
+ /**
+ * CTPMV performs one of the matrix-vector operations
+ * x := A*x or x := A**T*x or x := A**H*x
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d4/dbb/ctpmv_8f.html
+ *
+ * Note: For a N*N matrix, the input Allocation should be a 1D allocation of size dimX = N*(N+1)/2,
+ * The following subroutine can is an example showing how to convert a UPPER trianglar matrix
+ * 'a' to packed matrix 'b'.
+ * k = 0
+ * for i in range(0, n):
+ * for j in range(i, n):
+ * b[k++] = a[i, j]
+ *
+ * @param Uplo Specifies whether the matrix is an upper or lower triangular matrix.
+ * @param TransA The type of transpose applied to matrix A.
+ * @param Diag Specifies whether or not A is unit triangular.
+ * @param Ap The input allocation contains packed matrix A, supported elements type {@link Element#F32_2}.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F32_2}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ */
public void CTPMV(@Uplo int Uplo, @Transpose int TransA, @Diag int Diag, Allocation Ap, Allocation X, int incX) {
int N = validateTPMV(Element.F32_2(mRS), Uplo, TransA, Diag, Ap, X, incX);
mRS.nScriptIntrinsicBLAS_Complex(getID(mRS), RsBlas_ctpmv, TransA, 0, 0, Uplo, Diag, 0, N, 0, 0, 0, Ap.getID(mRS), X.getID(mRS), 0, 0, 0, incX, 0, 0, 0);
}
+
+ /**
+ * ZTPMV performs one of the matrix-vector operations
+ * x := A*x or x := A**T*x or x := A**H*x
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d2/d9e/ztpmv_8f.html
+ *
+ * Note: For a N*N matrix, the input Allocation should be a 1D allocation of size dimX = N*(N+1)/2,
+ * The following subroutine can is an example showing how to convert a UPPER trianglar matrix
+ * 'a' to packed matrix 'b'.
+ * k = 0
+ * for i in range(0, n):
+ * for j in range(i, n):
+ * b[k++] = a[i, j]
+ *
+ * @param Uplo Specifies whether the matrix is an upper or lower triangular matrix.
+ * @param TransA The type of transpose applied to matrix A.
+ * @param Diag Specifies whether or not A is unit triangular.
+ * @param Ap The input allocation contains packed matrix A, supported elements type {@link Element#F64_2}.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F64_2}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ */
public void ZTPMV(@Uplo int Uplo, @Transpose int TransA, @Diag int Diag, Allocation Ap, Allocation X, int incX) {
int N = validateTPMV(Element.F64_2(mRS), Uplo, TransA, Diag, Ap, X, incX);
mRS.nScriptIntrinsicBLAS_Z(getID(mRS), RsBlas_ztpmv, TransA, 0, 0, Uplo, Diag, 0, N, 0, 0, 0, Ap.getID(mRS), X.getID(mRS), 0, 0, 0, incX, 0, 0, 0);
}
+
+ /**
+ * STRSV solves one of the systems of equations
+ * A*x = b or A**T*x = b
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d0/d2a/strsv_8f.html
+ *
+ * @param Uplo Specifies whether the matrix is an upper or lower triangular matrix.
+ * @param TransA The type of transpose applied to matrix A.
+ * @param Diag Specifies whether or not A is unit triangular.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F32}.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F32}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ */
public void STRSV(@Uplo int Uplo, @Transpose int TransA, @Diag int Diag, Allocation A, Allocation X, int incX) {
// TRSV is the same as TRMV
validateTRMV(Element.F32(mRS), Uplo, TransA, Diag, A, X, incX);
@@ -483,6 +911,20 @@ public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
mRS.nScriptIntrinsicBLAS_Single(getID(mRS), RsBlas_strsv, TransA, 0, 0, Uplo, Diag, 0, N, 0, 0, A.getID(mRS), X.getID(mRS), 0, 0, incX, 0, 0, 0);
}
+
+ /**
+ * DTRSV solves one of the systems of equations
+ * A*x = b or A**T*x = b
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d6/d96/dtrsv_8f.html
+ *
+ * @param Uplo Specifies whether the matrix is an upper or lower triangular matrix.
+ * @param TransA The type of transpose applied to matrix A.
+ * @param Diag Specifies whether or not A is unit triangular.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F64}.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F64}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ */
public void DTRSV(@Uplo int Uplo, @Transpose int TransA, @Diag int Diag, Allocation A, Allocation X, int incX) {
// TRSV is the same as TRMV
validateTRMV(Element.F64(mRS), Uplo, TransA, Diag, A, X, incX);
@@ -490,6 +932,20 @@ public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
mRS.nScriptIntrinsicBLAS_Double(getID(mRS), RsBlas_dtrsv, TransA, 0, 0, Uplo, Diag, 0, N, 0, 0, A.getID(mRS), X.getID(mRS), 0, 0, incX, 0, 0, 0);
}
+
+ /**
+ * CTRSV solves one of the systems of equations
+ * A*x = b or A**T*x = b or A**H*x = b
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d4/dc8/ctrsv_8f.html
+ *
+ * @param Uplo Specifies whether the matrix is an upper or lower triangular matrix.
+ * @param TransA The type of transpose applied to matrix A.
+ * @param Diag Specifies whether or not A is unit triangular.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F32_2}.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F32_2}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ */
public void CTRSV(@Uplo int Uplo, @Transpose int TransA, @Diag int Diag, Allocation A, Allocation X, int incX) {
// TRSV is the same as TRMV
validateTRMV(Element.F32_2(mRS), Uplo, TransA, Diag, A, X, incX);
@@ -497,6 +953,20 @@ public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
mRS.nScriptIntrinsicBLAS_Complex(getID(mRS), RsBlas_ctrsv, TransA, 0, 0, Uplo, Diag, 0, N, 0, 0, 0, A.getID(mRS), X.getID(mRS), 0, 0, 0, incX, 0, 0, 0);
}
+
+ /**
+ * ZTRSV solves one of the systems of equations
+ * A*x = b or A**T*x = b or A**H*x = b
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d1/d2f/ztrsv_8f.html
+ *
+ * @param Uplo Specifies whether the matrix is an upper or lower triangular matrix.
+ * @param TransA The type of transpose applied to matrix A.
+ * @param Diag Specifies whether or not A is unit triangular.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F64_2}.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F64_2}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ */
public void ZTRSV(@Uplo int Uplo, @Transpose int TransA, @Diag int Diag, Allocation A, Allocation X, int incX) {
// TRSV is the same as TRMV
validateTRMV(Element.F64_2(mRS), Uplo, TransA, Diag, A, X, incX);
@@ -504,6 +974,28 @@ public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
mRS.nScriptIntrinsicBLAS_Z(getID(mRS), RsBlas_ztrsv, TransA, 0, 0, Uplo, Diag, 0, N, 0, 0, 0, A.getID(mRS), X.getID(mRS), 0, 0, 0, incX, 0, 0, 0);
}
+
+ /**
+ * STBSV solves one of the systems of equations
+ * A*x = b or A**T*x = b
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d0/d1f/stbsv_8f.html
+ *
+ * Note: For a N*N matrix, the input Allocation should also be of size N*N (dimY = N, dimX = N),
+ * but only the region N*(K+1) will be referenced. The following subroutine can is an
+ * example showing how to convert a UPPER trianglar matrix 'a' to row-based band matrix 'b'.
+ * for i in range(0, n):
+ * for j in range(i, min(i+k+1, n)):
+ * b[i, j-i] = a[i, j]
+ *
+ * @param Uplo Specifies whether the matrix is an upper or lower triangular matrix.
+ * @param TransA The type of transpose applied to matrix A.
+ * @param Diag Specifies whether or not A is unit triangular.
+ * @param K The number of off-diagonals of the matrix A
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F32}.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F32}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ */
public void STBSV(@Uplo int Uplo, @Transpose int TransA, @Diag int Diag, int K, Allocation A, Allocation X, int incX) {
// TBSV is the same as TRMV + K >= 0
validateTRMV(Element.F32(mRS), Uplo, TransA, Diag, A, X, incX);
@@ -513,6 +1005,28 @@ public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
}
mRS.nScriptIntrinsicBLAS_Single(getID(mRS), RsBlas_stbsv, TransA, 0, 0, Uplo, Diag, 0, N, K, 0, A.getID(mRS), X.getID(mRS), 0, 0, incX, 0, 0, 0);
}
+
+ /**
+ * DTBSV solves one of the systems of equations
+ * A*x = b or A**T*x = b
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d4/dcf/dtbsv_8f.html
+ *
+ * Note: For a N*N matrix, the input Allocation should also be of size N*N (dimY = N, dimX = N),
+ * but only the region N*(K+1) will be referenced. The following subroutine can is an
+ * example showing how to convert a UPPER trianglar matrix 'a' to row-based band matrix 'b'.
+ * for i in range(0, n):
+ * for j in range(i, min(i+k+1, n)):
+ * b[i, j-i] = a[i, j]
+ *
+ * @param Uplo Specifies whether the matrix is an upper or lower triangular matrix.
+ * @param TransA The type of transpose applied to matrix A.
+ * @param Diag Specifies whether or not A is unit triangular.
+ * @param K The number of off-diagonals of the matrix A
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F64}.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F64}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ */
public void DTBSV(@Uplo int Uplo, @Transpose int TransA, @Diag int Diag, int K, Allocation A, Allocation X, int incX) {
// TBSV is the same as TRMV + K >= 0
validateTRMV(Element.F64(mRS), Uplo, TransA, Diag, A, X, incX);
@@ -522,6 +1036,28 @@ public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
}
mRS.nScriptIntrinsicBLAS_Double(getID(mRS), RsBlas_dtbsv, TransA, 0, 0, Uplo, Diag, 0, N, K, 0, A.getID(mRS), X.getID(mRS), 0, 0, incX, 0, 0, 0);
}
+
+ /**
+ * CTBSV solves one of the systems of equations
+ * A*x = b or A**T*x = b or A**H*x = b
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d9/d5f/ctbsv_8f.html
+ *
+ * Note: For a N*N matrix, the input Allocation should also be of size N*N (dimY = N, dimX = N),
+ * but only the region N*(K+1) will be referenced. The following subroutine can is an
+ * example showing how to convert a UPPER trianglar matrix 'a' to row-based band matrix 'b'.
+ * for i in range(0, n):
+ * for j in range(i, min(i+k+1, n)):
+ * b[i, j-i] = a[i, j]
+ *
+ * @param Uplo Specifies whether the matrix is an upper or lower triangular matrix.
+ * @param TransA The type of transpose applied to matrix A.
+ * @param Diag Specifies whether or not A is unit triangular.
+ * @param K The number of off-diagonals of the matrix A
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F32_2}.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F32_2}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ */
public void CTBSV(@Uplo int Uplo, @Transpose int TransA, @Diag int Diag, int K, Allocation A, Allocation X, int incX) {
// TBSV is the same as TRMV + K >= 0
validateTRMV(Element.F32_2(mRS), Uplo, TransA, Diag, A, X, incX);
@@ -531,6 +1067,28 @@ public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
}
mRS.nScriptIntrinsicBLAS_Complex(getID(mRS), RsBlas_ctbsv, TransA, 0, 0, Uplo, Diag, 0, N, K, 0, 0, A.getID(mRS), X.getID(mRS), 0, 0, 0, incX, 0, 0, 0);
}
+
+ /**
+ * ZTBSV solves one of the systems of equations
+ * A*x = b or A**T*x = b or A**H*x = b
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d4/d5a/ztbsv_8f.html
+ *
+ * Note: For a N*N matrix, the input Allocation should also be of size N*N (dimY = N, dimX = N),
+ * but only the region N*(K+1) will be referenced. The following subroutine can is an
+ * example showing how to convert a UPPER trianglar matrix 'a' to row-based band matrix 'b'.
+ * for i in range(0, n):
+ * for j in range(i, min(i+k+1, n)):
+ * b[i, j-i] = a[i, j]
+ *
+ * @param Uplo Specifies whether the matrix is an upper or lower triangular matrix.
+ * @param TransA The type of transpose applied to matrix A.
+ * @param Diag Specifies whether or not A is unit triangular.
+ * @param K The number of off-diagonals of the matrix A
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F64_2}.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F64_2}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ */
public void ZTBSV(@Uplo int Uplo, @Transpose int TransA, @Diag int Diag, int K, Allocation A, Allocation X, int incX) {
// TBSV is the same as TRMV + K >= 0
validateTRMV(Element.F64_2(mRS), Uplo, TransA, Diag, A, X, incX);
@@ -540,21 +1098,109 @@ public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
}
mRS.nScriptIntrinsicBLAS_Z(getID(mRS), RsBlas_ztbsv, TransA, 0, 0, Uplo, Diag, 0, N, K, 0, 0, A.getID(mRS), X.getID(mRS), 0, 0, 0, incX, 0, 0, 0);
}
+
+ /**
+ * STPSV solves one of the systems of equations
+ * A*x = b or A**T*x = b
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d0/d7c/stpsv_8f.html
+ *
+ * Note: For a N*N matrix, the input Allocation should be a 1D allocation of size dimX = N*(N+1)/2,
+ * The following subroutine can is an example showing how to convert a UPPER trianglar matrix
+ * 'a' to packed matrix 'b'.
+ * k = 0
+ * for i in range(0, n):
+ * for j in range(i, n):
+ * b[k++] = a[i, j]
+ *
+ * @param Uplo Specifies whether the matrix is an upper or lower triangular matrix.
+ * @param TransA The type of transpose applied to matrix A.
+ * @param Diag Specifies whether or not A is unit triangular.
+ * @param Ap The input allocation contains packed matrix A, supported elements type {@link Element#F32}.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F32}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ */
public void STPSV(@Uplo int Uplo, @Transpose int TransA, @Diag int Diag, Allocation Ap, Allocation X, int incX) {
// TPSV is same as TPMV
int N = validateTPMV(Element.F32(mRS), Uplo, TransA, Diag, Ap, X, incX);
mRS.nScriptIntrinsicBLAS_Single(getID(mRS), RsBlas_stpsv, TransA, 0, 0, Uplo, Diag, 0, N, 0, 0, Ap.getID(mRS), X.getID(mRS), 0, 0, incX, 0, 0, 0);
}
+
+ /**
+ * DTPSV solves one of the systems of equations
+ * A*x = b or A**T*x = b
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d9/d84/dtpsv_8f.html
+ *
+ * Note: For a N*N matrix, the input Allocation should be a 1D allocation of size dimX = N*(N+1)/2,
+ * The following subroutine can is an example showing how to convert a UPPER trianglar matrix
+ * 'a' to packed matrix 'b'.
+ * k = 0
+ * for i in range(0, n):
+ * for j in range(i, n):
+ * b[k++] = a[i, j]
+ *
+ * @param Uplo Specifies whether the matrix is an upper or lower triangular matrix.
+ * @param TransA The type of transpose applied to matrix A.
+ * @param Diag Specifies whether or not A is unit triangular.
+ * @param Ap The input allocation contains packed matrix A, supported elements type {@link Element#F64}.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F64}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ */
public void DTPSV(@Uplo int Uplo, @Transpose int TransA, @Diag int Diag, Allocation Ap, Allocation X, int incX) {
// TPSV is same as TPMV
int N = validateTPMV(Element.F64(mRS), Uplo, TransA, Diag, Ap, X, incX);
mRS.nScriptIntrinsicBLAS_Double(getID(mRS), RsBlas_dtpsv, TransA, 0, 0, Uplo, Diag, 0, N, 0, 0, Ap.getID(mRS), X.getID(mRS), 0, 0, incX, 0, 0, 0);
}
+
+ /**
+ * CTPSV solves one of the systems of equations
+ * A*x = b or A**T*x = b or A**H*x = b
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d8/d56/ctpsv_8f.html
+ *
+ * Note: For a N*N matrix, the input Allocation should be a 1D allocation of size dimX = N*(N+1)/2,
+ * The following subroutine can is an example showing how to convert a UPPER trianglar matrix
+ * 'a' to packed matrix 'b'.
+ * k = 0
+ * for i in range(0, n):
+ * for j in range(i, n):
+ * b[k++] = a[i, j]
+ *
+ * @param Uplo Specifies whether the matrix is an upper or lower triangular matrix.
+ * @param TransA The type of transpose applied to matrix A.
+ * @param Diag Specifies whether or not A is unit triangular.
+ * @param Ap The input allocation contains packed matrix A, supported elements type {@link Element#F32_2}.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F32_2}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ */
public void CTPSV(@Uplo int Uplo, @Transpose int TransA, @Diag int Diag, Allocation Ap, Allocation X, int incX) {
// TPSV is same as TPMV
int N = validateTPMV(Element.F32_2(mRS), Uplo, TransA, Diag, Ap, X, incX);
mRS.nScriptIntrinsicBLAS_Complex(getID(mRS), RsBlas_ctpsv, TransA, 0, 0, Uplo, Diag, 0, N, 0, 0, 0, Ap.getID(mRS), X.getID(mRS), 0, 0, 0, incX, 0, 0, 0);
}
+
+ /**
+ * ZTPSV solves one of the systems of equations
+ * A*x = b or A**T*x = b or A**H*x = b
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/da/d57/ztpsv_8f.html
+ *
+ * Note: For a N*N matrix, the input Allocation should be a 1D allocation of size dimX = N*(N+1)/2,
+ * The following subroutine can is an example showing how to convert a UPPER trianglar matrix
+ * 'a' to packed matrix 'b'.
+ * k = 0
+ * for i in range(0, n):
+ * for j in range(i, n):
+ * b[k++] = a[i, j]
+ *
+ * @param Uplo Specifies whether the matrix is an upper or lower triangular matrix.
+ * @param TransA The type of transpose applied to matrix A.
+ * @param Diag Specifies whether or not A is unit triangular.
+ * @param Ap The input allocation contains packed matrix A, supported elements type {@link Element#F64_2}.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F64_2}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ */
public void ZTPSV(@Uplo int Uplo, @Transpose int TransA, @Diag int Diag, Allocation Ap, Allocation X, int incX) {
// TPSV is same as TPMV
int N = validateTPMV(Element.F64_2(mRS), Uplo, TransA, Diag, Ap, X, incX);
@@ -768,10 +1414,49 @@ public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
return N;
}
+ /**
+ * SSYMV performs the matrix-vector operation
+ * y := alpha*A*x + beta*y
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d2/d94/ssymv_8f.html
+ *
+ * @param Uplo Specifies whether the upper or lower triangular part is to be referenced.
+ * @param alpha The scalar alpha.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F32}.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F32}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ * @param beta The scalar beta.
+ * @param Y The input allocation contains vector y, supported elements type {@link Element#F32}.
+ * @param incY The increment for the elements of vector y, must be larger than zero.
+ */
public void SSYMV(@Uplo int Uplo, float alpha, Allocation A, Allocation X, int incX, float beta, Allocation Y, int incY) {
int N = validateSYMV(Element.F32(mRS), Uplo, A, X, Y, incX, incY);
mRS.nScriptIntrinsicBLAS_Single(getID(mRS), RsBlas_ssymv, 0, 0, 0, Uplo, 0, 0, N, 0, alpha, A.getID(mRS), X.getID(mRS), beta, Y.getID(mRS), incX, incY, 0, 0);
}
+
+ /**
+ * SSBMV performs the matrix-vector operation
+ * y := alpha*A*x + beta*y
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d3/da1/ssbmv_8f.html
+ *
+ * Note: For a N*N matrix, the input Allocation should also be of size N*N (dimY = N, dimX = N),
+ * but only the region N*(K+1) will be referenced. The following subroutine can is an
+ * example showing how to convert a UPPER trianglar matrix 'a' to row-based band matrix 'b'.
+ * for i in range(0, n):
+ * for j in range(i, min(i+k+1, n)):
+ * b[i, j-i] = a[i, j]
+ *
+ * @param Uplo Specifies whether the upper or lower triangular part of the band matrix A is being supplied.
+ * @param K The number of off-diagonals of the matrix A
+ * @param alpha The scalar alpha.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F32}.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F32}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ * @param beta The scalar beta.
+ * @param Y The input allocation contains vector y, supported elements type {@link Element#F32}.
+ * @param incY The increment for the elements of vector y, must be larger than zero.
+ */
public void SSBMV(@Uplo int Uplo, int K, float alpha, Allocation A, Allocation X, int incX, float beta, Allocation Y, int incY) {
// SBMV is the same as SYMV + K >= 0
if (K < 0) {
@@ -780,36 +1465,186 @@ public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
int N = validateSYMV(Element.F32(mRS), Uplo, A, X, Y, incX, incY);
mRS.nScriptIntrinsicBLAS_Single(getID(mRS), RsBlas_ssbmv, 0, 0, 0, Uplo, 0, 0, N, K, alpha, A.getID(mRS), X.getID(mRS), beta, Y.getID(mRS), incX, incY, 0, 0);
}
+
+ /**
+ * SSPMV performs the matrix-vector operation
+ * y := alpha*A*x + beta*y
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d8/d68/sspmv_8f.html
+ *
+ * Note: For a N*N matrix, the input Allocation should be a 1D allocation of size dimX = N*(N+1)/2,
+ * The following subroutine can is an example showing how to convert a UPPER trianglar matrix
+ * 'a' to packed matrix 'b'.
+ * k = 0
+ * for i in range(0, n):
+ * for j in range(i, n):
+ * b[k++] = a[i, j]
+ *
+ * @param Uplo Specifies whether the upper or lower triangular part of the matrix A is supplied in packed form.
+ * @param alpha The scalar alpha.
+ * @param Ap The input allocation contains matrix A, supported elements type {@link Element#F32}.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F32}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ * @param beta The scalar beta.
+ * @param Y The input allocation contains vector y, supported elements type {@link Element#F32}.
+ * @param incY The increment for the elements of vector y, must be larger than zero.
+ */
public void SSPMV(@Uplo int Uplo, float alpha, Allocation Ap, Allocation X, int incX, float beta, Allocation Y, int incY) {
int N = validateSPMV(Element.F32(mRS), Uplo, Ap, X, incX, Y, incY);
mRS.nScriptIntrinsicBLAS_Single(getID(mRS), RsBlas_sspmv, 0, 0, 0, Uplo, 0, 0, N, 0, alpha, Ap.getID(mRS), X.getID(mRS), beta, Y.getID(mRS), incX, incY, 0, 0);
}
+
+ /**
+ * SGER performs the rank 1 operation
+ * A := alpha*x*y**T + A
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/db/d5c/sger_8f.html
+ *
+ * @param alpha The scalar alpha.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F32}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ * @param Y The input allocation contains vector y, supported elements type {@link Element#F32}.
+ * @param incY The increment for the elements of vector y, must be larger than zero.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F32}.
+ */
public void SGER(float alpha, Allocation X, int incX, Allocation Y, int incY, Allocation A) {
int M = A.getType().getY();
int N = A.getType().getX();
validateGER(Element.F32(mRS), X, incX, Y, incY, A);
mRS.nScriptIntrinsicBLAS_Single(getID(mRS), RsBlas_sger, 0, 0, 0, 0, 0, M, N, 0, alpha, X.getID(mRS), Y.getID(mRS), 0.f, A.getID(mRS), incX, incY, 0, 0);
}
+
+ /**
+ * SSYR performs the rank 1 operation
+ * A := alpha*x*x**T + A
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d6/dac/ssyr_8f.html
+ *
+ * @param Uplo Specifies whether the upper or lower triangular part is to be referenced.
+ * @param alpha The scalar alpha.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F32}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F32}.
+ */
public void SSYR(@Uplo int Uplo, float alpha, Allocation X, int incX, Allocation A) {
int N = validateSYR(Element.F32(mRS), Uplo, X, incX, A);
mRS.nScriptIntrinsicBLAS_Single(getID(mRS), RsBlas_ssyr, 0, 0, 0, Uplo, 0, 0, N, 0, alpha, X.getID(mRS), A.getID(mRS), 0.f, 0, incX, 0, 0, 0);
}
+
+ /**
+ * SSPR performs the rank 1 operation
+ * A := alpha*x*x**T + A
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d2/d9b/sspr_8f.html
+ *
+ * Note: For a N*N matrix, the input Allocation should be a 1D allocation of size dimX = N*(N+1)/2,
+ * The following subroutine can is an example showing how to convert a UPPER trianglar matrix
+ * 'a' to packed matrix 'b'.
+ * k = 0
+ * for i in range(0, n):
+ * for j in range(i, n):
+ * b[k++] = a[i, j]
+ *
+ * @param Uplo Specifies whether the upper or lower triangular part is to be supplied in the packed form.
+ * @param alpha The scalar alpha.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F32}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ * @param Ap The input allocation contains matrix A, supported elements type {@link Element#F32}.
+ */
public void SSPR(@Uplo int Uplo, float alpha, Allocation X, int incX, Allocation Ap) {
int N = validateSPR(Element.F32(mRS), Uplo, X, incX, Ap);
mRS.nScriptIntrinsicBLAS_Single(getID(mRS), RsBlas_sspr, 0, 0, 0, Uplo, 0, 0, N, 0, alpha, X.getID(mRS), Ap.getID(mRS), 0.f, 0, incX, 0, 0, 0);
}
+
+ /**
+ * SSYR2 performs the symmetric rank 2 operation
+ * A := alpha*x*y**T + alpha*y*x**T + A
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/db/d99/ssyr2_8f.html
+ *
+ * @param Uplo Specifies whether the upper or lower triangular part is to be referenced.
+ * @param alpha The scalar alpha.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F32}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ * @param Y The input allocation contains vector y, supported elements type {@link Element#F32}.
+ * @param incY The increment for the elements of vector y, must be larger than zero.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F32}.
+ */
public void SSYR2(@Uplo int Uplo, float alpha, Allocation X, int incX, Allocation Y, int incY, Allocation A) {
int N = validateSYR2(Element.F32(mRS), Uplo, X, incX, Y, incY, A);
mRS.nScriptIntrinsicBLAS_Single(getID(mRS), RsBlas_ssyr2, 0, 0, 0, Uplo, 0, 0, N, 0, alpha, X.getID(mRS), Y.getID(mRS), 0, A.getID(mRS), incX, incY, 0, 0);
}
+
+ /**
+ * SSPR2 performs the symmetric rank 2 operation
+ * A := alpha*x*y**T + alpha*y*x**T + A
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/db/d3e/sspr2_8f.html
+ *
+ * Note: For a N*N matrix, the input Allocation should be a 1D allocation of size dimX = N*(N+1)/2,
+ * The following subroutine can is an example showing how to convert a UPPER trianglar matrix
+ * 'a' to packed matrix 'b'.
+ * k = 0
+ * for i in range(0, n):
+ * for j in range(i, n):
+ * b[k++] = a[i, j]
+ *
+ * @param Uplo Specifies whether the upper or lower triangular part is to be supplied in the packed form.
+ * @param alpha The scalar alpha.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F32}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ * @param Y The input allocation contains vector y, supported elements type {@link Element#F32}.
+ * @param incY The increment for the elements of vector y, must be larger than zero.
+ * @param Ap The input allocation contains matrix A, supported elements type {@link Element#F32}.
+ */
public void SSPR2(@Uplo int Uplo, float alpha, Allocation X, int incX, Allocation Y, int incY, Allocation Ap) {
int N = validateSPR2(Element.F32(mRS), Uplo, X, incX, Y, incY, Ap);
mRS.nScriptIntrinsicBLAS_Single(getID(mRS), RsBlas_sspr2, 0, 0, 0, Uplo, 0, 0, N, 0, alpha, X.getID(mRS), Y.getID(mRS), 0, Ap.getID(mRS), incX, incY, 0, 0);
}
+
+ /**
+ * DSYMV performs the matrix-vector operation
+ * y := alpha*A*x + beta*y
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d8/dbe/dsymv_8f.html
+ *
+ * @param Uplo Specifies whether the upper or lower triangular part is to be referenced.
+ * @param alpha The scalar alpha.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F64}.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F64}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ * @param beta The scalar beta.
+ * @param Y The input allocation contains vector y, supported elements type {@link Element#F64}.
+ * @param incY The increment for the elements of vector y, must be larger than zero.
+ */
public void DSYMV(@Uplo int Uplo, double alpha, Allocation A, Allocation X, int incX, double beta, Allocation Y, int incY) {
int N = validateSYMV(Element.F64(mRS), Uplo, A, X, Y, incX, incY);
mRS.nScriptIntrinsicBLAS_Double(getID(mRS), RsBlas_dsymv, 0, 0, 0, Uplo, 0, 0, N, 0, alpha, A.getID(mRS), X.getID(mRS), beta, Y.getID(mRS), incX, incY, 0, 0);
}
+
+ /**
+ * DSBMV performs the matrix-vector operation
+ * y := alpha*A*x + beta*y
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d8/d1e/dsbmv_8f.html
+ *
+ * Note: For a N*N matrix, the input Allocation should also be of size N*N (dimY = N, dimX = N),
+ * but only the region N*(K+1) will be referenced. The following subroutine can is an
+ * example showing how to convert a UPPER trianglar matrix 'a' to row-based band matrix 'b'.
+ * for i in range(0, n):
+ * for j in range(i, min(i+k+1, n)):
+ * b[i, j-i] = a[i, j]
+ *
+ * @param Uplo Specifies whether the upper or lower triangular part of the band matrix A is being supplied.
+ * @param K The number of off-diagonals of the matrix A
+ * @param alpha The scalar alpha.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F64}.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F64}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ * @param beta The scalar beta.
+ * @param Y The input allocation contains vector y, supported elements type {@link Element#F64}.
+ * @param incY The increment for the elements of vector y, must be larger than zero.
+ */
public void DSBMV(@Uplo int Uplo, int K, double alpha, Allocation A, Allocation X, int incX, double beta, Allocation Y, int incY) {
// SBMV is the same as SYMV + K >= 0
if (K < 0) {
@@ -818,28 +1653,138 @@ public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
int N = validateSYMV(Element.F64(mRS), Uplo, A, X, Y, incX, incY);
mRS.nScriptIntrinsicBLAS_Double(getID(mRS), RsBlas_dsbmv, 0, 0, 0, Uplo, 0, 0, N, K, alpha, A.getID(mRS), X.getID(mRS), beta, Y.getID(mRS), incX, incY, 0, 0);
}
+
+ /**
+ * DSPMV performs the matrix-vector operation
+ * y := alpha*A*x + beta*y
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d4/d85/dspmv_8f.html
+ *
+ * Note: For a N*N matrix, the input Allocation should be a 1D allocation of size dimX = N*(N+1)/2,
+ * The following subroutine can is an example showing how to convert a UPPER trianglar matrix
+ * 'a' to packed matrix 'b'.
+ * k = 0
+ * for i in range(0, n):
+ * for j in range(i, n):
+ * b[k++] = a[i, j]
+ *
+ * @param Uplo Specifies whether the upper or lower triangular part of the matrix A is supplied in packed form.
+ * @param alpha The scalar alpha.
+ * @param Ap The input allocation contains matrix A, supported elements type {@link Element#F64}.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F64}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ * @param beta The scalar beta.
+ * @param Y The input allocation contains vector y, supported elements type {@link Element#F64}.
+ * @param incY The increment for the elements of vector y, must be larger than zero.
+ */
public void DSPMV(@Uplo int Uplo, double alpha, Allocation Ap, Allocation X, int incX, double beta, Allocation Y, int incY) {
int N = validateSPMV(Element.F64(mRS), Uplo, Ap, X, incX, Y, incY);
mRS.nScriptIntrinsicBLAS_Double(getID(mRS), RsBlas_dspmv, 0, 0, 0, Uplo, 0, 0, N, 0, alpha, Ap.getID(mRS), X.getID(mRS), beta, Y.getID(mRS), incX, incY, 0, 0);
}
+
+ /**
+ * DGER performs the rank 1 operation
+ * A := alpha*x*y**T + A
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/dc/da8/dger_8f.html
+ *
+ * @param alpha The scalar alpha.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F64}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ * @param Y The input allocation contains vector y, supported elements type {@link Element#F64}.
+ * @param incY The increment for the elements of vector y, must be larger than zero.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F64}.
+ */
public void DGER(double alpha, Allocation X, int incX, Allocation Y, int incY, Allocation A) {
int M = A.getType().getY();
int N = A.getType().getX();
validateGER(Element.F64(mRS), X, incX, Y, incY, A);
mRS.nScriptIntrinsicBLAS_Double(getID(mRS), RsBlas_dger, 0, 0, 0, 0, 0, M, N, 0, alpha, X.getID(mRS), Y.getID(mRS), 0.f, A.getID(mRS), incX, incY, 0, 0);
}
+
+ /**
+ * DSYR performs the rank 1 operation
+ * A := alpha*x*x**T + A
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d3/d60/dsyr_8f.html
+ *
+ * @param Uplo Specifies whether the upper or lower triangular part is to be referenced.
+ * @param alpha The scalar alpha.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F64}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F64}.
+ */
public void DSYR(@Uplo int Uplo, double alpha, Allocation X, int incX, Allocation A) {
int N = validateSYR(Element.F64(mRS), Uplo, X, incX, A);
mRS.nScriptIntrinsicBLAS_Double(getID(mRS), RsBlas_dsyr, 0, 0, 0, Uplo, 0, 0, N, 0, alpha, X.getID(mRS), A.getID(mRS), 0.f, 0, incX, 0, 0, 0);
}
+
+ /**
+ * DSPR performs the rank 1 operation
+ * A := alpha*x*x**T + A
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/dd/dba/dspr_8f.html
+ *
+ * Note: For a N*N matrix, the input Allocation should be a 1D allocation of size dimX = N*(N+1)/2,
+ * The following subroutine can is an example showing how to convert a UPPER trianglar matrix
+ * 'a' to packed matrix 'b'.
+ * k = 0
+ * for i in range(0, n):
+ * for j in range(i, n):
+ * b[k++] = a[i, j]
+ *
+ * @param Uplo Specifies whether the upper or lower triangular part is to be supplied in the packed form.
+ * @param alpha The scalar alpha.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F64}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ * @param Ap The input allocation contains matrix A, supported elements type {@link Element#F64}.
+ */
public void DSPR(@Uplo int Uplo, double alpha, Allocation X, int incX, Allocation Ap) {
int N = validateSPR(Element.F64(mRS), Uplo, X, incX, Ap);
mRS.nScriptIntrinsicBLAS_Double(getID(mRS), RsBlas_dspr, 0, 0, 0, Uplo, 0, 0, N, 0, alpha, X.getID(mRS), Ap.getID(mRS), 0.f, 0, incX, 0, 0, 0);
}
+
+ /**
+ * DSYR2 performs the symmetric rank 2 operation
+ * A := alpha*x*y**T + alpha*y*x**T + A
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/de/d41/dsyr2_8f.html
+ *
+ * @param Uplo Specifies whether the upper or lower triangular part is to be referenced.
+ * @param alpha The scalar alpha.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F64}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ * @param Y The input allocation contains vector y, supported elements type {@link Element#F64}.
+ * @param incY The increment for the elements of vector y, must be larger than zero.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F64}.
+ */
public void DSYR2(@Uplo int Uplo, double alpha, Allocation X, int incX, Allocation Y, int incY, Allocation A) {
int N = validateSYR2(Element.F64(mRS), Uplo, X, incX, Y, incY, A);
mRS.nScriptIntrinsicBLAS_Double(getID(mRS), RsBlas_dsyr2, 0, 0, 0, Uplo, 0, 0, N, 0, alpha, X.getID(mRS), Y.getID(mRS), 0, A.getID(mRS), incX, incY, 0, 0);
}
+
+ /**
+ * DSPR2 performs the symmetric rank 2 operation
+ * A := alpha*x*y**T + alpha*y*x**T + A
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/dd/d9e/dspr2_8f.html
+ *
+ * Note: For a N*N matrix, the input Allocation should be a 1D allocation of size dimX = N*(N+1)/2,
+ * The following subroutine can is an example showing how to convert a UPPER trianglar matrix
+ * 'a' to packed matrix 'b'.
+ * k = 0
+ * for i in range(0, n):
+ * for j in range(i, n):
+ * b[k++] = a[i, j]
+ *
+ * @param Uplo Specifies whether the upper or lower triangular part is to be supplied in the packed form.
+ * @param alpha The scalar alpha.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F64}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ * @param Y The input allocation contains vector y, supported elements type {@link Element#F64}.
+ * @param incY The increment for the elements of vector y, must be larger than zero.
+ * @param Ap The input allocation contains matrix A, supported elements type {@link Element#F64}.
+ */
public void DSPR2(@Uplo int Uplo, double alpha, Allocation X, int incX, Allocation Y, int incY, Allocation Ap) {
int N = validateSPR2(Element.F64(mRS), Uplo, X, incX, Y, incY, Ap);
mRS.nScriptIntrinsicBLAS_Double(getID(mRS), RsBlas_dspr2, 0, 0, 0, Uplo, 0, 0, N, 0, alpha, X.getID(mRS), Y.getID(mRS), 0, Ap.getID(mRS), incX, incY, 0, 0);
@@ -876,11 +1821,50 @@ public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
}
+ /**
+ * CHEMV performs the matrix-vector operation
+ * y := alpha*A*x + beta*y
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d7/d51/chemv_8f.html
+ *
+ * @param Uplo Specifies whether the upper or lower triangular part is to be referenced.
+ * @param alpha The scalar alpha.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F32_2}.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F32_2}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ * @param beta The scalar beta.
+ * @param Y The input allocation contains vector y, supported elements type {@link Element#F32_2}.
+ * @param incY The increment for the elements of vector y, must be larger than zero.
+ */
public void CHEMV(@Uplo int Uplo, Float2 alpha, Allocation A, Allocation X, int incX, Float2 beta, Allocation Y, int incY) {
// HEMV is the same as SYR2 validation-wise
int N = validateSYR2(Element.F32_2(mRS), Uplo, X, incX, Y, incY, A);
mRS.nScriptIntrinsicBLAS_Complex(getID(mRS), RsBlas_chemv, 0, 0, 0, Uplo, 0, 0, N, 0, alpha.x, alpha.y, A.getID(mRS), X.getID(mRS), beta.x, beta.y, Y.getID(mRS), incX, incY, 0, 0);
}
+
+ /**
+ * CHBMV performs the matrix-vector operation
+ * y := alpha*A*x + beta*y
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/db/dc2/chbmv_8f.html
+ *
+ * Note: For a N*N matrix, the input Allocation should also be of size N*N (dimY = N, dimX = N),
+ * but only the region N*(K+1) will be referenced. The following subroutine can is an
+ * example showing how to convert a UPPER trianglar matrix 'a' to row-based band matrix 'b'.
+ * for i in range(0, n):
+ * for j in range(i, min(i+k+1, n)):
+ * b[i, j-i] = a[i, j]
+ *
+ * @param Uplo Specifies whether the upper or lower triangular part of the band matrix A is being supplied.
+ * @param K The number of off-diagonals of the matrix A
+ * @param alpha The scalar alpha.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F32_2}.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F32_2}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ * @param beta The scalar beta.
+ * @param Y The input allocation contains vector y, supported elements type {@link Element#F32_2}.
+ * @param incY The increment for the elements of vector y, must be larger than zero.
+ */
public void CHBMV(@Uplo int Uplo, int K, Float2 alpha, Allocation A, Allocation X, int incX, Float2 beta, Allocation Y, int incY) {
// HBMV is the same as SYR2 validation-wise
int N = validateSYR2(Element.F32_2(mRS), Uplo, X, incX, Y, incY, A);
@@ -889,17 +1873,69 @@ public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
}
mRS.nScriptIntrinsicBLAS_Complex(getID(mRS), RsBlas_chbmv, 0, 0, 0, Uplo, 0, 0, N, K, alpha.x, alpha.y, A.getID(mRS), X.getID(mRS), beta.x, beta.y, Y.getID(mRS), incX, incY, 0, 0);
}
+
+ /**
+ * CHPMV performs the matrix-vector operation
+ * y := alpha*A*x + beta*y
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d2/d06/chpmv_8f.html
+ *
+ * Note: For a N*N matrix, the input Allocation should be a 1D allocation of size dimX = N*(N+1)/2,
+ * The following subroutine can is an example showing how to convert a UPPER trianglar matrix
+ * 'a' to packed matrix 'b'.
+ * k = 0
+ * for i in range(0, n):
+ * for j in range(i, n):
+ * b[k++] = a[i, j]
+ *
+ * @param Uplo Specifies whether the upper or lower triangular part of the matrix A is supplied in packed form.
+ * @param alpha The scalar alpha.
+ * @param Ap The input allocation contains matrix A, supported elements type {@link Element#F32_2}.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F32_2}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ * @param beta The scalar beta.
+ * @param Y The input allocation contains vector y, supported elements type {@link Element#F32_2}.
+ * @param incY The increment for the elements of vector y, must be larger than zero.
+ */
public void CHPMV(@Uplo int Uplo, Float2 alpha, Allocation Ap, Allocation X, int incX, Float2 beta, Allocation Y, int incY) {
// HPMV is the same as SPR2
int N = validateSPR2(Element.F32_2(mRS), Uplo, X, incX, Y, incY, Ap);
mRS.nScriptIntrinsicBLAS_Complex(getID(mRS), RsBlas_chpmv, 0, 0, 0, Uplo, 0, 0, N, 0, alpha.x, alpha.y, Ap.getID(mRS), X.getID(mRS), beta.x, beta.y, Y.getID(mRS), incX, incY, 0, 0);
}
+
+ /**
+ * CGERU performs the rank 1 operation
+ * A := alpha*x*y**T + A
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/db/d5f/cgeru_8f.html
+ *
+ * @param alpha The scalar alpha.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F32_2}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ * @param Y The input allocation contains vector y, supported elements type {@link Element#F32_2}.
+ * @param incY The increment for the elements of vector y, must be larger than zero.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F32_2}.
+ */
public void CGERU(Float2 alpha, Allocation X, int incX, Allocation Y, int incY, Allocation A) {
validateGERU(Element.F32_2(mRS), X, incX, Y, incY, A);
int M = A.getType().getY();
int N = A.getType().getX();
mRS.nScriptIntrinsicBLAS_Complex(getID(mRS), RsBlas_cgeru, 0, 0, 0, 0, 0, M, N, 0, alpha.x, alpha.y, X.getID(mRS), Y.getID(mRS), 0, 0, A.getID(mRS), incX, incY, 0, 0);
}
+
+ /**
+ * CGERC performs the rank 1 operation
+ * A := alpha*x*y**H + A
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/dd/d84/cgerc_8f.html
+ *
+ * @param alpha The scalar alpha.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F32_2}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ * @param Y The input allocation contains vector y, supported elements type {@link Element#F32_2}.
+ * @param incY The increment for the elements of vector y, must be larger than zero.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F32_2}.
+ */
public void CGERC(Float2 alpha, Allocation X, int incX, Allocation Y, int incY, Allocation A) {
// same as GERU
validateGERU(Element.F32_2(mRS), X, incX, Y, incY, A);
@@ -907,31 +1943,143 @@ public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
int N = A.getType().getX();
mRS.nScriptIntrinsicBLAS_Complex(getID(mRS), RsBlas_cgerc, 0, 0, 0, 0, 0, M, N, 0, alpha.x, alpha.y, X.getID(mRS), Y.getID(mRS), 0, 0, A.getID(mRS), incX, incY, 0, 0);
}
+
+ /**
+ * CHER performs the rank 1 operation
+ * A := alpha*x*x**H + A
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d3/d6d/cher_8f.html
+ *
+ * @param Uplo Specifies whether the upper or lower triangular part is to be referenced.
+ * @param alpha The scalar alpha.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F32_2}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F32_2}.
+ */
public void CHER(@Uplo int Uplo, float alpha, Allocation X, int incX, Allocation A) {
// same as SYR
int N = validateSYR(Element.F32_2(mRS), Uplo, X, incX, A);
mRS.nScriptIntrinsicBLAS_Complex(getID(mRS), RsBlas_cher, 0, 0, 0, Uplo, 0, 0, N, 0, alpha, 0, X.getID(mRS), 0, 0, 0, A.getID(mRS), incX, 0, 0, 0);
}
+
+ /**
+ * CHPR performs the rank 1 operation
+ * A := alpha*x*x**H + A
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/db/dcd/chpr_8f.html
+ *
+ * Note: For a N*N matrix, the input Allocation should be a 1D allocation of size dimX = N*(N+1)/2,
+ * The following subroutine can is an example showing how to convert a UPPER trianglar matrix
+ * 'a' to packed matrix 'b'.
+ * k = 0
+ * for i in range(0, n):
+ * for j in range(i, n):
+ * b[k++] = a[i, j]
+ *
+ * @param Uplo Specifies whether the upper or lower triangular part is to be supplied in the packed form.
+ * @param alpha The scalar alpha.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F32_2}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ * @param Ap The input allocation contains matrix A, supported elements type {@link Element#F32_2}.
+ */
public void CHPR(@Uplo int Uplo, float alpha, Allocation X, int incX, Allocation Ap) {
// equivalent to SPR for validation
int N = validateSPR(Element.F32_2(mRS), Uplo, X, incX, Ap);
mRS.nScriptIntrinsicBLAS_Complex(getID(mRS), RsBlas_chpr, 0, 0, 0, Uplo, 0, 0, N, 0, alpha, 0, X.getID(mRS), 0, 0, 0, Ap.getID(mRS), incX, 0, 0, 0);
}
+
+ /**
+ * CHER2 performs the symmetric rank 2 operation
+ * A := alpha*x*y**H + alpha*y*x**H + A
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/db/d87/cher2_8f.html
+ *
+ * @param Uplo Specifies whether the upper or lower triangular part is to be referenced.
+ * @param alpha The scalar alpha.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F32_2}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ * @param Y The input allocation contains vector y, supported elements type {@link Element#F32_2}.
+ * @param incY The increment for the elements of vector y, must be larger than zero.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F32_2}.
+ */
public void CHER2(@Uplo int Uplo, Float2 alpha, Allocation X, int incX, Allocation Y, int incY, Allocation A) {
// same as SYR2
int N = validateSYR2(Element.F32_2(mRS), Uplo, X, incX, Y, incY, A);
mRS.nScriptIntrinsicBLAS_Complex(getID(mRS), RsBlas_cher2, 0, 0, 0, Uplo, 0, 0, N, 0, alpha.x, alpha.y, X.getID(mRS), Y.getID(mRS), 0, 0, A.getID(mRS), incX, incY, 0, 0);
}
+
+ /**
+ * CHPR2 performs the symmetric rank 2 operation
+ * A := alpha*x*y**H + alpha*y*x**H + A
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d6/d44/chpr2_8f.html
+ *
+ * Note: For a N*N matrix, the input Allocation should be a 1D allocation of size dimX = N*(N+1)/2,
+ * The following subroutine can is an example showing how to convert a UPPER trianglar matrix
+ * 'a' to packed matrix 'b'.
+ * k = 0
+ * for i in range(0, n):
+ * for j in range(i, n):
+ * b[k++] = a[i, j]
+ *
+ * @param Uplo Specifies whether the upper or lower triangular part is to be supplied in the packed form.
+ * @param alpha The scalar alpha.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F32_2}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ * @param Y The input allocation contains vector y, supported elements type {@link Element#F32_2}.
+ * @param incY The increment for the elements of vector y, must be larger than zero.
+ * @param Ap The input allocation contains matrix A, supported elements type {@link Element#F32_2}.
+ */
public void CHPR2(@Uplo int Uplo, Float2 alpha, Allocation X, int incX, Allocation Y, int incY, Allocation Ap) {
// same as SPR2
int N = validateSPR2(Element.F32_2(mRS), Uplo, X, incX, Y, incY, Ap);
mRS.nScriptIntrinsicBLAS_Complex(getID(mRS), RsBlas_chpr2, 0, 0, 0, Uplo, 0, 0, N, 0, alpha.x, alpha.y, X.getID(mRS), Y.getID(mRS), 0, 0, Ap.getID(mRS), incX, incY, 0, 0);
}
+
+ /**
+ * ZHEMV performs the matrix-vector operation
+ * y := alpha*A*x + beta*y
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d0/ddd/zhemv_8f.html
+ *
+ * @param Uplo Specifies whether the upper or lower triangular part is to be referenced.
+ * @param alpha The scalar alpha.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F64_2}.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F64_2}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ * @param beta The scalar beta.
+ * @param Y The input allocation contains vector y, supported elements type {@link Element#F64_2}.
+ * @param incY The increment for the elements of vector y, must be larger than zero.
+ */
public void ZHEMV(@Uplo int Uplo, Double2 alpha, Allocation A, Allocation X, int incX, Double2 beta, Allocation Y, int incY) {
// HEMV is the same as SYR2 validation-wise
int N = validateSYR2(Element.F64_2(mRS), Uplo, X, incX, Y, incY, A);
mRS.nScriptIntrinsicBLAS_Z(getID(mRS), RsBlas_zhemv, 0, 0, 0, Uplo, 0, 0, N, 0, alpha.x, alpha.y, A.getID(mRS), X.getID(mRS), beta.x, beta.y, Y.getID(mRS), incX, incY, 0, 0);
}
+
+ /**
+ * ZHBMV performs the matrix-vector operation
+ * y := alpha*A*x + beta*y
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d3/d1a/zhbmv_8f.html
+ *
+ * Note: For a N*N matrix, the input Allocation should also be of size N*N (dimY = N, dimX = N),
+ * but only the region N*(K+1) will be referenced. The following subroutine can is an
+ * example showing how to convert a UPPER trianglar matrix 'a' to row-based band matrix 'b'.
+ * for i in range(0, n):
+ * for j in range(i, min(i+k+1, n)):
+ * b[i, j-i] = a[i, j]
+ *
+ * @param Uplo Specifies whether the upper or lower triangular part of the band matrix A is being supplied.
+ * @param K The number of off-diagonals of the matrix A
+ * @param alpha The scalar alpha.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F64_2}.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F64_2}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ * @param beta The scalar beta.
+ * @param Y The input allocation contains vector y, supported elements type {@link Element#F64_2}.
+ * @param incY The increment for the elements of vector y, must be larger than zero.
+ */
public void ZHBMV(@Uplo int Uplo, int K, Double2 alpha, Allocation A, Allocation X, int incX, Double2 beta, Allocation Y, int incY) {
// HBMV is the same as SYR2 validation-wise
int N = validateSYR2(Element.F64_2(mRS), Uplo, X, incX, Y, incY, A);
@@ -940,17 +2088,69 @@ public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
}
mRS.nScriptIntrinsicBLAS_Z(getID(mRS), RsBlas_zhbmv, 0, 0, 0, Uplo, 0, 0, N, K, alpha.x, alpha.y, A.getID(mRS), X.getID(mRS), beta.x, beta.y, Y.getID(mRS), incX, incY, 0, 0);
}
+
+ /**
+ * ZHPMV performs the matrix-vector operation
+ * y := alpha*A*x + beta*y
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d0/d60/zhpmv_8f.html
+ *
+ * Note: For a N*N matrix, the input Allocation should be a 1D allocation of size dimX = N*(N+1)/2,
+ * The following subroutine can is an example showing how to convert a UPPER trianglar matrix
+ * 'a' to packed matrix 'b'.
+ * k = 0
+ * for i in range(0, n):
+ * for j in range(i, n):
+ * b[k++] = a[i, j]
+ *
+ * @param Uplo Specifies whether the upper or lower triangular part of the matrix A is supplied in packed form.
+ * @param alpha The scalar alpha.
+ * @param Ap The input allocation contains matrix A, supported elements type {@link Element#F64_2}.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F64_2}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ * @param beta The scalar beta.
+ * @param Y The input allocation contains vector y, supported elements type {@link Element#F64_2}.
+ * @param incY The increment for the elements of vector y, must be larger than zero.
+ */
public void ZHPMV(@Uplo int Uplo, Double2 alpha, Allocation Ap, Allocation X, int incX, Double2 beta, Allocation Y, int incY) {
// HPMV is the same as SPR2
int N = validateSPR2(Element.F64_2(mRS), Uplo, X, incX, Y, incY, Ap);
mRS.nScriptIntrinsicBLAS_Z(getID(mRS), RsBlas_zhpmv, 0, 0, 0, Uplo, 0, 0, N, 0, alpha.x, alpha.y, Ap.getID(mRS), X.getID(mRS), beta.x, beta.y, Y.getID(mRS), incX, incY, 0, 0);
}
+
+ /**
+ * ZGERU performs the rank 1 operation
+ * A := alpha*x*y**T + A
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d7/d12/zgeru_8f.html
+ *
+ * @param alpha The scalar alpha.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F64_2}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ * @param Y The input allocation contains vector y, supported elements type {@link Element#F64_2}.
+ * @param incY The increment for the elements of vector y, must be larger than zero.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F64_2}.
+ */
public void ZGERU(Double2 alpha, Allocation X, int incX, Allocation Y, int incY, Allocation A) {
validateGERU(Element.F64_2(mRS), X, incX, Y, incY, A);
int M = A.getType().getY();
int N = A.getType().getX();
mRS.nScriptIntrinsicBLAS_Z(getID(mRS), RsBlas_zgeru, 0, 0, 0, 0, 0, M, N, 0, alpha.x, alpha.y, X.getID(mRS), Y.getID(mRS), 0, 0, A.getID(mRS), incX, incY, 0, 0);
}
+
+ /**
+ * ZGERC performs the rank 1 operation
+ * A := alpha*x*y**H + A
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d3/dad/zgerc_8f.html
+ *
+ * @param alpha The scalar alpha.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F64_2}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ * @param Y The input allocation contains vector y, supported elements type {@link Element#F64_2}.
+ * @param incY The increment for the elements of vector y, must be larger than zero.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F64_2}.
+ */
public void ZGERC(Double2 alpha, Allocation X, int incX, Allocation Y, int incY, Allocation A) {
// same as GERU
validateGERU(Element.F64_2(mRS), X, incX, Y, incY, A);
@@ -958,21 +2158,93 @@ public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
int N = A.getType().getX();
mRS.nScriptIntrinsicBLAS_Z(getID(mRS), RsBlas_zgerc, 0, 0, 0, 0, 0, M, N, 0, alpha.x, alpha.y, X.getID(mRS), Y.getID(mRS), 0, 0, A.getID(mRS), incX, incY, 0, 0);
}
+
+ /**
+ * ZHER performs the rank 1 operation
+ * A := alpha*x*x**H + A
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/de/d0e/zher_8f.html
+ *
+ * @param Uplo Specifies whether the upper or lower triangular part is to be referenced.
+ * @param alpha The scalar alpha.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F64_2}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F64_2}.
+ */
public void ZHER(@Uplo int Uplo, double alpha, Allocation X, int incX, Allocation A) {
// same as SYR
int N = validateSYR(Element.F64_2(mRS), Uplo, X, incX, A);
mRS.nScriptIntrinsicBLAS_Z(getID(mRS), RsBlas_zher, 0, 0, 0, Uplo, 0, 0, N, 0, alpha, 0, X.getID(mRS), 0, 0, 0, A.getID(mRS), incX, 0, 0, 0);
}
+
+ /**
+ * ZHPR performs the rank 1 operation
+ * A := alpha*x*x**H + A
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/de/de1/zhpr_8f.html
+ *
+ * Note: For a N*N matrix, the input Allocation should be a 1D allocation of size dimX = N*(N+1)/2,
+ * The following subroutine can is an example showing how to convert a UPPER trianglar matrix
+ * 'a' to packed matrix 'b'.
+ * k = 0
+ * for i in range(0, n):
+ * for j in range(i, n):
+ * b[k++] = a[i, j]
+ *
+ * @param Uplo Specifies whether the upper or lower triangular part is to be supplied in the packed form.
+ * @param alpha The scalar alpha.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F64_2}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ * @param Ap The input allocation contains matrix A, supported elements type {@link Element#F64_2}.
+ */
public void ZHPR(@Uplo int Uplo, double alpha, Allocation X, int incX, Allocation Ap) {
// equivalent to SPR for validation
int N = validateSPR(Element.F64_2(mRS), Uplo, X, incX, Ap);
mRS.nScriptIntrinsicBLAS_Z(getID(mRS), RsBlas_zhpr, 0, 0, 0, Uplo, 0, 0, N, 0, alpha, 0, X.getID(mRS), 0, 0, 0, Ap.getID(mRS), incX, 0, 0, 0);
}
+
+ /**
+ * ZHER2 performs the symmetric rank 2 operation
+ * A := alpha*x*y**H + alpha*y*x**H + A
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/da/d8a/zher2_8f.html
+ *
+ * @param Uplo Specifies whether the upper or lower triangular part is to be referenced.
+ * @param alpha The scalar alpha.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F64_2}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ * @param Y The input allocation contains vector y, supported elements type {@link Element#F64_2}.
+ * @param incY The increment for the elements of vector y, must be larger than zero.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F64_2}.
+ */
public void ZHER2(@Uplo int Uplo, Double2 alpha, Allocation X, int incX, Allocation Y, int incY, Allocation A) {
// same as SYR2
int N = validateSYR2(Element.F64_2(mRS), Uplo, X, incX, Y, incY, A);
mRS.nScriptIntrinsicBLAS_Z(getID(mRS), RsBlas_zher2, 0, 0, 0, Uplo, 0, 0, N, 0, alpha.x, alpha.y, X.getID(mRS), Y.getID(mRS), 0, 0, A.getID(mRS), incX, incY, 0, 0);
}
+
+ /**
+ * ZHPR2 performs the symmetric rank 2 operation
+ * A := alpha*x*y**H + alpha*y*x**H + A
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d5/d52/zhpr2_8f.html
+ *
+ * Note: For a N*N matrix, the input Allocation should be a 1D allocation of size dimX = N*(N+1)/2,
+ * The following subroutine can is an example showing how to convert a UPPER trianglar matrix
+ * 'a' to packed matrix 'b'.
+ * k = 0
+ * for i in range(0, n):
+ * for j in range(i, n):
+ * b[k++] = a[i, j]
+ *
+ * @param Uplo Specifies whether the upper or lower triangular part is to be supplied in the packed form.
+ * @param alpha The scalar alpha.
+ * @param X The input allocation contains vector x, supported elements type {@link Element#F64_2}.
+ * @param incX The increment for the elements of vector x, must be larger than zero.
+ * @param Y The input allocation contains vector y, supported elements type {@link Element#F64_2}.
+ * @param incY The increment for the elements of vector y, must be larger than zero.
+ * @param Ap The input allocation contains matrix A, supported elements type {@link Element#F64_2}.
+ */
public void ZHPR2(@Uplo int Uplo, Double2 alpha, Allocation X, int incX, Allocation Y, int incY, Allocation Ap) {
// same as SPR2
int N = validateSPR2(Element.F64_2(mRS), Uplo, X, incX, Y, incY, Ap);
@@ -1051,6 +2323,20 @@ public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
}
+ /**
+ * SGEMM performs one of the matrix-matrix operations
+ * C := alpha*op(A)*op(B) + beta*C where op(X) is one of op(X) = X or op(X) = X**T
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d4/de2/sgemm_8f.html
+ *
+ * @param TransA The type of transpose applied to matrix A.
+ * @param TransB The type of transpose applied to matrix B.
+ * @param alpha The scalar alpha.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F32}.
+ * @param B The input allocation contains matrix B, supported elements type {@link Element#F32}.
+ * @param beta The scalar beta.
+ * @param C The input allocation contains matrix C, supported elements type {@link Element#F32}.
+ */
public void SGEMM(@Transpose int TransA, @Transpose int TransB, float alpha, Allocation A,
Allocation B, float beta, Allocation C) {
validateTranspose(TransA);
@@ -1073,6 +2359,21 @@ public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
mRS.nScriptIntrinsicBLAS_Single(getID(mRS), RsBlas_sgemm, TransA, TransB, 0, 0, 0, M, N, K, alpha, A.getID(mRS), B.getID(mRS),
beta, C.getID(mRS), 0, 0, 0, 0);
}
+
+ /**
+ * DGEMM performs one of the matrix-matrix operations
+ * C := alpha*op(A)*op(B) + beta*C where op(X) is one of op(X) = X or op(X) = X**T
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d7/d2b/dgemm_8f.html
+ *
+ * @param TransA The type of transpose applied to matrix A.
+ * @param TransB The type of transpose applied to matrix B.
+ * @param alpha The scalar alpha.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F64}.
+ * @param B The input allocation contains matrix B, supported elements type {@link Element#F64}.
+ * @param beta The scalar beta.
+ * @param C The input allocation contains matrix C, supported elements type {@link Element#F64}.
+ */
public void DGEMM(@Transpose int TransA, @Transpose int TransB, double alpha, Allocation A,
Allocation B, double beta, Allocation C) {
validateTranspose(TransA);
@@ -1094,6 +2395,21 @@ public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
mRS.nScriptIntrinsicBLAS_Double(getID(mRS), RsBlas_dgemm, TransA, TransB, 0, 0, 0, M, N, K, alpha, A.getID(mRS), B.getID(mRS),
beta, C.getID(mRS), 0, 0, 0, 0);
}
+
+ /**
+ * CGEMM performs one of the matrix-matrix operations
+ * C := alpha*op(A)*op(B) + beta*C where op(X) is one of op(X) = X or op(X) = X**T or op(X) = X**H
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d6/d5b/cgemm_8f.html
+ *
+ * @param TransA The type of transpose applied to matrix A.
+ * @param TransB The type of transpose applied to matrix B.
+ * @param alpha The scalar alpha.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F32_2}.
+ * @param B The input allocation contains matrix B, supported elements type {@link Element#F32_2}.
+ * @param beta The scalar beta.
+ * @param C The input allocation contains matrix C, supported elements type {@link Element#F32_2}.
+ */
public void CGEMM(@Transpose int TransA, @Transpose int TransB, Float2 alpha, Allocation A,
Allocation B, Float2 beta, Allocation C) {
validateTranspose(TransA);
@@ -1116,6 +2432,20 @@ public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
beta.x, beta.y, C.getID(mRS), 0, 0, 0, 0);
}
+ /**
+ * ZGEMM performs one of the matrix-matrix operations
+ * C := alpha*op(A)*op(B) + beta*C where op(X) is one of op(X) = X or op(X) = X**T or op(X) = X**H
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d7/d76/zgemm_8f.html
+ *
+ * @param TransA The type of transpose applied to matrix A.
+ * @param TransB The type of transpose applied to matrix B.
+ * @param alpha The scalar alpha.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F64_2
+ * @param B The input allocation contains matrix B, supported elements type {@link Element#F64_2
+ * @param beta The scalar beta.
+ * @param C The input allocation contains matrix C, supported elements type {@link Element#F64_2
+ */
public void ZGEMM(@Transpose int TransA, @Transpose int TransB, Double2 alpha, Allocation A,
Allocation B, Double2 beta, Allocation C) {
validateTranspose(TransA);
@@ -1138,6 +2468,20 @@ public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
beta.x, beta.y, C.getID(mRS), 0, 0, 0, 0);
}
+ /**
+ * SSYMM performs one of the matrix-matrix operations
+ * C := alpha*A*B + beta*C or C := alpha*B*A + beta*C
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d7/d42/ssymm_8f.html
+ *
+ * @param Side Specifies whether the symmetric matrix A appears on the left or right.
+ * @param Uplo Specifies whether the upper or lower triangular part is to be referenced.
+ * @param alpha The scalar alpha.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F32}.
+ * @param B The input allocation contains matrix B, supported elements type {@link Element#F32}.
+ * @param beta The scalar beta.
+ * @param C The input allocation contains matrix C, supported elements type {@link Element#F32}.
+ */
public void SSYMM(@Side int Side, @Uplo int Uplo, float alpha, Allocation A,
Allocation B, float beta, Allocation C) {
validateSide(Side);
@@ -1150,6 +2494,21 @@ public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
mRS.nScriptIntrinsicBLAS_Single(getID(mRS), RsBlas_ssymm, 0, 0, Side, Uplo, 0, C.getType().getY(), C.getType().getX(), 0, alpha, A.getID(mRS), B.getID(mRS),
beta, C.getID(mRS), 0, 0, 0, 0);
}
+
+ /**
+ * DSYMM performs one of the matrix-matrix operations
+ * C := alpha*A*B + beta*C or C := alpha*B*A + beta*C
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d8/db0/dsymm_8f.html
+ *
+ * @param Side Specifies whether the symmetric matrix A appears on the left or right.
+ * @param Uplo Specifies whether the upper or lower triangular part is to be referenced.
+ * @param alpha The scalar alpha.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F64}.
+ * @param B The input allocation contains matrix B, supported elements type {@link Element#F64}.
+ * @param beta The scalar beta.
+ * @param C The input allocation contains matrix C, supported elements type {@link Element#F64}.
+ */
public void DSYMM(@Side int Side, @Uplo int Uplo, double alpha, Allocation A,
Allocation B, double beta, Allocation C) {
validateSide(Side);
@@ -1161,6 +2520,21 @@ public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
mRS.nScriptIntrinsicBLAS_Double(getID(mRS), RsBlas_dsymm, 0, 0, Side, Uplo, 0, C.getType().getY(), C.getType().getX(), 0, alpha, A.getID(mRS), B.getID(mRS),
beta, C.getID(mRS), 0, 0, 0, 0);
}
+
+ /**
+ * CSYMM performs one of the matrix-matrix operations
+ * C := alpha*A*B + beta*C or C := alpha*B*A + beta*C
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/db/d59/csymm_8f.html
+ *
+ * @param Side Specifies whether the symmetric matrix A appears on the left or right.
+ * @param Uplo Specifies whether the upper or lower triangular part is to be referenced.
+ * @param alpha The scalar alpha.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F32_2}.
+ * @param B The input allocation contains matrix B, supported elements type {@link Element#F32_2}.
+ * @param beta The scalar beta.
+ * @param C The input allocation contains matrix C, supported elements type {@link Element#F32_2}.
+ */
public void CSYMM(@Side int Side, @Uplo int Uplo, Float2 alpha, Allocation A,
Allocation B, Float2 beta, Allocation C) {
validateSide(Side);
@@ -1172,6 +2546,21 @@ public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
mRS.nScriptIntrinsicBLAS_Complex(getID(mRS), RsBlas_csymm, 0, 0, Side, Uplo, 0, C.getType().getY(), C.getType().getX(), 0, alpha.x, alpha.y, A.getID(mRS), B.getID(mRS),
beta.x, beta.y, C.getID(mRS), 0, 0, 0, 0);
}
+
+ /**
+ * ZSYMM performs one of the matrix-matrix operations
+ * C := alpha*A*B + beta*C or C := alpha*B*A + beta*C
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/df/d51/zsymm_8f.html
+ *
+ * @param Side Specifies whether the symmetric matrix A appears on the left or right.
+ * @param Uplo Specifies whether the upper or lower triangular part is to be referenced.
+ * @param alpha The scalar alpha.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F64_2}.
+ * @param B The input allocation contains matrix B, supported elements type {@link Element#F64_2}.
+ * @param beta The scalar beta.
+ * @param C The input allocation contains matrix C, supported elements type {@link Element#F64_2}.
+ */
public void ZSYMM(@Side int Side, @Uplo int Uplo, Double2 alpha, Allocation A,
Allocation B, Double2 beta, Allocation C) {
validateSide(Side);
@@ -1184,6 +2573,19 @@ public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
beta.x, beta.y, C.getID(mRS), 0, 0, 0, 0);
}
+ /**
+ * SSYRK performs one of the symmetric rank k operations
+ * C := alpha*A*A**T + beta*C or C := alpha*A**T*A + beta*C
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d0/d40/ssyrk_8f.html
+ *
+ * @param Uplo Specifies whether the upper or lower triangular part of C is to be referenced.
+ * @param Trans The type of transpose applied to the operation.
+ * @param alpha The scalar alpha.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F32}.
+ * @param beta The scalar beta.
+ * @param C The input allocation contains matrix C, supported elements type {@link Element#F32}.
+ */
public void SSYRK(@Uplo int Uplo, @Transpose int Trans, float alpha, Allocation A, float beta, Allocation C) {
validateTranspose(Trans);
validateUplo(Uplo);
@@ -1198,6 +2600,19 @@ public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
mRS.nScriptIntrinsicBLAS_Single(getID(mRS), RsBlas_ssyrk, Trans, 0, 0, Uplo, 0, 0, C.getType().getX(), K, alpha, A.getID(mRS), 0, beta, C.getID(mRS), 0, 0, 0, 0);
}
+ /**
+ * DSYRK performs one of the symmetric rank k operations
+ * C := alpha*A*A**T + beta*C or C := alpha*A**T*A + beta*C
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/dc/d05/dsyrk_8f.html
+ *
+ * @param Uplo Specifies whether the upper or lower triangular part of C is to be referenced.
+ * @param Trans The type of transpose applied to the operation.
+ * @param alpha The scalar alpha.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F64}.
+ * @param beta The scalar beta.
+ * @param C The input allocation contains matrix C, supported elements type {@link Element#F64}.
+ */
public void DSYRK(@Uplo int Uplo, @Transpose int Trans, double alpha, Allocation A, double beta, Allocation C) {
validateTranspose(Trans);
validateUplo(Uplo);
@@ -1210,6 +2625,20 @@ public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
}
mRS.nScriptIntrinsicBLAS_Double(getID(mRS), RsBlas_dsyrk, Trans, 0, 0, Uplo, 0, 0, C.getType().getX(), K, alpha, A.getID(mRS), 0, beta, C.getID(mRS), 0, 0, 0, 0);
}
+
+ /**
+ * CSYRK performs one of the symmetric rank k operations
+ * C := alpha*A*A**T + beta*C or C := alpha*A**T*A + beta*C
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d3/d6a/csyrk_8f.html
+ *
+ * @param Uplo Specifies whether the upper or lower triangular part of C is to be referenced.
+ * @param Trans The type of transpose applied to the operation.
+ * @param alpha The scalar alpha.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F32_2}.
+ * @param beta The scalar beta.
+ * @param C The input allocation contains matrix C, supported elements type {@link Element#F32_2}.
+ */
public void CSYRK(@Uplo int Uplo, @Transpose int Trans, Float2 alpha, Allocation A, Float2 beta, Allocation C) {
validateTranspose(Trans);
validateUplo(Uplo);
@@ -1223,6 +2652,20 @@ public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
mRS.nScriptIntrinsicBLAS_Complex(getID(mRS), RsBlas_csyrk, Trans, 0, 0, Uplo, 0, 0, C.getType().getX(), K, alpha.x, alpha.y, A.getID(mRS), 0, beta.x, beta.y,
C.getID(mRS), 0, 0, 0, 0);
}
+
+ /**
+ * ZSYRK performs one of the symmetric rank k operations
+ * C := alpha*A*A**T + beta*C or C := alpha*A**T*A + beta*C
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/de/d54/zsyrk_8f.html
+ *
+ * @param Uplo Specifies whether the upper or lower triangular part of C is to be referenced.
+ * @param Trans The type of transpose applied to the operation.
+ * @param alpha The scalar alpha.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F64_2}.
+ * @param beta The scalar beta.
+ * @param C The input allocation contains matrix C, supported elements type {@link Element#F64_2}.
+ */
public void ZSYRK(@Uplo int Uplo, @Transpose int Trans, Double2 alpha, Allocation A, Double2 beta, Allocation C) {
validateTranspose(Trans);
validateUplo(Uplo);
@@ -1262,6 +2705,21 @@ public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
throw new RSRuntimeException("Invalid A and B in SYR2K");
}
}
+
+ /**
+ * SSYR2K performs one of the symmetric rank 2k operations
+ * C := alpha*A*B**T + alpha*B*A**T + beta*C or C := alpha*A**T*B + alpha*B**T*A + beta*C
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/df/d3d/ssyr2k_8f.html
+ *
+ * @param Uplo Specifies whether the upper or lower triangular part of C is to be referenced.
+ * @param Trans The type of transpose applied to the operation.
+ * @param alpha The scalar alpha.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F32}.
+ * @param B The input allocation contains matrix B, supported elements type {@link Element#F32}.
+ * @param beta The scalar beta.
+ * @param C The input allocation contains matrix C, supported elements type {@link Element#F32}.
+ */
public void SSYR2K(@Uplo int Uplo, @Transpose int Trans, float alpha, Allocation A, Allocation B, float beta, Allocation C) {
validateUplo(Uplo);
validateSYR2K(Element.F32(mRS), Trans, A, B, C);
@@ -1273,6 +2731,21 @@ public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
}
mRS.nScriptIntrinsicBLAS_Single(getID(mRS), RsBlas_ssyr2k, Trans, 0, 0, Uplo, 0, 0, C.getType().getX(), K, alpha, A.getID(mRS), B.getID(mRS), beta, C.getID(mRS), 0, 0, 0, 0);
}
+
+ /**
+ * DSYR2K performs one of the symmetric rank 2k operations
+ * C := alpha*A*B**T + alpha*B*A**T + beta*C or C := alpha*A**T*B + alpha*B**T*A + beta*C
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d1/dec/dsyr2k_8f.html
+ *
+ * @param Uplo Specifies whether the upper or lower triangular part of C is to be referenced.
+ * @param Trans The type of transpose applied to the operation.
+ * @param alpha The scalar alpha.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F64}.
+ * @param B The input allocation contains matrix B, supported elements type {@link Element#F64}.
+ * @param beta The scalar beta.
+ * @param C The input allocation contains matrix C, supported elements type {@link Element#F64}.
+ */
public void DSYR2K(@Uplo int Uplo, @Transpose int Trans, double alpha, Allocation A, Allocation B, double beta, Allocation C) {
validateUplo(Uplo);
validateSYR2K(Element.F64(mRS), Trans, A, B, C);
@@ -1284,6 +2757,21 @@ public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
}
mRS.nScriptIntrinsicBLAS_Double(getID(mRS), RsBlas_dsyr2k, Trans, 0, 0, Uplo, 0, 0, C.getType().getX(), K, alpha, A.getID(mRS), B.getID(mRS), beta, C.getID(mRS), 0, 0, 0, 0);
}
+
+ /**
+ * CSYR2K performs one of the symmetric rank 2k operations
+ * C := alpha*A*B**T + alpha*B*A**T + beta*C or C := alpha*A**T*B + alpha*B**T*A + beta*C
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/de/d7e/csyr2k_8f.html
+ *
+ * @param Uplo Specifies whether the upper or lower triangular part of C is to be referenced.
+ * @param Trans The type of transpose applied to the operation.
+ * @param alpha The scalar alpha.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F32_2}.
+ * @param B The input allocation contains matrix B, supported elements type {@link Element#F32_2}.
+ * @param beta The scalar beta.
+ * @param C The input allocation contains matrix C, supported elements type {@link Element#F32_2}.
+ */
public void CSYR2K(@Uplo int Uplo, @Transpose int Trans, Float2 alpha, Allocation A, Allocation B, Float2 beta, Allocation C) {
validateUplo(Uplo);
validateSYR2K(Element.F32_2(mRS), Trans, A, B, C);
@@ -1295,6 +2783,21 @@ public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
}
mRS.nScriptIntrinsicBLAS_Complex(getID(mRS), RsBlas_csyr2k, Trans, 0, 0, Uplo, 0, 0, C.getType().getX(), K, alpha.x, alpha.y, A.getID(mRS), B.getID(mRS), beta.x, beta.y, C.getID(mRS), 0, 0, 0, 0);
}
+
+ /**
+ * ZSYR2K performs one of the symmetric rank 2k operations
+ * C := alpha*A*B**T + alpha*B*A**T + beta*C or C := alpha*A**T*B + alpha*B**T*A + beta*C
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/df/d20/zsyr2k_8f.html
+ *
+ * @param Uplo Specifies whether the upper or lower triangular part of C is to be referenced.
+ * @param Trans The type of transpose applied to the operation.
+ * @param alpha The scalar alpha.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F64_2}.
+ * @param B The input allocation contains matrix B, supported elements type {@link Element#F64_2}.
+ * @param beta The scalar beta.
+ * @param C The input allocation contains matrix C, supported elements type {@link Element#F64_2}.
+ */
public void ZSYR2K(@Uplo int Uplo, @Transpose int Trans, Double2 alpha, Allocation A, Allocation B, Double2 beta, Allocation C) {
validateUplo(Uplo);
validateSYR2K(Element.F64_2(mRS), Trans, A, B, C);
@@ -1334,6 +2837,22 @@ public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
}
}
}
+
+ /**
+ * STRMM performs one of the matrix-matrix operations
+ * B := alpha*op(A)*B or B := alpha*B*op(A)
+ * op(A) is one of op(A) = A or op(A) = A**T
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/df/d01/strmm_8f.html
+ *
+ * @param Side Specifies whether the symmetric matrix A appears on the left or right.
+ * @param Uplo Specifies whether matrix A is upper or lower triangular.
+ * @param TransA The type of transpose applied to matrix A.
+ * @param Diag Specifies whether or not A is unit triangular.
+ * @param alpha The scalar alpha.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F32}.
+ * @param B The input allocation contains matrix B, supported elements type {@link Element#F32}.
+ */
public void STRMM(@Side int Side, @Uplo int Uplo, @Transpose int TransA, @Diag int Diag, float alpha, Allocation A, Allocation B) {
validateUplo(Uplo);
validateDiag(Diag);
@@ -1341,6 +2860,22 @@ public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
mRS.nScriptIntrinsicBLAS_Single(getID(mRS), RsBlas_strmm, TransA, 0, Side, Uplo, Diag, B.getType().getY(), B.getType().getX(), 0,
alpha, A.getID(mRS), B.getID(mRS), 0.f, 0, 0, 0, 0, 0);
}
+
+ /**
+ * DTRMM performs one of the matrix-matrix operations
+ * B := alpha*op(A)*B or B := alpha*B*op(A)
+ * op(A) is one of op(A) = A or op(A) = A**T
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/dd/d19/dtrmm_8f.html
+ *
+ * @param Side Specifies whether the symmetric matrix A appears on the left or right.
+ * @param Uplo Specifies whether matrix A is upper or lower triangular.
+ * @param TransA The type of transpose applied to matrix A.
+ * @param Diag Specifies whether or not A is unit triangular.
+ * @param alpha The scalar alpha.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F64}.
+ * @param B The input allocation contains matrix B, supported elements type {@link Element#F64}.
+ */
public void DTRMM(@Side int Side, @Uplo int Uplo, @Transpose int TransA, @Diag int Diag, double alpha, Allocation A, Allocation B) {
validateUplo(Uplo);
validateDiag(Diag);
@@ -1348,6 +2883,22 @@ public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
mRS.nScriptIntrinsicBLAS_Double(getID(mRS), RsBlas_dtrmm, TransA, 0, Side, Uplo, Diag, B.getType().getY(), B.getType().getX(), 0,
alpha, A.getID(mRS), B.getID(mRS), 0, 0, 0, 0, 0, 0);
}
+
+ /**
+ * CTRMM performs one of the matrix-matrix operations
+ * B := alpha*op(A)*B or B := alpha*B*op(A)
+ * op(A) is one of op(A) = A or op(A) = A**T or op(A) = A**H
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d4/d9b/ctrmm_8f.html
+ *
+ * @param Side Specifies whether the symmetric matrix A appears on the left or right.
+ * @param Uplo Specifies whether matrix A is upper or lower triangular.
+ * @param TransA The type of transpose applied to matrix A.
+ * @param Diag Specifies whether or not A is unit triangular.
+ * @param alpha The scalar alpha.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F32_2}.
+ * @param B The input allocation contains matrix B, supported elements type {@link Element#F32_2}.
+ */
public void CTRMM(@Side int Side, @Uplo int Uplo, @Transpose int TransA, @Diag int Diag, Float2 alpha, Allocation A, Allocation B) {
validateUplo(Uplo);
validateDiag(Diag);
@@ -1355,6 +2906,22 @@ public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
mRS.nScriptIntrinsicBLAS_Complex(getID(mRS), RsBlas_ctrmm, TransA, 0, Side, Uplo, Diag, B.getType().getY(), B.getType().getX(), 0,
alpha.x, alpha.y, A.getID(mRS), B.getID(mRS), 0, 0, 0, 0, 0, 0, 0);
}
+
+ /**
+ * ZTRMM performs one of the matrix-matrix operations
+ * B := alpha*op(A)*B or B := alpha*B*op(A)
+ * op(A) is one of op(A) = A or op(A) = A**T or op(A) = A**H
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d8/de1/ztrmm_8f.html
+ *
+ * @param Side Specifies whether the symmetric matrix A appears on the left or right.
+ * @param Uplo Specifies whether matrix A is upper or lower triangular.
+ * @param TransA The type of transpose applied to matrix A.
+ * @param Diag Specifies whether or not A is unit triangular.
+ * @param alpha The scalar alpha.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F64_2}.
+ * @param B The input allocation contains matrix B, supported elements type {@link Element#F64_2}.
+ */
public void ZTRMM(@Side int Side, @Uplo int Uplo, @Transpose int TransA, @Diag int Diag, Double2 alpha, Allocation A, Allocation B) {
validateUplo(Uplo);
validateDiag(Diag);
@@ -1392,6 +2959,22 @@ public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
}
}
}
+
+ /**
+ * STRSM solves one of the matrix equations
+ * op(A)*X := alpha*B or X*op(A) := alpha*B
+ * op(A) is one of op(A) = A or op(A) = A**T
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d2/d8b/strsm_8f.html
+ *
+ * @param Side Specifies whether the symmetric matrix A appears on the left or right.
+ * @param Uplo Specifies whether matrix A is upper or lower triangular.
+ * @param TransA The type of transpose applied to matrix A.
+ * @param Diag Specifies whether or not A is unit triangular.
+ * @param alpha The scalar alpha.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F32}.
+ * @param B The input allocation contains matrix B, supported elements type {@link Element#F32}.
+ */
public void STRSM(@Side int Side, @Uplo int Uplo, @Transpose int TransA, @Diag int Diag, float alpha, Allocation A, Allocation B) {
validateUplo(Uplo);
validateDiag(Diag);
@@ -1399,6 +2982,22 @@ public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
mRS.nScriptIntrinsicBLAS_Single(getID(mRS), RsBlas_strsm, TransA, 0, Side, Uplo, Diag, B.getType().getY(), B.getType().getX(), 0,
alpha, A.getID(mRS), B.getID(mRS), 0, 0, 0, 0, 0, 0);
}
+
+ /**
+ * DTRSM solves one of the matrix equations
+ * op(A)*X := alpha*B or X*op(A) := alpha*B
+ * op(A) is one of op(A) = A or op(A) = A**T
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/de/da7/dtrsm_8f.html
+ *
+ * @param Side Specifies whether the symmetric matrix A appears on the left or right.
+ * @param Uplo Specifies whether matrix A is upper or lower triangular.
+ * @param TransA The type of transpose applied to matrix A.
+ * @param Diag Specifies whether or not A is unit triangular.
+ * @param alpha The scalar alpha.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F64}.
+ * @param B The input allocation contains matrix B, supported elements type {@link Element#F64}.
+ */
public void DTRSM(@Side int Side, @Uplo int Uplo, @Transpose int TransA, @Diag int Diag, double alpha, Allocation A, Allocation B) {
validateUplo(Uplo);
validateDiag(Diag);
@@ -1406,6 +3005,22 @@ public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
mRS.nScriptIntrinsicBLAS_Double(getID(mRS), RsBlas_dtrsm, TransA, 0, Side, Uplo, Diag, B.getType().getY(), B.getType().getX(), 0,
alpha, A.getID(mRS), B.getID(mRS), 0, 0, 0, 0, 0, 0);
}
+
+ /**
+ * CTRSM solves one of the matrix equations
+ * op(A)*X := alpha*B or X*op(A) := alpha*B
+ * op(A) is one of op(A) = A or op(A) = A**T or op(A) = A**H
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/de/d30/ctrsm_8f.html
+ *
+ * @param Side Specifies whether the symmetric matrix A appears on the left or right.
+ * @param Uplo Specifies whether matrix A is upper or lower triangular.
+ * @param TransA The type of transpose applied to matrix A.
+ * @param Diag Specifies whether or not A is unit triangular.
+ * @param alpha The scalar alpha.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F32_2}.
+ * @param B The input allocation contains matrix B, supported elements type {@link Element#F32_2}.
+ */
public void CTRSM(@Side int Side, @Uplo int Uplo, @Transpose int TransA, @Diag int Diag, Float2 alpha, Allocation A, Allocation B) {
validateUplo(Uplo);
validateDiag(Diag);
@@ -1413,6 +3028,22 @@ public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
mRS.nScriptIntrinsicBLAS_Complex(getID(mRS), RsBlas_ctrsm, TransA, 0, Side, Uplo, Diag, B.getType().getY(), B.getType().getX(), 0,
alpha.x, alpha.y, A.getID(mRS), B.getID(mRS), 0, 0, 0, 0, 0, 0, 0);
}
+
+ /**
+ * ZTRSM solves one of the matrix equations
+ * op(A)*X := alpha*B or X*op(A) := alpha*B
+ * op(A) is one of op(A) = A or op(A) = A**T or op(A) = A**H
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d1/d39/ztrsm_8f.html
+ *
+ * @param Side Specifies whether the symmetric matrix A appears on the left or right.
+ * @param Uplo Specifies whether matrix A is upper or lower triangular.
+ * @param TransA The type of transpose applied to matrix A.
+ * @param Diag Specifies whether or not A is unit triangular.
+ * @param alpha The scalar alpha.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F64_2}.
+ * @param B The input allocation contains matrix B, supported elements type {@link Element#F64_2}.
+ */
public void ZTRSM(@Side int Side, @Uplo int Uplo, @Transpose int TransA, @Diag int Diag, Double2 alpha, Allocation A, Allocation B) {
validateUplo(Uplo);
validateDiag(Diag);
@@ -1444,12 +3075,42 @@ public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
throw new RSRuntimeException("Called HEMM with mismatched B and C");
}
}
+
+ /**
+ * CHEMM performs one of the matrix-matrix operations
+ * C := alpha*A*B + beta*C or C := alpha*B*A + beta*C
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d3/d66/chemm_8f.html
+ *
+ * @param Side Specifies whether the symmetric matrix A appears on the left or right.
+ * @param Uplo Specifies whether the upper or lower triangular part is to be referenced.
+ * @param alpha The scalar alpha.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F32_2}.
+ * @param B The input allocation contains matrix B, supported elements type {@link Element#F32_2}.
+ * @param beta The scalar beta.
+ * @param C The input allocation contains matrix C, supported elements type {@link Element#F32_2}.
+ */
public void CHEMM(@Side int Side, @Uplo int Uplo, Float2 alpha, Allocation A, Allocation B, Float2 beta, Allocation C) {
validateUplo(Uplo);
validateHEMM(Element.F32_2(mRS), Side, A, B, C);
mRS.nScriptIntrinsicBLAS_Complex(getID(mRS), RsBlas_chemm, 0, 0, Side, Uplo, 0, C.getType().getY(), C.getType().getX(), 0,
alpha.x, alpha.y, A.getID(mRS), B.getID(mRS), beta.x, beta.y, C.getID(mRS), 0, 0, 0, 0);
}
+
+ /**
+ * ZHEMM performs one of the matrix-matrix operations
+ * C := alpha*A*B + beta*C or C := alpha*B*A + beta*C
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d6/d3e/zhemm_8f.html
+ *
+ * @param Side Specifies whether the symmetric matrix A appears on the left or right.
+ * @param Uplo Specifies whether the upper or lower triangular part is to be referenced.
+ * @param alpha The scalar alpha.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F64_2}.
+ * @param B The input allocation contains matrix B, supported elements type {@link Element#F64_2}.
+ * @param beta The scalar beta.
+ * @param C The input allocation contains matrix C, supported elements type {@link Element#F64_2}.
+ */
public void ZHEMM(@Side int Side, @Uplo int Uplo, Double2 alpha, Allocation A, Allocation B, Double2 beta, Allocation C) {
validateUplo(Uplo);
validateHEMM(Element.F64_2(mRS), Side, A, B, C);
@@ -1477,6 +3138,20 @@ public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
}
}
}
+
+ /**
+ * CHERK performs one of the hermitian rank k operations
+ * C := alpha*A*A**H + beta*C or C := alpha*A**H*A + beta*C
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d8/d52/cherk_8f.html
+ *
+ * @param Uplo Specifies whether the upper or lower triangular part of C is to be referenced.
+ * @param Trans The type of transpose applied to the operation.
+ * @param alpha The scalar alpha.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F32_2}.
+ * @param beta The scalar beta.
+ * @param C The input allocation contains matrix C, supported elements type {@link Element#F32_2}.
+ */
public void CHERK(@Uplo int Uplo, @Transpose int Trans, float alpha, Allocation A, float beta, Allocation C) {
validateUplo(Uplo);
validateHERK(Element.F32_2(mRS), Trans, A, C);
@@ -1489,6 +3164,20 @@ public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
mRS.nScriptIntrinsicBLAS_Complex(getID(mRS), RsBlas_cherk, Trans, 0, 0, Uplo, 0, 0, C.getType().getX(), k,
alpha, 0, A.getID(mRS), 0, beta, 0, C.getID(mRS), 0, 0, 0, 0);
}
+
+ /**
+ * ZHERK performs one of the hermitian rank k operations
+ * C := alpha*A*A**H + beta*C or C := alpha*A**H*A + beta*C
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d1/db1/zherk_8f.html
+ *
+ * @param Uplo Specifies whether the upper or lower triangular part of C is to be referenced.
+ * @param Trans The type of transpose applied to the operation.
+ * @param alpha The scalar alpha.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F64_2}.
+ * @param beta The scalar beta.
+ * @param C The input allocation contains matrix C, supported elements type {@link Element#F64_2}.
+ */
public void ZHERK(@Uplo int Uplo, @Transpose int Trans, double alpha, Allocation A, double beta, Allocation C) {
validateUplo(Uplo);
validateHERK(Element.F64_2(mRS), Trans, A, C);
@@ -1526,6 +3215,21 @@ public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
throw new RSRuntimeException("Called HER2K with invalid A and B matrices");
}
}
+
+ /**
+ * CHER2K performs one of the hermitian rank 2k operations
+ * C := alpha*A*B**H + conjg( alpha )*B*A**H + beta*C or C := alpha*A**H*B + conjg( alpha )*B**H*A + beta*C
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d1/d82/cher2k_8f.html
+ *
+ * @param Uplo Specifies whether the upper or lower triangular part of C is to be referenced.
+ * @param Trans The type of transpose applied to the operation.
+ * @param alpha The scalar alpha.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F32_2}.
+ * @param B The input allocation contains matrix B, supported elements type {@link Element#F32_2}.
+ * @param beta The scalar beta.
+ * @param C The input allocation contains matrix C, supported elements type {@link Element#F32_2}.
+ */
public void CHER2K(@Uplo int Uplo, @Transpose int Trans, Float2 alpha, Allocation A, Allocation B, float beta, Allocation C) {
validateUplo(Uplo);
validateHER2K(Element.F32_2(mRS), Trans, A, B, C);
@@ -1538,6 +3242,21 @@ public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
mRS.nScriptIntrinsicBLAS_Complex(getID(mRS), RsBlas_cher2k, Trans, 0, 0, Uplo, 0, 0, C.getType().getX(), k, alpha.x, alpha.y,
A.getID(mRS), B.getID(mRS), beta, 0, C.getID(mRS), 0, 0, 0, 0);
}
+
+ /**
+ * ZHER2K performs one of the hermitian rank 2k operations
+ * C := alpha*A*B**H + conjg( alpha )*B*A**H + beta*C or C := alpha*A**H*B + conjg( alpha )*B**H*A + beta*C
+ *
+ * Details: http://www.netlib.org/lapack/explore-html/d7/dfa/zher2k_8f.html
+ *
+ * @param Uplo Specifies whether the upper or lower triangular part of C is to be referenced.
+ * @param Trans The type of transpose applied to the operation.
+ * @param alpha The scalar alpha.
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#F64_2}.
+ * @param B The input allocation contains matrix B, supported elements type {@link Element#F64_2}.
+ * @param beta The scalar beta.
+ * @param C The input allocation contains matrix C, supported elements type {@link Element#F64_2}.
+ */
public void ZHER2K(@Uplo int Uplo, @Transpose int Trans, Double2 alpha, Allocation A, Allocation B, double beta, Allocation C) {
validateUplo(Uplo);
validateHER2K(Element.F64_2(mRS), Trans, A, B, C);
@@ -1553,9 +3272,19 @@ public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
/**
- *
- * 8-bit GEMM-like operation for neural networks
- *
+ * 8-bit GEMM-like operation for neural networks: C = B.transposed() * A
+ * Calculations are done in 1.10.21 fixed-point format for the final output,
+ * just before there's a shift down to drop the fractional parts. The output
+ * values are gated to 0 to 255 to fit in a byte, but the 10-bit format
+ * gives some headroom to avoid wrapping around on small overflows.
+ *
+ * @param A The input allocation contains matrix A, supported elements type {@link Element#U8}.
+ * @param a_offset The offset for all values in matrix A, e.g A[i,j] = A[i,j] - a_offset.
+ * @param B The input allocation contains matrix B, supported elements type {@link Element#U8}.
+ * @param b_offset The offset for all values in matrix B, e.g B[i,j] = B[i,j] - b_offset.
+ * @param C The input allocation contains matrix C, supported elements type {@link Element#U8}.
+ * @param c_offset The offset for all values in matrix C.
+ * @param c_mult The multiplier for all values in matrix C, e.g C[i,j] = (C[i,j] + c_offset) * c_mult.
**/
public void BNNM(Allocation A, int a_offset, Allocation B, int b_offset, Allocation C, int c_offset, int c_mult) {
validateL3(Element.U8(mRS), NO_TRANSPOSE, TRANSPOSE, 0, A, B, C);
diff --git a/services/core/java/com/android/server/InputMethodManagerService.java b/services/core/java/com/android/server/InputMethodManagerService.java
index 2f153a0..47c9f04 100644
--- a/services/core/java/com/android/server/InputMethodManagerService.java
+++ b/services/core/java/com/android/server/InputMethodManagerService.java
@@ -16,6 +16,7 @@
package com.android.server;
import android.annotation.NonNull;
+import android.content.pm.PackageManagerInternal;
import com.android.internal.content.PackageMonitor;
import com.android.internal.inputmethod.InputMethodSubtypeSwitchingController;
import com.android.internal.inputmethod.InputMethodSubtypeSwitchingController.ImeSubtypeListItem;
@@ -31,6 +32,7 @@ import com.android.internal.view.IInputMethodClient;
import com.android.internal.view.IInputMethodManager;
import com.android.internal.view.IInputMethodSession;
import com.android.internal.view.InputBindResult;
+import com.android.server.pm.UserManagerService;
import com.android.server.statusbar.StatusBarManagerService;
import com.android.server.wm.WindowManagerService;
@@ -859,6 +861,38 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
// mSettings should be created before buildInputMethodListLocked
mSettings = new InputMethodSettings(
mRes, context.getContentResolver(), mMethodMap, mMethodList, userId);
+
+ // Let the package manager query which are the default imes
+ // as they get certain permissions granted by default.
+ PackageManagerInternal packageManagerInternal = LocalServices.getService(
+ PackageManagerInternal.class);
+ packageManagerInternal.setImePackagesProvider(
+ new PackageManagerInternal.PackagesProvider() {
+ @Override
+ public String[] getPackages(int userId) {
+ synchronized (mMethodMap) {
+ final int currentUserId = mSettings.getCurrentUserId();
+ // TODO: We are switching the current user id in the settings
+ // object to query it and then revert the user id. Ideally, we
+ // should call a API in settings with the user id as an argument.
+ mSettings.setCurrentUserId(userId);
+ List<InputMethodInfo> imes = mSettings
+ .getEnabledInputMethodListLocked();
+ String[] packageNames = null;
+ if (imes != null) {
+ final int imeCount = imes.size();
+ packageNames = new String[imeCount];
+ for (int i = 0; i < imeCount; i++) {
+ InputMethodInfo ime = imes.get(i);
+ packageNames[i] = ime.getPackageName();
+ }
+ }
+ mSettings.setCurrentUserId(currentUserId);
+ return packageNames;
+ }
+ }
+ });
+
updateCurrentProfileIds();
mFileManager = new InputMethodFileManager(mMethodMap, userId);
synchronized (mMethodMap) {
diff --git a/services/core/java/com/android/server/LocationManagerService.java b/services/core/java/com/android/server/LocationManagerService.java
index 743aafb..61bedf5 100644
--- a/services/core/java/com/android/server/LocationManagerService.java
+++ b/services/core/java/com/android/server/LocationManagerService.java
@@ -16,6 +16,7 @@
package com.android.server;
+import android.content.pm.PackageManagerInternal;
import com.android.internal.content.PackageMonitor;
import com.android.internal.location.ProviderProperties;
import com.android.internal.location.ProviderRequest;
@@ -218,6 +219,19 @@ public class LocationManagerService extends ILocationManager.Stub {
mContext = context;
mAppOps = (AppOpsManager)context.getSystemService(Context.APP_OPS_SERVICE);
+ // Let the package manager query which are the default location
+ // providers as they get certain permissions granted by default.
+ PackageManagerInternal packageManagerInternal = LocalServices.getService(
+ PackageManagerInternal.class);
+ packageManagerInternal.setLocationPackagesProvider(
+ new PackageManagerInternal.PackagesProvider() {
+ @Override
+ public String[] getPackages(int userId) {
+ return mContext.getResources().getStringArray(
+ com.android.internal.R.array.config_locationProviderPackageNames);
+ }
+ });
+
if (D) Log.d(TAG, "Constructed");
// most startup is deferred until systemReady()
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index 970deba..c0c401d 100644
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -676,9 +676,9 @@ public final class ActivityManagerService extends ActivityManagerNative
final SparseArray<UidRecord> mActiveUids = new SparseArray<>();
/**
- * Which uses have been started, so are allowed to run code.
+ * Which users have been started, so are allowed to run code.
*/
- final SparseArray<UserStartedState> mStartedUsers = new SparseArray<>();
+ final SparseArray<UserState> mStartedUsers = new SparseArray<>();
/**
* LRU list of history of current users. Most recently current is at the end.
@@ -1781,15 +1781,15 @@ public final class ActivityManagerService extends ActivityManagerNative
break;
}
case REPORT_USER_SWITCH_MSG: {
- dispatchUserSwitch((UserStartedState) msg.obj, msg.arg1, msg.arg2);
+ dispatchUserSwitch((UserState) msg.obj, msg.arg1, msg.arg2);
break;
}
case CONTINUE_USER_SWITCH_MSG: {
- continueUserSwitch((UserStartedState) msg.obj, msg.arg1, msg.arg2);
+ continueUserSwitch((UserState) msg.obj, msg.arg1, msg.arg2);
break;
}
case USER_SWITCH_TIMEOUT_MSG: {
- timeoutUserSwitch((UserStartedState) msg.obj, msg.arg1, msg.arg2);
+ timeoutUserSwitch((UserState) msg.obj, msg.arg1, msg.arg2);
break;
}
case IMMERSIVE_MODE_LOCK_MSG: {
@@ -2309,7 +2309,7 @@ public final class ActivityManagerService extends ActivityManagerNative
mGrantFile = new AtomicFile(new File(systemDir, "urigrants.xml"));
// User 0 is the first and only user that runs at boot.
- mStartedUsers.put(UserHandle.USER_OWNER, new UserStartedState(UserHandle.OWNER, true));
+ mStartedUsers.put(UserHandle.USER_OWNER, new UserState(UserHandle.OWNER, true));
mUserLru.add(UserHandle.USER_OWNER);
updateStartedUserArrayLocked();
@@ -3264,9 +3264,9 @@ public final class ActivityManagerService extends ActivityManagerNative
debugFlags |= Zygote.DEBUG_ENABLE_JIT;
}
}
- String genCFIDebugProperty = SystemProperties.get("debug.gencfi");
- if ("true".equals(genCFIDebugProperty)) {
- debugFlags |= Zygote.DEBUG_GENERATE_CFI;
+ String genDebugInfoProperty = SystemProperties.get("debug.generate-debug-info");
+ if ("true".equals(genDebugInfoProperty)) {
+ debugFlags |= Zygote.DEBUG_GENERATE_DEBUG_INFO;
}
if ("1".equals(SystemProperties.get("debug.jni.logging"))) {
debugFlags |= Zygote.DEBUG_ENABLE_JNI_LOGGING;
@@ -6305,9 +6305,9 @@ public final class ActivityManagerService extends ActivityManagerNative
SystemProperties.set("dev.bootcomplete", "1");
}
for (int i=0; i<mStartedUsers.size(); i++) {
- UserStartedState uss = mStartedUsers.valueAt(i);
- if (uss.mState == UserStartedState.STATE_BOOTING) {
- uss.mState = UserStartedState.STATE_RUNNING;
+ UserState uss = mStartedUsers.valueAt(i);
+ if (uss.mState == UserState.STATE_BOOTING) {
+ uss.mState = UserState.STATE_RUNNING;
final int userId = mStartedUsers.keyAt(i);
Intent intent = new Intent(Intent.ACTION_BOOT_COMPLETED, null);
intent.putExtra(Intent.EXTRA_USER_HANDLE, userId);
@@ -8270,7 +8270,7 @@ public final class ActivityManagerService extends ActivityManagerNative
try {
if (AppGlobals.getPackageManager().isUidPrivileged(callingUid)) {
allowed = true;
- Slog.w(TAG, caller + ": caller " + callingUid
+ if (DEBUG_TASKS) Slog.w(TAG, caller + ": caller " + callingUid
+ " is using old GET_TASKS but privileged; allowing");
}
} catch (RemoteException e) {
@@ -8278,7 +8278,7 @@ public final class ActivityManagerService extends ActivityManagerNative
}
}
if (!allowed) {
- Slog.w(TAG, caller + ": caller " + callingUid
+ if (DEBUG_TASKS) Slog.w(TAG, caller + ": caller " + callingUid
+ " does not hold REAL_GET_TASKS; limiting output");
}
return allowed;
@@ -9434,6 +9434,7 @@ public final class ActivityManagerService extends ActivityManagerNative
}
checkTime(startTime, "getContentProviderImpl: before updateOomAdj");
boolean success = updateOomAdjLocked(cpr.proc);
+ maybeUpdateProviderUsageStatsLocked(r, cpr.info.packageName, name);
checkTime(startTime, "getContentProviderImpl: after updateOomAdj");
if (DEBUG_PROVIDER) Slog.i(TAG_PROVIDER, "Adjust success: " + success);
// NOTE: there is still a race here where a signal could be
@@ -9823,6 +9824,8 @@ public final class ActivityManagerService extends ActivityManagerNative
dst.notifyAll();
}
updateOomAdjLocked(r);
+ maybeUpdateProviderUsageStatsLocked(r, src.info.packageName,
+ src.info.authority);
}
}
@@ -13335,7 +13338,7 @@ public final class ActivityManagerService extends ActivityManagerNative
needSep = false;
pw.println(" mStartedUsers:");
for (int i=0; i<mStartedUsers.size(); i++) {
- UserStartedState uss = mStartedUsers.valueAt(i);
+ UserState uss = mStartedUsers.valueAt(i);
pw.print(" User #"); pw.print(uss.mHandle.getIdentifier());
pw.print(": "); uss.dump("", pw);
}
@@ -18607,6 +18610,22 @@ public final class ActivityManagerService extends ActivityManagerNative
uidRec.pendingChange.processState = uidRec.setProcState;
}
+ private void maybeUpdateProviderUsageStatsLocked(ProcessRecord app, String providerPkgName,
+ String authority) {
+ if (app == null) return;
+ if (app.curProcState <= ActivityManager.PROCESS_STATE_IMPORTANT_FOREGROUND) {
+ UserState userState = mStartedUsers.get(app.userId);
+ if (userState == null) return;
+ final long now = SystemClock.elapsedRealtime();
+ Long lastReported = userState.mProviderLastReportedFg.get(authority);
+ if (lastReported == null || lastReported < now - 60 * 1000L) {
+ mUsageStatsService.reportContentProviderUsage(
+ authority, providerPkgName, app.userId);
+ userState.mProviderLastReportedFg.put(authority, now);
+ }
+ }
+ }
+
private void maybeUpdateUsageStatsLocked(ProcessRecord app) {
if (DEBUG_USAGE_STATS) {
Slog.d(TAG, "Checking proc [" + Arrays.toString(app.getPackageList())
@@ -19594,7 +19613,7 @@ public final class ActivityManagerService extends ActivityManagerNative
// If the user we are switching to is not currently started, then
// we need to start it now.
if (mStartedUsers.get(userId) == null) {
- mStartedUsers.put(userId, new UserStartedState(new UserHandle(userId), false));
+ mStartedUsers.put(userId, new UserState(new UserHandle(userId), false));
updateStartedUserArrayLocked();
needStart = true;
}
@@ -19619,26 +19638,26 @@ public final class ActivityManagerService extends ActivityManagerNative
mUserLru.add(currentUserIdInt);
}
- final UserStartedState uss = mStartedUsers.get(userId);
+ final UserState uss = mStartedUsers.get(userId);
// Make sure user is in the started state. If it is currently
// stopping, we need to knock that off.
- if (uss.mState == UserStartedState.STATE_STOPPING) {
+ if (uss.mState == UserState.STATE_STOPPING) {
// If we are stopping, we haven't sent ACTION_SHUTDOWN,
// so we can just fairly silently bring the user back from
// the almost-dead.
- uss.mState = UserStartedState.STATE_RUNNING;
+ uss.mState = UserState.STATE_RUNNING;
updateStartedUserArrayLocked();
needStart = true;
- } else if (uss.mState == UserStartedState.STATE_SHUTDOWN) {
+ } else if (uss.mState == UserState.STATE_SHUTDOWN) {
// This means ACTION_SHUTDOWN has been sent, so we will
// need to treat this as a new boot of the user.
- uss.mState = UserStartedState.STATE_BOOTING;
+ uss.mState = UserState.STATE_BOOTING;
updateStartedUserArrayLocked();
needStart = true;
}
- if (uss.mState == UserStartedState.STATE_BOOTING) {
+ if (uss.mState == UserState.STATE_BOOTING) {
// Booting up a new user, need to tell system services about it.
// Note that this is on the same handler as scheduling of broadcasts,
// which is important because it needs to go first.
@@ -19776,7 +19795,7 @@ public final class ActivityManagerService extends ActivityManagerNative
}
}
- void dispatchUserSwitch(final UserStartedState uss, final int oldUserId,
+ void dispatchUserSwitch(final UserState uss, final int oldUserId,
final int newUserId) {
final int N = mUserSwitchObservers.beginBroadcast();
if (N > 0) {
@@ -19813,21 +19832,21 @@ public final class ActivityManagerService extends ActivityManagerNative
mUserSwitchObservers.finishBroadcast();
}
- void timeoutUserSwitch(UserStartedState uss, int oldUserId, int newUserId) {
+ void timeoutUserSwitch(UserState uss, int oldUserId, int newUserId) {
synchronized (this) {
Slog.w(TAG, "User switch timeout: from " + oldUserId + " to " + newUserId);
sendContinueUserSwitchLocked(uss, oldUserId, newUserId);
}
}
- void sendContinueUserSwitchLocked(UserStartedState uss, int oldUserId, int newUserId) {
+ void sendContinueUserSwitchLocked(UserState uss, int oldUserId, int newUserId) {
mCurUserSwitchCallback = null;
mHandler.removeMessages(USER_SWITCH_TIMEOUT_MSG);
mHandler.sendMessage(mHandler.obtainMessage(CONTINUE_USER_SWITCH_MSG,
oldUserId, newUserId, uss));
}
- void onUserInitialized(UserStartedState uss, boolean foreground, int oldUserId, int newUserId) {
+ void onUserInitialized(UserState uss, boolean foreground, int oldUserId, int newUserId) {
synchronized (this) {
if (foreground) {
moveUserToForeground(uss, oldUserId, newUserId);
@@ -19837,7 +19856,7 @@ public final class ActivityManagerService extends ActivityManagerNative
completeSwitchAndInitalize(uss, newUserId, true, false);
}
- void moveUserToForeground(UserStartedState uss, int oldUserId, int newUserId) {
+ void moveUserToForeground(UserState uss, int oldUserId, int newUserId) {
boolean homeInFront = mStackSupervisor.switchUserLocked(newUserId, uss);
if (homeInFront) {
startHomeActivityLocked(newUserId, "moveUserToFroreground");
@@ -19849,11 +19868,11 @@ public final class ActivityManagerService extends ActivityManagerNative
sendUserSwitchBroadcastsLocked(oldUserId, newUserId);
}
- void continueUserSwitch(UserStartedState uss, int oldUserId, int newUserId) {
+ void continueUserSwitch(UserState uss, int oldUserId, int newUserId) {
completeSwitchAndInitalize(uss, newUserId, false, true);
}
- void completeSwitchAndInitalize(UserStartedState uss, int newUserId,
+ void completeSwitchAndInitalize(UserState uss, int newUserId,
boolean clearInitializing, boolean clearSwitching) {
boolean unfrozen = false;
synchronized (this) {
@@ -19890,10 +19909,10 @@ public final class ActivityManagerService extends ActivityManagerNative
final int num = mUserLru.size();
for (int i = 0; i < num; i++) {
Integer oldUserId = mUserLru.get(i);
- UserStartedState oldUss = mStartedUsers.get(oldUserId);
+ UserState oldUss = mStartedUsers.get(oldUserId);
if (oldUserId == UserHandle.USER_OWNER || oldUserId == mCurrentUserId
- || oldUss.mState == UserStartedState.STATE_STOPPING
- || oldUss.mState == UserStartedState.STATE_SHUTDOWN) {
+ || oldUss.mState == UserState.STATE_STOPPING
+ || oldUss.mState == UserState.STATE_SHUTDOWN) {
continue;
}
UserInfo userInfo = mUserManager.getUserInfo(oldUserId);
@@ -19934,11 +19953,11 @@ public final class ActivityManagerService extends ActivityManagerNative
}
}
- void finishUserBoot(UserStartedState uss) {
+ void finishUserBoot(UserState uss) {
synchronized (this) {
- if (uss.mState == UserStartedState.STATE_BOOTING
+ if (uss.mState == UserState.STATE_BOOTING
&& mStartedUsers.get(uss.mHandle.getIdentifier()) == uss) {
- uss.mState = UserStartedState.STATE_RUNNING;
+ uss.mState = UserState.STATE_RUNNING;
final int userId = uss.mHandle.getIdentifier();
Intent intent = new Intent(Intent.ACTION_BOOT_COMPLETED, null);
intent.putExtra(Intent.EXTRA_USER_HANDLE, userId);
@@ -19951,7 +19970,7 @@ public final class ActivityManagerService extends ActivityManagerNative
}
}
- void finishUserSwitch(UserStartedState uss) {
+ void finishUserSwitch(UserState uss) {
synchronized (this) {
finishUserBoot(uss);
@@ -19961,15 +19980,15 @@ public final class ActivityManagerService extends ActivityManagerNative
int i = 0;
while (num > MAX_RUNNING_USERS && i < mUserLru.size()) {
Integer oldUserId = mUserLru.get(i);
- UserStartedState oldUss = mStartedUsers.get(oldUserId);
+ UserState oldUss = mStartedUsers.get(oldUserId);
if (oldUss == null) {
// Shouldn't happen, but be sane if it does.
mUserLru.remove(i);
num--;
continue;
}
- if (oldUss.mState == UserStartedState.STATE_STOPPING
- || oldUss.mState == UserStartedState.STATE_SHUTDOWN) {
+ if (oldUss.mState == UserState.STATE_STOPPING
+ || oldUss.mState == UserState.STATE_SHUTDOWN) {
// This user is already stopping, doesn't count.
num--;
i++;
@@ -20014,7 +20033,7 @@ public final class ActivityManagerService extends ActivityManagerNative
return ActivityManager.USER_OP_IS_CURRENT;
}
- final UserStartedState uss = mStartedUsers.get(userId);
+ final UserState uss = mStartedUsers.get(userId);
if (uss == null) {
// User is not started, nothing to do... but we do need to
// callback if requested.
@@ -20036,9 +20055,9 @@ public final class ActivityManagerService extends ActivityManagerNative
uss.mStopCallbacks.add(callback);
}
- if (uss.mState != UserStartedState.STATE_STOPPING
- && uss.mState != UserStartedState.STATE_SHUTDOWN) {
- uss.mState = UserStartedState.STATE_STOPPING;
+ if (uss.mState != UserState.STATE_STOPPING
+ && uss.mState != UserState.STATE_SHUTDOWN) {
+ uss.mState = UserState.STATE_STOPPING;
updateStartedUserArrayLocked();
long ident = Binder.clearCallingIdentity();
@@ -20066,11 +20085,11 @@ public final class ActivityManagerService extends ActivityManagerNative
Bundle extras, boolean ordered, boolean sticky, int sendingUser) {
// On to the next.
synchronized (ActivityManagerService.this) {
- if (uss.mState != UserStartedState.STATE_STOPPING) {
+ if (uss.mState != UserState.STATE_STOPPING) {
// Whoops, we are being started back up. Abort, abort!
return;
}
- uss.mState = UserStartedState.STATE_SHUTDOWN;
+ uss.mState = UserState.STATE_SHUTDOWN;
}
mBatteryStatsService.noteEvent(
BatteryStats.HistoryItem.EVENT_USER_RUNNING_FINISH,
@@ -20094,7 +20113,7 @@ public final class ActivityManagerService extends ActivityManagerNative
return ActivityManager.USER_OP_SUCCESS;
}
- void finishUserStop(UserStartedState uss) {
+ void finishUserStop(UserState uss) {
final int userId = uss.mHandle.getIdentifier();
boolean stopped;
ArrayList<IStopUserCallback> callbacks;
@@ -20102,7 +20121,7 @@ public final class ActivityManagerService extends ActivityManagerNative
callbacks = new ArrayList<IStopUserCallback>(uss.mStopCallbacks);
if (mStartedUsers.get(userId) != uss) {
stopped = false;
- } else if (uss.mState != UserStartedState.STATE_SHUTDOWN) {
+ } else if (uss.mState != UserState.STATE_SHUTDOWN) {
stopped = false;
} else {
stopped = true;
@@ -20176,15 +20195,15 @@ public final class ActivityManagerService extends ActivityManagerNative
}
boolean isUserRunningLocked(int userId, boolean orStopped) {
- UserStartedState state = mStartedUsers.get(userId);
+ UserState state = mStartedUsers.get(userId);
if (state == null) {
return false;
}
if (orStopped) {
return true;
}
- return state.mState != UserStartedState.STATE_STOPPING
- && state.mState != UserStartedState.STATE_SHUTDOWN;
+ return state.mState != UserState.STATE_STOPPING
+ && state.mState != UserState.STATE_SHUTDOWN;
}
@Override
@@ -20206,19 +20225,19 @@ public final class ActivityManagerService extends ActivityManagerNative
private void updateStartedUserArrayLocked() {
int num = 0;
for (int i=0; i<mStartedUsers.size(); i++) {
- UserStartedState uss = mStartedUsers.valueAt(i);
+ UserState uss = mStartedUsers.valueAt(i);
// This list does not include stopping users.
- if (uss.mState != UserStartedState.STATE_STOPPING
- && uss.mState != UserStartedState.STATE_SHUTDOWN) {
+ if (uss.mState != UserState.STATE_STOPPING
+ && uss.mState != UserState.STATE_SHUTDOWN) {
num++;
}
}
mStartedUserArray = new int[num];
num = 0;
for (int i=0; i<mStartedUsers.size(); i++) {
- UserStartedState uss = mStartedUsers.valueAt(i);
- if (uss.mState != UserStartedState.STATE_STOPPING
- && uss.mState != UserStartedState.STATE_SHUTDOWN) {
+ UserState uss = mStartedUsers.valueAt(i);
+ if (uss.mState != UserState.STATE_STOPPING
+ && uss.mState != UserState.STATE_SHUTDOWN) {
mStartedUserArray[num] = mStartedUsers.keyAt(i);
num++;
}
diff --git a/services/core/java/com/android/server/am/ActivityStackSupervisor.java b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
index 9e33f2a..c54a96d 100644
--- a/services/core/java/com/android/server/am/ActivityStackSupervisor.java
+++ b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
@@ -233,10 +233,10 @@ public final class ActivityStackSupervisor implements DisplayListener {
final ArrayList<ActivityRecord> mGoingToSleepActivities = new ArrayList<>();
/** Used on user changes */
- final ArrayList<UserStartedState> mStartingUsers = new ArrayList<>();
+ final ArrayList<UserState> mStartingUsers = new ArrayList<>();
/** Used to queue up any background users being started */
- final ArrayList<UserStartedState> mStartingBackgroundUsers = new ArrayList<>();
+ final ArrayList<UserState> mStartingBackgroundUsers = new ArrayList<>();
/** Set to indicate whether to issue an onUserLeaving callback when a newly launched activity
* is being brought in front of us. */
@@ -1915,7 +1915,12 @@ public final class ActivityStackSupervisor implements DisplayListener {
ActivityRecord intentActivity = !launchSingleInstance ?
findTaskLocked(r) : findActivityLocked(intent, r.info);
if (intentActivity != null) {
- if (isLockTaskModeViolation(intentActivity.task)) {
+ // When the flags NEW_TASK and CLEAR_TASK are set, then the task gets reused
+ // but still needs to be a lock task mode violation since the task gets
+ // cleared out and the device would otherwise leave the locked task.
+ if (isLockTaskModeViolation(intentActivity.task,
+ (launchFlags & (FLAG_ACTIVITY_NEW_TASK | FLAG_ACTIVITY_CLEAR_TASK))
+ == (FLAG_ACTIVITY_NEW_TASK | FLAG_ACTIVITY_CLEAR_TASK))) {
showLockTaskToast();
Slog.e(TAG, "startActivityUnchecked: Attempt to violate Lock Task Mode");
return ActivityManager.START_RETURN_LOCK_TASK_MODE_VIOLATION;
@@ -2371,7 +2376,7 @@ public final class ActivityStackSupervisor implements DisplayListener {
ArrayList<ActivityRecord> stops = null;
ArrayList<ActivityRecord> finishes = null;
- ArrayList<UserStartedState> startingUsers = null;
+ ArrayList<UserState> startingUsers = null;
int NS = 0;
int NF = 0;
boolean booting = false;
@@ -2468,7 +2473,7 @@ public final class ActivityStackSupervisor implements DisplayListener {
}
// Complete starting up of background users
if (mStartingBackgroundUsers.size() > 0) {
- startingUsers = new ArrayList<UserStartedState>(mStartingBackgroundUsers);
+ startingUsers = new ArrayList<UserState>(mStartingBackgroundUsers);
mStartingBackgroundUsers.clear();
for (int i = 0; i < startingUsers.size(); i++) {
mService.finishUserBoot(startingUsers.get(i));
@@ -3230,7 +3235,7 @@ public final class ActivityStackSupervisor implements DisplayListener {
}
}
- boolean switchUserLocked(int userId, UserStartedState uss) {
+ boolean switchUserLocked(int userId, UserState uss) {
mUserStackInFront.put(mCurrentUser, mFocusedStack.getStackId());
final int restoreStackId = mUserStackInFront.get(userId, HOME_STACK_ID);
mCurrentUser = userId;
@@ -3271,7 +3276,7 @@ public final class ActivityStackSupervisor implements DisplayListener {
* @param userId The user being started in the background
* @param uss The state object for the user.
*/
- public void startBackgroundUserLocked(int userId, UserStartedState uss) {
+ public void startBackgroundUserLocked(int userId, UserState uss) {
mStartingBackgroundUsers.add(uss);
}
@@ -3780,7 +3785,11 @@ public final class ActivityStackSupervisor implements DisplayListener {
}
boolean isLockTaskModeViolation(TaskRecord task) {
- if (getLockedTaskLocked() == task) {
+ return isLockTaskModeViolation(task, false);
+ }
+
+ boolean isLockTaskModeViolation(TaskRecord task, boolean isNewClearTask) {
+ if (getLockedTaskLocked() == task && !isNewClearTask) {
return false;
}
final int lockTaskAuth = task.mLockTaskAuth;
diff --git a/services/core/java/com/android/server/am/UserStartedState.java b/services/core/java/com/android/server/am/UserState.java
index d3e73d5..b3d82bc 100644
--- a/services/core/java/com/android/server/am/UserStartedState.java
+++ b/services/core/java/com/android/server/am/UserState.java
@@ -21,8 +21,9 @@ import java.util.ArrayList;
import android.app.IStopUserCallback;
import android.os.UserHandle;
+import android.util.ArrayMap;
-public final class UserStartedState {
+public final class UserState {
// User is first coming up.
public final static int STATE_BOOTING = 0;
// User is in the normal running state.
@@ -40,7 +41,13 @@ public final class UserStartedState {
public boolean switching;
public boolean initializing;
- public UserStartedState(UserHandle handle, boolean initial) {
+ /**
+ * The last time that a provider was reported to usage stats as being brought to important
+ * foreground procstate.
+ */
+ public final ArrayMap<String,Long> mProviderLastReportedFg = new ArrayMap<>();
+
+ public UserState(UserHandle handle, boolean initial) {
mHandle = handle;
}
diff --git a/services/core/java/com/android/server/content/ContentService.java b/services/core/java/com/android/server/content/ContentService.java
index ea461e5..93ed2ee 100644
--- a/services/core/java/com/android/server/content/ContentService.java
+++ b/services/core/java/com/android/server/content/ContentService.java
@@ -506,6 +506,21 @@ public final class ContentService extends IContentService.Stub {
}
@Override
+ public String[] getSyncAdapterPackagesForAuthorityAsUser(String authority, int userId) {
+ enforceCrossUserPermission(userId,
+ "no permission to read sync settings for user " + userId);
+ // This makes it so that future permission checks will be in the context of this
+ // process rather than the caller's process. We will restore this before returning.
+ final long identityToken = clearCallingIdentity();
+ try {
+ SyncManager syncManager = getSyncManager();
+ return syncManager.getSyncAdapterPackagesForAuthorityAsUser(authority, userId);
+ } finally {
+ restoreCallingIdentity(identityToken);
+ }
+ }
+
+ @Override
public boolean getSyncAutomatically(Account account, String providerName) {
return getSyncAutomaticallyAsUser(account, providerName, UserHandle.getCallingUserId());
}
diff --git a/services/core/java/com/android/server/content/SyncManager.java b/services/core/java/com/android/server/content/SyncManager.java
index 2eb8797..cd9c7fe 100644
--- a/services/core/java/com/android/server/content/SyncManager.java
+++ b/services/core/java/com/android/server/content/SyncManager.java
@@ -908,6 +908,10 @@ public class SyncManager {
return types;
}
+ public String[] getSyncAdapterPackagesForAuthorityAsUser(String authority, int userId) {
+ return mSyncAdapters.getSyncAdapterPackagesForAuthority(authority, userId);
+ }
+
private void sendSyncAlarmMessage() {
if (Log.isLoggable(TAG, Log.VERBOSE)) Log.v(TAG, "sending MESSAGE_SYNC_ALARM");
mSyncHandler.sendEmptyMessage(SyncHandler.MESSAGE_SYNC_ALARM);
diff --git a/services/core/java/com/android/server/pm/DefaultPermissionGrantPolicy.java b/services/core/java/com/android/server/pm/DefaultPermissionGrantPolicy.java
new file mode 100644
index 0000000..fe3103b
--- /dev/null
+++ b/services/core/java/com/android/server/pm/DefaultPermissionGrantPolicy.java
@@ -0,0 +1,521 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.pm;
+
+import android.Manifest;
+import android.content.Intent;
+import android.content.pm.ApplicationInfo;
+import android.content.pm.PackageManager;
+import android.content.pm.PackageManagerInternal.PackagesProvider;
+import android.content.pm.PackageParser;
+import android.content.pm.ResolveInfo;
+import android.net.Uri;
+import android.os.Build;
+import android.os.UserHandle;
+import android.provider.MediaStore;
+import android.util.ArraySet;
+import android.util.Log;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+import static android.os.Process.FIRST_APPLICATION_UID;
+
+/**
+ * This class is the policy for granting runtime permissions to
+ * platform components and default handlers in the system such
+ * that the device is usable out-of-the-box. For example, the
+ * shell UID is a part of the system and the Phone app should
+ * have phone related permission by default.
+ */
+final class DefaultPermissionGrantPolicy {
+ private static final String TAG = "DefaultPermissionGrantPolicy";
+ private static final boolean DEBUG = false;
+
+ private static final String PACKAGE_MIME_TYPE = "application/vnd.android.package-archive";
+
+ private static final Set<String> PHONE_PERMISSIONS = new ArraySet<>();
+ static {
+ PHONE_PERMISSIONS.add(Manifest.permission.READ_PHONE_STATE);
+ PHONE_PERMISSIONS.add(Manifest.permission.CALL_PHONE);
+ PHONE_PERMISSIONS.add( Manifest.permission.READ_CALL_LOG);
+ PHONE_PERMISSIONS.add(Manifest.permission.WRITE_CALL_LOG);
+ PHONE_PERMISSIONS.add(Manifest.permission.ADD_VOICEMAIL);
+ PHONE_PERMISSIONS.add(Manifest.permission.USE_SIP);
+ PHONE_PERMISSIONS.add(Manifest.permission.PROCESS_OUTGOING_CALLS);
+ }
+
+ private static final Set<String> CONTACTS_PERMISSIONS = new ArraySet<>();
+ static {
+ CONTACTS_PERMISSIONS.add(Manifest.permission.READ_CONTACTS);
+ CONTACTS_PERMISSIONS.add(Manifest.permission.WRITE_CONTACTS);
+ }
+
+ private static final Set<String> LOCATION_PERMISSIONS = new ArraySet<>();
+ static {
+ LOCATION_PERMISSIONS.add(Manifest.permission.ACCESS_FINE_LOCATION);
+ LOCATION_PERMISSIONS.add(Manifest.permission.ACCESS_COARSE_LOCATION);
+ }
+
+ private static final Set<String> CALENDAR_PERMISSIONS = new ArraySet<>();
+ static {
+ CALENDAR_PERMISSIONS.add(Manifest.permission.READ_CALENDAR);
+ CALENDAR_PERMISSIONS.add(Manifest.permission.WRITE_CALENDAR);
+ }
+
+ private static final Set<String> SMS_PERMISSIONS = new ArraySet<>();
+ static {
+ SMS_PERMISSIONS.add(Manifest.permission.SEND_SMS);
+ SMS_PERMISSIONS.add(Manifest.permission.RECEIVE_SMS);
+ SMS_PERMISSIONS.add(Manifest.permission.READ_SMS);
+ SMS_PERMISSIONS.add(Manifest.permission.RECEIVE_WAP_PUSH);
+ SMS_PERMISSIONS.add(Manifest.permission.RECEIVE_MMS);
+ SMS_PERMISSIONS.add(Manifest.permission.READ_CELL_BROADCASTS);
+ }
+
+ private static final Set<String> MICROPHONE_PERMISSIONS = new ArraySet<>();
+ static {
+ MICROPHONE_PERMISSIONS.add(Manifest.permission.RECORD_AUDIO);
+ }
+
+ private static final Set<String> CAMERA_PERMISSIONS = new ArraySet<>();
+ static {
+ CAMERA_PERMISSIONS.add(Manifest.permission.CAMERA);
+ }
+
+ private static final Set<String> SENSORS_PERMISSIONS = new ArraySet<>();
+ static {
+ SENSORS_PERMISSIONS.add(Manifest.permission.BODY_SENSORS);
+ }
+
+ private static final Set<String> STORAGE_PERMISSIONS = new ArraySet<>();
+ static {
+// STORAGE_PERMISSIONS.add(Manifest.permission.READ_EXTERNAL_STORAGE);
+ STORAGE_PERMISSIONS.add(Manifest.permission.WRITE_EXTERNAL_STORAGE);
+ }
+
+ private static final Set<String> SETTINGS_PERMISSIONS = new ArraySet<>();
+ static {
+ SETTINGS_PERMISSIONS.add(Manifest.permission.WRITE_SETTINGS);
+ }
+
+ private static final Set<String> INSTALLER_PERMISSIONS = new ArraySet<>();
+ static {
+ INSTALLER_PERMISSIONS.add(Manifest.permission.GRANT_REVOKE_PERMISSIONS);
+ INSTALLER_PERMISSIONS.add(Manifest.permission.INTERACT_ACROSS_USERS_FULL);
+ INSTALLER_PERMISSIONS.add(Manifest.permission.CLEAR_APP_USER_DATA);
+ INSTALLER_PERMISSIONS.add(Manifest.permission.KILL_UID);
+ }
+
+ private static final Set<String> VERIFIER_PERMISSIONS = new ArraySet<>();
+ static {
+ INSTALLER_PERMISSIONS.add(Manifest.permission.GRANT_REVOKE_PERMISSIONS);
+ }
+
+ private final PackageManagerService mService;
+
+ private PackagesProvider mImePackagesProvider;
+ private PackagesProvider mLocationPackagesProvider;
+ private PackagesProvider mVoiceInteractionPackagesProvider;
+
+ public DefaultPermissionGrantPolicy(PackageManagerService service) {
+ mService = service;
+ }
+
+ public void setImePackagesProviderLPr(PackagesProvider provider) {
+ mImePackagesProvider = provider;
+ }
+
+ public void setLocationPackagesProviderLPw(PackagesProvider provider) {
+ mLocationPackagesProvider = provider;
+ }
+
+ public void setVoiceInteractionPackagesProviderLPw(PackagesProvider provider) {
+ mVoiceInteractionPackagesProvider = provider;
+ }
+
+ public void grantDefaultPermissions(int userId) {
+ grantPermissionsToSysComponentsAndPrivApps(userId);
+ grantDefaultSystemHandlerPermissions(userId);
+ }
+
+ private void grantPermissionsToSysComponentsAndPrivApps(int userId) {
+ Log.i(TAG, "Granting permissions to platform components");
+
+ synchronized (mService.mPackages) {
+ for (PackageParser.Package pkg : mService.mPackages.values()) {
+ if (!isSysComponentOrPersistentPrivApp(pkg)
+ || !doesPackageSupportRuntimePermissions(pkg)) {
+ continue;
+ }
+ final int permissionCount = pkg.requestedPermissions.size();
+ for (int i = 0; i < permissionCount; i++) {
+ String permission = pkg.requestedPermissions.get(i);
+ BasePermission bp = mService.mSettings.mPermissions.get(permission);
+ if (bp != null && bp.isRuntime()) {
+ final int flags = mService.getPermissionFlags(permission,
+ pkg.packageName, userId);
+ if ((flags & PackageManager.FLAG_PERMISSION_SYSTEM_FIXED) == 0) {
+ mService.grantRuntimePermission(pkg.packageName, permission, userId);
+ mService.updatePermissionFlags(permission, pkg.packageName,
+ PackageManager.MASK_PERMISSION_FLAGS,
+ PackageManager.FLAG_PERMISSION_SYSTEM_FIXED, userId);
+ if (DEBUG) {
+ Log.i(TAG, "Granted " + permission + " to system component "
+ + pkg.packageName);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ private void grantDefaultSystemHandlerPermissions(int userId) {
+ Log.i(TAG, "Granting permissions to default platform handlers");
+
+ final PackagesProvider imePackagesProvider;
+ final PackagesProvider locationPackagesProvider;
+ final PackagesProvider voiceInteractionPackagesProvider;
+
+ synchronized (mService.mPackages) {
+ imePackagesProvider = mImePackagesProvider;
+ locationPackagesProvider = mLocationPackagesProvider;
+ voiceInteractionPackagesProvider = mVoiceInteractionPackagesProvider;
+ }
+
+ String[] imePackageNames = (imePackagesProvider != null)
+ ? imePackagesProvider.getPackages(userId) : null;
+ String[] voiceInteractPackageNames = (voiceInteractionPackagesProvider != null)
+ ? voiceInteractionPackagesProvider.getPackages(userId) : null;
+ String[] locationPackageNames = (locationPackagesProvider != null)
+ ? locationPackagesProvider.getPackages(userId) : null;
+
+ synchronized (mService.mPackages) {
+ // Installers
+ Intent installerIntent = new Intent(Intent.ACTION_INSTALL_PACKAGE);
+ installerIntent.addCategory(Intent.CATEGORY_DEFAULT);
+ installerIntent.setDataAndType(Uri.fromFile(new File("foo.apk")),
+ PACKAGE_MIME_TYPE);
+ List<PackageParser.Package> installerPackages =
+ getPrivilegedHandlerActivityPackagesLPr(installerIntent, userId);
+ final int installerCount = installerPackages.size();
+ for (int i = 0; i < installerCount; i++) {
+ PackageParser.Package installPackage = installerPackages.get(i);
+ grantInstallPermissionsLPw(installPackage, INSTALLER_PERMISSIONS, userId);
+ }
+
+ // Verifiers
+ Intent verifierIntent = new Intent(Intent.ACTION_PACKAGE_NEEDS_VERIFICATION);
+ verifierIntent.setType(PACKAGE_MIME_TYPE);
+ List<PackageParser.Package> verifierPackages =
+ getPrivilegedHandlerReceiverPackagesLPr(verifierIntent, userId);
+ final int verifierCount = verifierPackages.size();
+ for (int i = 0; i < verifierCount; i++) {
+ PackageParser.Package verifierPackage = verifierPackages.get(i);
+ grantInstallPermissionsLPw(verifierPackage, VERIFIER_PERMISSIONS, userId);
+ }
+
+ // SetupWizard
+ Intent setupIntent = new Intent(Intent.ACTION_MAIN);
+ setupIntent.addCategory(Intent.CATEGORY_HOME);
+ PackageParser.Package setupPackage = getDefaultSystemHandlerActvityPackageLPr(
+ setupIntent, userId);
+ if (setupPackage != null
+ && doesPackageSupportRuntimePermissions(setupPackage)) {
+ grantRuntimePermissionsLPw(setupPackage, PHONE_PERMISSIONS, userId);
+ grantRuntimePermissionsLPw(setupPackage, CONTACTS_PERMISSIONS, userId);
+ grantRuntimePermissionsLPw(setupPackage, SETTINGS_PERMISSIONS, userId);
+ }
+
+ // Phone
+ Intent dialerIntent = new Intent(Intent.ACTION_DIAL);
+ PackageParser.Package dialerPackage = getDefaultSystemHandlerActvityPackageLPr(
+ dialerIntent, userId);
+ if (dialerPackage != null
+ && doesPackageSupportRuntimePermissions(dialerPackage)) {
+ grantRuntimePermissionsLPw(dialerPackage, PHONE_PERMISSIONS, userId);
+ grantRuntimePermissionsLPw(dialerPackage, CONTACTS_PERMISSIONS, userId);
+ grantRuntimePermissionsLPw(dialerPackage, SMS_PERMISSIONS, userId);
+ grantRuntimePermissionsLPw(dialerPackage, MICROPHONE_PERMISSIONS, userId);
+ }
+
+ // Camera
+ Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
+ PackageParser.Package cameraPackage = getDefaultSystemHandlerActvityPackageLPr(
+ cameraIntent, userId);
+ if (cameraPackage != null
+ && doesPackageSupportRuntimePermissions(cameraPackage)) {
+ grantRuntimePermissionsLPw(cameraPackage, CAMERA_PERMISSIONS, userId);
+ grantRuntimePermissionsLPw(cameraPackage, MICROPHONE_PERMISSIONS, userId);
+ }
+
+ // Messaging
+ Intent messagingIntent = new Intent(Intent.ACTION_MAIN);
+ messagingIntent.addCategory(Intent.CATEGORY_APP_MESSAGING);
+ PackageParser.Package messagingPackage = getDefaultSystemHandlerActvityPackageLPr(
+ messagingIntent, userId);
+ if (messagingPackage != null
+ && doesPackageSupportRuntimePermissions(messagingPackage)) {
+ grantRuntimePermissionsLPw(messagingPackage, PHONE_PERMISSIONS, userId);
+ grantRuntimePermissionsLPw(messagingPackage, CONTACTS_PERMISSIONS, userId);
+ grantRuntimePermissionsLPw(messagingPackage, SMS_PERMISSIONS, userId);
+ }
+
+ // Calendar
+ Intent calendarIntent = new Intent(Intent.ACTION_MAIN);
+ calendarIntent.addCategory(Intent.CATEGORY_APP_CALENDAR);
+ PackageParser.Package calendarPackage = getDefaultSystemHandlerActvityPackageLPr(
+ calendarIntent, userId);
+ if (calendarPackage != null
+ && doesPackageSupportRuntimePermissions(calendarPackage)) {
+ grantRuntimePermissionsLPw(calendarPackage, CALENDAR_PERMISSIONS, userId);
+ grantRuntimePermissionsLPw(calendarPackage, CONTACTS_PERMISSIONS, userId);
+ }
+
+ // Contacts
+ Intent contactsIntent = new Intent(Intent.ACTION_MAIN);
+ contactsIntent.addCategory(Intent.CATEGORY_APP_CONTACTS);
+ PackageParser.Package contactsPackage = getDefaultSystemHandlerActvityPackageLPr(
+ contactsIntent, userId);
+ if (contactsPackage != null
+ && doesPackageSupportRuntimePermissions(contactsPackage)) {
+ grantRuntimePermissionsLPw(contactsPackage, CONTACTS_PERMISSIONS, userId);
+ grantRuntimePermissionsLPw(contactsPackage, PHONE_PERMISSIONS, userId);
+ }
+
+ // Maps
+ Intent mapsIntent = new Intent(Intent.ACTION_MAIN);
+ mapsIntent.addCategory(Intent.CATEGORY_APP_MAPS);
+ PackageParser.Package mapsPackage = getDefaultSystemHandlerActvityPackageLPr(
+ mapsIntent, userId);
+ if (mapsPackage != null
+ && doesPackageSupportRuntimePermissions(mapsPackage)) {
+ grantRuntimePermissionsLPw(mapsPackage, LOCATION_PERMISSIONS, userId);
+ }
+
+ // Email
+ Intent emailIntent = new Intent(Intent.ACTION_MAIN);
+ emailIntent.addCategory(Intent.CATEGORY_APP_EMAIL);
+ PackageParser.Package emailPackage = getDefaultSystemHandlerActvityPackageLPr(
+ emailIntent, userId);
+ if (emailPackage != null
+ && doesPackageSupportRuntimePermissions(emailPackage)) {
+ grantRuntimePermissionsLPw(emailPackage, CONTACTS_PERMISSIONS, userId);
+ }
+
+ // Browser
+ Intent browserIntent = new Intent(Intent.ACTION_MAIN);
+ browserIntent.addCategory(Intent.CATEGORY_APP_BROWSER);
+ PackageParser.Package browserPackage = getDefaultSystemHandlerActvityPackageLPr(
+ browserIntent, userId);
+ if (browserPackage != null
+ && doesPackageSupportRuntimePermissions(browserPackage)) {
+ grantRuntimePermissionsLPw(browserPackage, LOCATION_PERMISSIONS, userId);
+ }
+
+ // IME
+ if (imePackageNames != null) {
+ for (String imePackageName : imePackageNames) {
+ PackageParser.Package imePackage = getSystemPackageLPr(imePackageName);
+ if (imePackage != null
+ && doesPackageSupportRuntimePermissions(imePackage)) {
+ grantRuntimePermissionsLPw(imePackage, CONTACTS_PERMISSIONS, userId);
+ }
+ }
+ }
+
+ // Voice interaction
+ if (voiceInteractPackageNames != null) {
+ for (String voiceInteractPackageName : voiceInteractPackageNames) {
+ PackageParser.Package voiceInteractPackage = getSystemPackageLPr(
+ voiceInteractPackageName);
+ if (voiceInteractPackage != null
+ && doesPackageSupportRuntimePermissions(voiceInteractPackage)) {
+ grantRuntimePermissionsLPw(voiceInteractPackage,
+ CONTACTS_PERMISSIONS, userId);
+ grantRuntimePermissionsLPw(voiceInteractPackage,
+ CALENDAR_PERMISSIONS, userId);
+ grantRuntimePermissionsLPw(voiceInteractPackage,
+ MICROPHONE_PERMISSIONS, userId);
+ grantRuntimePermissionsLPw(voiceInteractPackage,
+ PHONE_PERMISSIONS, userId);
+ grantRuntimePermissionsLPw(voiceInteractPackage,
+ SMS_PERMISSIONS, userId);
+ grantRuntimePermissionsLPw(voiceInteractPackage,
+ LOCATION_PERMISSIONS, userId);
+ }
+ }
+ }
+
+ // Location
+ if (locationPackageNames != null) {
+ for (String packageName : locationPackageNames) {
+ PackageParser.Package locationPackage = getSystemPackageLPr(packageName);
+ if (locationPackage != null
+ && doesPackageSupportRuntimePermissions(locationPackage)) {
+ grantRuntimePermissionsLPw(locationPackage, CONTACTS_PERMISSIONS, userId);
+ grantRuntimePermissionsLPw(locationPackage, CALENDAR_PERMISSIONS, userId);
+ grantRuntimePermissionsLPw(locationPackage, MICROPHONE_PERMISSIONS, userId);
+ grantRuntimePermissionsLPw(locationPackage, PHONE_PERMISSIONS, userId);
+ grantRuntimePermissionsLPw(locationPackage, SMS_PERMISSIONS, userId);
+ grantRuntimePermissionsLPw(locationPackage, LOCATION_PERMISSIONS, userId);
+ grantRuntimePermissionsLPw(locationPackage, CAMERA_PERMISSIONS, userId);
+ grantRuntimePermissionsLPw(locationPackage, SENSORS_PERMISSIONS, userId);
+ grantRuntimePermissionsLPw(locationPackage, STORAGE_PERMISSIONS, userId);
+ }
+ }
+ }
+ }
+ }
+
+ private List<PackageParser.Package> getPrivilegedHandlerReceiverPackagesLPr(
+ Intent intent, int userId) {
+ List<ResolveInfo> handlers = mService.queryIntentReceivers(
+ intent, intent.resolveTypeIfNeeded(mService.mContext.getContentResolver()),
+ 0, userId);
+ return getPrivilegedPackages(handlers);
+ }
+
+ private List<PackageParser.Package> getPrivilegedHandlerActivityPackagesLPr(
+ Intent intent, int userId) {
+ List<ResolveInfo> handlers = mService.queryIntentActivities(
+ intent, intent.resolveTypeIfNeeded(mService.mContext.getContentResolver()),
+ 0, userId);
+ return getPrivilegedPackages(handlers);
+ }
+
+ private List<PackageParser.Package> getPrivilegedPackages(List<ResolveInfo> resolveInfos) {
+ List<PackageParser.Package> handlerPackages = new ArrayList<>();
+ final int handlerCount = resolveInfos.size();
+ for (int i = 0; i < handlerCount; i++) {
+ ResolveInfo handler = resolveInfos.get(i);
+ PackageParser.Package handlerPackage = getPrivilegedPackageLPr(
+ handler.activityInfo.packageName);
+ if (handlerPackage != null) {
+ handlerPackages.add(handlerPackage);
+ }
+ }
+ return handlerPackages;
+ }
+
+ private PackageParser.Package getDefaultSystemHandlerActvityPackageLPr(
+ Intent intent, int userId) {
+ List<ResolveInfo> handlers = mService.queryIntentActivities(intent, null, 0, userId);
+ final int handlerCount = handlers.size();
+ for (int i = 0; i < handlerCount; i++) {
+ ResolveInfo handler = handlers.get(i);
+ // TODO: This is a temporary hack to figure out the setup app.
+ PackageParser.Package handlerPackage = getSystemPackageLPr(
+ handler.activityInfo.packageName);
+ if (handlerPackage != null) {
+ return handlerPackage;
+ }
+ }
+ return null;
+ }
+
+ private PackageParser.Package getSystemPackageLPr(String packageName) {
+ PackageParser.Package pkg = mService.mPackages.get(packageName);
+ if (pkg != null && pkg.isSystemApp()) {
+ return !isSysComponentOrPersistentPrivApp(pkg) ? pkg : null;
+ }
+ return null;
+ }
+
+ private PackageParser.Package getPrivilegedPackageLPr(String packageName) {
+ PackageParser.Package pkg = mService.mPackages.get(packageName);
+ if (pkg != null && pkg.applicationInfo.isPrivilegedApp()) {
+ return !isSysComponentOrPersistentPrivApp(pkg) ? pkg : null;
+ }
+ return null;
+ }
+
+ private void grantRuntimePermissionsLPw(PackageParser.Package pkg, Set<String> permissions,
+ int userId) {
+ List<String> requestedPermissions = pkg.requestedPermissions;
+
+ if (pkg.isUpdatedSystemApp()) {
+ PackageSetting sysPs = mService.mSettings.getDisabledSystemPkgLPr(pkg.packageName);
+ if (sysPs != null) {
+ requestedPermissions = sysPs.pkg.requestedPermissions;
+ }
+ }
+
+ final int permissionCount = requestedPermissions.size();
+ for (int i = 0; i < permissionCount; i++) {
+ String permission = requestedPermissions.get(i);
+ if (permissions.contains(permission)) {
+ final int flags = mService.getPermissionFlags(permission, pkg.packageName, userId);
+
+ // If any flags are set to the permission, then it is either set in
+ // its current state by the system or device/profile owner or the user.
+ // In all these cases we do not want to clobber the current state.
+ if (flags == 0) {
+ mService.grantRuntimePermission(pkg.packageName, permission, userId);
+ if (DEBUG) {
+ Log.i(TAG, "Granted " + permission + " to default handler "
+ + pkg.packageName);
+ }
+ }
+ }
+ }
+ }
+
+ private void grantInstallPermissionsLPw(PackageParser.Package pkg, Set<String> permissions,
+ int userId) {
+ List<String> requestedPermissions = pkg.requestedPermissions;
+
+ if (pkg.isUpdatedSystemApp()) {
+ PackageSetting sysPs = mService.mSettings.getDisabledSystemPkgLPr(pkg.packageName);
+ if (sysPs != null) {
+ requestedPermissions = sysPs.pkg.requestedPermissions;
+ }
+ }
+
+ final int permissionCount = requestedPermissions.size();
+ for (int i = 0; i < permissionCount; i++) {
+ String permission = requestedPermissions.get(i);
+ if (permissions.contains(permission)) {
+ final int flags = mService.getPermissionFlags(permission, pkg.packageName, userId);
+
+ // If any flags are set to the permission, then it is either set in
+ // its current state by the system or device/profile owner or the user.
+ // In all these cases we do not want to clobber the current state.
+ if (flags == 0) {
+ mService.grantInstallPermissionLPw(permission, pkg);
+ if (DEBUG) {
+ Log.i(TAG, "Granted install " + permission + " to " + pkg.packageName);
+ }
+ }
+ }
+ }
+ }
+
+ private static boolean isSysComponentOrPersistentPrivApp(PackageParser.Package pkg) {
+ return UserHandle.getAppId(pkg.applicationInfo.uid) < FIRST_APPLICATION_UID
+ || ((pkg.applicationInfo.privateFlags
+ & ApplicationInfo.PRIVATE_FLAG_PRIVILEGED) != 0
+ && (pkg.applicationInfo.flags & ApplicationInfo.FLAG_PERSISTENT) != 0);
+ }
+
+ private static boolean doesPackageSupportRuntimePermissions(PackageParser.Package pkg) {
+ return pkg.applicationInfo.targetSdkVersion > Build.VERSION_CODES.LOLLIPOP_MR1;
+ }
+}
diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java
index 709ae54..5b876ad 100644
--- a/services/core/java/com/android/server/pm/PackageManagerService.java
+++ b/services/core/java/com/android/server/pm/PackageManagerService.java
@@ -55,7 +55,6 @@ import static android.content.pm.PackageManager.MOVE_FAILED_INTERNAL_ERROR;
import static android.content.pm.PackageManager.MOVE_FAILED_OPERATION_PENDING;
import static android.content.pm.PackageManager.MOVE_FAILED_SYSTEM_PACKAGE;
import static android.content.pm.PackageParser.isApkFile;
-import static android.os.Process.FIRST_APPLICATION_UID;
import static android.os.Process.PACKAGE_INFO_GID;
import static android.os.Process.SYSTEM_UID;
import static android.system.OsConstants.O_CREAT;
@@ -111,6 +110,7 @@ import android.content.pm.PackageInfoLite;
import android.content.pm.PackageInstaller;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.LegacyPackageDeleteObserver;
+import android.content.pm.PackageManagerInternal;
import android.content.pm.PackageParser;
import android.content.pm.PackageParser.ActivityIntentInfo;
import android.content.pm.PackageParser.PackageLite;
@@ -281,6 +281,8 @@ public class PackageManagerService extends IPackageManager.Stub {
private static final boolean DEBUG_DEXOPT = false;
private static final boolean DEBUG_ABI_SELECTION = false;
+ static final boolean CLEAR_RUNTIME_PERMISSIONS_ON_UPGRADE = Build.IS_DEBUGGABLE;
+
private static final int RADIO_UID = Process.PHONE_UID;
private static final int LOG_UID = Process.LOG_UID;
private static final int NFC_UID = Process.NFC_UID;
@@ -551,6 +553,9 @@ public class PackageManagerService extends IPackageManager.Stub {
final SparseArray<IntentFilterVerificationState> mIntentFilterVerificationStates
= new SparseArray<IntentFilterVerificationState>();
+ final DefaultPermissionGrantPolicy mDefaultPermissionPolicy =
+ new DefaultPermissionGrantPolicy(this);
+
private interface IntentFilterVerifier<T extends IntentFilter> {
boolean addOneIntentFilterVerification(int verifierId, int userId, int verificationId,
T filter, String packageName);
@@ -2199,6 +2204,9 @@ public class PackageManagerService extends IPackageManager.Stub {
// are all flushed. Not really needed, but keeps things nice and
// tidy.
Runtime.getRuntime().gc();
+
+ // Expose private service for system components to use.
+ LocalServices.addService(PackageManagerInternal.class, new PackageManagerInternalImpl());
}
@Override
@@ -3155,7 +3163,7 @@ public class PackageManagerService extends IPackageManager.Stub {
}
@Override
- public void grantRuntimePermission(String packageName, String name, int userId) {
+ public void grantRuntimePermission(String packageName, String name, final int userId) {
if (!sUserManager.exists(userId)) {
Log.e(TAG, "No such user:" + userId);
return;
@@ -3168,7 +3176,6 @@ public class PackageManagerService extends IPackageManager.Stub {
enforceCrossUserPermission(Binder.getCallingUid(), userId, true, false,
"grantRuntimePermission");
- boolean gidsChanged = false;
final SettingBase sb;
synchronized (mPackages) {
@@ -3204,7 +3211,12 @@ public class PackageManagerService extends IPackageManager.Stub {
}
case PermissionsState.PERMISSION_OPERATION_SUCCESS_GIDS_CHANGED: {
- gidsChanged = true;
+ mHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ killSettingPackagesForUser(sb, userId, KILL_APP_REASON_GIDS_CHANGED);
+ }
+ });
} break;
}
@@ -3213,10 +3225,6 @@ public class PackageManagerService extends IPackageManager.Stub {
// Not critical if that is lost - app has to request again.
mSettings.writeRuntimePermissionsForUserLPr(userId, false);
}
-
- if (gidsChanged) {
- killSettingPackagesForUser(sb, userId, KILL_APP_REASON_GIDS_CHANGED);
- }
}
@Override
@@ -3323,15 +3331,14 @@ public class PackageManagerService extends IPackageManager.Stub {
enforceCrossUserPermission(Binder.getCallingUid(), userId, true, false,
"updatePermissionFlags");
- // Only the system can change policy flags.
+ // Only the system can change policy and system fixed flags.
if (getCallingUid() != Process.SYSTEM_UID) {
flagMask &= ~PackageManager.FLAG_PERMISSION_POLICY_FIXED;
flagValues &= ~PackageManager.FLAG_PERMISSION_POLICY_FIXED;
- }
- // Only the package manager can change system flags.
- flagMask &= ~PackageManager.FLAG_PERMISSION_SYSTEM_FIXED;
- flagValues &= ~PackageManager.FLAG_PERMISSION_SYSTEM_FIXED;
+ flagMask &= ~PackageManager.FLAG_PERMISSION_SYSTEM_FIXED;
+ flagValues &= ~PackageManager.FLAG_PERMISSION_SYSTEM_FIXED;
+ }
synchronized (mPackages) {
final PackageParser.Package pkg = mPackages.get(packageName);
@@ -3409,6 +3416,21 @@ public class PackageManagerService extends IPackageManager.Stub {
return (flags & PackageManager.FLAG_PERMISSION_USER_SET) != 0;
}
+ void grantInstallPermissionLPw(String permission, PackageParser.Package pkg) {
+ BasePermission bp = mSettings.mPermissions.get(permission);
+ if (bp == null) {
+ throw new SecurityException("Missing " + permission + " permission");
+ }
+
+ SettingBase sb = (SettingBase) pkg.mExtras;
+ PermissionsState permissionsState = sb.getPermissionsState();
+
+ if (permissionsState.grantInstallPermission(bp) !=
+ PermissionsState.PERMISSION_OPERATION_FAILURE) {
+ scheduleWriteSettingsLocked();
+ }
+ }
+
@Override
public void addOnPermissionsChangeListener(IOnPermissionsChangeListener listener) {
mContext.enforceCallingOrSelfPermission(
@@ -7753,7 +7775,6 @@ public class PackageManagerService extends IPackageManager.Stub {
final int[] currentUserIds = UserManagerService.getInstance().getUserIds();
- int[] upgradeUserIds = EMPTY_INT_ARRAY;
int[] changedRuntimePermissionUserIds = EMPTY_INT_ARRAY;
boolean changedInstallPermission = false;
@@ -7810,32 +7831,11 @@ public class PackageManagerService extends IPackageManager.Stub {
if (pkg.applicationInfo.targetSdkVersion <= Build.VERSION_CODES.LOLLIPOP_MR1) {
// For legacy apps dangerous permissions are install time ones.
grant = GRANT_INSTALL_LEGACY;
- } else if (ps.isSystem()) {
- final int[] updatedUserIds = ps.getPermissionsUpdatedForUserIds();
- if (origPermissions.hasInstallPermission(bp.name)) {
- // If a system app had an install permission, then the app was
- // upgraded and we grant the permissions as runtime to all users.
- grant = GRANT_UPGRADE;
- upgradeUserIds = currentUserIds;
- } else if (!Arrays.equals(updatedUserIds, currentUserIds)) {
- // If users changed since the last permissions update for a
- // system app, we grant the permission as runtime to the new users.
- grant = GRANT_UPGRADE;
- upgradeUserIds = currentUserIds;
- for (int userId : updatedUserIds) {
- upgradeUserIds = ArrayUtils.removeInt(upgradeUserIds, userId);
- }
- } else {
- // Otherwise, we grant the permission as runtime if the app
- // already had it, i.e. we preserve runtime permissions.
- grant = GRANT_RUNTIME;
- }
} else if (origPermissions.hasInstallPermission(bp.name)) {
// For legacy apps that became modern, install becomes runtime.
grant = GRANT_UPGRADE;
- upgradeUserIds = currentUserIds;
- } else if (replace) {
- // For upgraded modern apps keep runtime permissions unchanged.
+ } else {
+ // For modern apps keep runtime permissions unchanged.
grant = GRANT_RUNTIME;
}
} break;
@@ -7870,7 +7870,7 @@ public class PackageManagerService extends IPackageManager.Stub {
switch (grant) {
case GRANT_INSTALL: {
// Revoke this as runtime permission to handle the case of
- // a runtime permssion being downgraded to an install one.
+ // a runtime permission being downgraded to an install one.
for (int userId : UserManagerService.getInstance().getUserIds()) {
if (origPermissions.getRuntimePermissionState(
bp.name, userId) != null) {
@@ -7901,26 +7901,20 @@ public class PackageManagerService extends IPackageManager.Stub {
case GRANT_RUNTIME: {
// Grant previously granted runtime permissions.
for (int userId : UserManagerService.getInstance().getUserIds()) {
+ PermissionState permissionState = origPermissions
+ .getRuntimePermissionState(bp.name, userId);
+ final int flags = permissionState != null
+ ? permissionState.getFlags() : 0;
if (origPermissions.hasRuntimePermission(bp.name, userId)) {
- PermissionState permissionState = origPermissions
- .getRuntimePermissionState(bp.name, userId);
- final int flags = permissionState.getFlags();
if (permissionsState.grantRuntimePermission(bp, userId) ==
PermissionsState.PERMISSION_OPERATION_FAILURE) {
// If we cannot put the permission as it was, we have to write.
changedRuntimePermissionUserIds = ArrayUtils.appendInt(
changedRuntimePermissionUserIds, userId);
- } else {
- // System components not only get the permissions but
- // they are also fixed, so nothing can change that.
- final int newFlags = !isSystemComponentOrPersistentPrivApp(pkg)
- ? flags
- : flags | PackageManager.FLAG_PERMISSION_SYSTEM_FIXED;
- // Propagate the permission flags.
- permissionsState.updatePermissionFlags(bp, userId,
- newFlags, newFlags);
}
}
+ // Propagate the permission flags.
+ permissionsState.updatePermissionFlags(bp, userId, flags, flags);
}
} break;
@@ -7930,25 +7924,23 @@ public class PackageManagerService extends IPackageManager.Stub {
.getInstallPermissionState(bp.name);
final int flags = permissionState != null ? permissionState.getFlags() : 0;
- origPermissions.revokeInstallPermission(bp);
- // We will be transferring the permission flags, so clear them.
- origPermissions.updatePermissionFlags(bp, UserHandle.USER_ALL,
- PackageManager.MASK_PERMISSION_FLAGS, 0);
+ if (origPermissions.revokeInstallPermission(bp)
+ != PermissionsState.PERMISSION_OPERATION_FAILURE) {
+ // We will be transferring the permission flags, so clear them.
+ origPermissions.updatePermissionFlags(bp, UserHandle.USER_ALL,
+ PackageManager.MASK_PERMISSION_FLAGS, 0);
+ changedInstallPermission = true;
+ }
// If the permission is not to be promoted to runtime we ignore it and
// also its other flags as they are not applicable to install permissions.
if ((flags & PackageManager.FLAG_PERMISSION_REVOKE_ON_UPGRADE) == 0) {
- for (int userId : upgradeUserIds) {
+ for (int userId : currentUserIds) {
if (permissionsState.grantRuntimePermission(bp, userId) !=
PermissionsState.PERMISSION_OPERATION_FAILURE) {
- // System components not only get the permissions but
- // they are also fixed so nothing can change that.
- final int newFlags = !isSystemComponentOrPersistentPrivApp(pkg)
- ? flags
- : flags | PackageManager.FLAG_PERMISSION_SYSTEM_FIXED;
// Transfer the permission flags.
permissionsState.updatePermissionFlags(bp, userId,
- newFlags, newFlags);
+ flags, flags);
// If we granted the permission, we have to write.
changedRuntimePermissionUserIds = ArrayUtils.appendInt(
changedRuntimePermissionUserIds, userId);
@@ -8000,8 +7992,6 @@ public class PackageManagerService extends IPackageManager.Stub {
ps.installPermissionsFixed = true;
}
- ps.setPermissionsUpdatedForUserIds(currentUserIds);
-
// Persist the runtime permissions state for users with changes.
for (int userId : changedRuntimePermissionUserIds) {
mSettings.writeRuntimePermissionsForUserLPr(userId, false);
@@ -11881,13 +11871,6 @@ public class PackageManagerService extends IPackageManager.Stub {
}
}
- private boolean isSystemComponentOrPersistentPrivApp(PackageParser.Package pkg) {
- return UserHandle.getAppId(pkg.applicationInfo.uid) < FIRST_APPLICATION_UID
- || ((pkg.applicationInfo.privateFlags
- & ApplicationInfo.PRIVATE_FLAG_PRIVILEGED) != 0
- && (pkg.applicationInfo.flags & ApplicationInfo.FLAG_PERSISTENT) != 0);
- }
-
private static boolean isMultiArch(PackageSetting ps) {
return (ps.pkgFlags & ApplicationInfo.FLAG_MULTIARCH) != 0;
}
@@ -12500,6 +12483,8 @@ public class PackageManagerService extends IPackageManager.Stub {
if (clearPackagePreferredActivitiesLPw(packageName, removeUser)) {
scheduleWritePackageRestrictionsLocked(removeUser);
}
+ revokeRuntimePermissionsAndClearAllFlagsLocked(ps.getPermissionsState(),
+ removeUser);
}
return true;
}
@@ -12706,13 +12691,37 @@ public class PackageManagerService extends IPackageManager.Stub {
| PackageManager.FLAG_PERMISSION_USER_FIXED
| PackageManager.FLAG_PERMISSION_REVOKE_ON_UPGRADE;
+ revokeRuntimePermissionsAndClearFlagsLocked(permissionsState, userId, userSetFlags);
+ }
+
+ /**
+ * Revokes granted runtime permissions and clears all flags.
+ *
+ * @param permissionsState The permission state to reset.
+ * @param userId The device user for which to do a reset.
+ */
+ private void revokeRuntimePermissionsAndClearAllFlagsLocked(
+ PermissionsState permissionsState, int userId) {
+ revokeRuntimePermissionsAndClearFlagsLocked(permissionsState, userId,
+ PackageManager.MASK_PERMISSION_FLAGS);
+ }
+
+ /**
+ * Revokes granted runtime permissions and clears certain flags.
+ *
+ * @param permissionsState The permission state to reset.
+ * @param userId The device user for which to do a reset.
+ * @param flags The flags that is going to be reset.
+ */
+ private void revokeRuntimePermissionsAndClearFlagsLocked(
+ PermissionsState permissionsState, int userId, int flags) {
boolean needsWrite = false;
for (PermissionState state : permissionsState.getRuntimePermissionStates(userId)) {
BasePermission bp = mSettings.mPermissions.get(state.getName());
if (bp != null) {
permissionsState.revokeRuntimePermission(bp, userId);
- permissionsState.updatePermissionFlags(bp, userId, userSetFlags, 0);
+ permissionsState.updatePermissionFlags(bp, userId, flags, 0);
needsWrite = true;
}
}
@@ -13680,6 +13689,14 @@ public class PackageManagerService extends IPackageManager.Stub {
}
sUserManager.systemReady();
+ // If we upgraded grant all default permissions before kicking off.
+ if (isFirstBoot()) {
+ updatePermissionsLPw(null, null, UPDATE_PERMISSIONS_ALL);
+ for (int userId : UserManagerService.getInstance().getUserIds()) {
+ mDefaultPermissionPolicy.grantDefaultPermissions(userId);
+ }
+ }
+
// Kick off any messages waiting for system ready
if (mPostSystemReadyMessages != null) {
for (Message msg : mPostSystemReadyMessages) {
@@ -15069,9 +15086,16 @@ public class PackageManagerService extends IPackageManager.Stub {
}
}
- void newUserCreatedLILPw(int userHandle) {
- // Adding a user requires updating runtime permissions for system apps.
- updatePermissionsLPw(null, null, UPDATE_PERMISSIONS_ALL);
+ void newUserCreatedLILPw(final int userHandle) {
+ // We cannot grant the default permissions with a lock held as
+ // we query providers from other components for default handlers
+ // such as enabled IMEs, etc.
+ mHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ mDefaultPermissionPolicy.grantDefaultPermissions(userHandle);
+ }
+ });
}
@Override
@@ -15423,4 +15447,27 @@ public class PackageManagerService extends IPackageManager.Stub {
}
}
}
+
+ private class PackageManagerInternalImpl extends PackageManagerInternal {
+ @Override
+ public void setLocationPackagesProvider(PackagesProvider provider) {
+ synchronized (mPackages) {
+ mDefaultPermissionPolicy.setLocationPackagesProviderLPw(provider);
+ }
+ }
+
+ @Override
+ public void setImePackagesProvider(PackagesProvider provider) {
+ synchronized (mPackages) {
+ mDefaultPermissionPolicy.setImePackagesProviderLPr(provider);
+ }
+ }
+
+ @Override
+ public void setVoiceInteractionPackagesProvider(PackagesProvider provider) {
+ synchronized (mPackages) {
+ mDefaultPermissionPolicy.setVoiceInteractionPackagesProviderLPw(provider);
+ }
+ }
+ }
}
diff --git a/services/core/java/com/android/server/pm/PackageSettingBase.java b/services/core/java/com/android/server/pm/PackageSettingBase.java
index f62c00c..6f46f69 100644
--- a/services/core/java/com/android/server/pm/PackageSettingBase.java
+++ b/services/core/java/com/android/server/pm/PackageSettingBase.java
@@ -24,7 +24,6 @@ import android.content.pm.IntentFilterVerificationInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageUserState;
import android.os.storage.VolumeInfo;
-import android.text.TextUtils;
import android.util.ArraySet;
import android.util.SparseArray;
@@ -223,7 +222,6 @@ abstract class PackageSettingBase extends SettingBase {
* Make a shallow copy of this package settings.
*/
public void copyFrom(PackageSettingBase base) {
- setPermissionsUpdatedForUserIds(base.getPermissionsUpdatedForUserIds());
mPermissionsState.copyFrom(base.mPermissionsState);
primaryCpuAbiString = base.primaryCpuAbiString;
secondaryCpuAbiString = base.secondaryCpuAbiString;
diff --git a/services/core/java/com/android/server/pm/SettingBase.java b/services/core/java/com/android/server/pm/SettingBase.java
index c35258a..5cf92a9 100644
--- a/services/core/java/com/android/server/pm/SettingBase.java
+++ b/services/core/java/com/android/server/pm/SettingBase.java
@@ -18,16 +18,11 @@ package com.android.server.pm;
import android.content.pm.ApplicationInfo;
-import java.util.Arrays;
-
abstract class SettingBase {
- private static final int[] USERS_NONE = new int[0];
-
int pkgFlags;
int pkgPrivateFlags;
protected final PermissionsState mPermissionsState;
- private int[] mPermissionsUpdatedForUserIds = USERS_NONE;
SettingBase(int pkgFlags, int pkgPrivateFlags) {
setFlags(pkgFlags);
@@ -39,29 +34,12 @@ abstract class SettingBase {
pkgFlags = base.pkgFlags;
pkgPrivateFlags = base.pkgPrivateFlags;
mPermissionsState = new PermissionsState(base.mPermissionsState);
- setPermissionsUpdatedForUserIds(base.mPermissionsUpdatedForUserIds);
}
public PermissionsState getPermissionsState() {
return mPermissionsState;
}
- public int[] getPermissionsUpdatedForUserIds() {
- return mPermissionsUpdatedForUserIds;
- }
-
- public void setPermissionsUpdatedForUserIds(int[] userIds) {
- if (Arrays.equals(mPermissionsUpdatedForUserIds, userIds)) {
- return;
- }
-
- if (userIds == USERS_NONE) {
- mPermissionsUpdatedForUserIds = userIds;
- } else {
- mPermissionsUpdatedForUserIds = Arrays.copyOf(userIds, userIds.length);
- }
- }
-
void setFlags(int pkgFlags) {
this.pkgFlags = pkgFlags
& (ApplicationInfo.FLAG_SYSTEM
diff --git a/services/core/java/com/android/server/pm/Settings.java b/services/core/java/com/android/server/pm/Settings.java
index cd50946..286bbfe 100644
--- a/services/core/java/com/android/server/pm/Settings.java
+++ b/services/core/java/com/android/server/pm/Settings.java
@@ -1139,17 +1139,6 @@ final class Settings {
return new File(userDir, RUNTIME_PERMISSIONS_FILE_NAME);
}
- boolean isFirstRuntimePermissionsBoot() {
- return !getUserRuntimePermissionsFile(UserHandle.USER_OWNER).exists();
- }
-
- void deleteRuntimePermissionsFiles() {
- for (int userId : UserManagerService.getInstance().getUserIds()) {
- File file = getUserRuntimePermissionsFile(userId);
- file.delete();
- }
- }
-
private File getUserPackagesStateBackupFile(int userId) {
return new File(Environment.getUserSystemDirectory(userId),
"package-restrictions-backup.xml");
@@ -2098,7 +2087,7 @@ final class Settings {
}
final ApplicationInfo ai = pkg.pkg.applicationInfo;
- final String dataPath = ai.dataDir;
+ final String dataPath = new File(ai.dataDir).getCanonicalPath();
final boolean isDebug = (ai.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0;
final int[] gids = pkg.getPermissionsState().computeGids(userIds);
@@ -2466,6 +2455,22 @@ final class Settings {
} catch (NumberFormatException e) {
}
mFingerprint = parser.getAttributeValue(null, "fingerprint");
+
+ // If the build is setup to drop runtime permissions
+ // on update drop the files before loading them.
+ if (PackageManagerService.CLEAR_RUNTIME_PERMISSIONS_ON_UPGRADE) {
+ if (!Build.FINGERPRINT.equals(mFingerprint)) {
+ if (users == null) {
+ mRuntimePermissionsPersistence.deleteUserRuntimePermissionsFile(
+ UserHandle.USER_OWNER);
+ } else {
+ for (UserInfo user : users) {
+ mRuntimePermissionsPersistence.deleteUserRuntimePermissionsFile(
+ user.id);
+ }
+ }
+ }
+ }
} else if (tagName.equals("database-version")) {
mInternalDatabaseVersion = mExternalDatabaseVersion = 0;
try {
@@ -2554,15 +2559,21 @@ final class Settings {
} else {
if (users == null) {
readPackageRestrictionsLPr(0);
- mRuntimePermissionsPersistence.readStateForUserSyncLPr(UserHandle.USER_OWNER);
} else {
for (UserInfo user : users) {
readPackageRestrictionsLPr(user.id);
- mRuntimePermissionsPersistence.readStateForUserSyncLPr(user.id);
}
}
}
+ if (users == null) {
+ mRuntimePermissionsPersistence.readStateForUserSyncLPr(UserHandle.USER_OWNER);
+ } else {
+ for (UserInfo user : users) {
+ mRuntimePermissionsPersistence.readStateForUserSyncLPr(user.id);
+ }
+ }
+
/*
* Make sure all the updated system packages have their shared users
* associated with them.
@@ -3056,18 +3067,6 @@ final class Settings {
}
}
- // We keep track for which users we granted permissions to be able
- // to grant runtime permissions to system apps for newly appeared
- // users or newly appeared system apps. If we supported runtime
- // permissions during the previous boot, then we already granted
- // permissions for all device users. In such a case we set the users
- // for which we granted permissions to avoid clobbering of runtime
- // permissions we granted to system apps but the user revoked later.
- if (!isFirstRuntimePermissionsBoot()) {
- final int[] userIds = UserManagerService.getInstance().getUserIds();
- ps.setPermissionsUpdatedForUserIds(userIds);
- }
-
mDisabledSysPackages.put(name, ps);
}
@@ -3364,18 +3363,6 @@ final class Settings {
XmlUtils.skipCurrentTag(parser);
}
}
-
- // We keep track for which users we granted permissions to be able
- // to grant runtime permissions to system apps for newly appeared
- // users or newly appeared system apps. If we supported runtime
- // permissions during the previous boot, then we already granted
- // permissions for all device users. In such a case we set the users
- // for which we granted permissions to avoid clobbering of runtime
- // permissions we granted to system apps but the user revoked later.
- if (!isFirstRuntimePermissionsBoot()) {
- final int[] userIds = UserManagerService.getInstance().getUserIds();
- packageSetting.setPermissionsUpdatedForUserIds(userIds);
- }
} else {
XmlUtils.skipCurrentTag(parser);
}
@@ -3493,18 +3480,6 @@ final class Settings {
XmlUtils.skipCurrentTag(parser);
}
}
-
- // We keep track for which users we granted permissions to be able
- // to grant runtime permissions to system apps for newly appeared
- // users or newly appeared system apps. If we supported runtime
- // permissions during the previous boot, then we already granted
- // permissions for all device users. In such a case we set the users
- // for which we granted permissions to avoid clobbering of runtime
- // permissions we granted to system apps but the user revoked later.
- if (!isFirstRuntimePermissionsBoot()) {
- final int[] userIds = UserManagerService.getInstance().getUserIds();
- su.setPermissionsUpdatedForUserIds(userIds);
- }
} else {
XmlUtils.skipCurrentTag(parser);
}
@@ -4397,6 +4372,10 @@ final class Settings {
}
}
+ public void deleteUserRuntimePermissionsFile(int userId) {
+ getUserRuntimePermissionsFile(userId).delete();
+ }
+
public void readStateForUserSyncLPr(int userId) {
File permissionsFile = getUserRuntimePermissionsFile(userId);
if (!permissionsFile.exists()) {
@@ -4489,22 +4468,12 @@ final class Settings {
? Integer.parseInt(flagsStr, 16) : 0;
if (granted) {
- if (permissionsState.grantRuntimePermission(bp, userId) ==
- PermissionsState.PERMISSION_OPERATION_FAILURE) {
- Slog.w(PackageManagerService.TAG, "Duplicate permission:" + name);
- } else {
- permissionsState.updatePermissionFlags(bp, userId,
+ permissionsState.grantRuntimePermission(bp, userId);
+ permissionsState.updatePermissionFlags(bp, userId,
PackageManager.MASK_PERMISSION_FLAGS, flags);
-
- }
} else {
- if (permissionsState.revokeRuntimePermission(bp, userId) ==
- PermissionsState.PERMISSION_OPERATION_FAILURE) {
- Slog.w(PackageManagerService.TAG, "Duplicate permission:" + name);
- } else {
- permissionsState.updatePermissionFlags(bp, userId,
- PackageManager.MASK_PERMISSION_FLAGS, flags);
- }
+ permissionsState.updatePermissionFlags(bp, userId,
+ PackageManager.MASK_PERMISSION_FLAGS, flags);
}
} break;
diff --git a/services/core/java/com/android/server/statusbar/StatusBarManagerInternal.java b/services/core/java/com/android/server/statusbar/StatusBarManagerInternal.java
index 58c3ea1..4692403 100644
--- a/services/core/java/com/android/server/statusbar/StatusBarManagerInternal.java
+++ b/services/core/java/com/android/server/statusbar/StatusBarManagerInternal.java
@@ -24,4 +24,5 @@ public interface StatusBarManagerInternal {
void notificationLightPulse(int argb, int onMillis, int offMillis);
void notificationLightOff();
void showScreenPinningRequest();
+ void showAssistDisclosure();
}
diff --git a/services/core/java/com/android/server/statusbar/StatusBarManagerService.java b/services/core/java/com/android/server/statusbar/StatusBarManagerService.java
index 5669f30..a754379 100644
--- a/services/core/java/com/android/server/statusbar/StatusBarManagerService.java
+++ b/services/core/java/com/android/server/statusbar/StatusBarManagerService.java
@@ -154,6 +154,16 @@ public class StatusBarManagerService extends IStatusBarService.Stub {
}
}
}
+
+ @Override
+ public void showAssistDisclosure() {
+ if (mBar != null) {
+ try {
+ mBar.showAssistDisclosure();
+ } catch (RemoteException e) {
+ }
+ }
+ }
};
// ================================================================================
diff --git a/services/core/java/com/android/server/wm/WindowStateAnimator.java b/services/core/java/com/android/server/wm/WindowStateAnimator.java
index 5064d8f..f1331e9 100644
--- a/services/core/java/com/android/server/wm/WindowStateAnimator.java
+++ b/services/core/java/com/android/server/wm/WindowStateAnimator.java
@@ -1383,10 +1383,21 @@ class WindowStateAnimator {
// Adjust for surface insets.
final LayoutParams attrs = w.getAttrs();
- width += attrs.surfaceInsets.left + attrs.surfaceInsets.right;
- height += attrs.surfaceInsets.top + attrs.surfaceInsets.bottom;
- left -= attrs.surfaceInsets.left;
- top -= attrs.surfaceInsets.top;
+ final int displayId = w.getDisplayId();
+ float scale = 1.0f;
+ // Magnification is supported only for the default display.
+ if (mService.mAccessibilityController != null && displayId == Display.DEFAULT_DISPLAY) {
+ MagnificationSpec spec =
+ mService.mAccessibilityController.getMagnificationSpecForWindowLocked(w);
+ if (spec != null && !spec.isNop()) {
+ scale = spec.scale;
+ }
+ }
+
+ width += scale * (attrs.surfaceInsets.left + attrs.surfaceInsets.right);
+ height += scale * (attrs.surfaceInsets.top + attrs.surfaceInsets.bottom);
+ left -= scale * attrs.surfaceInsets.left;
+ top -= scale * attrs.surfaceInsets.top;
final boolean surfaceMoved = mSurfaceX != left || mSurfaceY != top;
if (surfaceMoved) {
diff --git a/services/usage/java/com/android/server/usage/UsageStatsService.java b/services/usage/java/com/android/server/usage/UsageStatsService.java
index 3767fce..3b7ed91 100644
--- a/services/usage/java/com/android/server/usage/UsageStatsService.java
+++ b/services/usage/java/com/android/server/usage/UsageStatsService.java
@@ -31,9 +31,12 @@ import android.app.usage.UsageStatsManagerInternal.AppIdleStateChangeListener;
import android.appwidget.AppWidgetManager;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
+import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
+import android.content.SyncAdapterType;
+import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.ParceledListSlice;
@@ -69,6 +72,7 @@ import android.view.Display;
import com.android.internal.annotations.GuardedBy;
import com.android.internal.app.IBatteryStats;
import com.android.internal.os.BackgroundThread;
+import com.android.internal.os.SomeArgs;
import com.android.internal.util.IndentingPrintWriter;
import com.android.server.DeviceIdleController;
import com.android.server.SystemService;
@@ -117,6 +121,7 @@ public class UsageStatsService extends SystemService implements
static final int MSG_CHECK_IDLE_STATES = 5;
static final int MSG_CHECK_PAROLE_TIMEOUT = 6;
static final int MSG_PAROLE_END_TIMEOUT = 7;
+ static final int MSG_REPORT_CONTENT_PROVIDER_USAGE = 8;
private final Object mLock = new Object();
Handler mHandler;
@@ -583,6 +588,29 @@ public class UsageStatsService extends SystemService implements
}
}
+ void reportContentProviderUsage(String authority, String providerPkgName, int userId) {
+ // Get sync adapters for the authority
+ String[] packages = ContentResolver.getSyncAdapterPackagesForAuthorityAsUser(
+ authority, userId);
+ for (String packageName: packages) {
+ // Only force the sync adapters to active if the provider is not in the same package and
+ // the sync adapter is a system package.
+ try {
+ PackageInfo pi = AppGlobals.getPackageManager().getPackageInfo(
+ packageName, 0, userId);
+ if (pi == null || pi.applicationInfo == null
+ || !pi.applicationInfo.isSystemApp()) {
+ continue;
+ }
+ if (!packageName.equals(providerPkgName)) {
+ forceIdleState(packageName, userId, false);
+ }
+ } catch (RemoteException re) {
+ // Shouldn't happen
+ }
+ }
+ }
+
/**
* Forces the app's beginIdleTime and lastUsedTime to reflect idle or active. If idle,
* then it rolls back the beginIdleTime and lastUsedTime to a point in time that's behind
@@ -605,7 +633,7 @@ public class UsageStatsService extends SystemService implements
timeNow - (idle ? mAppIdleWallclockThresholdMillis : 0) - 5000);
// Inform listeners if necessary
if (previouslyIdle != idle) {
- // Slog.d(TAG, "Informing listeners of out-of-idle " + event.mPackage);
+ // Slog.d(TAG, "Informing listeners of out-of-idle " + packageName);
mHandler.sendMessage(mHandler.obtainMessage(MSG_INFORM_LISTENERS, userId,
/* idle = */ idle ? 1 : 0, packageName));
if (!idle) {
@@ -916,6 +944,14 @@ public class UsageStatsService extends SystemService implements
setAppIdleParoled(false);
break;
+ case MSG_REPORT_CONTENT_PROVIDER_USAGE:
+ SomeArgs args = (SomeArgs) msg.obj;
+ reportContentProviderUsage((String) args.arg1, // authority name
+ (String) args.arg2, // package name
+ (int) args.arg3); // userId
+ args.recycle();
+ break;
+
default:
super.handleMessage(msg);
break;
@@ -1177,6 +1213,16 @@ public class UsageStatsService extends SystemService implements
}
@Override
+ public void reportContentProviderUsage(String name, String packageName, int userId) {
+ SomeArgs args = SomeArgs.obtain();
+ args.arg1 = name;
+ args.arg2 = packageName;
+ args.arg3 = userId;
+ mHandler.obtainMessage(MSG_REPORT_CONTENT_PROVIDER_USAGE, args)
+ .sendToTarget();
+ }
+
+ @Override
public boolean isAppIdle(String packageName, int userId) {
return UsageStatsService.this.isAppIdleFiltered(packageName, userId, -1);
}
diff --git a/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java b/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java
index fafe44a..b68abab 100644
--- a/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java
+++ b/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java
@@ -26,6 +26,7 @@ import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.IPackageManager;
import android.content.pm.PackageManager;
+import android.content.pm.PackageManagerInternal;
import android.content.pm.ResolveInfo;
import android.content.pm.ServiceInfo;
import android.content.res.Resources;
@@ -57,6 +58,7 @@ import com.android.internal.app.IVoiceInteractionSessionShowCallback;
import com.android.internal.app.IVoiceInteractor;
import com.android.internal.content.PackageMonitor;
import com.android.internal.os.BackgroundThread;
+import com.android.server.LocalServices;
import com.android.server.SystemService;
import com.android.server.UiThread;
@@ -83,6 +85,21 @@ public class VoiceInteractionManagerService extends SystemService {
mDbHelper = new DatabaseHelper(context);
mSoundTriggerHelper = new SoundTriggerHelper(context);
mServiceStub = new VoiceInteractionManagerServiceStub();
+
+ PackageManagerInternal packageManagerInternal = LocalServices.getService(
+ PackageManagerInternal.class);
+ packageManagerInternal.setVoiceInteractionPackagesProvider(
+ new PackageManagerInternal.PackagesProvider() {
+ @Override
+ public String[] getPackages(int userId) {
+ mServiceStub.initForUser(userId);
+ ComponentName interactor = mServiceStub.getCurInteractor(userId);
+ if (interactor != null) {
+ return new String[] {interactor.getPackageName()};
+ }
+ return null;
+ }
+ });
}
@Override
diff --git a/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerServiceImpl.java b/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerServiceImpl.java
index acd484d..af0ddbe 100644
--- a/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerServiceImpl.java
+++ b/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerServiceImpl.java
@@ -139,7 +139,7 @@ class VoiceInteractionManagerServiceImpl implements VoiceInteractionSessionConne
IVoiceInteractionSessionShowCallback showCallback) {
if (mActiveSession == null) {
mActiveSession = new VoiceInteractionSessionConnection(mLock, mSessionComponentName,
- mUser, mContext, this, mInfo.getServiceInfo().applicationInfo.uid);
+ mUser, mContext, this, mInfo.getServiceInfo().applicationInfo.uid, mHandler);
}
return mActiveSession.showLocked(args, flags, showCallback);
}
diff --git a/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionSessionConnection.java b/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionSessionConnection.java
index 47a230a..cc6a9c5 100644
--- a/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionSessionConnection.java
+++ b/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionSessionConnection.java
@@ -32,6 +32,7 @@ import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Binder;
import android.os.Bundle;
+import android.os.Handler;
import android.os.IBinder;
import android.os.RemoteException;
import android.os.ServiceManager;
@@ -48,6 +49,8 @@ import com.android.internal.app.IAssistScreenshotReceiver;
import com.android.internal.app.IVoiceInteractionSessionShowCallback;
import com.android.internal.app.IVoiceInteractor;
import com.android.internal.os.IResultReceiver;
+import com.android.server.LocalServices;
+import com.android.server.statusbar.StatusBarManagerInternal;
import java.io.PrintWriter;
import java.util.ArrayList;
@@ -63,6 +66,7 @@ final class VoiceInteractionSessionConnection implements ServiceConnection {
final Context mContext;
final Callback mCallback;
final int mCallingUid;
+ final Handler mHandler;
final IActivityManager mAm;
final IWindowManager mIWindowManager;
final AppOpsManager mAppOps;
@@ -141,13 +145,14 @@ final class VoiceInteractionSessionConnection implements ServiceConnection {
};
public VoiceInteractionSessionConnection(Object lock, ComponentName component, int user,
- Context context, Callback callback, int callingUid) {
+ Context context, Callback callback, int callingUid, Handler handler) {
mLock = lock;
mSessionComponentName = component;
mUser = user;
mContext = context;
mCallback = callback;
mCallingUid = callingUid;
+ mHandler = handler;
mAm = ActivityManagerNative.getDefault();
mIWindowManager = IWindowManager.Stub.asInterface(
ServiceManager.getService(Context.WINDOW_SERVICE));
@@ -193,11 +198,13 @@ final class VoiceInteractionSessionConnection implements ServiceConnection {
mShowArgs = args;
mShowFlags = flags;
mHaveAssistData = false;
+ boolean needDisclosure = false;
if ((flags& VoiceInteractionSession.SHOW_WITH_ASSIST) != 0) {
if (mAppOps.noteOpNoThrow(AppOpsManager.OP_ASSIST_STRUCTURE, mCallingUid,
mSessionComponentName.getPackageName()) == AppOpsManager.MODE_ALLOWED
&& allDataEnabled) {
try {
+ needDisclosure = true;
mAm.requestAssistContextExtras(ActivityManager.ASSIST_CONTEXT_FULL,
mAssistReceiver);
} catch (RemoteException e) {
@@ -215,6 +222,7 @@ final class VoiceInteractionSessionConnection implements ServiceConnection {
mSessionComponentName.getPackageName()) == AppOpsManager.MODE_ALLOWED
&& allDataEnabled) {
try {
+ needDisclosure = true;
mIWindowManager.requestAssistScreenshot(mScreenshotReceiver);
} catch (RemoteException e) {
}
@@ -225,6 +233,9 @@ final class VoiceInteractionSessionConnection implements ServiceConnection {
} else {
mScreenshot = null;
}
+ if (needDisclosure) {
+ mHandler.post(mShowAssistDisclosureRunnable);
+ }
if (mSession != null) {
try {
mSession.show(mShowArgs, mShowFlags, showCallback);
@@ -483,4 +494,15 @@ final class VoiceInteractionSessionConnection implements ServiceConnection {
pw.print(prefix); pw.print("mAssistData="); pw.println(mAssistData);
}
}
+
+ private Runnable mShowAssistDisclosureRunnable = new Runnable() {
+ @Override
+ public void run() {
+ StatusBarManagerInternal statusBarInternal = LocalServices.getService(
+ StatusBarManagerInternal.class);
+ if (statusBarInternal != null) {
+ statusBarInternal.showAssistDisclosure();
+ }
+ }
+ };
};
diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java
index 01cab33..fa0af96 100644
--- a/telephony/java/android/telephony/CarrierConfigManager.java
+++ b/telephony/java/android/telephony/CarrierConfigManager.java
@@ -298,6 +298,14 @@ public class CarrierConfigManager {
public static final String KEY_CI_ACTION_ON_SYS_UPDATE_EXTRA_VAL_STRING =
"ci_action_on_sys_update_extra_val_string";
+ /**
+ * If this is true, the SIM card (through Customer Service Profile EF file) will be able to
+ * prevent manual operator selection. If false, this SIM setting will be ignored and manual
+ * operator selection will always be available. See CPHS4_2.WW6, CPHS B.4.7.1 for more
+ * information
+ */
+ public static final String KEY_CSP_ENABLED_BOOL = "csp_enabled_bool";
+
// These variables are used by the MMS service and exposed through another API, {@link
// SmsManager}. The variable names and string values are copied from there.
public static final String KEY_MMS_ALIAS_ENABLED_BOOL = "aliasEnabled";
@@ -377,6 +385,7 @@ public class CarrierConfigManager {
sDefaults.putString(KEY_CI_ACTION_ON_SYS_UPDATE_INTENT_STRING, "");
sDefaults.putString(KEY_CI_ACTION_ON_SYS_UPDATE_EXTRA_STRING, "");
sDefaults.putString(KEY_CI_ACTION_ON_SYS_UPDATE_EXTRA_VAL_STRING, "");
+ sDefaults.putBoolean(KEY_CSP_ENABLED_BOOL, false);
sDefaults.putStringArray(KEY_GSM_ROAMING_NETWORKS_STRING_ARRAY, null);
sDefaults.putStringArray(KEY_GSM_NONROAMING_NETWORKS_STRING_ARRAY, null);
@@ -422,6 +431,9 @@ public class CarrierConfigManager {
* specific SIM card. If an invalid subId is used, the returned config will contain default
* values.
*
+ * <p>Requires Permission:
+ * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
+ *
* @param subId the subscription ID, normally obtained from {@link SubscriptionManager}.
* @return A {@link PersistableBundle} containing the config for the given subId, or default
* values for an invalid subId.
@@ -443,6 +455,9 @@ public class CarrierConfigManager {
/**
* Gets the configuration values for the default subscription.
*
+ * <p>Requires Permission:
+ * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
+ *
* @see #getConfigForSubId
*/
@Nullable
@@ -457,6 +472,8 @@ public class CarrierConfigManager {
* This should be called by a carrier service app if it wants to update config at an arbitrary
* moment.
* </p>
+ * <p>Requires that the calling app has carrier privileges.
+ * @see #hasCarrierPrivileges
* <p>
* This method returns before the reload has completed, and
* {@link android.service.carrier.CarrierService#onLoadConfig} will be called from an