Merge "Using the rs API instead."
diff --git a/api/16.txt b/api/16.txt
index 6543ab0..8ff7675 100644
--- a/api/16.txt
+++ b/api/16.txt
@@ -10771,8 +10771,6 @@
method public void setAudioEncodingBitRate(int);
method public void setAudioSamplingRate(int);
method public void setAudioSource(int) throws java.lang.IllegalStateException;
- method public deprecated void setAuxiliaryOutputFile(java.io.FileDescriptor);
- method public deprecated void setAuxiliaryOutputFile(java.lang.String);
method public void setCamera(android.hardware.Camera);
method public void setCaptureRate(double);
method public void setLocation(float, float);
diff --git a/api/current.txt b/api/current.txt
index f4bfced..29f093a 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -76,6 +76,7 @@
field public static final java.lang.String PROCESS_OUTGOING_CALLS = "android.permission.PROCESS_OUTGOING_CALLS";
field public static final java.lang.String READ_CALENDAR = "android.permission.READ_CALENDAR";
field public static final java.lang.String READ_CONTACTS = "android.permission.READ_CONTACTS";
+ field public static final java.lang.String READ_EXTERNAL_STORAGE = "android.permission.READ_EXTERNAL_STORAGE";
field public static final java.lang.String READ_FRAME_BUFFER = "android.permission.READ_FRAME_BUFFER";
field public static final java.lang.String READ_HISTORY_BOOKMARKS = "com.android.browser.permission.READ_HISTORY_BOOKMARKS";
field public static final java.lang.String READ_INPUT_STATE = "android.permission.READ_INPUT_STATE";
@@ -8034,6 +8035,9 @@
ctor public Camera();
method public void applyToCanvas(android.graphics.Canvas);
method public float dotWithNormal(float, float, float);
+ method public float getLocationX();
+ method public float getLocationY();
+ method public float getLocationZ();
method public void getMatrix(android.graphics.Matrix);
method public void restore();
method public void rotate(float, float, float);
@@ -10935,8 +10939,6 @@
method public void setAudioEncodingBitRate(int);
method public void setAudioSamplingRate(int);
method public void setAudioSource(int) throws java.lang.IllegalStateException;
- method public deprecated void setAuxiliaryOutputFile(java.io.FileDescriptor);
- method public deprecated void setAuxiliaryOutputFile(java.lang.String);
method public void setCamera(android.hardware.Camera);
method public void setCaptureRate(double);
method public void setLocation(float, float);
@@ -21640,6 +21642,10 @@
method public android.util.JsonWriter value(java.lang.Number) throws java.io.IOException;
}
+ public class LocaleUtil {
+ method public static int getLayoutDirectionFromLocale(java.util.Locale);
+ }
+
public final class Log {
method public static int d(java.lang.String, java.lang.String);
method public static int d(java.lang.String, java.lang.String, java.lang.Throwable);
@@ -22105,8 +22111,11 @@
public class Gravity {
ctor public Gravity();
method public static void apply(int, int, int, android.graphics.Rect, android.graphics.Rect);
+ method public static void apply(int, int, int, android.graphics.Rect, android.graphics.Rect, int);
method public static void apply(int, int, int, android.graphics.Rect, int, int, android.graphics.Rect);
+ method public static void apply(int, int, int, android.graphics.Rect, int, int, android.graphics.Rect, int);
method public static void applyDisplay(int, android.graphics.Rect, android.graphics.Rect);
+ method public static void applyDisplay(int, android.graphics.Rect, android.graphics.Rect, int);
method public static int getAbsoluteGravity(int, int);
method public static boolean isHorizontal(int);
method public static boolean isVertical(int);
@@ -23194,6 +23203,7 @@
method public final int getBottom();
method protected float getBottomFadingEdgeStrength();
method protected int getBottomPaddingOffset();
+ method public float getCameraDistance();
method public java.lang.CharSequence getContentDescription();
method public final android.content.Context getContext();
method protected android.view.ContextMenu.ContextMenuInfo getContextMenuInfo();
diff --git a/cmds/am/src/com/android/commands/am/Am.java b/cmds/am/src/com/android/commands/am/Am.java
index 901f7c7..da38df1 100644
--- a/cmds/am/src/com/android/commands/am/Am.java
+++ b/cmds/am/src/com/android/commands/am/Am.java
@@ -61,6 +61,8 @@
private boolean mWaitOption = false;
private boolean mStopOption = false;
+ private boolean mOpenglTraceOption = false;
+
private int mRepeat = 0;
private String mProfileFile;
@@ -151,6 +153,7 @@
mDebugOption = false;
mWaitOption = false;
mStopOption = false;
+ mOpenglTraceOption = false;
mRepeat = 0;
mProfileFile = null;
Uri data = null;
@@ -307,6 +310,8 @@
mRepeat = Integer.parseInt(nextArgRequired());
} else if (opt.equals("-S")) {
mStopOption = true;
+ } else if (opt.equals("--opengl-trace")) {
+ mOpenglTraceOption = true;
} else {
System.err.println("Error: Unknown option: " + opt);
showUsage();
@@ -440,17 +445,19 @@
return;
}
}
-
+
IActivityManager.WaitResult result = null;
int res;
if (mWaitOption) {
result = mAm.startActivityAndWait(null, intent, mimeType,
- null, 0, null, null, 0, false, mDebugOption,
+ null, 0, null, null, 0, false,
+ mDebugOption, mOpenglTraceOption,
mProfileFile, fd, mProfileAutoStop);
res = result.result;
} else {
res = mAm.startActivity(null, intent, mimeType,
- null, 0, null, null, 0, false, mDebugOption,
+ null, 0, null, null, 0, false,
+ mDebugOption, mOpenglTraceOption,
mProfileFile, fd, mProfileAutoStop);
}
PrintStream out = mWaitOption ? System.out : System.err;
@@ -1277,7 +1284,7 @@
System.err.println(
"usage: am [subcommand] [options]\n" +
"usage: am start [-D] [-W] [-P <FILE>] [--start-profiler <FILE>]\n" +
- " [--R COUNT] [-S] <INTENT>\n" +
+ " [--R COUNT] [-S] [--opengl-trace] <INTENT>\n" +
" am startservice <INTENT>\n" +
" am force-stop <PACKAGE>\n" +
" am kill <PACKAGE>\n" +
@@ -1304,6 +1311,7 @@
" -R: repeat the activity launch <COUNT> times. Prior to each repeat,\n" +
" the top activity will be finished.\n" +
" -S: force stop the target app before starting the activity\n" +
+ " --opengl-trace: enable tracing of OpenGL functions\n" +
"\n" +
"am startservice: start a Service.\n" +
"\n" +
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java
index 599487dc..0f2aa46 100644
--- a/core/java/android/app/Activity.java
+++ b/core/java/android/app/Activity.java
@@ -3388,17 +3388,16 @@
intent.setAllowFds(false);
result = ActivityManagerNative.getDefault()
.startActivity(mMainThread.getApplicationThread(),
- intent, intent.resolveTypeIfNeeded(
- getContentResolver()),
+ intent, intent.resolveTypeIfNeeded(getContentResolver()),
null, 0,
- mToken, mEmbeddedID, requestCode, true, false,
- null, null, false);
+ mToken, mEmbeddedID, requestCode, true /* onlyIfNeeded */,
+ false, false, null, null, false);
} catch (RemoteException e) {
// Empty
}
-
+
Instrumentation.checkStartActivityResult(result, intent);
-
+
if (requestCode >= 0) {
// If this start is requesting a result, we can avoid making
// the activity visible until the result is received. Setting
diff --git a/core/java/android/app/ActivityManagerNative.java b/core/java/android/app/ActivityManagerNative.java
index b952649..7daaf7d 100644
--- a/core/java/android/app/ActivityManagerNative.java
+++ b/core/java/android/app/ActivityManagerNative.java
@@ -120,17 +120,19 @@
Uri[] grantedUriPermissions = data.createTypedArray(Uri.CREATOR);
int grantedMode = data.readInt();
IBinder resultTo = data.readStrongBinder();
- String resultWho = data.readString();
+ String resultWho = data.readString();
int requestCode = data.readInt();
boolean onlyIfNeeded = data.readInt() != 0;
boolean debug = data.readInt() != 0;
+ boolean openglTrace = data.readInt() != 0;
String profileFile = data.readString();
ParcelFileDescriptor profileFd = data.readInt() != 0
? data.readFileDescriptor() : null;
boolean autoStopProfiler = data.readInt() != 0;
int result = startActivity(app, intent, resolvedType,
grantedUriPermissions, grantedMode, resultTo, resultWho,
- requestCode, onlyIfNeeded, debug, profileFile, profileFd, autoStopProfiler);
+ requestCode, onlyIfNeeded, debug, openglTrace,
+ profileFile, profileFd, autoStopProfiler);
reply.writeNoException();
reply.writeInt(result);
return true;
@@ -146,17 +148,19 @@
Uri[] grantedUriPermissions = data.createTypedArray(Uri.CREATOR);
int grantedMode = data.readInt();
IBinder resultTo = data.readStrongBinder();
- String resultWho = data.readString();
+ String resultWho = data.readString();
int requestCode = data.readInt();
boolean onlyIfNeeded = data.readInt() != 0;
boolean debug = data.readInt() != 0;
+ boolean openglTrace = data.readInt() != 0;
String profileFile = data.readString();
ParcelFileDescriptor profileFd = data.readInt() != 0
? data.readFileDescriptor() : null;
boolean autoStopProfiler = data.readInt() != 0;
WaitResult result = startActivityAndWait(app, intent, resolvedType,
grantedUriPermissions, grantedMode, resultTo, resultWho,
- requestCode, onlyIfNeeded, debug, profileFile, profileFd, autoStopProfiler);
+ requestCode, onlyIfNeeded, debug, openglTrace,
+ profileFile, profileFd, autoStopProfiler);
reply.writeNoException();
result.writeToParcel(reply, 0);
return true;
@@ -1607,17 +1611,17 @@
{
mRemote = remote;
}
-
+
public IBinder asBinder()
{
return mRemote;
}
-
+
public int startActivity(IApplicationThread caller, Intent intent,
String resolvedType, Uri[] grantedUriPermissions, int grantedMode,
IBinder resultTo, String resultWho,
int requestCode, boolean onlyIfNeeded,
- boolean debug, String profileFile, ParcelFileDescriptor profileFd,
+ boolean debug, boolean openglTrace, String profileFile, ParcelFileDescriptor profileFd,
boolean autoStopProfiler) throws RemoteException {
Parcel data = Parcel.obtain();
Parcel reply = Parcel.obtain();
@@ -1632,6 +1636,7 @@
data.writeInt(requestCode);
data.writeInt(onlyIfNeeded ? 1 : 0);
data.writeInt(debug ? 1 : 0);
+ data.writeInt(openglTrace ? 1 : 0);
data.writeString(profileFile);
if (profileFd != null) {
data.writeInt(1);
@@ -1651,7 +1656,7 @@
String resolvedType, Uri[] grantedUriPermissions, int grantedMode,
IBinder resultTo, String resultWho,
int requestCode, boolean onlyIfNeeded,
- boolean debug, String profileFile, ParcelFileDescriptor profileFd,
+ boolean debug, boolean openglTrace, String profileFile, ParcelFileDescriptor profileFd,
boolean autoStopProfiler) throws RemoteException {
Parcel data = Parcel.obtain();
Parcel reply = Parcel.obtain();
@@ -1666,6 +1671,7 @@
data.writeInt(requestCode);
data.writeInt(onlyIfNeeded ? 1 : 0);
data.writeInt(debug ? 1 : 0);
+ data.writeInt(openglTrace ? 1 : 0);
data.writeString(profileFile);
if (profileFd != null) {
data.writeInt(1);
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index aa15f39..2610d87 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -376,6 +376,7 @@
Bundle instrumentationArgs;
IInstrumentationWatcher instrumentationWatcher;
int debugMode;
+ boolean enableOpenGlTrace;
boolean restrictedBackupMode;
boolean persistent;
Configuration config;
@@ -676,8 +677,8 @@
ComponentName instrumentationName, String profileFile,
ParcelFileDescriptor profileFd, boolean autoStopProfiler,
Bundle instrumentationArgs, IInstrumentationWatcher instrumentationWatcher,
- int debugMode, boolean isRestrictedBackupMode, boolean persistent,
- Configuration config, CompatibilityInfo compatInfo,
+ int debugMode, boolean enableOpenGlTrace, boolean isRestrictedBackupMode,
+ boolean persistent, Configuration config, CompatibilityInfo compatInfo,
Map<String, IBinder> services, Bundle coreSettings) {
if (services != null) {
@@ -695,6 +696,7 @@
data.instrumentationArgs = instrumentationArgs;
data.instrumentationWatcher = instrumentationWatcher;
data.debugMode = debugMode;
+ data.enableOpenGlTrace = enableOpenGlTrace;
data.restrictedBackupMode = isRestrictedBackupMode;
data.persistent = persistent;
data.config = config;
@@ -3912,6 +3914,11 @@
}
}
+ // Enable OpenGL tracing if required
+ if (data.enableOpenGlTrace) {
+ GLUtils.enableTracing();
+ }
+
/**
* Initialize the default http proxy in this process for the reasons we set the time zone.
*/
diff --git a/core/java/android/app/ApplicationThreadNative.java b/core/java/android/app/ApplicationThreadNative.java
index e75d7b4..437362b 100644
--- a/core/java/android/app/ApplicationThreadNative.java
+++ b/core/java/android/app/ApplicationThreadNative.java
@@ -267,6 +267,7 @@
IBinder binder = data.readStrongBinder();
IInstrumentationWatcher testWatcher = IInstrumentationWatcher.Stub.asInterface(binder);
int testMode = data.readInt();
+ boolean openGlTrace = data.readInt() != 0;
boolean restrictedBackupMode = (data.readInt() != 0);
boolean persistent = (data.readInt() != 0);
Configuration config = Configuration.CREATOR.createFromParcel(data);
@@ -275,11 +276,11 @@
Bundle coreSettings = data.readBundle();
bindApplication(packageName, info,
providers, testName, profileName, profileFd, autoStopProfiler,
- testArgs, testWatcher, testMode, restrictedBackupMode, persistent,
- config, compatInfo, services, coreSettings);
+ testArgs, testWatcher, testMode, openGlTrace, restrictedBackupMode,
+ persistent, config, compatInfo, services, coreSettings);
return true;
}
-
+
case SCHEDULE_EXIT_TRANSACTION:
{
data.enforceInterface(IApplicationThread.descriptor);
@@ -849,8 +850,9 @@
public final void bindApplication(String packageName, ApplicationInfo info,
List<ProviderInfo> providers, ComponentName testName, String profileName,
ParcelFileDescriptor profileFd, boolean autoStopProfiler, Bundle testArgs,
- IInstrumentationWatcher testWatcher, int debugMode, boolean restrictedBackupMode,
- boolean persistent, Configuration config, CompatibilityInfo compatInfo,
+ IInstrumentationWatcher testWatcher, int debugMode, boolean openGlTrace,
+ boolean restrictedBackupMode, boolean persistent,
+ Configuration config, CompatibilityInfo compatInfo,
Map<String, IBinder> services, Bundle coreSettings) throws RemoteException {
Parcel data = Parcel.obtain();
data.writeInterfaceToken(IApplicationThread.descriptor);
@@ -874,6 +876,7 @@
data.writeBundle(testArgs);
data.writeStrongInterface(testWatcher);
data.writeInt(debugMode);
+ data.writeInt(openGlTrace ? 1 : 0);
data.writeInt(restrictedBackupMode ? 1 : 0);
data.writeInt(persistent ? 1 : 0);
config.writeToParcel(data, 0);
diff --git a/core/java/android/app/IActivityManager.java b/core/java/android/app/IActivityManager.java
index ea2545f..acebf58 100644
--- a/core/java/android/app/IActivityManager.java
+++ b/core/java/android/app/IActivityManager.java
@@ -84,12 +84,12 @@
public int startActivity(IApplicationThread caller,
Intent intent, String resolvedType, Uri[] grantedUriPermissions,
int grantedMode, IBinder resultTo, String resultWho, int requestCode,
- boolean onlyIfNeeded, boolean debug, String profileFile,
+ boolean onlyIfNeeded, boolean debug, boolean openglTrace, String profileFile,
ParcelFileDescriptor profileFd, boolean autoStopProfiler) throws RemoteException;
public WaitResult startActivityAndWait(IApplicationThread caller,
Intent intent, String resolvedType, Uri[] grantedUriPermissions,
int grantedMode, IBinder resultTo, String resultWho, int requestCode,
- boolean onlyIfNeeded, boolean debug, String profileFile,
+ boolean onlyIfNeeded, boolean debug, boolean openglTrace, String profileFile,
ParcelFileDescriptor profileFd, boolean autoStopProfiler) throws RemoteException;
public int startActivityWithConfig(IApplicationThread caller,
Intent intent, String resolvedType, Uri[] grantedUriPermissions,
diff --git a/core/java/android/app/IApplicationThread.java b/core/java/android/app/IApplicationThread.java
index 6ad1736a..70029d2 100644
--- a/core/java/android/app/IApplicationThread.java
+++ b/core/java/android/app/IApplicationThread.java
@@ -89,7 +89,7 @@
void bindApplication(String packageName, ApplicationInfo info, List<ProviderInfo> providers,
ComponentName testName, String profileName, ParcelFileDescriptor profileFd,
boolean autoStopProfiler, Bundle testArguments, IInstrumentationWatcher testWatcher,
- int debugMode, boolean restrictedBackupMode, boolean persistent,
+ int debugMode, boolean openGlTrace, boolean restrictedBackupMode, boolean persistent,
Configuration config, CompatibilityInfo compatInfo, Map<String, IBinder> services,
Bundle coreSettings) throws RemoteException;
void scheduleExit() throws RemoteException;
diff --git a/core/java/android/app/Instrumentation.java b/core/java/android/app/Instrumentation.java
index c037ffb..a34e1d3 100644
--- a/core/java/android/app/Instrumentation.java
+++ b/core/java/android/app/Instrumentation.java
@@ -1384,7 +1384,7 @@
.startActivity(whoThread, intent,
intent.resolveTypeIfNeeded(who.getContentResolver()),
null, 0, token, target != null ? target.mEmbeddedID : null,
- requestCode, false, false, null, null, false);
+ requestCode, false, false, false, null, null, false);
checkStartActivityResult(result, intent);
} catch (RemoteException e) {
}
@@ -1482,7 +1482,8 @@
.startActivity(whoThread, intent,
intent.resolveTypeIfNeeded(who.getContentResolver()),
null, 0, token, target != null ? target.mWho : null,
- requestCode, false, false, null, null, false);
+ requestCode, false, false /* debug */, false /* openglTrace */,
+ null, null, false);
checkStartActivityResult(result, intent);
} catch (RemoteException e) {
}
diff --git a/core/java/android/content/ContentProvider.java b/core/java/android/content/ContentProvider.java
index 12e3ccf..ec67d8c 100644
--- a/core/java/android/content/ContentProvider.java
+++ b/core/java/android/content/ContentProvider.java
@@ -16,6 +16,8 @@
package android.content;
+import static android.content.pm.PackageManager.PERMISSION_GRANTED;
+
import android.content.pm.PackageManager;
import android.content.pm.PathPermission;
import android.content.pm.ProviderInfo;
@@ -30,6 +32,7 @@
import android.os.ParcelFileDescriptor;
import android.os.Process;
import android.os.RemoteException;
+import android.os.UserId;
import android.util.Log;
import java.io.File;
@@ -267,90 +270,116 @@
return CancellationSignal.createTransport();
}
- private void enforceReadPermission(Uri uri) {
- final int uid = Binder.getCallingUid();
- if (uid == mMyUid) {
- return;
- }
-
+ private boolean hasReadPermission(Uri uri) {
final Context context = getContext();
- final String rperm = getReadPermission();
final int pid = Binder.getCallingPid();
- if (mExported && (rperm == null
- || context.checkPermission(rperm, pid, uid)
- == PackageManager.PERMISSION_GRANTED)) {
- return;
- }
-
- PathPermission[] pps = getPathPermissions();
- if (pps != null) {
- final String path = uri.getPath();
- int i = pps.length;
- while (i > 0) {
- i--;
- final PathPermission pp = pps[i];
- final String pprperm = pp.getReadPermission();
- if (pprperm != null && pp.match(path)) {
- if (context.checkPermission(pprperm, pid, uid)
- == PackageManager.PERMISSION_GRANTED) {
- return;
+ final int uid = Binder.getCallingUid();
+
+ if (uid == mMyUid) {
+ return true;
+
+ } else if (mExported) {
+ final String componentPerm = getReadPermission();
+ if (componentPerm != null
+ && (context.checkPermission(componentPerm, pid, uid) == PERMISSION_GRANTED)) {
+ return true;
+ }
+
+ // track if unprotected read is allowed; any denied
+ // <path-permission> below removes this ability
+ boolean allowDefaultRead = (componentPerm == null);
+
+ final PathPermission[] pps = getPathPermissions();
+ if (pps != null) {
+ final String path = uri.getPath();
+ for (PathPermission pp : pps) {
+ final String pathPerm = pp.getReadPermission();
+ if (pathPerm != null && pp.match(path)) {
+ if (context.checkPermission(pathPerm, pid, uid) == PERMISSION_GRANTED) {
+ return true;
+ } else {
+ // any denied <path-permission> means we lose
+ // default <provider> access.
+ allowDefaultRead = false;
+ }
}
}
}
+
+ // if we passed <path-permission> checks above, and no default
+ // <provider> permission, then allow access.
+ if (allowDefaultRead) return true;
}
-
- if (context.checkUriPermission(uri, pid, uid,
- Intent.FLAG_GRANT_READ_URI_PERMISSION)
- == PackageManager.PERMISSION_GRANTED) {
+
+ // last chance, check against any uri grants
+ if (context.checkUriPermission(uri, pid, uid, Intent.FLAG_GRANT_READ_URI_PERMISSION)
+ == PERMISSION_GRANTED) {
+ return true;
+ }
+
+ return false;
+ }
+
+ private void enforceReadPermission(Uri uri) {
+ if (hasReadPermission(uri)) {
return;
}
-
+
String msg = "Permission Denial: reading "
+ ContentProvider.this.getClass().getName()
+ " uri " + uri + " from pid=" + Binder.getCallingPid()
+ ", uid=" + Binder.getCallingUid()
- + " requires " + rperm;
+ + " requires " + getReadPermission();
throw new SecurityException(msg);
}
private boolean hasWritePermission(Uri uri) {
+ final Context context = getContext();
+ final int pid = Binder.getCallingPid();
final int uid = Binder.getCallingUid();
+
if (uid == mMyUid) {
return true;
- }
-
- final Context context = getContext();
- final String wperm = getWritePermission();
- final int pid = Binder.getCallingPid();
- if (mExported && (wperm == null
- || context.checkPermission(wperm, pid, uid)
- == PackageManager.PERMISSION_GRANTED)) {
- return true;
- }
-
- PathPermission[] pps = getPathPermissions();
- if (pps != null) {
- final String path = uri.getPath();
- int i = pps.length;
- while (i > 0) {
- i--;
- final PathPermission pp = pps[i];
- final String ppwperm = pp.getWritePermission();
- if (ppwperm != null && pp.match(path)) {
- if (context.checkPermission(ppwperm, pid, uid)
- == PackageManager.PERMISSION_GRANTED) {
- return true;
+
+ } else if (mExported) {
+ final String componentPerm = getWritePermission();
+ if (componentPerm != null
+ && (context.checkPermission(componentPerm, pid, uid) == PERMISSION_GRANTED)) {
+ return true;
+ }
+
+ // track if unprotected write is allowed; any denied
+ // <path-permission> below removes this ability
+ boolean allowDefaultWrite = (componentPerm == null);
+
+ final PathPermission[] pps = getPathPermissions();
+ if (pps != null) {
+ final String path = uri.getPath();
+ for (PathPermission pp : pps) {
+ final String pathPerm = pp.getWritePermission();
+ if (pathPerm != null && pp.match(path)) {
+ if (context.checkPermission(pathPerm, pid, uid) == PERMISSION_GRANTED) {
+ return true;
+ } else {
+ // any denied <path-permission> means we lose
+ // default <provider> access.
+ allowDefaultWrite = false;
+ }
}
}
}
+
+ // if we passed <path-permission> checks above, and no default
+ // <provider> permission, then allow access.
+ if (allowDefaultWrite) return true;
}
-
- if (context.checkUriPermission(uri, pid, uid,
- Intent.FLAG_GRANT_WRITE_URI_PERMISSION)
- == PackageManager.PERMISSION_GRANTED) {
+
+ // last chance, check against any uri grants
+ if (context.checkUriPermission(uri, pid, uid, Intent.FLAG_GRANT_WRITE_URI_PERMISSION)
+ == PERMISSION_GRANTED) {
return true;
}
-
+
return false;
}
diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java
index e88ee02..207f077 100644
--- a/core/java/android/content/pm/PackageParser.java
+++ b/core/java/android/content/pm/PackageParser.java
@@ -89,11 +89,25 @@
this.fileVersion = fileVersion;
}
}
-
+
+ /** @hide */
+ public static class SplitPermissionInfo {
+ public final String rootPerm;
+ public final String[] newPerms;
+
+ public SplitPermissionInfo(String rootPerm, String[] newPerms) {
+ this.rootPerm = rootPerm;
+ this.newPerms = newPerms;
+ }
+ }
+
/**
* List of new permissions that have been added since 1.0.
* NOTE: These must be declared in SDK version order, with permissions
* added to older SDKs appearing before those added to newer SDKs.
+ * If sdkVersion is 0, then this is not a permission that we want to
+ * automatically add to older apps, but we do want to allow it to be
+ * granted during a platform update.
* @hide
*/
public static final PackageParser.NewPermissionInfo NEW_PERMISSIONS[] =
@@ -104,6 +118,17 @@
android.os.Build.VERSION_CODES.DONUT, 0)
};
+ /**
+ * List of permissions that have been split into more granular or dependent
+ * permissions.
+ * @hide
+ */
+ public static final PackageParser.SplitPermissionInfo SPLIT_PERMISSIONS[] =
+ new PackageParser.SplitPermissionInfo[] {
+ new PackageParser.SplitPermissionInfo(android.Manifest.permission.WRITE_EXTERNAL_STORAGE,
+ new String[] { android.Manifest.permission.READ_EXTERNAL_STORAGE })
+ };
+
private String mArchiveSourcePath;
private String[] mSeparateProcesses;
private boolean mOnlyCoreApps;
@@ -1245,7 +1270,23 @@
if (implicitPerms != null) {
Slog.i(TAG, implicitPerms.toString());
}
-
+
+ final int NS = PackageParser.SPLIT_PERMISSIONS.length;
+ for (int is=0; is<NS; is++) {
+ final PackageParser.SplitPermissionInfo spi
+ = PackageParser.SPLIT_PERMISSIONS[is];
+ if (!pkg.requestedPermissions.contains(spi.rootPerm)) {
+ break;
+ }
+ for (int in=0; in<spi.newPerms.length; in++) {
+ final String perm = spi.newPerms[in];
+ if (!pkg.requestedPermissions.contains(perm)) {
+ pkg.requestedPermissions.add(perm);
+ pkg.requestedPermissionsRequired.add(Boolean.TRUE);
+ }
+ }
+ }
+
if (supportsSmallScreens < 0 || (supportsSmallScreens > 0
&& pkg.applicationInfo.targetSdkVersion
>= android.os.Build.VERSION_CODES.DONUT)) {
diff --git a/core/java/android/database/sqlite/SQLiteProgram.java b/core/java/android/database/sqlite/SQLiteProgram.java
index 94a23cb..e9b06c6 100644
--- a/core/java/android/database/sqlite/SQLiteProgram.java
+++ b/core/java/android/database/sqlite/SQLiteProgram.java
@@ -64,19 +64,19 @@
break;
}
- if (mNumParameters != 0) {
- mBindArgs = new Object[mNumParameters];
- } else {
- mBindArgs = null;
+ if (bindArgs != null && bindArgs.length > mNumParameters) {
+ throw new IllegalArgumentException("Too many bind arguments. "
+ + bindArgs.length + " arguments were provided but the statement needs "
+ + mNumParameters + " arguments.");
}
- if (bindArgs != null) {
- if (bindArgs.length > mNumParameters) {
- throw new IllegalArgumentException("Too many bind arguments. "
- + bindArgs.length + " arguments were provided but the statement needs "
- + mNumParameters + " arguments.");
+ if (mNumParameters != 0) {
+ mBindArgs = new Object[mNumParameters];
+ if (bindArgs != null) {
+ System.arraycopy(bindArgs, 0, mBindArgs, 0, bindArgs.length);
}
- System.arraycopy(bindArgs, 0, mBindArgs, 0, bindArgs.length);
+ } else {
+ mBindArgs = null;
}
}
diff --git a/core/java/android/os/Trace.java b/core/java/android/os/Trace.java
new file mode 100644
index 0000000..af94a37
--- /dev/null
+++ b/core/java/android/os/Trace.java
@@ -0,0 +1,94 @@
+/*
+ * Copyright (C) 2012 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.os;
+
+/**
+ * Writes trace events to the kernel trace buffer. These trace events can be
+ * collected using the "atrace" program for offline analysis.
+ *
+ * This tracing mechanism is independent of the method tracing mechanism
+ * offered by {@link Debug#startMethodTracing}. In particular, it enables
+ * tracing of events that occur across processes.
+ *
+ * @hide
+ */
+public final class Trace {
+ // These tags must be kept in sync with frameworks/native/include/utils/Trace.h.
+ public static final long TRACE_TAG_NEVER = 0;
+ public static final long TRACE_TAG_ALWAYS = 1L << 0;
+ public static final long TRACE_TAG_GRAPHICS = 1L << 1;
+ public static final long TRACE_TAG_INPUT = 1L << 2;
+ public static final long TRACE_TAG_VIEW = 1L << 3;
+
+ private static final long sEnabledTags = nativeGetEnabledTags();
+
+ private static native long nativeGetEnabledTags();
+ private static native void nativeTraceCounter(long tag, String name, int value);
+ private static native void nativeTraceBegin(long tag, String name);
+ private static native void nativeTraceEnd(long tag);
+
+ private Trace() {
+ }
+
+ /**
+ * Returns true if a trace tag is enabled.
+ *
+ * @param traceTag The trace tag to check.
+ * @return True if the trace tag is valid.
+ */
+ public static boolean isTagEnabled(long traceTag) {
+ return (sEnabledTags & traceTag) != 0;
+ }
+
+ /**
+ * Writes trace message to indicate the value of a given counter.
+ *
+ * @param traceTag The trace tag.
+ * @param counterName The counter name to appear in the trace.
+ * @param counterValue The counter value.
+ */
+ public static void traceCounter(long traceTag, String counterName, int counterValue) {
+ if ((sEnabledTags & traceTag) != 0) {
+ nativeTraceCounter(traceTag, counterName, counterValue);
+ }
+ }
+
+ /**
+ * Writes a trace message to indicate that a given method has begun.
+ * Must be followed by a call to {@link #traceEnd} using the same tag.
+ *
+ * @param traceTag The trace tag.
+ * @param methodName The method name to appear in the trace.
+ */
+ public static void traceBegin(long traceTag, String methodName) {
+ if ((sEnabledTags & traceTag) != 0) {
+ nativeTraceBegin(traceTag, methodName);
+ }
+ }
+
+ /**
+ * Writes a trace message to indicate that the current method has ended.
+ * Must be called exactly once for each call to {@link #traceBegin} using the same tag.
+ *
+ * @param traceTag The trace tag.
+ */
+ public static void traceEnd(long traceTag) {
+ if ((sEnabledTags & traceTag) != 0) {
+ nativeTraceEnd(traceTag);
+ }
+ }
+}
diff --git a/core/java/android/util/LocaleUtil.java b/core/java/android/util/LocaleUtil.java
index 9953252..60526e1 100644
--- a/core/java/android/util/LocaleUtil.java
+++ b/core/java/android/util/LocaleUtil.java
@@ -24,7 +24,6 @@
/**
* Various utilities for Locales
*
- * @hide
*/
public class LocaleUtil {
@@ -41,9 +40,7 @@
* {@link View#LAYOUT_DIRECTION_LTR} or
* {@link View#LAYOUT_DIRECTION_RTL}.
*
- * Be careful: this code will need to be changed when vertical scripts will be supported
- *
- * @hide
+ * Be careful: this code will need to be updated when vertical scripts will be supported
*/
public static int getLayoutDirectionFromLocale(Locale locale) {
if (locale != null && !locale.equals(Locale.ROOT)) {
@@ -69,7 +66,7 @@
* {@link View#LAYOUT_DIRECTION_LTR} or
* {@link View#LAYOUT_DIRECTION_RTL}.
*
- * Be careful: this code will need to be changed when vertical scripts will be supported
+ * Be careful: this code will need to be updated when vertical scripts will be supported
*
* @hide
*/
diff --git a/core/java/android/view/DisplayList.java b/core/java/android/view/DisplayList.java
index f60c8f0..a50f09f 100644
--- a/core/java/android/view/DisplayList.java
+++ b/core/java/android/view/DisplayList.java
@@ -70,4 +70,204 @@
* @return The size of this display list in bytes
*/
public abstract int getSize();
+
+ ///////////////////////////////////////////////////////////////////////////
+ // DisplayList Property Setters
+ ///////////////////////////////////////////////////////////////////////////
+
+ /**
+ * Set the caching property on the DisplayList, which indicates whether the DisplayList
+ * holds a layer. Layer DisplayLists should avoid creating an alpha layer, since alpha is
+ * handled in the drawLayer operation directly (and more efficiently).
+ *
+ * @param caching true if the DisplayList represents a hardware layer, false otherwise.
+ */
+ public abstract void setCaching(boolean caching);
+
+ /**
+ * Set whether the DisplayList should clip itself to its bounds. This property is controlled by
+ * the view's parent.
+ *
+ * @param clipChildren true if the DisplayList should clip to its bounds
+ */
+ public abstract void setClipChildren(boolean clipChildren);
+
+ /**
+ * Set the application scale on the DisplayList. This scale is incurred by applications that
+ * are auto-scaled for compatibility reasons. By default, the value is 1 (unscaled).
+ *
+ * @param scale The scaling factor
+ */
+ public abstract void setApplicationScale(float scale);
+
+ /**
+ * Sets the alpha value for the DisplayList
+ *
+ * @param alpha The translucency of the DisplayList
+ * @see View#setAlpha(float)
+ */
+ public abstract void setAlpha(float alpha);
+
+ /**
+ * Sets the translationX value for the DisplayList
+ *
+ * @param translationX The translationX value of the DisplayList
+ * @see View#setTranslationX(float)
+ */
+ public abstract void setTranslationX(float translationX);
+
+ /**
+ * Sets the translationY value for the DisplayList
+ *
+ * @param translationY The translationY value of the DisplayList
+ * @see View#setTranslationY(float)
+ */
+ public abstract void setTranslationY(float translationY);
+
+ /**
+ * Sets the rotation value for the DisplayList
+ *
+ * @param rotation The rotation value of the DisplayList
+ * @see View#setRotation(float)
+ */
+ public abstract void setRotation(float rotation);
+
+ /**
+ * Sets the rotationX value for the DisplayList
+ *
+ * @param rotationX The rotationX value of the DisplayList
+ * @see View#setRotationX(float)
+ */
+ public abstract void setRotationX(float rotationX);
+
+ /**
+ * Sets the rotationY value for the DisplayList
+ *
+ * @param rotationY The rotationY value of the DisplayList
+ * @see View#setRotationY(float)
+ */
+ public abstract void setRotationY(float rotationY);
+
+ /**
+ * Sets the scaleX value for the DisplayList
+ *
+ * @param scaleX The scaleX value of the DisplayList
+ * @see View#setScaleX(float)
+ */
+ public abstract void setScaleX(float scaleX);
+
+ /**
+ * Sets the scaleY value for the DisplayList
+ *
+ * @param scaleY The scaleY value of the DisplayList
+ * @see View#setScaleY(float)
+ */
+ public abstract void setScaleY(float scaleY);
+
+ /**
+ * Sets all of the transform-related values of the View onto the DisplayList
+ *
+ * @param alpha The alpha value of the DisplayList
+ * @param translationX The translationX value of the DisplayList
+ * @param translationY The translationY value of the DisplayList
+ * @param rotation The rotation value of the DisplayList
+ * @param rotationX The rotationX value of the DisplayList
+ * @param rotationY The rotationY value of the DisplayList
+ * @param scaleX The scaleX value of the DisplayList
+ * @param scaleY The scaleY value of the DisplayList
+ */
+ public abstract void setTransformationInfo(float alpha, float translationX, float translationY,
+ float rotation, float rotationX, float rotationY, float scaleX, float scaleY);
+
+ /**
+ * Sets the pivotX value for the DisplayList
+ *
+ * @param pivotX The pivotX value of the DisplayList
+ * @see View#setPivotX(float)
+ */
+ public abstract void setPivotX(float pivotX);
+
+ /**
+ * Sets the pivotY value for the DisplayList
+ *
+ * @param pivotY The pivotY value of the DisplayList
+ * @see View#setPivotY(float)
+ */
+ public abstract void setPivotY(float pivotY);
+
+ /**
+ * Sets the camera distance for the DisplayList
+ *
+ * @param distance The distance in z of the camera of the DisplayList
+ * @see View#setCameraDistance(float)
+ */
+ public abstract void setCameraDistance(float distance);
+
+ /**
+ * Sets the left value for the DisplayList
+ *
+ * @param left The left value of the DisplayList
+ * @see View#setLeft(int)
+ */
+ public abstract void setLeft(int left);
+
+ /**
+ * Sets the top value for the DisplayList
+ *
+ * @param top The top value of the DisplayList
+ * @see View#setTop(int)
+ */
+ public abstract void setTop(int top);
+
+ /**
+ * Sets the right value for the DisplayList
+ *
+ * @param right The right value of the DisplayList
+ * @see View#setRight(int)
+ */
+ public abstract void setRight(int right);
+
+ /**
+ * Sets the bottom value for the DisplayList
+ *
+ * @param bottom The bottom value of the DisplayList
+ * @see View#setBottom(int)
+ */
+ public abstract void setBottom(int bottom);
+
+ /**
+ * Sets the left and top values for the DisplayList
+ *
+ * @param left The left value of the DisplayList
+ * @param top The top value of the DisplayList
+ * @see View#setLeft(int)
+ * @see View#setTop(int)
+ */
+ public abstract void setLeftTop(int left, int top);
+
+ /**
+ * Sets the left and top values for the DisplayList
+ *
+ * @param left The left value of the DisplayList
+ * @param top The top value of the DisplayList
+ * @see View#setLeft(int)
+ * @see View#setTop(int)
+ */
+ public abstract void setLeftTopRightBottom(int left, int top, int right, int bottom);
+
+ /**
+ * Offsets the left and right values for the DisplayList
+ *
+ * @param offset The amount that the left and right values of the DisplayList are offset
+ * @see View#offsetLeftAndRight(int)
+ */
+ public abstract void offsetLeftRight(int offset);
+
+ /**
+ * Offsets the top and bottom values for the DisplayList
+ *
+ * @param offset The amount that the top and bottom values of the DisplayList are offset
+ * @see View#offsetTopAndBottom(int)
+ */
+ public abstract void offsetTopBottom(int offset);
}
diff --git a/core/java/android/view/GLES20DisplayList.java b/core/java/android/view/GLES20DisplayList.java
index 969c9ab..9b4cf21 100644
--- a/core/java/android/view/GLES20DisplayList.java
+++ b/core/java/android/view/GLES20DisplayList.java
@@ -96,6 +96,251 @@
return GLES20Canvas.getDisplayListSize(mFinalizer.mNativeDisplayList);
}
+ ///////////////////////////////////////////////////////////////////////////
+ // Native View Properties
+ ///////////////////////////////////////////////////////////////////////////
+
+ @Override
+ public void setCaching(boolean caching) {
+ try {
+ nSetCaching(getNativeDisplayList(), caching);
+ } catch (IllegalStateException e) {
+ // invalid DisplayList okay: we'll set current values the next time we render to it
+ }
+ }
+
+ @Override
+ public void setClipChildren(boolean clipChildren) {
+ try {
+ nSetClipChildren(getNativeDisplayList(), clipChildren);
+ } catch (IllegalStateException e) {
+ // invalid DisplayList okay: we'll set current values the next time we render to it
+ }
+ }
+
+ @Override
+ public void setApplicationScale(float scale) {
+ try {
+ nSetApplicationScale(getNativeDisplayList(), scale);
+ } catch (IllegalStateException e) {
+ // invalid DisplayList okay: we'll set current values the next time we render to it
+ }
+ }
+
+ @Override
+ public void setAlpha(float alpha) {
+ try {
+ nSetAlpha(getNativeDisplayList(), alpha);
+ } catch (IllegalStateException e) {
+ // invalid DisplayList okay: we'll set current values the next time we render to it
+ }
+ }
+
+ @Override
+ public void setTranslationX(float translationX) {
+ try {
+ nSetTranslationX(getNativeDisplayList(), translationX);
+ } catch (IllegalStateException e) {
+ // invalid DisplayList okay: we'll set current values the next time we render to it
+ }
+ }
+
+ @Override
+ public void setTranslationY(float translationY) {
+ try {
+ nSetTranslationY(getNativeDisplayList(), translationY);
+ } catch (IllegalStateException e) {
+ // invalid DisplayList okay: we'll set current values the next time we render to it
+ }
+ }
+
+ @Override
+ public void setRotation(float rotation) {
+ try {
+ nSetRotation(getNativeDisplayList(), rotation);
+ } catch (IllegalStateException e) {
+ // invalid DisplayList okay: we'll set current values the next time we render to it
+ }
+ }
+
+ @Override
+ public void setRotationX(float rotationX) {
+ try {
+ nSetRotationX(getNativeDisplayList(), rotationX);
+ } catch (IllegalStateException e) {
+ // invalid DisplayList okay: we'll set current values the next time we render to it
+ }
+ }
+
+ @Override
+ public void setRotationY(float rotationY) {
+ try {
+ nSetRotationY(getNativeDisplayList(), rotationY);
+ } catch (IllegalStateException e) {
+ // invalid DisplayList okay: we'll set current values the next time we render to it
+ }
+ }
+
+ @Override
+ public void setScaleX(float scaleX) {
+ try {
+ nSetScaleX(getNativeDisplayList(), scaleX);
+ } catch (IllegalStateException e) {
+ // invalid DisplayList okay: we'll set current values the next time we render to it
+ }
+ }
+
+ @Override
+ public void setScaleY(float scaleY) {
+ try {
+ nSetScaleY(getNativeDisplayList(), scaleY);
+ } catch (IllegalStateException e) {
+ // invalid DisplayList okay: we'll set current values the next time we render to it
+ }
+ }
+
+ @Override
+ public void setTransformationInfo(float alpha, float translationX, float translationY,
+ float rotation, float rotationX, float rotationY, float scaleX, float scaleY) {
+ try {
+ nSetTransformationInfo(getNativeDisplayList(), alpha, translationX, translationY,
+ rotation, rotationX, rotationY, scaleX, scaleY);
+ } catch (IllegalStateException e) {
+ // invalid DisplayList okay: we'll set current values the next time we render to it
+ }
+ }
+
+ @Override
+ public void setPivotX(float pivotX) {
+ try {
+ nSetPivotX(getNativeDisplayList(), pivotX);
+ } catch (IllegalStateException e) {
+ // invalid DisplayList okay: we'll set current values the next time we render to it
+ }
+ }
+
+ @Override
+ public void setPivotY(float pivotY) {
+ try {
+ nSetPivotY(getNativeDisplayList(), pivotY);
+ } catch (IllegalStateException e) {
+ // invalid DisplayList okay: we'll set current values the next time we render to it
+ }
+ }
+
+ @Override
+ public void setCameraDistance(float distance) {
+ try {
+ nSetCameraDistance(getNativeDisplayList(), distance);
+ } catch (IllegalStateException e) {
+ // invalid DisplayList okay: we'll set current values the next time we render to it
+ }
+ }
+
+ @Override
+ public void setLeft(int left) {
+ try {
+ nSetLeft(getNativeDisplayList(), left);
+ } catch (IllegalStateException e) {
+ // invalid DisplayList okay: we'll set current values the next time we render to it
+ }
+ }
+
+ @Override
+ public void setTop(int top) {
+ try {
+ nSetTop(getNativeDisplayList(), top);
+ } catch (IllegalStateException e) {
+ // invalid DisplayList okay: we'll set current values the next time we render to it
+ }
+ }
+
+ @Override
+ public void setRight(int right) {
+ try {
+ nSetRight(getNativeDisplayList(), right);
+ } catch (IllegalStateException e) {
+ // invalid DisplayList okay: we'll set current values the next time we render to it
+ }
+ }
+
+ @Override
+ public void setBottom(int bottom) {
+ try {
+ nSetBottom(getNativeDisplayList(), bottom);
+ } catch (IllegalStateException e) {
+ // invalid DisplayList okay: we'll set current values the next time we render to it
+ }
+ }
+
+ @Override
+ public void setLeftTop(int left, int top) {
+ try {
+ nSetLeftTop(getNativeDisplayList(), left, top);
+ } catch (IllegalStateException e) {
+ // invalid DisplayList okay: we'll set current values the next time we render to it
+ }
+ }
+
+ @Override
+ public void setLeftTopRightBottom(int left, int top, int right, int bottom) {
+ try {
+ nSetLeftTopRightBottom(getNativeDisplayList(), left, top, right, bottom);
+ } catch (IllegalStateException e) {
+ // invalid DisplayList okay: we'll set current values the next time we render to it
+ }
+ }
+
+ @Override
+ public void offsetLeftRight(int offset) {
+ try {
+ nOffsetLeftRight(getNativeDisplayList(), offset);
+ } catch (IllegalStateException e) {
+ // invalid DisplayList okay: we'll set current values the next time we render to it
+ }
+ }
+
+ @Override
+ public void offsetTopBottom(int offset) {
+ try {
+ nOffsetTopBottom(getNativeDisplayList(), offset);
+ } catch (IllegalStateException e) {
+ // invalid DisplayList okay: we'll set current values the next time we render to it
+ }
+ }
+
+ private static native void nOffsetTopBottom(int displayList, int offset);
+ private static native void nOffsetLeftRight(int displayList, int offset);
+ private static native void nSetLeftTopRightBottom(int displayList, int left, int top,
+ int right, int bottom);
+ private static native void nSetLeftTop(int displayList, int left, int top);
+ private static native void nSetBottom(int displayList, int bottom);
+ private static native void nSetRight(int displayList, int right);
+ private static native void nSetTop(int displayList, int top);
+ private static native void nSetLeft(int displayList, int left);
+ private static native void nSetCameraDistance(int displayList, float distance);
+ private static native void nSetPivotY(int displayList, float pivotY);
+ private static native void nSetPivotX(int displayList, float pivotX);
+ private static native void nSetCaching(int displayList, boolean caching);
+ private static native void nSetClipChildren(int displayList, boolean clipChildren);
+ private static native void nSetApplicationScale(int displayList, float scale);
+ private static native void nSetAlpha(int displayList, float alpha);
+ private static native void nSetTranslationX(int displayList, float translationX);
+ private static native void nSetTranslationY(int displayList, float translationY);
+ private static native void nSetRotation(int displayList, float rotation);
+ private static native void nSetRotationX(int displayList, float rotationX);
+ private static native void nSetRotationY(int displayList, float rotationY);
+ private static native void nSetScaleX(int displayList, float scaleX);
+ private static native void nSetScaleY(int displayList, float scaleY);
+ private static native void nSetTransformationInfo(int displayList, float alpha,
+ float translationX, float translationY, float rotation, float rotationX,
+ float rotationY, float scaleX, float scaleY);
+
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Finalization
+ ///////////////////////////////////////////////////////////////////////////
+
private static class DisplayListFinalizer {
final int mNativeDisplayList;
diff --git a/core/java/android/view/Gravity.java b/core/java/android/view/Gravity.java
index 63f5ec1..f031fe7 100644
--- a/core/java/android/view/Gravity.java
+++ b/core/java/android/view/Gravity.java
@@ -153,7 +153,8 @@
* container.
* @param layoutDirection The layout direction.
*
- * @hide
+ * @see {@link View#LAYOUT_DIRECTION_LTR}
+ * @see {@link View#LAYOUT_DIRECTION_RTL}
*/
public static void apply(int gravity, int w, int h, Rect container,
Rect outRect, int layoutDirection) {
@@ -268,6 +269,37 @@
}
/**
+ * Apply a gravity constant to an object.
+ *
+ * @param gravity The desired placement of the object, as defined by the
+ * constants in this class.
+ * @param w The horizontal size of the object.
+ * @param h The vertical size of the object.
+ * @param container The frame of the containing space, in which the object
+ * will be placed. Should be large enough to contain the
+ * width and height of the object.
+ * @param xAdj Offset to apply to the X axis. If gravity is LEFT this
+ * pushes it to the right; if gravity is RIGHT it pushes it to
+ * the left; if gravity is CENTER_HORIZONTAL it pushes it to the
+ * right or left; otherwise it is ignored.
+ * @param yAdj Offset to apply to the Y axis. If gravity is TOP this pushes
+ * it down; if gravity is BOTTOM it pushes it up; if gravity is
+ * CENTER_VERTICAL it pushes it down or up; otherwise it is
+ * ignored.
+ * @param outRect Receives the computed frame of the object in its
+ * container.
+ * @param layoutDirection The layout direction.
+ *
+ * @see {@link View#LAYOUT_DIRECTION_LTR}
+ * @see {@link View#LAYOUT_DIRECTION_RTL}
+ */
+ public static void apply(int gravity, int w, int h, Rect container,
+ int xAdj, int yAdj, Rect outRect, int layoutDirection) {
+ int absGravity = getAbsoluteGravity(gravity, layoutDirection);
+ apply(absGravity, w, h, container, xAdj, yAdj, outRect);
+ }
+
+ /**
* Apply additional gravity behavior based on the overall "display" that an
* object exists in. This can be used after
* {@link #apply(int, int, int, Rect, int, int, Rect)} to place the object
@@ -320,7 +352,32 @@
}
}
}
-
+
+ /**
+ * Apply additional gravity behavior based on the overall "display" that an
+ * object exists in. This can be used after
+ * {@link #apply(int, int, int, Rect, int, int, Rect)} to place the object
+ * within a visible display. By default this moves or clips the object
+ * to be visible in the display; the gravity flags
+ * {@link #DISPLAY_CLIP_HORIZONTAL} and {@link #DISPLAY_CLIP_VERTICAL}
+ * can be used to change this behavior.
+ *
+ * @param gravity Gravity constants to modify the placement within the
+ * display.
+ * @param display The rectangle of the display in which the object is
+ * being placed.
+ * @param inoutObj Supplies the current object position; returns with it
+ * modified if needed to fit in the display.
+ * @param layoutDirection The layout direction.
+ *
+ * @see {@link View#LAYOUT_DIRECTION_LTR}
+ * @see {@link View#LAYOUT_DIRECTION_RTL}
+ */
+ public static void applyDisplay(int gravity, Rect display, Rect inoutObj, int layoutDirection) {
+ int absGravity = getAbsoluteGravity(gravity, layoutDirection);
+ applyDisplay(absGravity, display, inoutObj);
+ }
+
/**
* <p>Indicate whether the supplied gravity has a vertical pull.</p>
*
diff --git a/core/java/android/view/HardwareLayer.java b/core/java/android/view/HardwareLayer.java
index a97167b..e73f7bf 100644
--- a/core/java/android/view/HardwareLayer.java
+++ b/core/java/android/view/HardwareLayer.java
@@ -36,6 +36,7 @@
int mWidth;
int mHeight;
+ DisplayList mDisplayList;
boolean mOpaque;
@@ -79,6 +80,24 @@
}
/**
+ * Returns the DisplayList for the layer.
+ *
+ * @return The DisplayList of the hardware layer
+ */
+ DisplayList getDisplayList() {
+ return mDisplayList;
+ }
+
+ /**
+ * Sets the DisplayList for the layer.
+ *
+ * @param displayList The new DisplayList for this layer
+ */
+ void setDisplayList(DisplayList displayList) {
+ mDisplayList = displayList;
+ }
+
+ /**
* Returns whether or not this layer is opaque.
*
* @return True if the layer is opaque, false otherwise
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 7a1923b..bf48ff2 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -336,9 +336,10 @@
* Padding can be used to offset the content of the view by a specific amount of
* pixels. For instance, a left padding of 2 will push the view's content by
* 2 pixels to the right of the left edge. Padding can be set using the
- * {@link #setPadding(int, int, int, int)} method and queried by calling
- * {@link #getPaddingLeft()}, {@link #getPaddingTop()},
- * {@link #getPaddingRight()}, {@link #getPaddingBottom()}.
+ * {@link #setPadding(int, int, int, int)} or {@link #setPaddingRelative(int, int, int, int)}
+ * method and queried by calling {@link #getPaddingLeft()}, {@link #getPaddingTop()},
+ * {@link #getPaddingRight()}, {@link #getPaddingBottom()}, {@link #getPaddingStart()},
+ * {@link #getPaddingEnd()}.
* </p>
*
* <p>
@@ -1497,6 +1498,14 @@
static final ThreadLocal<Rect> sThreadLocal = new ThreadLocal<Rect>();
/**
+ * Temporary flag, used to enable processing of View properties in the native DisplayList
+ * object instead of during draw(). Soon to be enabled by default for hardware-accelerated
+ * apps.
+ * @hide
+ */
+ protected static final boolean USE_DISPLAY_LIST_PROPERTIES = false;
+
+ /**
* Map used to store views' tags.
*/
private SparseArray<Object> mKeyedTags;
@@ -7283,6 +7292,24 @@
}
/**
+ * Gets the distance along the Z axis from the camera to this view.
+ *
+ * @see #setCameraDistance(float)
+ *
+ * @return The distance along the Z axis.
+ */
+ public float getCameraDistance() {
+ ensureTransformationInfo();
+ final float dpi = mResources.getDisplayMetrics().densityDpi;
+ final TransformationInfo info = mTransformationInfo;
+ if (info.mCamera == null) {
+ info.mCamera = new Camera();
+ info.matrix3D = new Matrix();
+ }
+ return -(info.mCamera.getLocationZ() * dpi);
+ }
+
+ /**
* <p>Sets the distance along the Z axis (orthogonal to the X/Y plane on which
* views are drawn) from the camera to this view. The camera's distance
* affects 3D transformations, for instance rotations around the X and Y
@@ -7337,6 +7364,9 @@
info.mMatrixDirty = true;
invalidate(false);
+ if (USE_DISPLAY_LIST_PROPERTIES && mDisplayList != null) {
+ mDisplayList.setCameraDistance(distance);
+ }
}
/**
@@ -7378,6 +7408,9 @@
info.mMatrixDirty = true;
mPrivateFlags |= DRAWN; // force another invalidation with the new orientation
invalidate(false);
+ if (USE_DISPLAY_LIST_PROPERTIES && mDisplayList != null) {
+ mDisplayList.setRotation(rotation);
+ }
}
}
@@ -7425,6 +7458,9 @@
info.mMatrixDirty = true;
mPrivateFlags |= DRAWN; // force another invalidation with the new orientation
invalidate(false);
+ if (USE_DISPLAY_LIST_PROPERTIES && mDisplayList != null) {
+ mDisplayList.setRotationY(rotationY);
+ }
}
}
@@ -7472,6 +7508,9 @@
info.mMatrixDirty = true;
mPrivateFlags |= DRAWN; // force another invalidation with the new orientation
invalidate(false);
+ if (USE_DISPLAY_LIST_PROPERTIES && mDisplayList != null) {
+ mDisplayList.setRotationX(rotationX);
+ }
}
}
@@ -7511,6 +7550,9 @@
info.mMatrixDirty = true;
mPrivateFlags |= DRAWN; // force another invalidation with the new orientation
invalidate(false);
+ if (USE_DISPLAY_LIST_PROPERTIES && mDisplayList != null) {
+ mDisplayList.setScaleX(scaleX);
+ }
}
}
@@ -7550,6 +7592,9 @@
info.mMatrixDirty = true;
mPrivateFlags |= DRAWN; // force another invalidation with the new orientation
invalidate(false);
+ if (USE_DISPLAY_LIST_PROPERTIES && mDisplayList != null) {
+ mDisplayList.setScaleY(scaleY);
+ }
}
}
@@ -7595,6 +7640,9 @@
info.mMatrixDirty = true;
mPrivateFlags |= DRAWN; // force another invalidation with the new orientation
invalidate(false);
+ if (USE_DISPLAY_LIST_PROPERTIES && mDisplayList != null) {
+ mDisplayList.setPivotX(pivotX);
+ }
}
}
@@ -7639,6 +7687,9 @@
info.mMatrixDirty = true;
mPrivateFlags |= DRAWN; // force another invalidation with the new orientation
invalidate(false);
+ if (USE_DISPLAY_LIST_PROPERTIES && mDisplayList != null) {
+ mDisplayList.setPivotY(pivotY);
+ }
}
}
@@ -7685,6 +7736,9 @@
} else {
mPrivateFlags &= ~ALPHA_SET;
invalidate(false);
+ if (USE_DISPLAY_LIST_PROPERTIES && mDisplayList != null) {
+ mDisplayList.setAlpha(alpha);
+ }
}
}
}
@@ -7709,6 +7763,9 @@
return true;
} else {
mPrivateFlags &= ~ALPHA_SET;
+ if (USE_DISPLAY_LIST_PROPERTIES && mDisplayList != null) {
+ mDisplayList.setAlpha(alpha);
+ }
}
}
return false;
@@ -7758,6 +7815,9 @@
int oldHeight = mBottom - mTop;
mTop = top;
+ if (USE_DISPLAY_LIST_PROPERTIES && mDisplayList != null) {
+ mDisplayList.setTop(mTop);
+ }
onSizeChanged(width, mBottom - mTop, width, oldHeight);
@@ -7824,6 +7884,9 @@
int oldHeight = mBottom - mTop;
mBottom = bottom;
+ if (USE_DISPLAY_LIST_PROPERTIES && mDisplayList != null) {
+ mDisplayList.setBottom(mBottom);
+ }
onSizeChanged(width, mBottom - mTop, width, oldHeight);
@@ -7884,6 +7947,9 @@
int height = mBottom - mTop;
mLeft = left;
+ if (USE_DISPLAY_LIST_PROPERTIES && mDisplayList != null) {
+ mDisplayList.setLeft(left);
+ }
onSizeChanged(mRight - mLeft, height, oldWidth, height);
@@ -7897,6 +7963,9 @@
}
mBackgroundSizeChanged = true;
invalidateParentIfNeeded();
+ if (USE_DISPLAY_LIST_PROPERTIES) {
+
+ }
}
}
@@ -7941,6 +8010,9 @@
int height = mBottom - mTop;
mRight = right;
+ if (USE_DISPLAY_LIST_PROPERTIES && mDisplayList != null) {
+ mDisplayList.setRight(mRight);
+ }
onSizeChanged(mRight - mLeft, height, oldWidth, height);
@@ -8037,6 +8109,9 @@
info.mMatrixDirty = true;
mPrivateFlags |= DRAWN; // force another invalidation with the new orientation
invalidate(false);
+ if (USE_DISPLAY_LIST_PROPERTIES && mDisplayList != null) {
+ mDisplayList.setTranslationX(translationX);
+ }
}
}
@@ -8074,6 +8149,9 @@
info.mMatrixDirty = true;
mPrivateFlags |= DRAWN; // force another invalidation with the new orientation
invalidate(false);
+ if (USE_DISPLAY_LIST_PROPERTIES && mDisplayList != null) {
+ mDisplayList.setTranslationY(translationY);
+ }
}
}
@@ -8206,6 +8284,9 @@
mTop += offset;
mBottom += offset;
+ if (USE_DISPLAY_LIST_PROPERTIES && mDisplayList != null) {
+ mDisplayList.offsetTopBottom(offset);
+ }
if (!matrixIsIdentity) {
mPrivateFlags |= DRAWN; // force another invalidation with the new orientation
@@ -8247,6 +8328,9 @@
mLeft += offset;
mRight += offset;
+ if (USE_DISPLAY_LIST_PROPERTIES && mDisplayList != null) {
+ mDisplayList.offsetLeftRight(offset);
+ }
if (!matrixIsIdentity) {
mPrivateFlags |= DRAWN; // force another invalidation with the new orientation
@@ -9819,8 +9903,8 @@
*
* @param layoutDirection the direction of the layout
*
- * {@link #LAYOUT_DIRECTION_LTR}
- * {@link #LAYOUT_DIRECTION_RTL}
+ * @see {@link #LAYOUT_DIRECTION_LTR}
+ * @see {@link #LAYOUT_DIRECTION_RTL}
*/
public void onPaddingChanged(int layoutDirection) {
}
@@ -10383,7 +10467,7 @@
return null;
}
- mHardwareLayer.redraw(getDisplayList(), mLocalDirtyRect);
+ mHardwareLayer.redraw(getHardwareLayerDisplayList(mHardwareLayer), mLocalDirtyRect);
mLocalDirtyRect.setEmpty();
}
@@ -10535,6 +10619,129 @@
}
/**
+ * Returns a DisplayList. If the incoming displayList is null, one will be created.
+ * Otherwise, the same display list will be returned (after having been rendered into
+ * along the way, depending on the invalidation state of the view).
+ *
+ * @param displayList The previous version of this displayList, could be null.
+ * @param isLayer Whether the requester of the display list is a layer. If so,
+ * the view will avoid creating a layer inside the resulting display list.
+ * @return A new or reused DisplayList object.
+ */
+ private DisplayList getDisplayList(DisplayList displayList, boolean isLayer) {
+ if (!canHaveDisplayList()) {
+ return null;
+ }
+
+ if (((mPrivateFlags & DRAWING_CACHE_VALID) == 0 ||
+ displayList == null || !displayList.isValid() ||
+ (!isLayer && mRecreateDisplayList))) {
+ // Don't need to recreate the display list, just need to tell our
+ // children to restore/recreate theirs
+ if (displayList != null && displayList.isValid() &&
+ !isLayer && !mRecreateDisplayList) {
+ mPrivateFlags |= DRAWN | DRAWING_CACHE_VALID;
+ mPrivateFlags &= ~DIRTY_MASK;
+ dispatchGetDisplayList();
+
+ return displayList;
+ }
+
+ if (!isLayer) {
+ // If we got here, we're recreating it. Mark it as such to ensure that
+ // we copy in child display lists into ours in drawChild()
+ mRecreateDisplayList = true;
+ }
+ if (displayList == null) {
+ final String name = getClass().getSimpleName();
+ displayList = mAttachInfo.mHardwareRenderer.createDisplayList(name);
+ // If we're creating a new display list, make sure our parent gets invalidated
+ // since they will need to recreate their display list to account for this
+ // new child display list.
+ invalidateParentCaches();
+ }
+
+ boolean caching = false;
+ final HardwareCanvas canvas = displayList.start();
+ int restoreCount = 0;
+ int width = mRight - mLeft;
+ int height = mBottom - mTop;
+
+ try {
+ canvas.setViewport(width, height);
+ // The dirty rect should always be null for a display list
+ canvas.onPreDraw(null);
+ int layerType = (
+ !(mParent instanceof ViewGroup) || ((ViewGroup)mParent).mDrawLayers) ?
+ getLayerType() : LAYER_TYPE_NONE;
+ if (!isLayer && layerType == LAYER_TYPE_HARDWARE && USE_DISPLAY_LIST_PROPERTIES) {
+ final HardwareLayer layer = getHardwareLayer();
+ if (layer != null && layer.isValid()) {
+ canvas.drawHardwareLayer(layer, 0, 0, mLayerPaint);
+ } else {
+ canvas.saveLayer(0, 0,
+ mRight - mLeft, mBottom - mTop, mLayerPaint,
+ Canvas.HAS_ALPHA_LAYER_SAVE_FLAG | Canvas.CLIP_TO_LAYER_SAVE_FLAG);
+ }
+ caching = true;
+ } else {
+
+ computeScroll();
+
+ if (!USE_DISPLAY_LIST_PROPERTIES) {
+ restoreCount = canvas.save();
+ }
+ canvas.translate(-mScrollX, -mScrollY);
+ if (!isLayer) {
+ mPrivateFlags |= DRAWN | DRAWING_CACHE_VALID;
+ mPrivateFlags &= ~DIRTY_MASK;
+ }
+
+ // Fast path for layouts with no backgrounds
+ if ((mPrivateFlags & SKIP_DRAW) == SKIP_DRAW) {
+ dispatchDraw(canvas);
+ } else {
+ draw(canvas);
+ }
+ }
+ } finally {
+ if (USE_DISPLAY_LIST_PROPERTIES) {
+ canvas.restoreToCount(restoreCount);
+ }
+ canvas.onPostDraw();
+
+ displayList.end();
+ if (USE_DISPLAY_LIST_PROPERTIES) {
+ displayList.setCaching(caching);
+ }
+ if (isLayer && USE_DISPLAY_LIST_PROPERTIES) {
+ displayList.setLeftTopRightBottom(0, 0, width, height);
+ } else {
+ setDisplayListProperties(displayList);
+ }
+ }
+ } else if (!isLayer) {
+ mPrivateFlags |= DRAWN | DRAWING_CACHE_VALID;
+ mPrivateFlags &= ~DIRTY_MASK;
+ }
+
+ return displayList;
+ }
+
+ /**
+ * Get the DisplayList for the HardwareLayer
+ *
+ * @param layer The HardwareLayer whose DisplayList we want
+ * @return A DisplayList fopr the specified HardwareLayer
+ */
+ private DisplayList getHardwareLayerDisplayList(HardwareLayer layer) {
+ DisplayList displayList = getDisplayList(layer.getDisplayList(), true);
+ layer.setDisplayList(displayList);
+ return displayList;
+ }
+
+
+ /**
* <p>Returns a display list that can be used to draw this view again
* without executing its draw method.</p>
*
@@ -10543,70 +10750,7 @@
* @hide
*/
public DisplayList getDisplayList() {
- if (!canHaveDisplayList()) {
- return null;
- }
-
- if (((mPrivateFlags & DRAWING_CACHE_VALID) == 0 ||
- mDisplayList == null || !mDisplayList.isValid() ||
- mRecreateDisplayList)) {
- // Don't need to recreate the display list, just need to tell our
- // children to restore/recreate theirs
- if (mDisplayList != null && mDisplayList.isValid() &&
- !mRecreateDisplayList) {
- mPrivateFlags |= DRAWN | DRAWING_CACHE_VALID;
- mPrivateFlags &= ~DIRTY_MASK;
- dispatchGetDisplayList();
-
- return mDisplayList;
- }
-
- // If we got here, we're recreating it. Mark it as such to ensure that
- // we copy in child display lists into ours in drawChild()
- mRecreateDisplayList = true;
- if (mDisplayList == null) {
- final String name = getClass().getSimpleName();
- mDisplayList = mAttachInfo.mHardwareRenderer.createDisplayList(name);
- // If we're creating a new display list, make sure our parent gets invalidated
- // since they will need to recreate their display list to account for this
- // new child display list.
- invalidateParentCaches();
- }
-
- final HardwareCanvas canvas = mDisplayList.start();
- int restoreCount = 0;
- try {
- int width = mRight - mLeft;
- int height = mBottom - mTop;
-
- canvas.setViewport(width, height);
- // The dirty rect should always be null for a display list
- canvas.onPreDraw(null);
-
- computeScroll();
-
- restoreCount = canvas.save();
- canvas.translate(-mScrollX, -mScrollY);
- mPrivateFlags |= DRAWN | DRAWING_CACHE_VALID;
- mPrivateFlags &= ~DIRTY_MASK;
-
- // Fast path for layouts with no backgrounds
- if ((mPrivateFlags & SKIP_DRAW) == SKIP_DRAW) {
- dispatchDraw(canvas);
- } else {
- draw(canvas);
- }
- } finally {
- canvas.restoreToCount(restoreCount);
- canvas.onPostDraw();
-
- mDisplayList.end();
- }
- } else {
- mPrivateFlags |= DRAWN | DRAWING_CACHE_VALID;
- mPrivateFlags &= ~DIRTY_MASK;
- }
-
+ mDisplayList = getDisplayList(mDisplayList, false);
return mDisplayList;
}
@@ -11151,19 +11295,57 @@
return more;
}
+ void setDisplayListProperties() {
+ setDisplayListProperties(mDisplayList);
+ }
+
+ /**
+ * This method is called by getDisplayList() when a display list is created or re-rendered.
+ * It sets or resets the current value of all properties on that display list (resetting is
+ * necessary when a display list is being re-created, because we need to make sure that
+ * previously-set transform values
+ */
+ void setDisplayListProperties(DisplayList displayList) {
+ if (USE_DISPLAY_LIST_PROPERTIES && displayList != null) {
+ displayList.setLeftTopRightBottom(mLeft, mTop, mRight, mBottom);
+ if (mParent instanceof ViewGroup) {
+ displayList.setClipChildren(
+ (((ViewGroup)mParent).mGroupFlags & ViewGroup.FLAG_CLIP_CHILDREN) != 0);
+ }
+ if (mAttachInfo != null && mAttachInfo.mScalingRequired &&
+ mAttachInfo.mApplicationScale != 1.0f) {
+ displayList.setApplicationScale(1f / mAttachInfo.mApplicationScale);
+ }
+ if (mTransformationInfo != null) {
+ displayList.setTransformationInfo(mTransformationInfo.mAlpha,
+ mTransformationInfo.mTranslationX, mTransformationInfo.mTranslationY,
+ mTransformationInfo.mRotation, mTransformationInfo.mRotationX,
+ mTransformationInfo.mRotationY, mTransformationInfo.mScaleX,
+ mTransformationInfo.mScaleY);
+ displayList.setCameraDistance(getCameraDistance());
+ if ((mPrivateFlags & PIVOT_EXPLICITLY_SET) == PIVOT_EXPLICITLY_SET) {
+ displayList.setPivotX(getPivotX());
+ displayList.setPivotY(getPivotY());
+ }
+ }
+ }
+ }
+
/**
* This method is called by ViewGroup.drawChild() to have each child view draw itself.
* This draw() method is an implementation detail and is not intended to be overridden or
* to be called from anywhere else other than ViewGroup.drawChild().
*/
boolean draw(Canvas canvas, ViewGroup parent, long drawingTime) {
+ boolean useDisplayListProperties = USE_DISPLAY_LIST_PROPERTIES && mAttachInfo != null &&
+ mAttachInfo.mHardwareAccelerated;
boolean more = false;
final boolean childHasIdentityMatrix = hasIdentityMatrix();
final int flags = parent.mGroupFlags;
- if ((flags & parent.FLAG_CLEAR_TRANSFORMATION) == parent.FLAG_CLEAR_TRANSFORMATION) {
+ if ((flags & ViewGroup.FLAG_CLEAR_TRANSFORMATION) == ViewGroup.FLAG_CLEAR_TRANSFORMATION) {
parent.mChildTransformation.clear();
- parent.mGroupFlags &= ~parent.FLAG_CLEAR_TRANSFORMATION;
+ parent.mGroupFlags &= ~ViewGroup.FLAG_CLEAR_TRANSFORMATION;
}
Transformation transformToApply = null;
@@ -11174,8 +11356,8 @@
int layerType = parent.mDrawLayers ? getLayerType() : LAYER_TYPE_NONE;
final boolean hardwareAccelerated = canvas.isHardwareAccelerated();
- if ((flags & parent.FLAG_CHILDREN_DRAWN_WITH_CACHE) == parent.FLAG_CHILDREN_DRAWN_WITH_CACHE ||
- (flags & parent.FLAG_ALWAYS_DRAWN_WITH_CACHE) == parent.FLAG_ALWAYS_DRAWN_WITH_CACHE) {
+ if ((flags & ViewGroup.FLAG_CHILDREN_DRAWN_WITH_CACHE) != 0 ||
+ (flags & ViewGroup.FLAG_ALWAYS_DRAWN_WITH_CACHE) != 0) {
caching = true;
if (mAttachInfo != null) scalingRequired = mAttachInfo.mScalingRequired;
} else {
@@ -11187,8 +11369,7 @@
more = drawAnimation(parent, drawingTime, a, scalingRequired);
concatMatrix = a.willChangeTransformationMatrix();
transformToApply = parent.mChildTransformation;
- } else if ((flags & parent.FLAG_SUPPORT_STATIC_TRANSFORMATIONS) ==
- parent.FLAG_SUPPORT_STATIC_TRANSFORMATIONS) {
+ } else if ((flags & ViewGroup.FLAG_SUPPORT_STATIC_TRANSFORMATIONS) != 0) {
final boolean hasTransform =
parent.getChildStaticTransformation(this, parent.mChildTransformation);
if (hasTransform) {
@@ -11238,6 +11419,11 @@
buildDrawingCache(true);
cache = getDrawingCache(true);
break;
+ case LAYER_TYPE_HARDWARE:
+ if (useDisplayListProperties) {
+ hasDisplayList = canHaveDisplayList();
+ }
+ break;
case LAYER_TYPE_NONE:
// Delay getting the display list until animation-driven alpha values are
// set up and possibly passed on to the view
@@ -11246,24 +11432,33 @@
}
}
}
+ useDisplayListProperties &= hasDisplayList;
final boolean hasNoCache = cache == null || hasDisplayList;
final boolean offsetForScroll = cache == null && !hasDisplayList &&
layerType != LAYER_TYPE_HARDWARE;
- final int restoreTo = canvas.save();
+ int restoreTo = -1;
+ if (!useDisplayListProperties) {
+ restoreTo = canvas.save();
+ }
if (offsetForScroll) {
canvas.translate(mLeft - sx, mTop - sy);
} else {
- canvas.translate(mLeft, mTop);
+ if (!useDisplayListProperties) {
+ canvas.translate(mLeft, mTop);
+ }
if (scalingRequired) {
+ if (useDisplayListProperties) {
+ restoreTo = canvas.save();
+ }
// mAttachInfo cannot be null, otherwise scalingRequired == false
final float scale = 1.0f / mAttachInfo.mApplicationScale;
canvas.scale(scale, scale);
}
}
- float alpha = getAlpha();
+ float alpha = useDisplayListProperties ? 1 : getAlpha();
if (transformToApply != null || alpha < 1.0f || !hasIdentityMatrix()) {
if (transformToApply != null || !childHasIdentityMatrix) {
int transX = 0;
@@ -11278,20 +11473,22 @@
if (concatMatrix) {
// Undo the scroll translation, apply the transformation matrix,
// then redo the scroll translate to get the correct result.
- canvas.translate(-transX, -transY);
- canvas.concat(transformToApply.getMatrix());
- canvas.translate(transX, transY);
- parent.mGroupFlags |= parent.FLAG_CLEAR_TRANSFORMATION;
+ if (!hasDisplayList) {
+ canvas.translate(-transX, -transY);
+ canvas.concat(transformToApply.getMatrix());
+ canvas.translate(transX, transY);
+ }
+ parent.mGroupFlags |= ViewGroup.FLAG_CLEAR_TRANSFORMATION;
}
float transformAlpha = transformToApply.getAlpha();
if (transformAlpha < 1.0f) {
alpha *= transformToApply.getAlpha();
- parent.mGroupFlags |= parent.FLAG_CLEAR_TRANSFORMATION;
+ parent.mGroupFlags |= ViewGroup.FLAG_CLEAR_TRANSFORMATION;
}
}
- if (!childHasIdentityMatrix) {
+ if (!childHasIdentityMatrix && !useDisplayListProperties) {
canvas.translate(-transX, -transY);
canvas.concat(getMatrix());
canvas.translate(transX, transY);
@@ -11299,20 +11496,22 @@
}
if (alpha < 1.0f) {
- parent.mGroupFlags |= parent.FLAG_CLEAR_TRANSFORMATION;
+ parent.mGroupFlags |= ViewGroup.FLAG_CLEAR_TRANSFORMATION;
if (hasNoCache) {
final int multipliedAlpha = (int) (255 * alpha);
if (!onSetAlpha(multipliedAlpha)) {
int layerFlags = Canvas.HAS_ALPHA_LAYER_SAVE_FLAG;
- if ((flags & parent.FLAG_CLIP_CHILDREN) == parent.FLAG_CLIP_CHILDREN ||
+ if ((flags & ViewGroup.FLAG_CLIP_CHILDREN) != 0 ||
layerType != LAYER_TYPE_NONE) {
layerFlags |= Canvas.CLIP_TO_LAYER_SAVE_FLAG;
}
if (layerType == LAYER_TYPE_NONE) {
- final int scrollX = hasDisplayList ? 0 : sx;
- final int scrollY = hasDisplayList ? 0 : sy;
- canvas.saveLayerAlpha(scrollX, scrollY, scrollX + mRight - mLeft,
- scrollY + mBottom - mTop, multipliedAlpha, layerFlags);
+ if (!useDisplayListProperties) {
+ final int scrollX = hasDisplayList ? 0 : sx;
+ final int scrollY = hasDisplayList ? 0 : sy;
+ canvas.saveLayerAlpha(scrollX, scrollY, scrollX + mRight - mLeft,
+ scrollY + mBottom - mTop, multipliedAlpha, layerFlags);
+ }
}
} else {
// Alpha is handled by the child directly, clobber the layer's alpha
@@ -11325,7 +11524,8 @@
mPrivateFlags &= ~ALPHA_SET;
}
- if ((flags & parent.FLAG_CLIP_CHILDREN) == parent.FLAG_CLIP_CHILDREN) {
+ if ((flags & ViewGroup.FLAG_CLIP_CHILDREN) == ViewGroup.FLAG_CLIP_CHILDREN &&
+ !useDisplayListProperties) {
if (offsetForScroll) {
canvas.clipRect(sx, sy, sx + (mRight - mLeft), sy + (mBottom - mTop));
} else {
@@ -11350,7 +11550,7 @@
if (hasNoCache) {
boolean layerRendered = false;
- if (layerType == LAYER_TYPE_HARDWARE) {
+ if (layerType == LAYER_TYPE_HARDWARE && !useDisplayListProperties) {
final HardwareLayer layer = getHardwareLayer();
if (layer != null && layer.isValid()) {
mLayerPaint.setAlpha((int) (alpha * 255));
@@ -11396,11 +11596,10 @@
}
if (alpha < 1.0f) {
cachePaint.setAlpha((int) (alpha * 255));
- parent.mGroupFlags |= parent.FLAG_ALPHA_LOWER_THAN_ONE;
- } else if ((flags & parent.FLAG_ALPHA_LOWER_THAN_ONE) ==
- parent.FLAG_ALPHA_LOWER_THAN_ONE) {
+ parent.mGroupFlags |= ViewGroup.FLAG_ALPHA_LOWER_THAN_ONE;
+ } else if ((flags & ViewGroup.FLAG_ALPHA_LOWER_THAN_ONE) != 0) {
cachePaint.setAlpha(255);
- parent.mGroupFlags &= ~parent.FLAG_ALPHA_LOWER_THAN_ONE;
+ parent.mGroupFlags &= ~ViewGroup.FLAG_ALPHA_LOWER_THAN_ONE;
}
} else {
cachePaint = mLayerPaint;
@@ -11409,7 +11608,9 @@
canvas.drawBitmap(cache, 0.0f, 0.0f, cachePaint);
}
- canvas.restoreToCount(restoreTo);
+ if (restoreTo >= 0) {
+ canvas.restoreToCount(restoreTo);
+ }
if (a != null && !more) {
if (!hardwareAccelerated && !a.getFillAfter()) {
@@ -11867,6 +12068,9 @@
mTop = top;
mRight = right;
mBottom = bottom;
+ if (USE_DISPLAY_LIST_PROPERTIES && mDisplayList != null) {
+ mDisplayList.setLeftTopRightBottom(mLeft, mTop, mRight, mBottom);
+ }
mPrivateFlags |= HAS_BOUNDS;
@@ -12473,9 +12677,9 @@
}
/**
- * Returns the start padding of this view. If there are inset and enabled
- * scrollbars, this value may include the space required to display the
- * scrollbars as well.
+ * Returns the start padding of this view depending on its resolved layout direction.
+ * If there are inset and enabled scrollbars, this value may include the space
+ * required to display the scrollbars as well.
*
* @return the start padding in pixels
*/
@@ -12496,9 +12700,9 @@
}
/**
- * Returns the end padding of this view. If there are inset and enabled
- * scrollbars, this value may include the space required to display the
- * scrollbars as well.
+ * Returns the end padding of this view depending on its resolved layout direction.
+ * If there are inset and enabled scrollbars, this value may include the space
+ * required to display the scrollbars as well.
*
* @return the end padding in pixels
*/
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java
index c9e0242..1993ce6 100644
--- a/core/java/android/view/ViewGroup.java
+++ b/core/java/android/view/ViewGroup.java
@@ -2736,7 +2736,18 @@
* @attr ref android.R.styleable#ViewGroup_clipChildren
*/
public void setClipChildren(boolean clipChildren) {
- setBooleanFlag(FLAG_CLIP_CHILDREN, clipChildren);
+ boolean previousValue = (mGroupFlags & FLAG_CLIP_CHILDREN) == FLAG_CLIP_CHILDREN;
+ if (clipChildren != previousValue) {
+ setBooleanFlag(FLAG_CLIP_CHILDREN, clipChildren);
+ if (USE_DISPLAY_LIST_PROPERTIES) {
+ for (int i = 0; i < mChildrenCount; ++i) {
+ View child = getChildAt(i);
+ if (child.mDisplayList != null) {
+ child.mDisplayList.setClipChildren(clipChildren);
+ }
+ }
+ }
+ }
}
/**
@@ -3973,6 +3984,9 @@
final View v = children[i];
v.mTop += offset;
v.mBottom += offset;
+ if (USE_DISPLAY_LIST_PROPERTIES && v.mDisplayList != null) {
+ v.mDisplayList.offsetTopBottom(offset);
+ }
}
}
diff --git a/core/java/android/view/ViewPropertyAnimator.java b/core/java/android/view/ViewPropertyAnimator.java
index 0fdcd0f..fe0e659 100644
--- a/core/java/android/view/ViewPropertyAnimator.java
+++ b/core/java/android/view/ViewPropertyAnimator.java
@@ -866,6 +866,8 @@
info.mAlpha = value;
break;
}
+ // TODO: optimize to set only the properties that have changed
+ mView.setDisplayListProperties();
}
/**
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index 72365c7..4472f8c 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -51,6 +51,7 @@
import android.os.RemoteException;
import android.os.SystemClock;
import android.os.SystemProperties;
+import android.os.Trace;
import android.util.AndroidRuntimeException;
import android.util.DisplayMetrics;
import android.util.EventLog;
@@ -960,7 +961,12 @@
}
}
- performTraversals();
+ Trace.traceBegin(Trace.TRACE_TAG_VIEW, "performTraversals");
+ try {
+ performTraversals();
+ } finally {
+ Trace.traceEnd(Trace.TRACE_TAG_VIEW);
+ }
if (ViewDebug.DEBUG_LATENCY) {
long now = System.nanoTime();
@@ -1919,7 +1925,13 @@
final boolean fullRedrawNeeded = mFullRedrawNeeded;
mFullRedrawNeeded = false;
- draw(fullRedrawNeeded);
+
+ Trace.traceBegin(Trace.TRACE_TAG_VIEW, "draw");
+ try {
+ draw(fullRedrawNeeded);
+ } finally {
+ Trace.traceEnd(Trace.TRACE_TAG_VIEW);
+ }
if (ViewDebug.DEBUG_LATENCY) {
long now = System.nanoTime();
@@ -2897,17 +2909,22 @@
q.mDeliverTimeNanos = System.nanoTime();
}
- if (q.mEvent instanceof KeyEvent) {
- deliverKeyEvent(q);
- } else {
- final int source = q.mEvent.getSource();
- if ((source & InputDevice.SOURCE_CLASS_POINTER) != 0) {
- deliverPointerEvent(q);
- } else if ((source & InputDevice.SOURCE_CLASS_TRACKBALL) != 0) {
- deliverTrackballEvent(q);
+ Trace.traceBegin(Trace.TRACE_TAG_VIEW, "deliverInputEvent");
+ try {
+ if (q.mEvent instanceof KeyEvent) {
+ deliverKeyEvent(q);
} else {
- deliverGenericMotionEvent(q);
+ final int source = q.mEvent.getSource();
+ if ((source & InputDevice.SOURCE_CLASS_POINTER) != 0) {
+ deliverPointerEvent(q);
+ } else if ((source & InputDevice.SOURCE_CLASS_TRACKBALL) != 0) {
+ deliverTrackballEvent(q);
+ } else {
+ deliverGenericMotionEvent(q);
+ }
}
+ } finally {
+ Trace.traceEnd(Trace.TRACE_TAG_VIEW);
}
}
diff --git a/core/java/android/webkit/AutoCompletePopup.java b/core/java/android/webkit/AutoCompletePopup.java
index e0e5eca..674428a 100644
--- a/core/java/android/webkit/AutoCompletePopup.java
+++ b/core/java/android/webkit/AutoCompletePopup.java
@@ -20,7 +20,6 @@
import android.os.Handler;
import android.os.Message;
import android.text.Editable;
-import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.widget.AbsoluteLayout;
@@ -92,7 +91,6 @@
state.handleUpEvent(event);
}
if (event.isTracking() && !event.isCanceled()) {
- Log.v("AutoCompletePopup", "dismiss popup 2");
mPopup.dismiss();
return true;
}
@@ -107,7 +105,6 @@
public void setFocused(boolean isFocused) {
mIsFocused = isFocused;
if (!mIsFocused) {
- Log.v("AutoCompletePopup", "dismiss popup 3");
mPopup.dismiss();
}
}
@@ -126,7 +123,6 @@
public void clearAdapter() {
mAdapter = null;
mFilter = null;
- Log.v("AutoCompletePopup", "dismiss popup 4");
mPopup.dismiss();
mPopup.setAdapter(null);
}
@@ -150,7 +146,6 @@
}
public void resetRect() {
- Log.v("AutoCompletePopup", "resetRect: " + mNodeBounds);
int left = mWebView.contentToViewX(mNodeBounds.left);
int right = mWebView.contentToViewX(mNodeBounds.right);
int width = right - left;
@@ -175,13 +170,10 @@
lp.height = height;
}
}
- Log.v("AutoCompletePopup", "resetRect layout " + lp.x + ", " + lp.y +
- ", " + lp.width + ", " + lp.height);
if (needsUpdate) {
mAnchor.setLayoutParams(lp);
}
if (mPopup.isShowing()) {
- Log.v("AutoCompletePopup", "showing popup again");
mPopup.show(); // update its position
}
}
@@ -222,7 +214,6 @@
pushTextToInputConnection();
}
}
- Log.v("AutoCompletePopup", "dismiss popup 5");
mPopup.dismiss();
}
@@ -240,7 +231,6 @@
@Override
public void onFilterComplete(int count) {
if (!mIsFocused) {
- Log.v("AutoCompletePopup", "dismiss popup 1");
mPopup.dismiss();
return;
}
@@ -252,11 +242,9 @@
// Make sure the list does not obscure the IME when shown for the first time.
mPopup.setInputMethodMode(ListPopupWindow.INPUT_METHOD_NEEDED);
}
- Log.v("AutoCompletePopup", "showing popup");
mPopup.show();
mPopup.getListView().setOverScrollMode(View.OVER_SCROLL_ALWAYS);
} else {
- Log.v("AutoCompletePopup", "dismiss popup");
mPopup.dismiss();
}
}
diff --git a/core/java/android/widget/GridView.java b/core/java/android/widget/GridView.java
index 0dedf8b..739bcce 100644
--- a/core/java/android/widget/GridView.java
+++ b/core/java/android/widget/GridView.java
@@ -99,7 +99,7 @@
private final Rect mTempRect = new Rect();
public GridView(Context context) {
- super(context);
+ this(context, null);
}
public GridView(Context context, AttributeSet attrs) {
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index b8db848..e535170 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -11703,8 +11703,10 @@
firstLine, lastLine);
if (mTextDisplayList == null || !mTextDisplayList.isValid()) {
+ boolean displayListCreated = false;
if (mTextDisplayList == null) {
mTextDisplayList = getHardwareRenderer().createDisplayList("Text");
+ displayListCreated = true;
}
final HardwareCanvas hardwareCanvas = mTextDisplayList.start();
@@ -11719,6 +11721,9 @@
} finally {
hardwareCanvas.onPostDraw();
mTextDisplayList.end();
+ if (displayListCreated && USE_DISPLAY_LIST_PROPERTIES) {
+ mTextDisplayList.setLeftTopRightBottom(mLeft, mTop, mRight, mBottom);
+ }
}
}
canvas.translate(mScrollX, mScrollY);
diff --git a/core/jni/Android.mk b/core/jni/Android.mk
index 642988b..92b07b3 100644
--- a/core/jni/Android.mk
+++ b/core/jni/Android.mk
@@ -53,6 +53,7 @@
android_view_KeyEvent.cpp \
android_view_KeyCharacterMap.cpp \
android_view_HardwareRenderer.cpp \
+ android_view_GLES20DisplayList.cpp \
android_view_GLES20Canvas.cpp \
android_view_MotionEvent.cpp \
android_view_PointerIcon.cpp \
@@ -69,6 +70,7 @@
android_os_StatFs.cpp \
android_os_SystemClock.cpp \
android_os_SystemProperties.cpp \
+ android_os_Trace.cpp \
android_os_UEventObserver.cpp \
android_net_LocalSocketImpl.cpp \
android_net_NetUtils.cpp \
diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp
index de9fd33..92ff8da 100644
--- a/core/jni/AndroidRuntime.cpp
+++ b/core/jni/AndroidRuntime.cpp
@@ -117,6 +117,7 @@
extern int register_android_graphics_PixelFormat(JNIEnv* env);
extern int register_android_view_Display(JNIEnv* env);
extern int register_android_view_DisplayEventReceiver(JNIEnv* env);
+extern int register_android_view_GLES20DisplayList(JNIEnv* env);
extern int register_android_view_GLES20Canvas(JNIEnv* env);
extern int register_android_view_HardwareRenderer(JNIEnv* env);
extern int register_android_view_Surface(JNIEnv* env);
@@ -136,6 +137,7 @@
extern int register_android_os_StatFs(JNIEnv *env);
extern int register_android_os_SystemProperties(JNIEnv *env);
extern int register_android_os_SystemClock(JNIEnv* env);
+extern int register_android_os_Trace(JNIEnv* env);
extern int register_android_os_FileObserver(JNIEnv *env);
extern int register_android_os_FileUtils(JNIEnv *env);
extern int register_android_os_UEventObserver(JNIEnv* env);
@@ -1101,6 +1103,7 @@
REG_JNI(register_android_nio_utils),
REG_JNI(register_android_graphics_PixelFormat),
REG_JNI(register_android_graphics_Graphics),
+ REG_JNI(register_android_view_GLES20DisplayList),
REG_JNI(register_android_view_GLES20Canvas),
REG_JNI(register_android_view_HardwareRenderer),
REG_JNI(register_android_view_Surface),
@@ -1151,6 +1154,7 @@
REG_JNI(register_android_os_ParcelFileDescriptor),
REG_JNI(register_android_os_Power),
REG_JNI(register_android_os_StatFs),
+ REG_JNI(register_android_os_Trace),
REG_JNI(register_android_os_UEventObserver),
REG_JNI(register_android_net_LocalSocketImpl),
REG_JNI(register_android_net_NetworkUtils),
diff --git a/core/jni/android/graphics/Camera.cpp b/core/jni/android/graphics/Camera.cpp
index 76d415a..5176d9a 100644
--- a/core/jni/android/graphics/Camera.cpp
+++ b/core/jni/android/graphics/Camera.cpp
@@ -57,6 +57,21 @@
v->setCameraLocation(SkFloatToScalar(x), SkFloatToScalar(y), SkFloatToScalar(z));
}
+static jfloat Camera_getLocationX(JNIEnv* env, jobject obj) {
+ Sk3DView* v = (Sk3DView*)env->GetIntField(obj, gNativeInstanceFieldID);
+ return SkScalarToFloat(v->getCameraLocationX());
+}
+
+static jfloat Camera_getLocationY(JNIEnv* env, jobject obj) {
+ Sk3DView* v = (Sk3DView*)env->GetIntField(obj, gNativeInstanceFieldID);
+ return SkScalarToFloat(v->getCameraLocationY());
+}
+
+static jfloat Camera_getLocationZ(JNIEnv* env, jobject obj) {
+ Sk3DView* v = (Sk3DView*)env->GetIntField(obj, gNativeInstanceFieldID);
+ return SkScalarToFloat(v->getCameraLocationZ());
+}
+
static void Camera_getMatrix(JNIEnv* env, jobject obj, int native_matrix) {
Sk3DView* v = (Sk3DView*)env->GetIntField(obj, gNativeInstanceFieldID);
v->getMatrix((SkMatrix*)native_matrix);
@@ -93,6 +108,9 @@
{ "rotateZ", "(F)V", (void*)Camera_rotateZ },
{ "rotate", "(FFF)V", (void*)Camera_rotate },
{ "setLocation", "(FFF)V", (void*)Camera_setLocation },
+ { "getLocationX", "()F", (void*)Camera_getLocationX },
+ { "getLocationY", "()F", (void*)Camera_getLocationY },
+ { "getLocationZ", "()F", (void*)Camera_getLocationZ },
{ "nativeGetMatrix", "(I)V", (void*)Camera_getMatrix },
{ "nativeApplyToCanvas", "(I)V", (void*)Camera_applyToCanvas },
{ "dotWithNormal", "(FFF)F", (void*)Camera_dotWithNormal }
diff --git a/core/jni/android/opengl/util.cpp b/core/jni/android/opengl/util.cpp
index 929df540..634efa6 100644
--- a/core/jni/android/opengl/util.cpp
+++ b/core/jni/android/opengl/util.cpp
@@ -556,6 +556,12 @@
nativeBitmapID = env->GetFieldID(bitmapClass, "mNativeBitmap", "I");
}
+extern void setGLDebugLevel(int level);
+void nativeEnableTracing(JNIEnv *env, jclass clazz)
+{
+ setGLDebugLevel(1);
+}
+
static int checkFormat(SkBitmap::Config config, int format, int type)
{
switch(config) {
@@ -1026,6 +1032,7 @@
{ "native_getType", "(Landroid/graphics/Bitmap;)I", (void*) util_getType },
{ "native_texImage2D", "(IIILandroid/graphics/Bitmap;II)I", (void*)util_texImage2D },
{ "native_texSubImage2D", "(IIIILandroid/graphics/Bitmap;II)I", (void*)util_texSubImage2D },
+ { "native_enableTracing", "()V", (void*)nativeEnableTracing },
};
static JNINativeMethod gEtc1Methods[] = {
diff --git a/core/jni/android_os_Trace.cpp b/core/jni/android_os_Trace.cpp
new file mode 100644
index 0000000..af8edae
--- /dev/null
+++ b/core/jni/android_os_Trace.cpp
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2012 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.
+ */
+
+#define LOG_TAG "Trace"
+
+#include <JNIHelp.h>
+#include <ScopedUtfChars.h>
+
+#include <utils/Trace.h>
+#include <cutils/log.h>
+
+namespace android {
+
+static jlong android_os_Trace_nativeGetEnabledTags(JNIEnv* env, jclass clazz) {
+ return Tracer::getEnabledTags();
+}
+
+static void android_os_Trace_nativeTraceCounter(JNIEnv* env, jclass clazz,
+ jlong tag, jstring nameStr, jint value) {
+ ScopedUtfChars name(env, nameStr);
+ Tracer::traceCounter(tag, name.c_str(), value);
+}
+
+static void android_os_Trace_nativeTraceBegin(JNIEnv* env, jclass clazz,
+ jlong tag, jstring nameStr) {
+ ScopedUtfChars name(env, nameStr);
+ Tracer::traceBegin(tag, name.c_str());
+}
+
+static void android_os_Trace_nativeTraceEnd(JNIEnv* env, jclass clazz,
+ jlong tag) {
+ Tracer::traceEnd(tag);
+}
+
+static JNINativeMethod gTraceMethods[] = {
+ /* name, signature, funcPtr */
+ { "nativeGetEnabledTags",
+ "()J",
+ (void*)android_os_Trace_nativeGetEnabledTags },
+ { "nativeTraceCounter",
+ "(JLjava/lang/String;I)V",
+ (void*)android_os_Trace_nativeTraceCounter },
+ { "nativeTraceBegin",
+ "(JLjava/lang/String;)V",
+ (void*)android_os_Trace_nativeTraceBegin },
+ { "nativeTraceEnd",
+ "(J)V",
+ (void*)android_os_Trace_nativeTraceEnd },
+};
+
+int register_android_os_Trace(JNIEnv* env) {
+ int res = jniRegisterNativeMethods(env, "android/os/Trace",
+ gTraceMethods, NELEM(gTraceMethods));
+ LOG_FATAL_IF(res < 0, "Unable to register native methods.");
+
+ return 0;
+}
+
+} // namespace android
diff --git a/core/jni/android_view_GLES20DisplayList.cpp b/core/jni/android_view_GLES20DisplayList.cpp
new file mode 100644
index 0000000..407c196
--- /dev/null
+++ b/core/jni/android_view_GLES20DisplayList.cpp
@@ -0,0 +1,227 @@
+/*
+ * Copyright (C) 2012 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.
+ */
+
+#define LOG_TAG "OpenGLRenderer"
+
+#include <EGL/egl.h>
+
+#include "jni.h"
+#include "GraphicsJNI.h"
+#include <nativehelper/JNIHelp.h>
+#include <android_runtime/AndroidRuntime.h>
+
+#include <DisplayListRenderer.h>
+
+namespace android {
+
+using namespace uirenderer;
+
+/**
+ * Note: OpenGLRenderer JNI layer is generated and compiled only on supported
+ * devices. This means all the logic must be compiled only when the
+ * preprocessor variable USE_OPENGL_RENDERER is defined.
+ */
+#ifdef USE_OPENGL_RENDERER
+
+// ----------------------------------------------------------------------------
+// DisplayList view properties
+// ----------------------------------------------------------------------------
+
+static void android_view_GLES20DisplayList_setCaching(JNIEnv* env,
+ jobject clazz, DisplayList* displayList, jboolean caching) {
+ displayList->setCaching(caching);
+}
+
+static void android_view_GLES20DisplayList_setApplicationScale(JNIEnv* env,
+ jobject clazz, DisplayList* displayList, float scale) {
+ displayList->setApplicationScale(scale);
+}
+
+static void android_view_GLES20DisplayList_setClipChildren(JNIEnv* env,
+ jobject clazz, DisplayList* displayList, jboolean clipChildren) {
+ displayList->setClipChildren(clipChildren);
+}
+
+static void android_view_GLES20DisplayList_setAlpha(JNIEnv* env,
+ jobject clazz, DisplayList* displayList, float alpha) {
+ displayList->setAlpha(alpha);
+}
+
+static void android_view_GLES20DisplayList_setTranslationX(JNIEnv* env,
+ jobject clazz, DisplayList* displayList, float tx) {
+ displayList->setTranslationX(tx);
+}
+
+static void android_view_GLES20DisplayList_setTranslationY(JNIEnv* env,
+ jobject clazz, DisplayList* displayList, float ty) {
+ displayList->setTranslationY(ty);
+}
+
+static void android_view_GLES20DisplayList_setRotation(JNIEnv* env,
+ jobject clazz, DisplayList* displayList, float rotation) {
+ displayList->setRotation(rotation);
+}
+
+static void android_view_GLES20DisplayList_setRotationX(JNIEnv* env,
+ jobject clazz, DisplayList* displayList, float rx) {
+ displayList->setRotationX(rx);
+}
+
+static void android_view_GLES20DisplayList_setRotationY(JNIEnv* env,
+ jobject clazz, DisplayList* displayList, float ry) {
+ displayList->setRotationY(ry);
+}
+
+static void android_view_GLES20DisplayList_setScaleX(JNIEnv* env,
+ jobject clazz, DisplayList* displayList, float sx) {
+ displayList->setScaleX(sx);
+}
+
+static void android_view_GLES20DisplayList_setScaleY(JNIEnv* env,
+ jobject clazz, DisplayList* displayList, float sy) {
+ displayList->setScaleY(sy);
+}
+
+static void android_view_GLES20DisplayList_setTransformationInfo(JNIEnv* env,
+ jobject clazz, DisplayList* displayList, float alpha,
+ float translationX, float translationY, float rotation, float rotationX, float rotationY,
+ float scaleX, float scaleY) {
+ displayList->setAlpha(alpha);
+ displayList->setTranslationX(translationX);
+ displayList->setTranslationY(translationY);
+ displayList->setRotation(rotation);
+ displayList->setRotationX(rotationX);
+ displayList->setRotationY(rotationY);
+ displayList->setScaleX(scaleX);
+ displayList->setScaleY(scaleY);
+}
+
+static void android_view_GLES20DisplayList_setPivotX(JNIEnv* env,
+ jobject clazz, DisplayList* displayList, float px) {
+ displayList->setPivotX(px);
+}
+
+static void android_view_GLES20DisplayList_setPivotY(JNIEnv* env,
+ jobject clazz, DisplayList* displayList, float py) {
+ displayList->setPivotY(py);
+}
+
+static void android_view_GLES20DisplayList_setCameraDistance(JNIEnv* env,
+ jobject clazz, DisplayList* displayList, float distance) {
+ displayList->setCameraDistance(distance);
+}
+
+static void android_view_GLES20DisplayList_setLeft(JNIEnv* env,
+ jobject clazz, DisplayList* displayList, int left) {
+ displayList->setLeft(left);
+}
+
+static void android_view_GLES20DisplayList_setTop(JNIEnv* env,
+ jobject clazz, DisplayList* displayList, int top) {
+ displayList->setTop(top);
+}
+
+static void android_view_GLES20DisplayList_setRight(JNIEnv* env,
+ jobject clazz, DisplayList* displayList, int right) {
+ displayList->setRight(right);
+}
+
+static void android_view_GLES20DisplayList_setBottom(JNIEnv* env,
+ jobject clazz, DisplayList* displayList, int bottom) {
+ displayList->setBottom(bottom);
+}
+
+static void android_view_GLES20DisplayList_setLeftTop(JNIEnv* env,
+ jobject clazz, DisplayList* displayList, int left, int top) {
+ displayList->setLeftTop(left, top);
+}
+
+static void android_view_GLES20DisplayList_setLeftTopRightBottom(JNIEnv* env,
+ jobject clazz, DisplayList* displayList, int left, int top,
+ int right, int bottom) {
+ displayList->setLeftTopRightBottom(left, top, right, bottom);
+}
+
+static void android_view_GLES20DisplayList_offsetLeftRight(JNIEnv* env,
+ jobject clazz, DisplayList* displayList, int offset) {
+ displayList->offsetLeftRight(offset);
+}
+
+static void android_view_GLES20DisplayList_offsetTopBottom(JNIEnv* env,
+ jobject clazz, DisplayList* displayList, int offset) {
+ displayList->offsetTopBottom(offset);
+}
+
+#endif // USE_OPENGL_RENDERER
+
+// ----------------------------------------------------------------------------
+// JNI Glue
+// ----------------------------------------------------------------------------
+
+const char* const kClassPathName = "android/view/GLES20DisplayList";
+
+static JNINativeMethod gMethods[] = {
+#ifdef USE_OPENGL_RENDERER
+ { "nSetCaching", "(IZ)V", (void*) android_view_GLES20DisplayList_setCaching },
+ { "nSetApplicationScale", "(IF)V",
+ (void*) android_view_GLES20DisplayList_setApplicationScale },
+ { "nSetClipChildren", "(IZ)V", (void*) android_view_GLES20DisplayList_setClipChildren },
+ { "nSetAlpha", "(IF)V", (void*) android_view_GLES20DisplayList_setAlpha },
+ { "nSetTranslationX", "(IF)V", (void*) android_view_GLES20DisplayList_setTranslationX },
+ { "nSetTranslationY", "(IF)V", (void*) android_view_GLES20DisplayList_setTranslationY },
+ { "nSetRotation", "(IF)V", (void*) android_view_GLES20DisplayList_setRotation },
+ { "nSetRotationX", "(IF)V", (void*) android_view_GLES20DisplayList_setRotationX },
+ { "nSetRotationY", "(IF)V", (void*) android_view_GLES20DisplayList_setRotationY },
+ { "nSetScaleX", "(IF)V", (void*) android_view_GLES20DisplayList_setScaleX },
+ { "nSetScaleY", "(IF)V", (void*) android_view_GLES20DisplayList_setScaleY },
+ { "nSetTransformationInfo", "(IFFFFFFFF)V",
+ (void*) android_view_GLES20DisplayList_setTransformationInfo },
+ { "nSetPivotX", "(IF)V", (void*) android_view_GLES20DisplayList_setPivotX },
+ { "nSetPivotY", "(IF)V", (void*) android_view_GLES20DisplayList_setPivotY },
+ { "nSetCameraDistance", "(IF)V",
+ (void*) android_view_GLES20DisplayList_setCameraDistance },
+ { "nSetLeft", "(II)V", (void*) android_view_GLES20DisplayList_setLeft },
+ { "nSetTop", "(II)V", (void*) android_view_GLES20DisplayList_setTop },
+ { "nSetRight", "(II)V", (void*) android_view_GLES20DisplayList_setRight },
+ { "nSetBottom", "(II)V", (void*) android_view_GLES20DisplayList_setBottom },
+ { "nSetLeftTop", "(III)V", (void*) android_view_GLES20DisplayList_setLeftTop },
+ { "nSetLeftTopRightBottom", "(IIIII)V",
+ (void*) android_view_GLES20DisplayList_setLeftTopRightBottom },
+ { "nOffsetLeftRight", "(II)V", (void*) android_view_GLES20DisplayList_offsetLeftRight },
+ { "nOffsetTopBottom", "(II)V", (void*) android_view_GLES20DisplayList_offsetTopBottom },
+
+#endif
+};
+
+#ifdef USE_OPENGL_RENDERER
+ #define FIND_CLASS(var, className) \
+ var = env->FindClass(className); \
+ LOG_FATAL_IF(! var, "Unable to find class " className);
+
+ #define GET_METHOD_ID(var, clazz, methodName, methodDescriptor) \
+ var = env->GetMethodID(clazz, methodName, methodDescriptor); \
+ LOG_FATAL_IF(! var, "Unable to find method " methodName);
+#else
+ #define FIND_CLASS(var, className)
+ #define GET_METHOD_ID(var, clazz, methodName, methodDescriptor)
+#endif
+
+int register_android_view_GLES20DisplayList(JNIEnv* env) {
+ return AndroidRuntime::registerNativeMethods(env, kClassPathName, gMethods, NELEM(gMethods));
+}
+
+};
+
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index 17d2212..8f03fe0 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -639,6 +639,13 @@
android:label="@string/permgrouplab_storage"
android:description="@string/permgroupdesc_storage" />
+ <!-- Allows an application to read from external storage -->
+ <permission android:name="android.permission.READ_EXTERNAL_STORAGE"
+ android:permissionGroup="android.permission-group.STORAGE"
+ android:label="@string/permlab_sdcardRead"
+ android:description="@string/permdesc_sdcardRead"
+ android:protectionLevel="dangerous" />
+
<!-- Allows an application to write to external storage -->
<permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:permissionGroup="android.permission-group.STORAGE"
diff --git a/core/res/res/values-af/strings.xml b/core/res/res/values-af/strings.xml
index 6eb4b93..48f4606 100644
--- a/core/res/res/values-af/strings.xml
+++ b/core/res/res/values-af/strings.xml
@@ -1172,6 +1172,14 @@
<string name="date_picker_decrement_day_button" msgid="2427816793443629131">"Trek \'n dag af."</string>
<string name="date_picker_increment_year_button" msgid="3058553394722295105">"Tel \'n jaar by"</string>
<string name="date_picker_decrement_year_button" msgid="5193062846559743823">"Trek \'n jaar af"</string>
+ <string name="checkbox_checked" msgid="7222044992652711167">"gekontroleer"</string>
+ <string name="checkbox_not_checked" msgid="5174639551134444056">"nie gekontroleer nie"</string>
+ <string name="radiobutton_selected" msgid="8603599808486581511">"gekies"</string>
+ <string name="radiobutton_not_selected" msgid="2908760184307722393">"nie gekies nie"</string>
+ <string name="switch_on" msgid="551417728476977311">"aan"</string>
+ <string name="switch_off" msgid="7249798614327155088">"af"</string>
+ <string name="togglebutton_pressed" msgid="4180411746647422233">"gedruk"</string>
+ <string name="togglebutton_not_pressed" msgid="4495147725636134425">"nie gedruk nie"</string>
<string name="keyboardview_keycode_alt" msgid="4856868820040051939">"Alt"</string>
<string name="keyboardview_keycode_cancel" msgid="1203984017245783244">"Kanselleer"</string>
<string name="keyboardview_keycode_delete" msgid="3337914833206635744">"Vee uit"</string>
diff --git a/core/res/res/values-am/strings.xml b/core/res/res/values-am/strings.xml
index 1d1af5f..b055634 100644
--- a/core/res/res/values-am/strings.xml
+++ b/core/res/res/values-am/strings.xml
@@ -1086,8 +1086,8 @@
<string name="ime_action_done" msgid="8971516117910934605">"ተከናውኗል"</string>
<string name="ime_action_previous" msgid="1443550039250105948">"ያለፈው"</string>
<string name="ime_action_default" msgid="2840921885558045721">"አከናውን"</string>
- <string name="dial_number_using" msgid="5789176425167573586">"የደወሉት ቁጥር"\n"<xliff:g id="NUMBER">%s</xliff:g>በመጠቀም ላይ"</string>
- <string name="create_contact_using" msgid="4947405226788104538">\n"በመጠቀም<xliff:g id="NUMBER">%s</xliff:g>ዕውቂያ ፍጠር"</string>
+ <string name="dial_number_using" msgid="5789176425167573586">"<xliff:g id="NUMBER">%s</xliff:g>ን በመጠቀም "\n" ደውል"</string>
+ <string name="create_contact_using" msgid="4947405226788104538">"<xliff:g id="NUMBER">%s</xliff:g>ን በመጠቀም "\n" ዕውቂያ ፍጠር"</string>
<string name="grant_credentials_permission_message_header" msgid="2106103817937859662">"የሚከተለው ወይም ተጨማሪ መተግበሪያዎች ወደ መለያህ ለመድረስ አሁን እና ወደፊት ፈቃድ ትጠይቃለህ።"</string>
<string name="grant_credentials_permission_message_footer" msgid="3125211343379376561">"ይህን ጥየቃ መፍቀድ ይፈልጋሉ?"</string>
<string name="grant_permissions_header_text" msgid="6874497408201826708">"የመድረሻ ጥያቄ"</string>
@@ -1172,6 +1172,14 @@
<string name="date_picker_decrement_day_button" msgid="2427816793443629131">"ቀን ቀንስ"</string>
<string name="date_picker_increment_year_button" msgid="3058553394722295105">"አመት ጨምር"</string>
<string name="date_picker_decrement_year_button" msgid="5193062846559743823">"አመት ቀንስ"</string>
+ <string name="checkbox_checked" msgid="7222044992652711167">"ታይቷል"</string>
+ <string name="checkbox_not_checked" msgid="5174639551134444056">"አልተፈተሸም"</string>
+ <string name="radiobutton_selected" msgid="8603599808486581511">"የተመረጠ"</string>
+ <string name="radiobutton_not_selected" msgid="2908760184307722393">"አልተመረጠም"</string>
+ <string name="switch_on" msgid="551417728476977311">"በ:"</string>
+ <string name="switch_off" msgid="7249798614327155088">"ውጪ"</string>
+ <string name="togglebutton_pressed" msgid="4180411746647422233">"ተጭኗል"</string>
+ <string name="togglebutton_not_pressed" msgid="4495147725636134425">"አልተጫነም።"</string>
<string name="keyboardview_keycode_alt" msgid="4856868820040051939">"Alt"</string>
<string name="keyboardview_keycode_cancel" msgid="1203984017245783244">"ተወው"</string>
<string name="keyboardview_keycode_delete" msgid="3337914833206635744">"ሰርዝ"</string>
diff --git a/core/res/res/values-ar/strings.xml b/core/res/res/values-ar/strings.xml
index 83c6f26..193157b 100644
--- a/core/res/res/values-ar/strings.xml
+++ b/core/res/res/values-ar/strings.xml
@@ -1172,6 +1172,14 @@
<string name="date_picker_decrement_day_button" msgid="2427816793443629131">"إنقاص يوم"</string>
<string name="date_picker_increment_year_button" msgid="3058553394722295105">"زيادة عام"</string>
<string name="date_picker_decrement_year_button" msgid="5193062846559743823">"إنقاص عام"</string>
+ <string name="checkbox_checked" msgid="7222044992652711167">"تم التحديد"</string>
+ <string name="checkbox_not_checked" msgid="5174639551134444056">"لم يتم التحديد"</string>
+ <string name="radiobutton_selected" msgid="8603599808486581511">"محدد"</string>
+ <string name="radiobutton_not_selected" msgid="2908760184307722393">"غير محدد"</string>
+ <string name="switch_on" msgid="551417728476977311">"تشغيل"</string>
+ <string name="switch_off" msgid="7249798614327155088">"إيقاف"</string>
+ <string name="togglebutton_pressed" msgid="4180411746647422233">"مضغوط"</string>
+ <string name="togglebutton_not_pressed" msgid="4495147725636134425">"غير مضغوط"</string>
<string name="keyboardview_keycode_alt" msgid="4856868820040051939">"Alt"</string>
<string name="keyboardview_keycode_cancel" msgid="1203984017245783244">"إلغاء"</string>
<string name="keyboardview_keycode_delete" msgid="3337914833206635744">"حذف"</string>
diff --git a/core/res/res/values-be/strings.xml b/core/res/res/values-be/strings.xml
index fced14a..a37e231 100644
--- a/core/res/res/values-be/strings.xml
+++ b/core/res/res/values-be/strings.xml
@@ -1172,6 +1172,14 @@
<string name="date_picker_decrement_day_button" msgid="2427816793443629131">"На дзень менш."</string>
<string name="date_picker_increment_year_button" msgid="3058553394722295105">"На год больш"</string>
<string name="date_picker_decrement_year_button" msgid="5193062846559743823">"На год менш"</string>
+ <string name="checkbox_checked" msgid="7222044992652711167">"пастаўлены"</string>
+ <string name="checkbox_not_checked" msgid="5174639551134444056">"не пастаўлены"</string>
+ <string name="radiobutton_selected" msgid="8603599808486581511">"абрана"</string>
+ <string name="radiobutton_not_selected" msgid="2908760184307722393">"не абрана"</string>
+ <string name="switch_on" msgid="551417728476977311">"укл."</string>
+ <string name="switch_off" msgid="7249798614327155088">"адключаны"</string>
+ <string name="togglebutton_pressed" msgid="4180411746647422233">"націснутая"</string>
+ <string name="togglebutton_not_pressed" msgid="4495147725636134425">"не націснутая"</string>
<string name="keyboardview_keycode_alt" msgid="4856868820040051939">"Alt"</string>
<string name="keyboardview_keycode_cancel" msgid="1203984017245783244">"Адмена"</string>
<string name="keyboardview_keycode_delete" msgid="3337914833206635744">"Выдаліць"</string>
diff --git a/core/res/res/values-bg/strings.xml b/core/res/res/values-bg/strings.xml
index 65fec6f..c277ee9 100644
--- a/core/res/res/values-bg/strings.xml
+++ b/core/res/res/values-bg/strings.xml
@@ -1172,6 +1172,14 @@
<string name="date_picker_decrement_day_button" msgid="2427816793443629131">"Намаляване на деня"</string>
<string name="date_picker_increment_year_button" msgid="3058553394722295105">"Увеличаване на годината"</string>
<string name="date_picker_decrement_year_button" msgid="5193062846559743823">"Намаляване на годината"</string>
+ <string name="checkbox_checked" msgid="7222044992652711167">"отметнато"</string>
+ <string name="checkbox_not_checked" msgid="5174639551134444056">"не е отметнато"</string>
+ <string name="radiobutton_selected" msgid="8603599808486581511">"избрано"</string>
+ <string name="radiobutton_not_selected" msgid="2908760184307722393">"не е избрано"</string>
+ <string name="switch_on" msgid="551417728476977311">"включено"</string>
+ <string name="switch_off" msgid="7249798614327155088">"изключено"</string>
+ <string name="togglebutton_pressed" msgid="4180411746647422233">"натиснато"</string>
+ <string name="togglebutton_not_pressed" msgid="4495147725636134425">"не е натиснато"</string>
<string name="keyboardview_keycode_alt" msgid="4856868820040051939">"Alt"</string>
<string name="keyboardview_keycode_cancel" msgid="1203984017245783244">"Отказ"</string>
<string name="keyboardview_keycode_delete" msgid="3337914833206635744">"Изтриване"</string>
diff --git a/core/res/res/values-ca/strings.xml b/core/res/res/values-ca/strings.xml
index 779de15..189225e 100644
--- a/core/res/res/values-ca/strings.xml
+++ b/core/res/res/values-ca/strings.xml
@@ -1172,6 +1172,14 @@
<string name="date_picker_decrement_day_button" msgid="2427816793443629131">"Disminueix els dies"</string>
<string name="date_picker_increment_year_button" msgid="3058553394722295105">"Incrementa l\'any"</string>
<string name="date_picker_decrement_year_button" msgid="5193062846559743823">"Disminueix l\'any"</string>
+ <string name="checkbox_checked" msgid="7222044992652711167">"marcat"</string>
+ <string name="checkbox_not_checked" msgid="5174639551134444056">"no marcat"</string>
+ <string name="radiobutton_selected" msgid="8603599808486581511">"seleccionat"</string>
+ <string name="radiobutton_not_selected" msgid="2908760184307722393">"no seleccionat"</string>
+ <string name="switch_on" msgid="551417728476977311">"activat"</string>
+ <string name="switch_off" msgid="7249798614327155088">"desactivat"</string>
+ <string name="togglebutton_pressed" msgid="4180411746647422233">"premut"</string>
+ <string name="togglebutton_not_pressed" msgid="4495147725636134425">"no premut"</string>
<string name="keyboardview_keycode_alt" msgid="4856868820040051939">"Alt"</string>
<string name="keyboardview_keycode_cancel" msgid="1203984017245783244">"Cancel·la"</string>
<string name="keyboardview_keycode_delete" msgid="3337914833206635744">"Suprimeix"</string>
diff --git a/core/res/res/values-cs/strings.xml b/core/res/res/values-cs/strings.xml
index cc8278d..389a672 100644
--- a/core/res/res/values-cs/strings.xml
+++ b/core/res/res/values-cs/strings.xml
@@ -1172,6 +1172,14 @@
<string name="date_picker_decrement_day_button" msgid="2427816793443629131">"Odečíst den"</string>
<string name="date_picker_increment_year_button" msgid="3058553394722295105">"Přičíst rok"</string>
<string name="date_picker_decrement_year_button" msgid="5193062846559743823">"Odečíst rok"</string>
+ <string name="checkbox_checked" msgid="7222044992652711167">"zaškrtnuto"</string>
+ <string name="checkbox_not_checked" msgid="5174639551134444056">"nezaškrtnuto"</string>
+ <string name="radiobutton_selected" msgid="8603599808486581511">"Vybráno"</string>
+ <string name="radiobutton_not_selected" msgid="2908760184307722393">"Nevybráno"</string>
+ <string name="switch_on" msgid="551417728476977311">"zapnuto"</string>
+ <string name="switch_off" msgid="7249798614327155088">"vypnuto"</string>
+ <string name="togglebutton_pressed" msgid="4180411746647422233">"stisknuto"</string>
+ <string name="togglebutton_not_pressed" msgid="4495147725636134425">"nestisknuto"</string>
<string name="keyboardview_keycode_alt" msgid="4856868820040051939">"Alt"</string>
<string name="keyboardview_keycode_cancel" msgid="1203984017245783244">"Zrušit"</string>
<string name="keyboardview_keycode_delete" msgid="3337914833206635744">"Smazat"</string>
diff --git a/core/res/res/values-da/strings.xml b/core/res/res/values-da/strings.xml
index 067b813..3ca0534 100644
--- a/core/res/res/values-da/strings.xml
+++ b/core/res/res/values-da/strings.xml
@@ -1172,6 +1172,14 @@
<string name="date_picker_decrement_day_button" msgid="2427816793443629131">"Fjern dag"</string>
<string name="date_picker_increment_year_button" msgid="3058553394722295105">"Tilføj år"</string>
<string name="date_picker_decrement_year_button" msgid="5193062846559743823">"Fjern år"</string>
+ <string name="checkbox_checked" msgid="7222044992652711167">"markeret"</string>
+ <string name="checkbox_not_checked" msgid="5174639551134444056">"ikke markeret"</string>
+ <string name="radiobutton_selected" msgid="8603599808486581511">"udvalgt"</string>
+ <string name="radiobutton_not_selected" msgid="2908760184307722393">"ikke valgt"</string>
+ <string name="switch_on" msgid="551417728476977311">"tændt"</string>
+ <string name="switch_off" msgid="7249798614327155088">"slukket"</string>
+ <string name="togglebutton_pressed" msgid="4180411746647422233">"trykket på"</string>
+ <string name="togglebutton_not_pressed" msgid="4495147725636134425">"ikke trykket på"</string>
<string name="keyboardview_keycode_alt" msgid="4856868820040051939">"Alt"</string>
<string name="keyboardview_keycode_cancel" msgid="1203984017245783244">"Annuller"</string>
<string name="keyboardview_keycode_delete" msgid="3337914833206635744">"Slet"</string>
diff --git a/core/res/res/values-de/strings.xml b/core/res/res/values-de/strings.xml
index 5c46e662..72ac55f 100644
--- a/core/res/res/values-de/strings.xml
+++ b/core/res/res/values-de/strings.xml
@@ -1173,6 +1173,14 @@
<string name="date_picker_decrement_day_button" msgid="2427816793443629131">"Tag zurückstellen"</string>
<string name="date_picker_increment_year_button" msgid="3058553394722295105">"Jahr vorstellen"</string>
<string name="date_picker_decrement_year_button" msgid="5193062846559743823">"Jahr zurückstellen"</string>
+ <string name="checkbox_checked" msgid="7222044992652711167">"Aktiviert"</string>
+ <string name="checkbox_not_checked" msgid="5174639551134444056">"Nicht aktiviert"</string>
+ <string name="radiobutton_selected" msgid="8603599808486581511">"Ausgewählt"</string>
+ <string name="radiobutton_not_selected" msgid="2908760184307722393">"Nicht ausgewählt"</string>
+ <string name="switch_on" msgid="551417728476977311">"An"</string>
+ <string name="switch_off" msgid="7249798614327155088">"Aus"</string>
+ <string name="togglebutton_pressed" msgid="4180411746647422233">"Gedrückt"</string>
+ <string name="togglebutton_not_pressed" msgid="4495147725636134425">"Nicht gedrückt"</string>
<string name="keyboardview_keycode_alt" msgid="4856868820040051939">"Alt"</string>
<string name="keyboardview_keycode_cancel" msgid="1203984017245783244">"Abbrechen"</string>
<string name="keyboardview_keycode_delete" msgid="3337914833206635744">"Löschen"</string>
diff --git a/core/res/res/values-el/strings.xml b/core/res/res/values-el/strings.xml
index 75f0b51..0e5dd10 100644
--- a/core/res/res/values-el/strings.xml
+++ b/core/res/res/values-el/strings.xml
@@ -1172,6 +1172,14 @@
<string name="date_picker_decrement_day_button" msgid="2427816793443629131">"Προηγούμενη μέρα"</string>
<string name="date_picker_increment_year_button" msgid="3058553394722295105">"Αύξηση έτους"</string>
<string name="date_picker_decrement_year_button" msgid="5193062846559743823">"Προηγούμενο έτος"</string>
+ <string name="checkbox_checked" msgid="7222044992652711167">"ελέγχθηκε"</string>
+ <string name="checkbox_not_checked" msgid="5174639551134444056">"δεν επιλέχθηκε"</string>
+ <string name="radiobutton_selected" msgid="8603599808486581511">"επιλεγμένο"</string>
+ <string name="radiobutton_not_selected" msgid="2908760184307722393">"δεν έχει επιλεγεί"</string>
+ <string name="switch_on" msgid="551417728476977311">"ενεργοποίηση"</string>
+ <string name="switch_off" msgid="7249798614327155088">"απενεργοποιημένη"</string>
+ <string name="togglebutton_pressed" msgid="4180411746647422233">"πατήθηκε"</string>
+ <string name="togglebutton_not_pressed" msgid="4495147725636134425">"δεν πατήθηκε"</string>
<string name="keyboardview_keycode_alt" msgid="4856868820040051939">"Alt"</string>
<string name="keyboardview_keycode_cancel" msgid="1203984017245783244">"Ακύρωση"</string>
<string name="keyboardview_keycode_delete" msgid="3337914833206635744">"Διαγραφή"</string>
diff --git a/core/res/res/values-en-rGB/strings.xml b/core/res/res/values-en-rGB/strings.xml
index c7364e8..e7ff973 100644
--- a/core/res/res/values-en-rGB/strings.xml
+++ b/core/res/res/values-en-rGB/strings.xml
@@ -1172,6 +1172,14 @@
<string name="date_picker_decrement_day_button" msgid="2427816793443629131">"Decrement day"</string>
<string name="date_picker_increment_year_button" msgid="3058553394722295105">"Increment year"</string>
<string name="date_picker_decrement_year_button" msgid="5193062846559743823">"Decrement year"</string>
+ <string name="checkbox_checked" msgid="7222044992652711167">"ticked"</string>
+ <string name="checkbox_not_checked" msgid="5174639551134444056">"not ticked"</string>
+ <string name="radiobutton_selected" msgid="8603599808486581511">"selected"</string>
+ <string name="radiobutton_not_selected" msgid="2908760184307722393">"not selected"</string>
+ <string name="switch_on" msgid="551417728476977311">"on"</string>
+ <string name="switch_off" msgid="7249798614327155088">"off"</string>
+ <string name="togglebutton_pressed" msgid="4180411746647422233">"pressed"</string>
+ <string name="togglebutton_not_pressed" msgid="4495147725636134425">"not pressed"</string>
<string name="keyboardview_keycode_alt" msgid="4856868820040051939">"Alt"</string>
<string name="keyboardview_keycode_cancel" msgid="1203984017245783244">"Cancel"</string>
<string name="keyboardview_keycode_delete" msgid="3337914833206635744">"Delete"</string>
diff --git a/core/res/res/values-es-rUS/strings.xml b/core/res/res/values-es-rUS/strings.xml
index 6cedde4..8e36948 100644
--- a/core/res/res/values-es-rUS/strings.xml
+++ b/core/res/res/values-es-rUS/strings.xml
@@ -1172,6 +1172,14 @@
<string name="date_picker_decrement_day_button" msgid="2427816793443629131">"Disminuir día"</string>
<string name="date_picker_increment_year_button" msgid="3058553394722295105">"Aumentar año"</string>
<string name="date_picker_decrement_year_button" msgid="5193062846559743823">"Disminuir año"</string>
+ <string name="checkbox_checked" msgid="7222044992652711167">"marcado"</string>
+ <string name="checkbox_not_checked" msgid="5174639551134444056">"no marcado"</string>
+ <string name="radiobutton_selected" msgid="8603599808486581511">"seleccionado"</string>
+ <string name="radiobutton_not_selected" msgid="2908760184307722393">"No se ha seleccionado."</string>
+ <string name="switch_on" msgid="551417728476977311">"Activado"</string>
+ <string name="switch_off" msgid="7249798614327155088">"Desactivado"</string>
+ <string name="togglebutton_pressed" msgid="4180411746647422233">"presionado"</string>
+ <string name="togglebutton_not_pressed" msgid="4495147725636134425">"sin presionar"</string>
<string name="keyboardview_keycode_alt" msgid="4856868820040051939">"Alt"</string>
<string name="keyboardview_keycode_cancel" msgid="1203984017245783244">"Cancelar"</string>
<string name="keyboardview_keycode_delete" msgid="3337914833206635744">"Eliminar"</string>
diff --git a/core/res/res/values-es/strings.xml b/core/res/res/values-es/strings.xml
index 7f64b0c..a4638fa 100644
--- a/core/res/res/values-es/strings.xml
+++ b/core/res/res/values-es/strings.xml
@@ -1172,6 +1172,14 @@
<string name="date_picker_decrement_day_button" msgid="2427816793443629131">"Disminuir día"</string>
<string name="date_picker_increment_year_button" msgid="3058553394722295105">"Aumentar año"</string>
<string name="date_picker_decrement_year_button" msgid="5193062846559743823">"Disminuir año"</string>
+ <string name="checkbox_checked" msgid="7222044992652711167">"seleccionado"</string>
+ <string name="checkbox_not_checked" msgid="5174639551134444056">"no seleccionado"</string>
+ <string name="radiobutton_selected" msgid="8603599808486581511">"seleccionado"</string>
+ <string name="radiobutton_not_selected" msgid="2908760184307722393">"no seleccionado"</string>
+ <string name="switch_on" msgid="551417728476977311">"activado"</string>
+ <string name="switch_off" msgid="7249798614327155088">"desactivado"</string>
+ <string name="togglebutton_pressed" msgid="4180411746647422233">"pulsado"</string>
+ <string name="togglebutton_not_pressed" msgid="4495147725636134425">"sin pulsar"</string>
<string name="keyboardview_keycode_alt" msgid="4856868820040051939">"Alt"</string>
<string name="keyboardview_keycode_cancel" msgid="1203984017245783244">"Cancelar"</string>
<string name="keyboardview_keycode_delete" msgid="3337914833206635744">"Eliminar"</string>
diff --git a/core/res/res/values-et/strings.xml b/core/res/res/values-et/strings.xml
index fd24d763..697c8f1 100644
--- a/core/res/res/values-et/strings.xml
+++ b/core/res/res/values-et/strings.xml
@@ -1172,6 +1172,14 @@
<string name="date_picker_decrement_day_button" msgid="2427816793443629131">"Eelmine päev"</string>
<string name="date_picker_increment_year_button" msgid="3058553394722295105">"Aastaarvu suurendamine"</string>
<string name="date_picker_decrement_year_button" msgid="5193062846559743823">"Aastaarvu vähendamine"</string>
+ <string name="checkbox_checked" msgid="7222044992652711167">"märgitud"</string>
+ <string name="checkbox_not_checked" msgid="5174639551134444056">"pole märgitud"</string>
+ <string name="radiobutton_selected" msgid="8603599808486581511">"valitud"</string>
+ <string name="radiobutton_not_selected" msgid="2908760184307722393">"pole valitud"</string>
+ <string name="switch_on" msgid="551417728476977311">"sees"</string>
+ <string name="switch_off" msgid="7249798614327155088">"väljas"</string>
+ <string name="togglebutton_pressed" msgid="4180411746647422233">"vajutatud"</string>
+ <string name="togglebutton_not_pressed" msgid="4495147725636134425">"pole vajutatud"</string>
<string name="keyboardview_keycode_alt" msgid="4856868820040051939">"Alt"</string>
<string name="keyboardview_keycode_cancel" msgid="1203984017245783244">"Tühista"</string>
<string name="keyboardview_keycode_delete" msgid="3337914833206635744">"Kustuta"</string>
diff --git a/core/res/res/values-fa/strings.xml b/core/res/res/values-fa/strings.xml
index f135ec8..a4a9bff 100644
--- a/core/res/res/values-fa/strings.xml
+++ b/core/res/res/values-fa/strings.xml
@@ -1172,6 +1172,14 @@
<string name="date_picker_decrement_day_button" msgid="2427816793443629131">"کاهش روز"</string>
<string name="date_picker_increment_year_button" msgid="3058553394722295105">"افزایش سال"</string>
<string name="date_picker_decrement_year_button" msgid="5193062846559743823">"کاهش سال"</string>
+ <string name="checkbox_checked" msgid="7222044992652711167">"علامت زده"</string>
+ <string name="checkbox_not_checked" msgid="5174639551134444056">"بدون علامت"</string>
+ <string name="radiobutton_selected" msgid="8603599808486581511">"انتخاب شد"</string>
+ <string name="radiobutton_not_selected" msgid="2908760184307722393">"انتخاب نشده"</string>
+ <string name="switch_on" msgid="551417728476977311">"روشن"</string>
+ <string name="switch_off" msgid="7249798614327155088">"خاموش"</string>
+ <string name="togglebutton_pressed" msgid="4180411746647422233">"فشرده شد"</string>
+ <string name="togglebutton_not_pressed" msgid="4495147725636134425">"فشرده نشد"</string>
<string name="keyboardview_keycode_alt" msgid="4856868820040051939">"Alt"</string>
<string name="keyboardview_keycode_cancel" msgid="1203984017245783244">"لغو"</string>
<string name="keyboardview_keycode_delete" msgid="3337914833206635744">"Delete"</string>
diff --git a/core/res/res/values-fi/strings.xml b/core/res/res/values-fi/strings.xml
index 8c8b057..1b8b18a 100644
--- a/core/res/res/values-fi/strings.xml
+++ b/core/res/res/values-fi/strings.xml
@@ -1172,6 +1172,14 @@
<string name="date_picker_decrement_day_button" msgid="2427816793443629131">"Pienennä päivää"</string>
<string name="date_picker_increment_year_button" msgid="3058553394722295105">"Kasvata vuotta"</string>
<string name="date_picker_decrement_year_button" msgid="5193062846559743823">"Pienennä vuotta"</string>
+ <string name="checkbox_checked" msgid="7222044992652711167">"valittu"</string>
+ <string name="checkbox_not_checked" msgid="5174639551134444056">"ei valittu"</string>
+ <string name="radiobutton_selected" msgid="8603599808486581511">"valittu"</string>
+ <string name="radiobutton_not_selected" msgid="2908760184307722393">"ei valittu"</string>
+ <string name="switch_on" msgid="551417728476977311">"käytössä"</string>
+ <string name="switch_off" msgid="7249798614327155088">"pois käytöstä"</string>
+ <string name="togglebutton_pressed" msgid="4180411746647422233">"painettu"</string>
+ <string name="togglebutton_not_pressed" msgid="4495147725636134425">"ei painettu"</string>
<string name="keyboardview_keycode_alt" msgid="4856868820040051939">"Alt"</string>
<string name="keyboardview_keycode_cancel" msgid="1203984017245783244">"Peruuta"</string>
<string name="keyboardview_keycode_delete" msgid="3337914833206635744">"Poista"</string>
diff --git a/core/res/res/values-fr/strings.xml b/core/res/res/values-fr/strings.xml
index d748a26..b19a7de 100644
--- a/core/res/res/values-fr/strings.xml
+++ b/core/res/res/values-fr/strings.xml
@@ -1172,6 +1172,14 @@
<string name="date_picker_decrement_day_button" msgid="2427816793443629131">"Jour précédent"</string>
<string name="date_picker_increment_year_button" msgid="3058553394722295105">"Année suivante"</string>
<string name="date_picker_decrement_year_button" msgid="5193062846559743823">"Année précédente"</string>
+ <string name="checkbox_checked" msgid="7222044992652711167">"coché"</string>
+ <string name="checkbox_not_checked" msgid="5174639551134444056">"non coché"</string>
+ <string name="radiobutton_selected" msgid="8603599808486581511">"sélectionné"</string>
+ <string name="radiobutton_not_selected" msgid="2908760184307722393">"non sélectionné"</string>
+ <string name="switch_on" msgid="551417728476977311">"activé"</string>
+ <string name="switch_off" msgid="7249798614327155088">"désactivé"</string>
+ <string name="togglebutton_pressed" msgid="4180411746647422233">"sélectionné"</string>
+ <string name="togglebutton_not_pressed" msgid="4495147725636134425">"non sélectionné"</string>
<string name="keyboardview_keycode_alt" msgid="4856868820040051939">"Alt"</string>
<string name="keyboardview_keycode_cancel" msgid="1203984017245783244">"Annuler"</string>
<string name="keyboardview_keycode_delete" msgid="3337914833206635744">"Supprimer"</string>
diff --git a/core/res/res/values-hi/strings.xml b/core/res/res/values-hi/strings.xml
index 66d71c2..d4b921f 100644
--- a/core/res/res/values-hi/strings.xml
+++ b/core/res/res/values-hi/strings.xml
@@ -1172,6 +1172,14 @@
<string name="date_picker_decrement_day_button" msgid="2427816793443629131">"घटते क्रम में दिन"</string>
<string name="date_picker_increment_year_button" msgid="3058553394722295105">"बढ़ते क्रम में वर्ष"</string>
<string name="date_picker_decrement_year_button" msgid="5193062846559743823">"घटते क्रम में वर्ष"</string>
+ <string name="checkbox_checked" msgid="7222044992652711167">"चेक किया गया"</string>
+ <string name="checkbox_not_checked" msgid="5174639551134444056">"चेक नहीं किया गया"</string>
+ <string name="radiobutton_selected" msgid="8603599808486581511">"चयनित"</string>
+ <string name="radiobutton_not_selected" msgid="2908760184307722393">"चयनित नहीं"</string>
+ <string name="switch_on" msgid="551417728476977311">"चालू"</string>
+ <string name="switch_off" msgid="7249798614327155088">"बंद"</string>
+ <string name="togglebutton_pressed" msgid="4180411746647422233">"दबाया गया"</string>
+ <string name="togglebutton_not_pressed" msgid="4495147725636134425">"दबाया नहीं गया."</string>
<string name="keyboardview_keycode_alt" msgid="4856868820040051939">"Alt"</string>
<string name="keyboardview_keycode_cancel" msgid="1203984017245783244">"रद्द करें"</string>
<string name="keyboardview_keycode_delete" msgid="3337914833206635744">"हटाएं"</string>
diff --git a/core/res/res/values-hr/strings.xml b/core/res/res/values-hr/strings.xml
index a726037..fbd3a3d 100644
--- a/core/res/res/values-hr/strings.xml
+++ b/core/res/res/values-hr/strings.xml
@@ -1172,6 +1172,14 @@
<string name="date_picker_decrement_day_button" msgid="2427816793443629131">"Pomak unatrag za jedan dan"</string>
<string name="date_picker_increment_year_button" msgid="3058553394722295105">"Pomak unaprijed za jednu godinu"</string>
<string name="date_picker_decrement_year_button" msgid="5193062846559743823">"Pomak unatrag za jednu godinu"</string>
+ <string name="checkbox_checked" msgid="7222044992652711167">"označeno"</string>
+ <string name="checkbox_not_checked" msgid="5174639551134444056">"nije označeno"</string>
+ <string name="radiobutton_selected" msgid="8603599808486581511">"odabran"</string>
+ <string name="radiobutton_not_selected" msgid="2908760184307722393">"nije odabrano"</string>
+ <string name="switch_on" msgid="551417728476977311">"uključeno"</string>
+ <string name="switch_off" msgid="7249798614327155088">"isključeno"</string>
+ <string name="togglebutton_pressed" msgid="4180411746647422233">"pritisnut"</string>
+ <string name="togglebutton_not_pressed" msgid="4495147725636134425">"nije pritisnut"</string>
<string name="keyboardview_keycode_alt" msgid="4856868820040051939">"Alt"</string>
<string name="keyboardview_keycode_cancel" msgid="1203984017245783244">"Odustani"</string>
<string name="keyboardview_keycode_delete" msgid="3337914833206635744">"Izbriši"</string>
diff --git a/core/res/res/values-hu/strings.xml b/core/res/res/values-hu/strings.xml
index 8b06ee7..c6190fd 100644
--- a/core/res/res/values-hu/strings.xml
+++ b/core/res/res/values-hu/strings.xml
@@ -1172,6 +1172,14 @@
<string name="date_picker_decrement_day_button" msgid="2427816793443629131">"Napok csökkentése"</string>
<string name="date_picker_increment_year_button" msgid="3058553394722295105">"Évek növelése"</string>
<string name="date_picker_decrement_year_button" msgid="5193062846559743823">"Évek csökkentése"</string>
+ <string name="checkbox_checked" msgid="7222044992652711167">"bejelölve"</string>
+ <string name="checkbox_not_checked" msgid="5174639551134444056">"nincs bejelölve"</string>
+ <string name="radiobutton_selected" msgid="8603599808486581511">"bejelölve"</string>
+ <string name="radiobutton_not_selected" msgid="2908760184307722393">"nincs kiválasztva"</string>
+ <string name="switch_on" msgid="551417728476977311">"be"</string>
+ <string name="switch_off" msgid="7249798614327155088">"kikapcsolva"</string>
+ <string name="togglebutton_pressed" msgid="4180411746647422233">"megnyomva"</string>
+ <string name="togglebutton_not_pressed" msgid="4495147725636134425">"nincs megnyomva"</string>
<string name="keyboardview_keycode_alt" msgid="4856868820040051939">"Alt"</string>
<string name="keyboardview_keycode_cancel" msgid="1203984017245783244">"Mégse"</string>
<string name="keyboardview_keycode_delete" msgid="3337914833206635744">"Delete"</string>
diff --git a/core/res/res/values-in/strings.xml b/core/res/res/values-in/strings.xml
index 1b436e6..d2d4ece 100644
--- a/core/res/res/values-in/strings.xml
+++ b/core/res/res/values-in/strings.xml
@@ -68,7 +68,7 @@
<string name="CLIRDefaultOffNextCallOn" msgid="6179425182856418465">"Nomor penelepon bawaan tidak dibatasi. Panggilan selanjutnya: Dibatasi"</string>
<string name="CLIRDefaultOffNextCallOff" msgid="2567998633124408552">"Nomor penelepon bawaan tidak dibatasi. Panggilan selanjutnya: Tidak dibatasi"</string>
<string name="serviceNotProvisioned" msgid="8614830180508686666">"Layanan tidak diperlengkapi."</string>
- <string name="CLIRPermanent" msgid="3377371145926835671">"Anda tidak dapat mengubah pengaturan nomor penelepon."</string>
+ <string name="CLIRPermanent" msgid="3377371145926835671">"Anda tidak dapat mengubah setelan nomor penelepon."</string>
<string name="RestrictedChangedTitle" msgid="5592189398956187498">"Akses terbatas berubah"</string>
<string name="RestrictedOnData" msgid="8653794784690065540">"Layanan data dicekal."</string>
<string name="RestrictedOnEmergency" msgid="6581163779072833665">"Layanan darurat dicekal."</string>
@@ -219,7 +219,7 @@
<string name="permdesc_setScreenCompatibility" msgid="692043618693917374">"Memungkinkan apl mengontrol mode kompatibilitas layar aplikasi lain. Aplikasi berbahaya dapat merusak perilaku aplikasi lain."</string>
<string name="permlab_setDebugApp" msgid="3022107198686584052">"mengaktifkan debugging apl"</string>
<string name="permdesc_setDebugApp" msgid="4474512416299013256">"Mengizinkan apl mengaktifkan debugging untuk apl lain. Apl berbahaya dapat menggunakan cara ini untuk menutup apl lain."</string>
- <string name="permlab_changeConfiguration" msgid="8214475779521218295">"ubah pengaturan UI Anda"</string>
+ <string name="permlab_changeConfiguration" msgid="8214475779521218295">"ubah setelan UI Anda"</string>
<string name="permdesc_changeConfiguration" msgid="4372223873154296076">"Mengizinkan apl mengubah konfigurasi saat ini, misalnya lokal atau ukuran fon keseluruhan."</string>
<string name="permlab_enableCarMode" msgid="5684504058192921098">"aktifkan mode mobil"</string>
<string name="permdesc_enableCarMode" msgid="4853187425751419467">"Mengizinkan apl mengaktifkan mode mobil."</string>
@@ -317,10 +317,10 @@
<string name="permdesc_grantRevokePermissions" msgid="4088642654085850662">"Memungkinkan aplikasi memberikan atau mencabut izin khusus untuk aplikasi tersebut atau aplikasi lainnya. Aplikasi berbahaya dapat menggunakannya untuk mengakses fitur yang tidak Anda beri izin."</string>
<string name="permlab_setPreferredApplications" msgid="8463181628695396391">"menyetel apl yang disukai"</string>
<string name="permdesc_setPreferredApplications" msgid="4973986762241783712">"Mengizinkan apl memodifikasi apl pilihan Anda. Apl berbahaya dapat diam-diam mengubah apl yang berjalan, menipu apl yang ada untuk mengumpulkan data pribadi dari Anda."</string>
- <string name="permlab_writeSettings" msgid="1365523497395143704">"ubah pengaturan sistem global"</string>
- <string name="permdesc_writeSettings" msgid="7775723441558907181">"Mengizinkan apl memodifikasi data pengaturan sistem. Apl berbahaya dapat merusak konfigurasi sistem anda."</string>
- <string name="permlab_writeSecureSettings" msgid="204676251876718288">"ubah pengaturan sistem aman"</string>
- <string name="permdesc_writeSecureSettings" msgid="8159535613020137391">"Mengizinkan apl memodifikasi data pengaturan aman sistem. Tidak untuk digunakan oleh apl normal."</string>
+ <string name="permlab_writeSettings" msgid="1365523497395143704">"ubah setelan sistem global"</string>
+ <string name="permdesc_writeSettings" msgid="7775723441558907181">"Mengizinkan apl memodifikasi data setelan sistem. Apl berbahaya dapat merusak konfigurasi sistem anda."</string>
+ <string name="permlab_writeSecureSettings" msgid="204676251876718288">"ubah setelan sistem aman"</string>
+ <string name="permdesc_writeSecureSettings" msgid="8159535613020137391">"Mengizinkan apl memodifikasi data setelan aman sistem. Tidak untuk digunakan oleh apl normal."</string>
<string name="permlab_writeGservices" msgid="2149426664226152185">"ubah peta layanan Google"</string>
<string name="permdesc_writeGservices" msgid="1287309437638380229">"Mengizinkan apl memodifikasi peta layanan Google. Tidak untuk digunakan oleh apl normal."</string>
<string name="permlab_receiveBootCompleted" msgid="7776779842866993377">"mulai secara otomatis pada saat boot"</string>
@@ -364,8 +364,8 @@
<string name="permdesc_accessSurfaceFlinger" msgid="1041619516733293551">"Mengizinkan apl menggunakan fitur tingkat rendah SurfaceFlinger."</string>
<string name="permlab_readFrameBuffer" msgid="6690504248178498136">"baca buffer frame"</string>
<string name="permdesc_readFrameBuffer" msgid="4937405521809454680">"Mengizinkan apl membaca konten penyangga frame."</string>
- <string name="permlab_modifyAudioSettings" msgid="6095859937069146086">"ubah pengaturan audio Anda"</string>
- <string name="permdesc_modifyAudioSettings" msgid="7343951185408396919">"Mengizinkan apl memodifikasi pengaturan audio global, misalnya volume dan perutean."</string>
+ <string name="permlab_modifyAudioSettings" msgid="6095859937069146086">"ubah setelan audio Anda"</string>
+ <string name="permdesc_modifyAudioSettings" msgid="7343951185408396919">"Mengizinkan apl memodifikasi setelan audio global, misalnya volume dan perutean."</string>
<string name="permlab_recordAudio" msgid="3876049771427466323">"rekam audio"</string>
<string name="permdesc_recordAudio" msgid="2387462233976248635">"Mengizinkan apl mengakses jalur rekaman audio."</string>
<string name="permlab_camera" msgid="3616391919559751192">"ambil gambar dan video"</string>
@@ -434,8 +434,8 @@
<string name="permdesc_setWallpaper" msgid="7373447920977624745">"Mengizinkan apl menyetel wallpaper sistem."</string>
<string name="permlab_setWallpaperHints" msgid="3600721069353106851">"atur petunjuk ukuran wallpaper"</string>
<string name="permdesc_setWallpaperHints" msgid="8235784384223730091">"Mengizinkan apl menyetel petunjuk ukuran wallpaper sistem."</string>
- <string name="permlab_masterClear" msgid="2315750423139697397">"setel ulang sistem ke pengaturan bawaan pabrik"</string>
- <string name="permdesc_masterClear" msgid="3665380492633910226">"Mengizinkan apl menyetel ulang sistem ke pengaturan pabrik sepenuhnya, menghapus semua data, konfigurasi, dan apl yang terpasang."</string>
+ <string name="permlab_masterClear" msgid="2315750423139697397">"setel ulang sistem ke setelan bawaan pabrik"</string>
+ <string name="permdesc_masterClear" msgid="3665380492633910226">"Mengizinkan apl menyetel ulang sistem ke setelan pabrik sepenuhnya, menghapus semua data, konfigurasi, dan apl yang terpasang."</string>
<string name="permlab_setTime" msgid="2021614829591775646">"atur waktu"</string>
<string name="permdesc_setTime" product="tablet" msgid="1896341438151152881">"Mengizinkan apl mengubah waktu pada jam tablet."</string>
<string name="permdesc_setTime" product="default" msgid="1855702730738020">"Mengizinkan apl mengubah waktu pada jam ponsel."</string>
@@ -457,14 +457,14 @@
<string name="permdesc_accessNetworkState" msgid="479772796952547198">"Mengizinkan apl melihat keadaan semua jaringan."</string>
<string name="permlab_createNetworkSockets" msgid="9121633680349549585">"akses internet penuh"</string>
<string name="permdesc_createNetworkSockets" msgid="5963922297444265950">"Mengizinkan apl membuat soket jaringan."</string>
- <string name="permlab_writeApnSettings" msgid="505660159675751896">"mengubah/mencegat lalu lintas dan pengaturan jaringan"</string>
- <string name="permdesc_writeApnSettings" msgid="5333798886412714193">"Mengizinkan apl mengubah pengaturan jaringan dan mencegat serta memeriksa semua lalu lintas jaringan, misalnya mengubah proxy dan port APN apa saja. Apl berbahaya dapat memantau, mengalihkan, atau mengubah paket jaringan tanpa sepengetahuan Anda."</string>
+ <string name="permlab_writeApnSettings" msgid="505660159675751896">"mengubah/mencegat lalu lintas dan setelan jaringan"</string>
+ <string name="permdesc_writeApnSettings" msgid="5333798886412714193">"Mengizinkan apl mengubah setelan jaringan dan mencegat serta memeriksa semua lalu lintas jaringan, misalnya mengubah proxy dan port APN apa saja. Apl berbahaya dapat memantau, mengalihkan, atau mengubah paket jaringan tanpa sepengetahuan Anda."</string>
<string name="permlab_changeNetworkState" msgid="958884291454327309">"ubah konektivitas jaringan"</string>
<string name="permdesc_changeNetworkState" msgid="6789123912476416214">"Mengizinkan apl mengubah keadaan konektivitas jaringan."</string>
<string name="permlab_changeTetherState" msgid="5952584964373017960">"mengubah konektivitas yang tertambat"</string>
<string name="permdesc_changeTetherState" msgid="1524441344412319780">"Mengizinkan apl mengubah status konektivitas jaringan yang tertambat."</string>
- <string name="permlab_changeBackgroundDataSetting" msgid="1400666012671648741">"mengubah pengaturan penggunaan data latar belakang"</string>
- <string name="permdesc_changeBackgroundDataSetting" msgid="5347729578468744379">"Mengizinkan apl mengubah pengaturan penggunaan data latar belakang."</string>
+ <string name="permlab_changeBackgroundDataSetting" msgid="1400666012671648741">"mengubah setelan penggunaan data latar belakang"</string>
+ <string name="permdesc_changeBackgroundDataSetting" msgid="5347729578468744379">"Mengizinkan apl mengubah setelan penggunaan data latar belakang."</string>
<string name="permlab_accessWifiState" msgid="8100926650211034400">"lihat kondisi Wi-Fi"</string>
<string name="permdesc_accessWifiState" msgid="7770452658226256831">"Mengizinkan apl melihat informasi tentang keadaan Wi-Fi."</string>
<string name="permlab_changeWifiState" msgid="7280632711057112137">"ubah status Wi-Fi"</string>
@@ -485,10 +485,10 @@
<string name="permdesc_nfc" msgid="7120611819401789907">"Mengizinkan apl berkomunikasi dengan tag, kartu, dan alat pembaca Komunikasi Nirkabel Jarak Dekat (NFC)."</string>
<string name="permlab_disableKeyguard" msgid="4977406164311535092">"nonaktifkan kunci tombol"</string>
<string name="permdesc_disableKeyguard" msgid="6231611286892232626">"Mengizinkan apl menonaktifkan kunci tombol dan segala keamanan sandi yang terkait. Contoh nyata dari hal ini adalah ponsel menonaktifkan kunci tombol saat menerima panggilan telepon masuk, kemudian mengaktifkan kembali kunci tombol ketika panggilan selesai."</string>
- <string name="permlab_readSyncSettings" msgid="6201810008230503052">"baca pengaturan sinkron"</string>
- <string name="permdesc_readSyncSettings" msgid="5464056785274229278">"Mengizinkan apl membaca pengaturan sinkronisasi, misalnya apakah sinkronisasi untuk apl Orang diaktifkan atau tidak."</string>
- <string name="permlab_writeSyncSettings" msgid="6297138566442486462">"tuliskan pengaturan sinkronisasi"</string>
- <string name="permdesc_writeSyncSettings" msgid="1466056564502117130">"Mengizinkan apl memodifikasi pengaturan sinkronisasi, seperti apakah sinkronisasi untuk apl Orang diaktifkan atau tidak."</string>
+ <string name="permlab_readSyncSettings" msgid="6201810008230503052">"baca setelan sinkron"</string>
+ <string name="permdesc_readSyncSettings" msgid="5464056785274229278">"Mengizinkan apl membaca setelan sinkronisasi, misalnya apakah sinkronisasi untuk apl Orang diaktifkan atau tidak."</string>
+ <string name="permlab_writeSyncSettings" msgid="6297138566442486462">"tuliskan setelan sinkronisasi"</string>
+ <string name="permdesc_writeSyncSettings" msgid="1466056564502117130">"Mengizinkan apl memodifikasi setelan sinkronisasi, seperti apakah sinkronisasi untuk apl Orang diaktifkan atau tidak."</string>
<string name="permlab_readSyncStats" msgid="7396577451360202448">"statistika baca sinkron"</string>
<string name="permdesc_readSyncStats" msgid="3801971839939951678">"Mengizinkan apl membaca statistik sinkronisasi; mis., riwayat sinkronisasi yang telah terjadi."</string>
<string name="permlab_subscribedFeedsRead" msgid="4756609637053353318">"baca umpan langganan"</string>
@@ -695,10 +695,10 @@
<string name="lockscreen_too_many_failed_pin_attempts_dialog_message" msgid="6216672706545696955">"Anda telah <xliff:g id="NUMBER_0">%d</xliff:g> kali salah mengetik PIN. "\n\n"Coba lagi dalam <xliff:g id="NUMBER_1">%d</xliff:g> detik."</string>
<string name="lockscreen_failed_attempts_almost_glogin" product="tablet" msgid="9191611984625460820">"Anda telah <xliff:g id="NUMBER_0">%d</xliff:g> kali salah menggambar pola pembuka kunci. Setelah <xliff:g id="NUMBER_1">%d</xliff:g> lagi upaya gagal, Anda akan diminta membuka kunci tablet menggunakan info masuk Google."\n\n"Coba lagi dalam <xliff:g id="NUMBER_2">%d</xliff:g> detik."</string>
<string name="lockscreen_failed_attempts_almost_glogin" product="default" msgid="2590227559763762751">"Anda telah <xliff:g id="NUMBER_0">%d</xliff:g> kali salah menggambar pola pembuka kunci. Setelah <xliff:g id="NUMBER_1">%d</xliff:g> lagi upaya gagal, Anda akan diminta membuka kunci ponsel menggunakan info masuk Google."\n\n"Coba lagi dalam <xliff:g id="NUMBER_2">%d</xliff:g> detik."</string>
- <string name="lockscreen_failed_attempts_almost_at_wipe" product="tablet" msgid="6128106399745755604">"Anda telah gagal mencoba membuka gembok tablet sebanyak <xliff:g id="NUMBER_0">%d</xliff:g> kali. Setelah <xliff:g id="NUMBER_1">%d</xliff:g> upaya gagal lagi, tablet akan disetel ulang ke pengaturan bawaan pabrik dan semua data pengguna hilang."</string>
- <string name="lockscreen_failed_attempts_almost_at_wipe" product="default" msgid="8603565142156826565">"Anda telah gagal mencoba membuka gembok ponsel sebanyak <xliff:g id="NUMBER_0">%d</xliff:g> kali. Setelah <xliff:g id="NUMBER_1">%d</xliff:g> upaya gagal lagi, ponsel akan disetel ulang ke pengaturan bawaan pabrik dan semua data pengguna hilang."</string>
- <string name="lockscreen_failed_attempts_now_wiping" product="tablet" msgid="280873516493934365">"Anda telah gagal mencoba membuka gembok tablet sebanyak <xliff:g id="NUMBER">%d</xliff:g> kali. Kini tablet akan disetel ulang ke pengaturan bawaan pabrik."</string>
- <string name="lockscreen_failed_attempts_now_wiping" product="default" msgid="3025504721764922246">"Anda telah gagal mencoba membuka gembok ponsel sebanyak <xliff:g id="NUMBER">%d</xliff:g> kali. Kini ponsel akan disetel ulang ke pengaturan bawaan pabrik."</string>
+ <string name="lockscreen_failed_attempts_almost_at_wipe" product="tablet" msgid="6128106399745755604">"Anda telah gagal mencoba membuka gembok tablet sebanyak <xliff:g id="NUMBER_0">%d</xliff:g> kali. Setelah <xliff:g id="NUMBER_1">%d</xliff:g> upaya gagal lagi, tablet akan disetel ulang ke setelan bawaan pabrik dan semua data pengguna hilang."</string>
+ <string name="lockscreen_failed_attempts_almost_at_wipe" product="default" msgid="8603565142156826565">"Anda telah gagal mencoba membuka gembok ponsel sebanyak <xliff:g id="NUMBER_0">%d</xliff:g> kali. Setelah <xliff:g id="NUMBER_1">%d</xliff:g> upaya gagal lagi, ponsel akan disetel ulang ke setelan bawaan pabrik dan semua data pengguna hilang."</string>
+ <string name="lockscreen_failed_attempts_now_wiping" product="tablet" msgid="280873516493934365">"Anda telah gagal mencoba membuka gembok tablet sebanyak <xliff:g id="NUMBER">%d</xliff:g> kali. Kini tablet akan disetel ulang ke setelan bawaan pabrik."</string>
+ <string name="lockscreen_failed_attempts_now_wiping" product="default" msgid="3025504721764922246">"Anda telah gagal mencoba membuka gembok ponsel sebanyak <xliff:g id="NUMBER">%d</xliff:g> kali. Kini ponsel akan disetel ulang ke setelan bawaan pabrik."</string>
<string name="lockscreen_too_many_failed_attempts_countdown" msgid="6251480343394389665">"Coba lagi dalam <xliff:g id="NUMBER">%d</xliff:g> detik."</string>
<string name="lockscreen_forgot_pattern_button_text" msgid="2626999449610695930">"Lupa pola?"</string>
<string name="lockscreen_glogin_forgot_pattern" msgid="2588521501166032747">"Pembuka kunci akun"</string>
@@ -910,7 +910,7 @@
<string name="capital_off" msgid="6815870386972805832">"MATI"</string>
<string name="whichApplication" msgid="4533185947064773386">"Tindakan lengkap menggunakan"</string>
<string name="alwaysUse" msgid="4583018368000610438">"Gunakan secara bawaan untuk tindakan ini."</string>
- <string name="clearDefaultHintMsg" msgid="3252584689512077257">"Menghapus bawaan di Pengaturan sistem > Apl > Terunduh."</string>
+ <string name="clearDefaultHintMsg" msgid="3252584689512077257">"Menghapus bawaan di Setelan sistem > Apl > Terunduh."</string>
<string name="chooseActivity" msgid="7486876147751803333">"Pilih tindakan"</string>
<string name="chooseUsbActivity" msgid="6894748416073583509">"Pilih apl untuk perangkat USB"</string>
<string name="noApplications" msgid="2991814273936504689">"Tidak ada apl yang dapat melakukan tindakan ini."</string>
@@ -931,7 +931,7 @@
<string name="launch_warning_original" msgid="188102023021668683">"<xliff:g id="APP_NAME">%1$s</xliff:g> telah diluncurkan aslinya."</string>
<string name="screen_compat_mode_scale" msgid="3202955667675944499">"Skala"</string>
<string name="screen_compat_mode_show" msgid="4013878876486655892">"Selalu tampilkan"</string>
- <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Aktifkan kembali dialog ini di Pengaturan sistem > Apl > Terunduh."</string>
+ <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Aktifkan kembali dialog ini di Setelan sistem > Apl > Terunduh."</string>
<string name="smv_application" msgid="3307209192155442829">"Apl <xliff:g id="APPLICATION">%1$s</xliff:g> (proses <xliff:g id="PROCESS">%2$s</xliff:g>) telah melanggar kebijakan StrictMode yang diberlakukannya sendiri."</string>
<string name="smv_process" msgid="5120397012047462446">"Proses <xliff:g id="PROCESS">%1$s</xliff:g> telah melanggar kebijakan StrictMode yang diberlakukan secara otomatis."</string>
<string name="android_upgrading_title" msgid="1584192285441405746">"Android sedang meningkatkan versi..."</string>
@@ -983,7 +983,7 @@
<string name="wifi_p2p_turnon_message" msgid="2909250942299627244">"Memulai Wi-Fi Langsung. Opsi ini akan mematikan hotspot/klien Wi-Fi."</string>
<string name="wifi_p2p_failed_message" msgid="3763669677935623084">"Tidak dapat memulai Wi-Fi Langsung."</string>
<string name="wifi_p2p_enabled_notification_title" msgid="2068321881673734886">"Wi-Fi Langsung aktif"</string>
- <string name="wifi_p2p_enabled_notification_message" msgid="1638949953993894335">"Sentuh untuk pengaturan"</string>
+ <string name="wifi_p2p_enabled_notification_message" msgid="1638949953993894335">"Sentuh untuk setelan"</string>
<string name="accept" msgid="1645267259272829559">"Terima"</string>
<string name="decline" msgid="2112225451706137894">"Tolak"</string>
<string name="wifi_p2p_invitation_sent_title" msgid="1318975185112070734">"Undangan terkirim"</string>
@@ -1027,7 +1027,7 @@
<string name="usb_storage_stop_message" product="nosdcard" msgid="4264025280777219521">"Sebelum mematikan penyimpanan USB, lepaskan (\"keluarkan\") penyimpanan USB Anda dari komputer."</string>
<string name="usb_storage_stop_message" product="default" msgid="8043969782460613114">"Sebelum mematikan penyimpanan USB, lepaskan (\"keluarkan\") kartu SD Android dari komputer."</string>
<string name="usb_storage_stop_button_mount" msgid="7060218034900696029">"Matikan penyimpanan USB"</string>
- <string name="usb_storage_stop_error_message" msgid="1970374898263063836">"Terjadi masalah saat mematikan penyimpanan USB. Periksa apakah Anda telah melepaskan inang USB, lalu coba sekali lagi."</string>
+ <string name="usb_storage_stop_error_message" msgid="1970374898263063836">"Terjadi masalah saat mematikan penyimpanan USB. Periksa apakah Anda telah melepaskan host USB, lalu coba sekali lagi."</string>
<string name="dlg_confirm_kill_storage_users_title" msgid="963039033470478697">"Hidupkan penyimpanan USB"</string>
<string name="dlg_confirm_kill_storage_users_text" msgid="5100428757107469454">"Jika Anda menyalakan penyimpanan USB, beberapa apl yang Anda gunakan akan berhenti dan mungkin tidak dapat dibuka hingga penyimpanan USB dimatikan."</string>
<string name="dlg_error_title" msgid="7323658469626514207">"Operasi USB gagal"</string>
@@ -1172,6 +1172,14 @@
<string name="date_picker_decrement_day_button" msgid="2427816793443629131">"Hari pengurangan"</string>
<string name="date_picker_increment_year_button" msgid="3058553394722295105">"Tahun penambahan"</string>
<string name="date_picker_decrement_year_button" msgid="5193062846559743823">"Tahun pengurangan"</string>
+ <string name="checkbox_checked" msgid="7222044992652711167">"dicentang"</string>
+ <string name="checkbox_not_checked" msgid="5174639551134444056">"tidak diperiksa"</string>
+ <string name="radiobutton_selected" msgid="8603599808486581511">"dipilih"</string>
+ <string name="radiobutton_not_selected" msgid="2908760184307722393">"tidak dipilih"</string>
+ <string name="switch_on" msgid="551417728476977311">"nyala"</string>
+ <string name="switch_off" msgid="7249798614327155088">"mati"</string>
+ <string name="togglebutton_pressed" msgid="4180411746647422233">"ditekan"</string>
+ <string name="togglebutton_not_pressed" msgid="4495147725636134425">"tidak ditekan"</string>
<string name="keyboardview_keycode_alt" msgid="4856868820040051939">"Alt"</string>
<string name="keyboardview_keycode_cancel" msgid="1203984017245783244">"Batal"</string>
<string name="keyboardview_keycode_delete" msgid="3337914833206635744">"Hapus"</string>
diff --git a/core/res/res/values-it/strings.xml b/core/res/res/values-it/strings.xml
index 97bb399..96c6709 100644
--- a/core/res/res/values-it/strings.xml
+++ b/core/res/res/values-it/strings.xml
@@ -1172,6 +1172,14 @@
<string name="date_picker_decrement_day_button" msgid="2427816793443629131">"Diminuisci giorno"</string>
<string name="date_picker_increment_year_button" msgid="3058553394722295105">"Aumenta anno"</string>
<string name="date_picker_decrement_year_button" msgid="5193062846559743823">"Diminuisci anno"</string>
+ <string name="checkbox_checked" msgid="7222044992652711167">"selezionata"</string>
+ <string name="checkbox_not_checked" msgid="5174639551134444056">"non selezionato"</string>
+ <string name="radiobutton_selected" msgid="8603599808486581511">"selezionato"</string>
+ <string name="radiobutton_not_selected" msgid="2908760184307722393">"non selezionato"</string>
+ <string name="switch_on" msgid="551417728476977311">"attivo"</string>
+ <string name="switch_off" msgid="7249798614327155088">"disattivo"</string>
+ <string name="togglebutton_pressed" msgid="4180411746647422233">"premuto"</string>
+ <string name="togglebutton_not_pressed" msgid="4495147725636134425">"non premuto"</string>
<string name="keyboardview_keycode_alt" msgid="4856868820040051939">"Alt"</string>
<string name="keyboardview_keycode_cancel" msgid="1203984017245783244">"Annulla"</string>
<string name="keyboardview_keycode_delete" msgid="3337914833206635744">"Canc"</string>
diff --git a/core/res/res/values-iw/strings.xml b/core/res/res/values-iw/strings.xml
index 0a7320a..485e0b0 100644
--- a/core/res/res/values-iw/strings.xml
+++ b/core/res/res/values-iw/strings.xml
@@ -1172,6 +1172,14 @@
<string name="date_picker_decrement_day_button" msgid="2427816793443629131">"הפחת יום."</string>
<string name="date_picker_increment_year_button" msgid="3058553394722295105">"הוסף שנה"</string>
<string name="date_picker_decrement_year_button" msgid="5193062846559743823">"הפחת שנה"</string>
+ <string name="checkbox_checked" msgid="7222044992652711167">"מסומן"</string>
+ <string name="checkbox_not_checked" msgid="5174639551134444056">"לא מסומן"</string>
+ <string name="radiobutton_selected" msgid="8603599808486581511">"נבחר"</string>
+ <string name="radiobutton_not_selected" msgid="2908760184307722393">"לא נבחר"</string>
+ <string name="switch_on" msgid="551417728476977311">"מופעל"</string>
+ <string name="switch_off" msgid="7249798614327155088">"כבוי"</string>
+ <string name="togglebutton_pressed" msgid="4180411746647422233">"לחוץ"</string>
+ <string name="togglebutton_not_pressed" msgid="4495147725636134425">"לא לחוץ"</string>
<string name="keyboardview_keycode_alt" msgid="4856868820040051939">"Alt"</string>
<string name="keyboardview_keycode_cancel" msgid="1203984017245783244">"ביטול"</string>
<string name="keyboardview_keycode_delete" msgid="3337914833206635744">"מחק"</string>
diff --git a/core/res/res/values-ja/strings.xml b/core/res/res/values-ja/strings.xml
index 08ef8ce..bc9840d 100644
--- a/core/res/res/values-ja/strings.xml
+++ b/core/res/res/values-ja/strings.xml
@@ -1172,6 +1172,14 @@
<string name="date_picker_decrement_day_button" msgid="2427816793443629131">"1日戻す"</string>
<string name="date_picker_increment_year_button" msgid="3058553394722295105">"1年進める"</string>
<string name="date_picker_decrement_year_button" msgid="5193062846559743823">"1年戻す"</string>
+ <string name="checkbox_checked" msgid="7222044992652711167">"ON"</string>
+ <string name="checkbox_not_checked" msgid="5174639551134444056">"OFF"</string>
+ <string name="radiobutton_selected" msgid="8603599808486581511">"ON"</string>
+ <string name="radiobutton_not_selected" msgid="2908760184307722393">"選択されていません"</string>
+ <string name="switch_on" msgid="551417728476977311">"ON"</string>
+ <string name="switch_off" msgid="7249798614327155088">"OFF"</string>
+ <string name="togglebutton_pressed" msgid="4180411746647422233">"ON"</string>
+ <string name="togglebutton_not_pressed" msgid="4495147725636134425">"OFF"</string>
<string name="keyboardview_keycode_alt" msgid="4856868820040051939">"Alt"</string>
<string name="keyboardview_keycode_cancel" msgid="1203984017245783244">"キャンセル"</string>
<string name="keyboardview_keycode_delete" msgid="3337914833206635744">"削除"</string>
diff --git a/core/res/res/values-ko/strings.xml b/core/res/res/values-ko/strings.xml
index ef673d2..c9801a3 100644
--- a/core/res/res/values-ko/strings.xml
+++ b/core/res/res/values-ko/strings.xml
@@ -1172,6 +1172,14 @@
<string name="date_picker_decrement_day_button" msgid="2427816793443629131">"\'날짜\'를 줄입니다."</string>
<string name="date_picker_increment_year_button" msgid="3058553394722295105">"\'연도\'를 올립니다."</string>
<string name="date_picker_decrement_year_button" msgid="5193062846559743823">"\'연도\'를 줄입니다."</string>
+ <string name="checkbox_checked" msgid="7222044992652711167">"확인"</string>
+ <string name="checkbox_not_checked" msgid="5174639551134444056">"선택 안함"</string>
+ <string name="radiobutton_selected" msgid="8603599808486581511">"선택됨"</string>
+ <string name="radiobutton_not_selected" msgid="2908760184307722393">"선택 안함"</string>
+ <string name="switch_on" msgid="551417728476977311">"켜짐"</string>
+ <string name="switch_off" msgid="7249798614327155088">"꺼짐"</string>
+ <string name="togglebutton_pressed" msgid="4180411746647422233">"누름"</string>
+ <string name="togglebutton_not_pressed" msgid="4495147725636134425">"누르지 않음"</string>
<string name="keyboardview_keycode_alt" msgid="4856868820040051939">"Alt 키"</string>
<string name="keyboardview_keycode_cancel" msgid="1203984017245783244">"취소"</string>
<string name="keyboardview_keycode_delete" msgid="3337914833206635744">"Delete 키"</string>
diff --git a/core/res/res/values-lt/strings.xml b/core/res/res/values-lt/strings.xml
index 744df41..4424ad5 100644
--- a/core/res/res/values-lt/strings.xml
+++ b/core/res/res/values-lt/strings.xml
@@ -1172,6 +1172,14 @@
<string name="date_picker_decrement_day_button" msgid="2427816793443629131">"Sumažėjimo diena"</string>
<string name="date_picker_increment_year_button" msgid="3058553394722295105">"Padidėjimo metai"</string>
<string name="date_picker_decrement_year_button" msgid="5193062846559743823">"Sumažėjimo metai"</string>
+ <string name="checkbox_checked" msgid="7222044992652711167">"pažymėtas"</string>
+ <string name="checkbox_not_checked" msgid="5174639551134444056">"nepatikrinta"</string>
+ <string name="radiobutton_selected" msgid="8603599808486581511">"pasirinkta"</string>
+ <string name="radiobutton_not_selected" msgid="2908760184307722393">"nepasirinkta"</string>
+ <string name="switch_on" msgid="551417728476977311">"įjungta"</string>
+ <string name="switch_off" msgid="7249798614327155088">"išjungta"</string>
+ <string name="togglebutton_pressed" msgid="4180411746647422233">"paspausta"</string>
+ <string name="togglebutton_not_pressed" msgid="4495147725636134425">"nepaspausta"</string>
<string name="keyboardview_keycode_alt" msgid="4856868820040051939">"Alt"</string>
<string name="keyboardview_keycode_cancel" msgid="1203984017245783244">"Atšaukti"</string>
<string name="keyboardview_keycode_delete" msgid="3337914833206635744">"Ištrinti"</string>
diff --git a/core/res/res/values-lv/strings.xml b/core/res/res/values-lv/strings.xml
index 4e7d63f..89baaaa 100644
--- a/core/res/res/values-lv/strings.xml
+++ b/core/res/res/values-lv/strings.xml
@@ -1172,6 +1172,14 @@
<string name="date_picker_decrement_day_button" msgid="2427816793443629131">"Samazināt datuma vērtību"</string>
<string name="date_picker_increment_year_button" msgid="3058553394722295105">"Palielināt gada vērtību"</string>
<string name="date_picker_decrement_year_button" msgid="5193062846559743823">"Samazināt gada vērtību"</string>
+ <string name="checkbox_checked" msgid="7222044992652711167">"atzīmēta"</string>
+ <string name="checkbox_not_checked" msgid="5174639551134444056">"nav atzīmēta"</string>
+ <string name="radiobutton_selected" msgid="8603599808486581511">"atlasīta"</string>
+ <string name="radiobutton_not_selected" msgid="2908760184307722393">"nav atlasīta"</string>
+ <string name="switch_on" msgid="551417728476977311">"ieslēgts"</string>
+ <string name="switch_off" msgid="7249798614327155088">"izslēgts"</string>
+ <string name="togglebutton_pressed" msgid="4180411746647422233">"nospiesta"</string>
+ <string name="togglebutton_not_pressed" msgid="4495147725636134425">"nav nospiesta"</string>
<string name="keyboardview_keycode_alt" msgid="4856868820040051939">"Alternēšanas taustiņš"</string>
<string name="keyboardview_keycode_cancel" msgid="1203984017245783244">"Atcelt"</string>
<string name="keyboardview_keycode_delete" msgid="3337914833206635744">"Dzēšanas taustiņš"</string>
diff --git a/core/res/res/values-ms/strings.xml b/core/res/res/values-ms/strings.xml
index 0b7973b..385bebb 100644
--- a/core/res/res/values-ms/strings.xml
+++ b/core/res/res/values-ms/strings.xml
@@ -1172,6 +1172,14 @@
<string name="date_picker_decrement_day_button" msgid="2427816793443629131">"Hari penyusutan"</string>
<string name="date_picker_increment_year_button" msgid="3058553394722295105">"Tahun kenaikan"</string>
<string name="date_picker_decrement_year_button" msgid="5193062846559743823">"Tahun penyusutan"</string>
+ <string name="checkbox_checked" msgid="7222044992652711167">"ditandakan"</string>
+ <string name="checkbox_not_checked" msgid="5174639551134444056">"tidak ditandakan"</string>
+ <string name="radiobutton_selected" msgid="8603599808486581511">"dipilih"</string>
+ <string name="radiobutton_not_selected" msgid="2908760184307722393">"tidak dipilih"</string>
+ <string name="switch_on" msgid="551417728476977311">"hidup"</string>
+ <string name="switch_off" msgid="7249798614327155088">"mati"</string>
+ <string name="togglebutton_pressed" msgid="4180411746647422233">"ditekan."</string>
+ <string name="togglebutton_not_pressed" msgid="4495147725636134425">"tidak ditekan"</string>
<string name="keyboardview_keycode_alt" msgid="4856868820040051939">"Alt"</string>
<string name="keyboardview_keycode_cancel" msgid="1203984017245783244">"Batal"</string>
<string name="keyboardview_keycode_delete" msgid="3337914833206635744">"Padam"</string>
diff --git a/core/res/res/values-nb/strings.xml b/core/res/res/values-nb/strings.xml
index dbe87e7..e70a664 100644
--- a/core/res/res/values-nb/strings.xml
+++ b/core/res/res/values-nb/strings.xml
@@ -1172,6 +1172,14 @@
<string name="date_picker_decrement_day_button" msgid="2427816793443629131">"Endre dag (bakover)"</string>
<string name="date_picker_increment_year_button" msgid="3058553394722295105">"Endre år (fremover)"</string>
<string name="date_picker_decrement_year_button" msgid="5193062846559743823">"Endre år (bakover)"</string>
+ <string name="checkbox_checked" msgid="7222044992652711167">"valgt"</string>
+ <string name="checkbox_not_checked" msgid="5174639551134444056">"ikke valgt"</string>
+ <string name="radiobutton_selected" msgid="8603599808486581511">"valgt"</string>
+ <string name="radiobutton_not_selected" msgid="2908760184307722393">"ikke valgt"</string>
+ <string name="switch_on" msgid="551417728476977311">"på"</string>
+ <string name="switch_off" msgid="7249798614327155088">"av"</string>
+ <string name="togglebutton_pressed" msgid="4180411746647422233">"trykket"</string>
+ <string name="togglebutton_not_pressed" msgid="4495147725636134425">"ikke trykket"</string>
<string name="keyboardview_keycode_alt" msgid="4856868820040051939">"Alt"</string>
<string name="keyboardview_keycode_cancel" msgid="1203984017245783244">"Avbryt"</string>
<string name="keyboardview_keycode_delete" msgid="3337914833206635744">"Slett"</string>
diff --git a/core/res/res/values-nl/strings.xml b/core/res/res/values-nl/strings.xml
index f2ea779..6876c63 100644
--- a/core/res/res/values-nl/strings.xml
+++ b/core/res/res/values-nl/strings.xml
@@ -1172,6 +1172,14 @@
<string name="date_picker_decrement_day_button" msgid="2427816793443629131">"Dag verlagen"</string>
<string name="date_picker_increment_year_button" msgid="3058553394722295105">"Jaar verhogen"</string>
<string name="date_picker_decrement_year_button" msgid="5193062846559743823">"Jaar verlagen"</string>
+ <string name="checkbox_checked" msgid="7222044992652711167">"aangevinkt"</string>
+ <string name="checkbox_not_checked" msgid="5174639551134444056">"niet aangevinkt"</string>
+ <string name="radiobutton_selected" msgid="8603599808486581511">"geselecteerd"</string>
+ <string name="radiobutton_not_selected" msgid="2908760184307722393">"niet geselecteerd"</string>
+ <string name="switch_on" msgid="551417728476977311">"aan"</string>
+ <string name="switch_off" msgid="7249798614327155088">"uit"</string>
+ <string name="togglebutton_pressed" msgid="4180411746647422233">"ingedrukt"</string>
+ <string name="togglebutton_not_pressed" msgid="4495147725636134425">"niet ingedrukt"</string>
<string name="keyboardview_keycode_alt" msgid="4856868820040051939">"Alt"</string>
<string name="keyboardview_keycode_cancel" msgid="1203984017245783244">"Annuleren"</string>
<string name="keyboardview_keycode_delete" msgid="3337914833206635744">"Delete"</string>
diff --git a/core/res/res/values-pl/strings.xml b/core/res/res/values-pl/strings.xml
index a2c525c..96dcfa0 100644
--- a/core/res/res/values-pl/strings.xml
+++ b/core/res/res/values-pl/strings.xml
@@ -1172,6 +1172,14 @@
<string name="date_picker_decrement_day_button" msgid="2427816793443629131">"Poprzedni dzień"</string>
<string name="date_picker_increment_year_button" msgid="3058553394722295105">"Następny rok"</string>
<string name="date_picker_decrement_year_button" msgid="5193062846559743823">"Poprzedni rok"</string>
+ <string name="checkbox_checked" msgid="7222044992652711167">"zaznaczono"</string>
+ <string name="checkbox_not_checked" msgid="5174639551134444056">"nie zaznaczono"</string>
+ <string name="radiobutton_selected" msgid="8603599808486581511">"wybrano"</string>
+ <string name="radiobutton_not_selected" msgid="2908760184307722393">"nie wybrano"</string>
+ <string name="switch_on" msgid="551417728476977311">"włączono"</string>
+ <string name="switch_off" msgid="7249798614327155088">"wyłączono"</string>
+ <string name="togglebutton_pressed" msgid="4180411746647422233">"naciśnięto"</string>
+ <string name="togglebutton_not_pressed" msgid="4495147725636134425">"nie naciśnięto"</string>
<string name="keyboardview_keycode_alt" msgid="4856868820040051939">"Alt"</string>
<string name="keyboardview_keycode_cancel" msgid="1203984017245783244">"Anuluj"</string>
<string name="keyboardview_keycode_delete" msgid="3337914833206635744">"Delete"</string>
diff --git a/core/res/res/values-pt-rPT/strings.xml b/core/res/res/values-pt-rPT/strings.xml
index 8f7e767..7f031fd 100644
--- a/core/res/res/values-pt-rPT/strings.xml
+++ b/core/res/res/values-pt-rPT/strings.xml
@@ -1172,6 +1172,14 @@
<string name="date_picker_decrement_day_button" msgid="2427816793443629131">"Diminuir dia"</string>
<string name="date_picker_increment_year_button" msgid="3058553394722295105">"Aumentar ano"</string>
<string name="date_picker_decrement_year_button" msgid="5193062846559743823">"Diminuir ano"</string>
+ <string name="checkbox_checked" msgid="7222044992652711167">"marcado"</string>
+ <string name="checkbox_not_checked" msgid="5174639551134444056">"desmarcado"</string>
+ <string name="radiobutton_selected" msgid="8603599808486581511">"selecionado"</string>
+ <string name="radiobutton_not_selected" msgid="2908760184307722393">"não selecionado"</string>
+ <string name="switch_on" msgid="551417728476977311">"ativado"</string>
+ <string name="switch_off" msgid="7249798614327155088">"desativado"</string>
+ <string name="togglebutton_pressed" msgid="4180411746647422233">"premido"</string>
+ <string name="togglebutton_not_pressed" msgid="4495147725636134425">"não premido"</string>
<string name="keyboardview_keycode_alt" msgid="4856868820040051939">"Alt"</string>
<string name="keyboardview_keycode_cancel" msgid="1203984017245783244">"Cancelar"</string>
<string name="keyboardview_keycode_delete" msgid="3337914833206635744">"Delete"</string>
diff --git a/core/res/res/values-pt/strings.xml b/core/res/res/values-pt/strings.xml
index e5d68f3..fbfe88f 100644
--- a/core/res/res/values-pt/strings.xml
+++ b/core/res/res/values-pt/strings.xml
@@ -1172,6 +1172,14 @@
<string name="date_picker_decrement_day_button" msgid="2427816793443629131">"Reduzir dia"</string>
<string name="date_picker_increment_year_button" msgid="3058553394722295105">"Aumentar ano"</string>
<string name="date_picker_decrement_year_button" msgid="5193062846559743823">"Diminuir ano"</string>
+ <string name="checkbox_checked" msgid="7222044992652711167">"verificado"</string>
+ <string name="checkbox_not_checked" msgid="5174639551134444056">"não selecionado"</string>
+ <string name="radiobutton_selected" msgid="8603599808486581511">"selecionado"</string>
+ <string name="radiobutton_not_selected" msgid="2908760184307722393">"Não selecionado"</string>
+ <string name="switch_on" msgid="551417728476977311">"ativado"</string>
+ <string name="switch_off" msgid="7249798614327155088">"desativado"</string>
+ <string name="togglebutton_pressed" msgid="4180411746647422233">"pressionado"</string>
+ <string name="togglebutton_not_pressed" msgid="4495147725636134425">"não pressionado"</string>
<string name="keyboardview_keycode_alt" msgid="4856868820040051939">"Alt"</string>
<string name="keyboardview_keycode_cancel" msgid="1203984017245783244">"Cancelar"</string>
<string name="keyboardview_keycode_delete" msgid="3337914833206635744">"Excluir"</string>
diff --git a/core/res/res/values-rm/strings.xml b/core/res/res/values-rm/strings.xml
index e03a7c3..ff76f74 100644
--- a/core/res/res/values-rm/strings.xml
+++ b/core/res/res/values-rm/strings.xml
@@ -1754,6 +1754,22 @@
<skip />
<!-- no translation found for date_picker_decrement_year_button (5193062846559743823) -->
<skip />
+ <!-- no translation found for checkbox_checked (7222044992652711167) -->
+ <skip />
+ <!-- no translation found for checkbox_not_checked (5174639551134444056) -->
+ <skip />
+ <!-- no translation found for radiobutton_selected (8603599808486581511) -->
+ <skip />
+ <!-- no translation found for radiobutton_not_selected (2908760184307722393) -->
+ <skip />
+ <!-- no translation found for switch_on (551417728476977311) -->
+ <skip />
+ <!-- no translation found for switch_off (7249798614327155088) -->
+ <skip />
+ <!-- no translation found for togglebutton_pressed (4180411746647422233) -->
+ <skip />
+ <!-- no translation found for togglebutton_not_pressed (4495147725636134425) -->
+ <skip />
<!-- no translation found for keyboardview_keycode_alt (4856868820040051939) -->
<skip />
<!-- no translation found for keyboardview_keycode_cancel (1203984017245783244) -->
diff --git a/core/res/res/values-ro/strings.xml b/core/res/res/values-ro/strings.xml
index ed95f36..cac586e 100644
--- a/core/res/res/values-ro/strings.xml
+++ b/core/res/res/values-ro/strings.xml
@@ -1172,6 +1172,14 @@
<string name="date_picker_decrement_day_button" msgid="2427816793443629131">"Decrementaţi valoarea pentru zi"</string>
<string name="date_picker_increment_year_button" msgid="3058553394722295105">"Incrementaţi valoarea pentru an"</string>
<string name="date_picker_decrement_year_button" msgid="5193062846559743823">"Decrementaţi valoarea pentru an"</string>
+ <string name="checkbox_checked" msgid="7222044992652711167">"bifată"</string>
+ <string name="checkbox_not_checked" msgid="5174639551134444056">"nebifată"</string>
+ <string name="radiobutton_selected" msgid="8603599808486581511">"selectat"</string>
+ <string name="radiobutton_not_selected" msgid="2908760184307722393">"neselectat"</string>
+ <string name="switch_on" msgid="551417728476977311">"activat"</string>
+ <string name="switch_off" msgid="7249798614327155088">"dezactivat"</string>
+ <string name="togglebutton_pressed" msgid="4180411746647422233">"apăsat"</string>
+ <string name="togglebutton_not_pressed" msgid="4495147725636134425">"neapăsat"</string>
<string name="keyboardview_keycode_alt" msgid="4856868820040051939">"Alt"</string>
<string name="keyboardview_keycode_cancel" msgid="1203984017245783244">"Anulaţi"</string>
<string name="keyboardview_keycode_delete" msgid="3337914833206635744">"Ştergeţi"</string>
diff --git a/core/res/res/values-ru/strings.xml b/core/res/res/values-ru/strings.xml
index e753531..3a554d6 100644
--- a/core/res/res/values-ru/strings.xml
+++ b/core/res/res/values-ru/strings.xml
@@ -1172,6 +1172,14 @@
<string name="date_picker_decrement_day_button" msgid="2427816793443629131">"На день назад"</string>
<string name="date_picker_increment_year_button" msgid="3058553394722295105">"На год вперед"</string>
<string name="date_picker_decrement_year_button" msgid="5193062846559743823">"На год назад"</string>
+ <string name="checkbox_checked" msgid="7222044992652711167">"установлено"</string>
+ <string name="checkbox_not_checked" msgid="5174639551134444056">"не установлено"</string>
+ <string name="radiobutton_selected" msgid="8603599808486581511">"выбрано"</string>
+ <string name="radiobutton_not_selected" msgid="2908760184307722393">"не выбрано"</string>
+ <string name="switch_on" msgid="551417728476977311">"Включено"</string>
+ <string name="switch_off" msgid="7249798614327155088">"Выкл."</string>
+ <string name="togglebutton_pressed" msgid="4180411746647422233">"нажато"</string>
+ <string name="togglebutton_not_pressed" msgid="4495147725636134425">"не нажато"</string>
<string name="keyboardview_keycode_alt" msgid="4856868820040051939">"Клавиша ALT"</string>
<string name="keyboardview_keycode_cancel" msgid="1203984017245783244">"Отмена"</string>
<string name="keyboardview_keycode_delete" msgid="3337914833206635744">"Клавиша удаления"</string>
diff --git a/core/res/res/values-sk/strings.xml b/core/res/res/values-sk/strings.xml
index 246abcc..daa321d 100644
--- a/core/res/res/values-sk/strings.xml
+++ b/core/res/res/values-sk/strings.xml
@@ -1172,6 +1172,14 @@
<string name="date_picker_decrement_day_button" msgid="2427816793443629131">"Odpočítať deň"</string>
<string name="date_picker_increment_year_button" msgid="3058553394722295105">"Pripočítať rok"</string>
<string name="date_picker_decrement_year_button" msgid="5193062846559743823">"Odpočítať rok"</string>
+ <string name="checkbox_checked" msgid="7222044992652711167">"začiarknuté"</string>
+ <string name="checkbox_not_checked" msgid="5174639551134444056">"nezačiarknuté"</string>
+ <string name="radiobutton_selected" msgid="8603599808486581511">"vybratý"</string>
+ <string name="radiobutton_not_selected" msgid="2908760184307722393">"nie je vybraté"</string>
+ <string name="switch_on" msgid="551417728476977311">"zapnuté"</string>
+ <string name="switch_off" msgid="7249798614327155088">"vypnuté"</string>
+ <string name="togglebutton_pressed" msgid="4180411746647422233">"stlačené"</string>
+ <string name="togglebutton_not_pressed" msgid="4495147725636134425">"nestlačené"</string>
<string name="keyboardview_keycode_alt" msgid="4856868820040051939">"Alt"</string>
<string name="keyboardview_keycode_cancel" msgid="1203984017245783244">"Zrušiť"</string>
<string name="keyboardview_keycode_delete" msgid="3337914833206635744">"Odstrániť"</string>
diff --git a/core/res/res/values-sl/strings.xml b/core/res/res/values-sl/strings.xml
index 84e011e..20ad59b 100644
--- a/core/res/res/values-sl/strings.xml
+++ b/core/res/res/values-sl/strings.xml
@@ -1172,6 +1172,14 @@
<string name="date_picker_decrement_day_button" msgid="2427816793443629131">"Prejšnji dan"</string>
<string name="date_picker_increment_year_button" msgid="3058553394722295105">"Naslednje leto"</string>
<string name="date_picker_decrement_year_button" msgid="5193062846559743823">"Prejšnje leto"</string>
+ <string name="checkbox_checked" msgid="7222044992652711167">"potrjeno"</string>
+ <string name="checkbox_not_checked" msgid="5174639551134444056">"ni odkljukano"</string>
+ <string name="radiobutton_selected" msgid="8603599808486581511">"izbrano"</string>
+ <string name="radiobutton_not_selected" msgid="2908760184307722393">"ni izbrano"</string>
+ <string name="switch_on" msgid="551417728476977311">"vklopljeno"</string>
+ <string name="switch_off" msgid="7249798614327155088">"izklopljeno"</string>
+ <string name="togglebutton_pressed" msgid="4180411746647422233">"vklopljen"</string>
+ <string name="togglebutton_not_pressed" msgid="4495147725636134425">"izklopljen"</string>
<string name="keyboardview_keycode_alt" msgid="4856868820040051939">"Tipka Alt"</string>
<string name="keyboardview_keycode_cancel" msgid="1203984017245783244">"Prekliči"</string>
<string name="keyboardview_keycode_delete" msgid="3337914833206635744">"Tipka Delete"</string>
diff --git a/core/res/res/values-sr/strings.xml b/core/res/res/values-sr/strings.xml
index faf73dc..9fb8abf 100644
--- a/core/res/res/values-sr/strings.xml
+++ b/core/res/res/values-sr/strings.xml
@@ -1172,6 +1172,14 @@
<string name="date_picker_decrement_day_button" msgid="2427816793443629131">"Смањи дане"</string>
<string name="date_picker_increment_year_button" msgid="3058553394722295105">"Повећај године"</string>
<string name="date_picker_decrement_year_button" msgid="5193062846559743823">"Смањи године"</string>
+ <string name="checkbox_checked" msgid="7222044992652711167">"изабрано"</string>
+ <string name="checkbox_not_checked" msgid="5174639551134444056">"није потврђено"</string>
+ <string name="radiobutton_selected" msgid="8603599808486581511">"изабрано"</string>
+ <string name="radiobutton_not_selected" msgid="2908760184307722393">"није изабрано"</string>
+ <string name="switch_on" msgid="551417728476977311">"укључено"</string>
+ <string name="switch_off" msgid="7249798614327155088">"искључено"</string>
+ <string name="togglebutton_pressed" msgid="4180411746647422233">"притиснуто"</string>
+ <string name="togglebutton_not_pressed" msgid="4495147725636134425">"није притиснуто"</string>
<string name="keyboardview_keycode_alt" msgid="4856868820040051939">"Alt"</string>
<string name="keyboardview_keycode_cancel" msgid="1203984017245783244">"Откажи"</string>
<string name="keyboardview_keycode_delete" msgid="3337914833206635744">"Избриши"</string>
diff --git a/core/res/res/values-sv/strings.xml b/core/res/res/values-sv/strings.xml
index b48f9d5..2c4189b 100644
--- a/core/res/res/values-sv/strings.xml
+++ b/core/res/res/values-sv/strings.xml
@@ -1173,6 +1173,14 @@
<string name="date_picker_decrement_day_button" msgid="2427816793443629131">"Minska dag"</string>
<string name="date_picker_increment_year_button" msgid="3058553394722295105">"Öka år"</string>
<string name="date_picker_decrement_year_button" msgid="5193062846559743823">"Minska år"</string>
+ <string name="checkbox_checked" msgid="7222044992652711167">"markerat"</string>
+ <string name="checkbox_not_checked" msgid="5174639551134444056">"inte markerat"</string>
+ <string name="radiobutton_selected" msgid="8603599808486581511">"markerade"</string>
+ <string name="radiobutton_not_selected" msgid="2908760184307722393">"ej vald"</string>
+ <string name="switch_on" msgid="551417728476977311">"på"</string>
+ <string name="switch_off" msgid="7249798614327155088">"av"</string>
+ <string name="togglebutton_pressed" msgid="4180411746647422233">"intryckt"</string>
+ <string name="togglebutton_not_pressed" msgid="4495147725636134425">"inte intryckt"</string>
<string name="keyboardview_keycode_alt" msgid="4856868820040051939">"Alt"</string>
<string name="keyboardview_keycode_cancel" msgid="1203984017245783244">"Avbryt"</string>
<string name="keyboardview_keycode_delete" msgid="3337914833206635744">"Delete"</string>
diff --git a/core/res/res/values-sw/strings.xml b/core/res/res/values-sw/strings.xml
index 376ec28..13053ab 100644
--- a/core/res/res/values-sw/strings.xml
+++ b/core/res/res/values-sw/strings.xml
@@ -1172,6 +1172,14 @@
<string name="date_picker_decrement_day_button" msgid="2427816793443629131">"Siku pungufu"</string>
<string name="date_picker_increment_year_button" msgid="3058553394722295105">"Mwaka wa nyongeza"</string>
<string name="date_picker_decrement_year_button" msgid="5193062846559743823">"Mwaka pungufu"</string>
+ <string name="checkbox_checked" msgid="7222044992652711167">"imeangaliwa"</string>
+ <string name="checkbox_not_checked" msgid="5174639551134444056">"haijakaguliwa"</string>
+ <string name="radiobutton_selected" msgid="8603599808486581511">"Iliyochaguliwa"</string>
+ <string name="radiobutton_not_selected" msgid="2908760184307722393">"Haijachaguliwa"</string>
+ <string name="switch_on" msgid="551417728476977311">"Washa"</string>
+ <string name="switch_off" msgid="7249798614327155088">"zima"</string>
+ <string name="togglebutton_pressed" msgid="4180411746647422233">"iliyobonyezwa"</string>
+ <string name="togglebutton_not_pressed" msgid="4495147725636134425">"Haijabonyezwa"</string>
<string name="keyboardview_keycode_alt" msgid="4856868820040051939">"Alt"</string>
<string name="keyboardview_keycode_cancel" msgid="1203984017245783244">"Ghairi"</string>
<string name="keyboardview_keycode_delete" msgid="3337914833206635744">"Futa"</string>
diff --git a/core/res/res/values-th/strings.xml b/core/res/res/values-th/strings.xml
index 7464aea..a9a196c 100644
--- a/core/res/res/values-th/strings.xml
+++ b/core/res/res/values-th/strings.xml
@@ -1172,6 +1172,14 @@
<string name="date_picker_decrement_day_button" msgid="2427816793443629131">"ลดวัน"</string>
<string name="date_picker_increment_year_button" msgid="3058553394722295105">"เพิ่มปี"</string>
<string name="date_picker_decrement_year_button" msgid="5193062846559743823">"ลดปี"</string>
+ <string name="checkbox_checked" msgid="7222044992652711167">"เลือกไว้"</string>
+ <string name="checkbox_not_checked" msgid="5174639551134444056">"ไม่ได้ตรวจสอบ"</string>
+ <string name="radiobutton_selected" msgid="8603599808486581511">"เลือกแล้ว"</string>
+ <string name="radiobutton_not_selected" msgid="2908760184307722393">"ไม่ได้เลือก"</string>
+ <string name="switch_on" msgid="551417728476977311">"เปิด"</string>
+ <string name="switch_off" msgid="7249798614327155088">"ปิด"</string>
+ <string name="togglebutton_pressed" msgid="4180411746647422233">"กดแล้ว"</string>
+ <string name="togglebutton_not_pressed" msgid="4495147725636134425">"ไม่ได้กด"</string>
<string name="keyboardview_keycode_alt" msgid="4856868820040051939">"Alt"</string>
<string name="keyboardview_keycode_cancel" msgid="1203984017245783244">"ยกเลิก"</string>
<string name="keyboardview_keycode_delete" msgid="3337914833206635744">"ลบ"</string>
diff --git a/core/res/res/values-tl/strings.xml b/core/res/res/values-tl/strings.xml
index ff62ab8..2672083 100644
--- a/core/res/res/values-tl/strings.xml
+++ b/core/res/res/values-tl/strings.xml
@@ -1172,6 +1172,14 @@
<string name="date_picker_decrement_day_button" msgid="2427816793443629131">"Araw ng pagbawas"</string>
<string name="date_picker_increment_year_button" msgid="3058553394722295105">"Taon ng pagdaragdag"</string>
<string name="date_picker_decrement_year_button" msgid="5193062846559743823">"Taon ng pagbawas"</string>
+ <string name="checkbox_checked" msgid="7222044992652711167">"nilagyan ng check"</string>
+ <string name="checkbox_not_checked" msgid="5174639551134444056">"hindi nilagyan ng check"</string>
+ <string name="radiobutton_selected" msgid="8603599808486581511">"pinili"</string>
+ <string name="radiobutton_not_selected" msgid="2908760184307722393">"Hindi pinili"</string>
+ <string name="switch_on" msgid="551417728476977311">"naka-on"</string>
+ <string name="switch_off" msgid="7249798614327155088">"naka-off"</string>
+ <string name="togglebutton_pressed" msgid="4180411746647422233">"pinindot"</string>
+ <string name="togglebutton_not_pressed" msgid="4495147725636134425">"hindi pinindot"</string>
<string name="keyboardview_keycode_alt" msgid="4856868820040051939">"Alt"</string>
<string name="keyboardview_keycode_cancel" msgid="1203984017245783244">"Kanselahin"</string>
<string name="keyboardview_keycode_delete" msgid="3337914833206635744">"Tanggalin"</string>
diff --git a/core/res/res/values-tr/strings.xml b/core/res/res/values-tr/strings.xml
index 0d89db1..059ccea 100644
--- a/core/res/res/values-tr/strings.xml
+++ b/core/res/res/values-tr/strings.xml
@@ -1172,6 +1172,14 @@
<string name="date_picker_decrement_day_button" msgid="2427816793443629131">"Gün değerini azalt"</string>
<string name="date_picker_increment_year_button" msgid="3058553394722295105">"Yıl değerini artır"</string>
<string name="date_picker_decrement_year_button" msgid="5193062846559743823">"Yıl değerini azalt"</string>
+ <string name="checkbox_checked" msgid="7222044992652711167">"işaretli"</string>
+ <string name="checkbox_not_checked" msgid="5174639551134444056">"işaretlenmedi"</string>
+ <string name="radiobutton_selected" msgid="8603599808486581511">"seçili"</string>
+ <string name="radiobutton_not_selected" msgid="2908760184307722393">"seçili değil"</string>
+ <string name="switch_on" msgid="551417728476977311">"açık"</string>
+ <string name="switch_off" msgid="7249798614327155088">"kapalı"</string>
+ <string name="togglebutton_pressed" msgid="4180411746647422233">"basıldı"</string>
+ <string name="togglebutton_not_pressed" msgid="4495147725636134425">"basılmadı"</string>
<string name="keyboardview_keycode_alt" msgid="4856868820040051939">"Alt"</string>
<string name="keyboardview_keycode_cancel" msgid="1203984017245783244">"İptal"</string>
<string name="keyboardview_keycode_delete" msgid="3337914833206635744">"Sil"</string>
diff --git a/core/res/res/values-uk/strings.xml b/core/res/res/values-uk/strings.xml
index d85bed8..42929ec 100644
--- a/core/res/res/values-uk/strings.xml
+++ b/core/res/res/values-uk/strings.xml
@@ -1172,6 +1172,14 @@
<string name="date_picker_decrement_day_button" msgid="2427816793443629131">"Відняти день"</string>
<string name="date_picker_increment_year_button" msgid="3058553394722295105">"Додати рік"</string>
<string name="date_picker_decrement_year_button" msgid="5193062846559743823">"Відняти рік"</string>
+ <string name="checkbox_checked" msgid="7222044992652711167">"перевірено"</string>
+ <string name="checkbox_not_checked" msgid="5174639551134444056">"не перевірено"</string>
+ <string name="radiobutton_selected" msgid="8603599808486581511">"вибрано"</string>
+ <string name="radiobutton_not_selected" msgid="2908760184307722393">"не вибрано"</string>
+ <string name="switch_on" msgid="551417728476977311">"увімк."</string>
+ <string name="switch_off" msgid="7249798614327155088">"вимкн."</string>
+ <string name="togglebutton_pressed" msgid="4180411746647422233">"натиснуто"</string>
+ <string name="togglebutton_not_pressed" msgid="4495147725636134425">"не натиснуто"</string>
<string name="keyboardview_keycode_alt" msgid="4856868820040051939">"Alt"</string>
<string name="keyboardview_keycode_cancel" msgid="1203984017245783244">"Скасувати"</string>
<string name="keyboardview_keycode_delete" msgid="3337914833206635744">"Delete"</string>
diff --git a/core/res/res/values-vi/strings.xml b/core/res/res/values-vi/strings.xml
index c75bed2..64469ab 100644
--- a/core/res/res/values-vi/strings.xml
+++ b/core/res/res/values-vi/strings.xml
@@ -1172,6 +1172,14 @@
<string name="date_picker_decrement_day_button" msgid="2427816793443629131">"Ngày giảm dần"</string>
<string name="date_picker_increment_year_button" msgid="3058553394722295105">"Năm tăng dần"</string>
<string name="date_picker_decrement_year_button" msgid="5193062846559743823">"Năm giảm dần."</string>
+ <string name="checkbox_checked" msgid="7222044992652711167">"đã kiểm tra"</string>
+ <string name="checkbox_not_checked" msgid="5174639551134444056">"chưa chọn"</string>
+ <string name="radiobutton_selected" msgid="8603599808486581511">"đã chọn"</string>
+ <string name="radiobutton_not_selected" msgid="2908760184307722393">"chưa được chọn"</string>
+ <string name="switch_on" msgid="551417728476977311">"bật"</string>
+ <string name="switch_off" msgid="7249798614327155088">"tắt"</string>
+ <string name="togglebutton_pressed" msgid="4180411746647422233">"đã bấm"</string>
+ <string name="togglebutton_not_pressed" msgid="4495147725636134425">"chưa được bấm"</string>
<string name="keyboardview_keycode_alt" msgid="4856868820040051939">"Alt"</string>
<string name="keyboardview_keycode_cancel" msgid="1203984017245783244">"Hủy"</string>
<string name="keyboardview_keycode_delete" msgid="3337914833206635744">"Xóa"</string>
diff --git a/core/res/res/values-zh-rCN/strings.xml b/core/res/res/values-zh-rCN/strings.xml
index a9f14a7..2664ad3 100644
--- a/core/res/res/values-zh-rCN/strings.xml
+++ b/core/res/res/values-zh-rCN/strings.xml
@@ -1172,6 +1172,14 @@
<string name="date_picker_decrement_day_button" msgid="2427816793443629131">"减少天数"</string>
<string name="date_picker_increment_year_button" msgid="3058553394722295105">"增加年数"</string>
<string name="date_picker_decrement_year_button" msgid="5193062846559743823">"减少年份值"</string>
+ <string name="checkbox_checked" msgid="7222044992652711167">"已选中"</string>
+ <string name="checkbox_not_checked" msgid="5174639551134444056">"未选中"</string>
+ <string name="radiobutton_selected" msgid="8603599808486581511">"已选择"</string>
+ <string name="radiobutton_not_selected" msgid="2908760184307722393">"未选择"</string>
+ <string name="switch_on" msgid="551417728476977311">"已打开"</string>
+ <string name="switch_off" msgid="7249798614327155088">"已关闭"</string>
+ <string name="togglebutton_pressed" msgid="4180411746647422233">"已按下"</string>
+ <string name="togglebutton_not_pressed" msgid="4495147725636134425">"未按下"</string>
<string name="keyboardview_keycode_alt" msgid="4856868820040051939">"Alt"</string>
<string name="keyboardview_keycode_cancel" msgid="1203984017245783244">"取消"</string>
<string name="keyboardview_keycode_delete" msgid="3337914833206635744">"Delete"</string>
diff --git a/core/res/res/values-zh-rTW/strings.xml b/core/res/res/values-zh-rTW/strings.xml
index 746f410..7c8617e 100644
--- a/core/res/res/values-zh-rTW/strings.xml
+++ b/core/res/res/values-zh-rTW/strings.xml
@@ -1173,6 +1173,14 @@
<string name="date_picker_decrement_day_button" msgid="2427816793443629131">"減少天數"</string>
<string name="date_picker_increment_year_button" msgid="3058553394722295105">"增加年份"</string>
<string name="date_picker_decrement_year_button" msgid="5193062846559743823">"減少年份"</string>
+ <string name="checkbox_checked" msgid="7222044992652711167">"已勾選"</string>
+ <string name="checkbox_not_checked" msgid="5174639551134444056">"尚未勾選"</string>
+ <string name="radiobutton_selected" msgid="8603599808486581511">"已選取"</string>
+ <string name="radiobutton_not_selected" msgid="2908760184307722393">"未選取"</string>
+ <string name="switch_on" msgid="551417728476977311">"開啟"</string>
+ <string name="switch_off" msgid="7249798614327155088">"關閉"</string>
+ <string name="togglebutton_pressed" msgid="4180411746647422233">"已按下"</string>
+ <string name="togglebutton_not_pressed" msgid="4495147725636134425">"未按下"</string>
<string name="keyboardview_keycode_alt" msgid="4856868820040051939">"Alt 鍵"</string>
<string name="keyboardview_keycode_cancel" msgid="1203984017245783244">"取消"</string>
<string name="keyboardview_keycode_delete" msgid="3337914833206635744">"Delete 鍵"</string>
diff --git a/core/res/res/values-zu/strings.xml b/core/res/res/values-zu/strings.xml
index 1b30035f..09777ab 100644
--- a/core/res/res/values-zu/strings.xml
+++ b/core/res/res/values-zu/strings.xml
@@ -1172,6 +1172,14 @@
<string name="date_picker_decrement_day_button" msgid="2427816793443629131">"Usuku lokwehlisa."</string>
<string name="date_picker_increment_year_button" msgid="3058553394722295105">"Unyaka wokwenyusa."</string>
<string name="date_picker_decrement_year_button" msgid="5193062846559743823">"Unyaka wokwehlisa"</string>
+ <string name="checkbox_checked" msgid="7222044992652711167">"kuhloliwe"</string>
+ <string name="checkbox_not_checked" msgid="5174639551134444056">"akuhloliwe"</string>
+ <string name="radiobutton_selected" msgid="8603599808486581511">"Okukhethiwe"</string>
+ <string name="radiobutton_not_selected" msgid="2908760184307722393">"akukhethiwe"</string>
+ <string name="switch_on" msgid="551417728476977311">"vuliwe"</string>
+ <string name="switch_off" msgid="7249798614327155088">"valiwe"</string>
+ <string name="togglebutton_pressed" msgid="4180411746647422233">"kucindezelwe."</string>
+ <string name="togglebutton_not_pressed" msgid="4495147725636134425">"akucindezelwe."</string>
<string name="keyboardview_keycode_alt" msgid="4856868820040051939">"i-ALT"</string>
<string name="keyboardview_keycode_cancel" msgid="1203984017245783244">"Khansela"</string>
<string name="keyboardview_keycode_delete" msgid="3337914833206635744">"Susa"</string>
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index c8df649..7137b7c 100755
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -1429,6 +1429,15 @@
user dictionary.</string>
<!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. [CHAR LIMIT=30] -->
+ <string name="permlab_sdcardRead" product="nosdcard">read USB storage contents</string>
+ <!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
+ <string name="permlab_sdcardRead" product="default">read SD card contents</string>
+ <!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. [CHAR LIMIT=30] -->
+ <string name="permdesc_sdcardRead" product="nosdcard">Allows the app to read contents of USB storage.</string>
+ <!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
+ <string name="permdesc_sdcardRead" product="default">Allows the app to read contents of SD card.</string>
+
+ <!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. [CHAR LIMIT=30] -->
<string name="permlab_sdcardWrite" product="nosdcard">modify/delete USB storage contents</string>
<!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
<string name="permlab_sdcardWrite" product="default">modify/delete SD card contents</string>
diff --git a/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/stress/WifiStressTest.java b/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/stress/WifiStressTest.java
index f46546f..649ec3e 100644
--- a/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/stress/WifiStressTest.java
+++ b/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/stress/WifiStressTest.java
@@ -97,6 +97,11 @@
mOutputWriter = new BufferedWriter(new FileWriter(new File(
Environment.getExternalStorageDirectory(), OUTPUT_FILE), true));
mAct.turnScreenOn();
+ if (mAct.mWifiManager.isWifiApEnabled()) {
+ // if soft AP is enabled, disable it
+ assertTrue(mAct.mWifiManager.setWifiApEnabled(null, false));
+ Log.v(TAG, "disable soft ap");
+ }
if (!mAct.mWifiManager.isWifiEnabled()) {
log("Enable wi-fi before stress tests.");
if (!mAct.enableWifi()) {
diff --git a/core/tests/coretests/src/android/view/GravityTest.java b/core/tests/coretests/src/android/view/GravityTest.java
deleted file mode 100644
index d8ef650..0000000
--- a/core/tests/coretests/src/android/view/GravityTest.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.view;
-
-import android.test.AndroidTestCase;
-import android.test.suitebuilder.annotation.SmallTest;
-
-public class GravityTest extends AndroidTestCase {
-
- @SmallTest
- public void testGetAbsoluteGravity() throws Exception {
- assertOneGravity(Gravity.LEFT, Gravity.LEFT, false);
- assertOneGravity(Gravity.LEFT, Gravity.LEFT, true);
-
- assertOneGravity(Gravity.RIGHT, Gravity.RIGHT, false);
- assertOneGravity(Gravity.RIGHT, Gravity.RIGHT, true);
-
- assertOneGravity(Gravity.TOP, Gravity.TOP, false);
- assertOneGravity(Gravity.TOP, Gravity.TOP, true);
-
- assertOneGravity(Gravity.BOTTOM, Gravity.BOTTOM, false);
- assertOneGravity(Gravity.BOTTOM, Gravity.BOTTOM, true);
-
- assertOneGravity(Gravity.CENTER_VERTICAL, Gravity.CENTER_VERTICAL, false);
- assertOneGravity(Gravity.CENTER_VERTICAL, Gravity.CENTER_VERTICAL, true);
-
- assertOneGravity(Gravity.CENTER_HORIZONTAL, Gravity.CENTER_HORIZONTAL, false);
- assertOneGravity(Gravity.CENTER_HORIZONTAL, Gravity.CENTER_HORIZONTAL, true);
-
- assertOneGravity(Gravity.CENTER, Gravity.CENTER, false);
- assertOneGravity(Gravity.CENTER, Gravity.CENTER, true);
-
- assertOneGravity(Gravity.FILL_VERTICAL, Gravity.FILL_VERTICAL, false);
- assertOneGravity(Gravity.FILL_VERTICAL, Gravity.FILL_VERTICAL, true);
-
- assertOneGravity(Gravity.FILL_HORIZONTAL, Gravity.FILL_HORIZONTAL, false);
- assertOneGravity(Gravity.FILL_HORIZONTAL, Gravity.FILL_HORIZONTAL, true);
-
- assertOneGravity(Gravity.FILL, Gravity.FILL, false);
- assertOneGravity(Gravity.FILL, Gravity.FILL, true);
-
- assertOneGravity(Gravity.CLIP_HORIZONTAL, Gravity.CLIP_HORIZONTAL, false);
- assertOneGravity(Gravity.CLIP_HORIZONTAL, Gravity.CLIP_HORIZONTAL, true);
-
- assertOneGravity(Gravity.CLIP_VERTICAL, Gravity.CLIP_VERTICAL, false);
- assertOneGravity(Gravity.CLIP_VERTICAL, Gravity.CLIP_VERTICAL, true);
-
- assertOneGravity(Gravity.LEFT, Gravity.START, false);
- assertOneGravity(Gravity.RIGHT, Gravity.START, true);
-
- assertOneGravity(Gravity.RIGHT, Gravity.END, false);
- assertOneGravity(Gravity.LEFT, Gravity.END, true);
- }
-
- private void assertOneGravity(int expected, int initial, boolean isRtl) {
- final int layoutDirection = isRtl ? View.LAYOUT_DIRECTION_RTL : View.LAYOUT_DIRECTION_LTR;
-
- assertEquals(expected, Gravity.getAbsoluteGravity(initial, layoutDirection));
- }
-}
diff --git a/data/etc/platform.xml b/data/etc/platform.xml
index 8be1db2..4b93e74 100644
--- a/data/etc/platform.xml
+++ b/data/etc/platform.xml
@@ -54,6 +54,10 @@
<group gid="log" />
</permission>
+ <permission name="android.permission.READ_EXTERNAL_STORAGE" >
+ <group gid="sdcard_r" />
+ </permission>
+
<permission name="android.permission.WRITE_EXTERNAL_STORAGE" >
<group gid="sdcard_rw" />
</permission>
diff --git a/graphics/java/android/graphics/Camera.java b/graphics/java/android/graphics/Camera.java
index 7ef35a9..6f71a2b 100644
--- a/graphics/java/android/graphics/Camera.java
+++ b/graphics/java/android/graphics/Camera.java
@@ -100,6 +100,27 @@
public native void rotate(float x, float y, float z);
/**
+ * Gets the x location of the camera.
+ *
+ * @see #setLocation(float, float, float)
+ */
+ public native float getLocationX();
+
+ /**
+ * Gets the y location of the camera.
+ *
+ * @see #setLocation(float, float, float)
+ */
+ public native float getLocationY();
+
+ /**
+ * Gets the z location of the camera.
+ *
+ * @see #setLocation(float, float, float)
+ */
+ public native float getLocationZ();
+
+ /**
* Sets the location of the camera. The default location is set at
* 0, 0, -8.
*
diff --git a/graphics/java/android/graphics/Typeface.java b/graphics/java/android/graphics/Typeface.java
index ed6fa08..4487a3c 100644
--- a/graphics/java/android/graphics/Typeface.java
+++ b/graphics/java/android/graphics/Typeface.java
@@ -17,6 +17,7 @@
package android.graphics;
import android.content.res.AssetManager;
+import android.util.SparseArray;
import java.io.File;
@@ -43,9 +44,11 @@
/** The NORMAL style of the default monospace typeface. */
public static final Typeface MONOSPACE;
- /* package */ static Typeface[] sDefaults;
-
- /* package */ int native_instance;
+ static Typeface[] sDefaults;
+ private static final SparseArray<SparseArray<Typeface>> sTypefaceCache =
+ new SparseArray<SparseArray<Typeface>>(3);
+
+ int native_instance;
// Style
public static final int NORMAL = 0;
@@ -53,19 +56,21 @@
public static final int ITALIC = 2;
public static final int BOLD_ITALIC = 3;
+ private int mStyle = 0;
+
/** Returns the typeface's intrinsic style attributes */
public int getStyle() {
- return nativeGetStyle(native_instance);
+ return mStyle;
}
/** Returns true if getStyle() has the BOLD bit set. */
public final boolean isBold() {
- return (getStyle() & BOLD) != 0;
+ return (mStyle & BOLD) != 0;
}
/** Returns true if getStyle() has the ITALIC bit set. */
public final boolean isItalic() {
- return (getStyle() & ITALIC) != 0;
+ return (mStyle & ITALIC) != 0;
}
/**
@@ -97,9 +102,32 @@
public static Typeface create(Typeface family, int style) {
int ni = 0;
if (family != null) {
+ // Return early if we're asked for the same face/style
+ if (family.mStyle == style) {
+ return family;
+ }
+
ni = family.native_instance;
}
- return new Typeface(nativeCreateFromTypeface(ni, style));
+
+ Typeface typeface;
+ SparseArray<Typeface> styles = sTypefaceCache.get(ni);
+
+ if (styles != null) {
+ typeface = styles.get(style);
+ if (typeface != null) {
+ return typeface;
+ }
+ }
+
+ typeface = new Typeface(nativeCreateFromTypeface(ni, style));
+ if (styles == null) {
+ styles = new SparseArray<Typeface>(4);
+ sTypefaceCache.put(ni, styles);
+ }
+ styles.put(style, typeface);
+
+ return typeface;
}
/**
@@ -143,15 +171,17 @@
// don't allow clients to call this directly
private Typeface(int ni) {
- if (0 == ni) {
+ if (ni == 0) {
throw new RuntimeException("native typeface cannot be made");
}
+
native_instance = ni;
+ mStyle = nativeGetStyle(ni);
}
static {
- DEFAULT = create((String)null, 0);
- DEFAULT_BOLD = create((String)null, Typeface.BOLD);
+ DEFAULT = create((String) null, 0);
+ DEFAULT_BOLD = create((String) null, Typeface.BOLD);
SANS_SERIF = create("sans-serif", 0);
SERIF = create("serif", 0);
MONOSPACE = create("monospace", 0);
@@ -159,14 +189,34 @@
sDefaults = new Typeface[] {
DEFAULT,
DEFAULT_BOLD,
- create((String)null, Typeface.ITALIC),
- create((String)null, Typeface.BOLD_ITALIC),
+ create((String) null, Typeface.ITALIC),
+ create((String) null, Typeface.BOLD_ITALIC),
};
}
protected void finalize() throws Throwable {
- super.finalize();
- nativeUnref(native_instance);
+ try {
+ nativeUnref(native_instance);
+ } finally {
+ super.finalize();
+ }
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ Typeface typeface = (Typeface) o;
+
+ return mStyle == typeface.mStyle && native_instance == typeface.native_instance;
+ }
+
+ @Override
+ public int hashCode() {
+ int result = native_instance;
+ result = 31 * result + mStyle;
+ return result;
}
private static native int nativeCreate(String familyName, int style);
diff --git a/include/media/IAudioFlinger.h b/include/media/IAudioFlinger.h
index c723b6d..0f39cf3 100644
--- a/include/media/IAudioFlinger.h
+++ b/include/media/IAudioFlinger.h
@@ -78,6 +78,8 @@
virtual int channelCount(audio_io_handle_t output) const = 0;
virtual audio_format_t format(audio_io_handle_t output) const = 0;
virtual size_t frameCount(audio_io_handle_t output) const = 0;
+
+ // return estimated latency in milliseconds
virtual uint32_t latency(audio_io_handle_t output) const = 0;
/* set/get the audio hardware state. This will probably be used by
diff --git a/libs/hwui/DisplayListRenderer.cpp b/libs/hwui/DisplayListRenderer.cpp
index d9b0e5a..24f4f1c 100644
--- a/libs/hwui/DisplayListRenderer.cpp
+++ b/libs/hwui/DisplayListRenderer.cpp
@@ -20,13 +20,11 @@
#include "DisplayListLogBuffer.h"
#include "DisplayListRenderer.h"
#include "Caches.h"
-
-#include <utils/String8.h>
+#include "SkCamera.h"
namespace android {
namespace uirenderer {
-
///////////////////////////////////////////////////////////////////////////////
// Display list
///////////////////////////////////////////////////////////////////////////////
@@ -101,6 +99,37 @@
clearResources();
}
+void DisplayList::initProperties() {
+ mLeft = 0;
+ mTop = 0;
+ mTop = 0;
+ mBottom = 0;
+ mApplicationScale = -1;
+ mClipChildren = true;
+ mAlpha = 1;
+ mMultipliedAlpha = 255;
+ mTranslationX = 0;
+ mTranslationY = 0;
+ mRotation = 0;
+ mRotationX = 0;
+ mRotationY= 0;
+ mScaleX = 1;
+ mScaleY = 1;
+ mPivotX = 0;
+ mPivotY = 0;
+ mMatrixDirty = false;
+ mMatrixFlags = 0;
+ mPrevWidth = -1;
+ mPrevHeight = -1;
+ mWidth = 0;
+ mHeight = 0;
+ mPivotExplicitlySet = false;
+ mTransformMatrix = NULL;
+ mTransformCamera = NULL;
+ mTransformMatrix3D = NULL;
+ mCaching = false;
+}
+
void DisplayList::destroyDisplayListDeferred(DisplayList* displayList) {
if (displayList) {
DISPLAY_LIST_LOGD("Deferring display list destruction");
@@ -111,6 +140,19 @@
void DisplayList::clearResources() {
sk_free((void*) mReader.base());
+ if (mTransformMatrix) {
+ delete mTransformMatrix;
+ mTransformMatrix = NULL;
+ }
+ if (mTransformCamera) {
+ delete mTransformCamera;
+ mTransformCamera = NULL;
+ }
+ if (mTransformMatrix3D) {
+ delete mTransformMatrix3D;
+ mTransformMatrix3D = NULL;
+ }
+
Caches& caches = Caches::getInstance();
for (size_t i = 0; i < mBitmapResources.size(); i++) {
@@ -159,6 +201,7 @@
// re-using display list - clear out previous allocations
clearResources();
}
+ initProperties();
mSize = writer.size();
void* buffer = sk_malloc_throw(mSize);
@@ -230,6 +273,7 @@
int saveCount = renderer.getSaveCount() - 1;
+ outputViewProperties(renderer, (char*) indent);
mReader.rewind();
while (!mReader.eof()) {
@@ -238,7 +282,7 @@
int skip = mReader.readInt();
ALOGD("%sSkip %d", (char*) indent, skip);
op &= ~OP_MAY_BE_SKIPPED_MASK;
- }
+ }
switch (op) {
case DrawGLFunction: {
@@ -268,7 +312,7 @@
SkPaint* paint = getPaint(renderer);
int flags = getInt();
ALOGD("%s%s %.2f, %.2f, %.2f, %.2f, %p, 0x%x", (char*) indent,
- OP_NAMES[op], f1, f2, f3, f4, paint, flags);
+ OP_NAMES[op], f1, f2, f3, f4, paint, flags);
}
break;
case SaveLayerAlpha: {
@@ -279,7 +323,7 @@
int alpha = getInt();
int flags = getInt();
ALOGD("%s%s %.2f, %.2f, %.2f, %.2f, %d, 0x%x", (char*) indent,
- OP_NAMES[op], f1, f2, f3, f4, alpha, flags);
+ OP_NAMES[op], f1, f2, f3, f4, alpha, flags);
}
break;
case Translate: {
@@ -312,7 +356,10 @@
break;
case ConcatMatrix: {
SkMatrix* matrix = getMatrix();
- ALOGD("%s%s %p", (char*) indent, OP_NAMES[op], matrix);
+ ALOGD("%s%s new concat %p: [%f, %f, %f] [%f, %f, %f] [%f, %f, %f]",
+ (char*) indent, OP_NAMES[op], matrix, matrix->get(0), matrix->get(1),
+ matrix->get(2), matrix->get(3), matrix->get(4), matrix->get(5),
+ matrix->get(6), matrix->get(7), matrix->get(8));
}
break;
case ClipRect: {
@@ -322,7 +369,7 @@
float f4 = getFloat();
int regionOp = getInt();
ALOGD("%s%s %.2f, %.2f, %.2f, %.2f, %d", (char*) indent, OP_NAMES[op],
- f1, f2, f3, f4, regionOp);
+ f1, f2, f3, f4, regionOp);
}
break;
case DrawDisplayList: {
@@ -331,7 +378,7 @@
uint32_t height = getUInt();
int32_t flags = getInt();
ALOGD("%s%s %p, %dx%d, 0x%x %d", (char*) indent, OP_NAMES[op],
- displayList, width, height, flags, level + 1);
+ displayList, width, height, flags, level + 1);
renderer.outputDisplayList(displayList, level + 1);
}
break;
@@ -341,7 +388,7 @@
float y = getFloat();
SkPaint* paint = getPaint(renderer);
ALOGD("%s%s %p, %.2f, %.2f, %p", (char*) indent, OP_NAMES[op],
- layer, x, y, paint);
+ layer, x, y, paint);
}
break;
case DrawBitmap: {
@@ -350,7 +397,7 @@
float y = getFloat();
SkPaint* paint = getPaint(renderer);
ALOGD("%s%s %p, %.2f, %.2f, %p", (char*) indent, OP_NAMES[op],
- bitmap, x, y, paint);
+ bitmap, x, y, paint);
}
break;
case DrawBitmapMatrix: {
@@ -358,7 +405,7 @@
SkMatrix* matrix = getMatrix();
SkPaint* paint = getPaint(renderer);
ALOGD("%s%s %p, %p, %p", (char*) indent, OP_NAMES[op],
- bitmap, matrix, paint);
+ bitmap, matrix, paint);
}
break;
case DrawBitmapRect: {
@@ -373,7 +420,7 @@
float f8 = getFloat();
SkPaint* paint = getPaint(renderer);
ALOGD("%s%s %p, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %p",
- (char*) indent, OP_NAMES[op], bitmap, f1, f2, f3, f4, f5, f6, f7, f8, paint);
+ (char*) indent, OP_NAMES[op], bitmap, f1, f2, f3, f4, f5, f6, f7, f8, paint);
}
break;
case DrawBitmapMesh: {
@@ -422,7 +469,7 @@
float f4 = getFloat();
SkPaint* paint = getPaint(renderer);
ALOGD("%s%s %.2f, %.2f, %.2f, %.2f, %p", (char*) indent, OP_NAMES[op],
- f1, f2, f3, f4, paint);
+ f1, f2, f3, f4, paint);
}
break;
case DrawRoundRect: {
@@ -434,7 +481,7 @@
float f6 = getFloat();
SkPaint* paint = getPaint(renderer);
ALOGD("%s%s %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %p",
- (char*) indent, OP_NAMES[op], f1, f2, f3, f4, f5, f6, paint);
+ (char*) indent, OP_NAMES[op], f1, f2, f3, f4, f5, f6, paint);
}
break;
case DrawCircle: {
@@ -443,7 +490,7 @@
float f3 = getFloat();
SkPaint* paint = getPaint(renderer);
ALOGD("%s%s %.2f, %.2f, %.2f, %p",
- (char*) indent, OP_NAMES[op], f1, f2, f3, paint);
+ (char*) indent, OP_NAMES[op], f1, f2, f3, paint);
}
break;
case DrawOval: {
@@ -453,7 +500,7 @@
float f4 = getFloat();
SkPaint* paint = getPaint(renderer);
ALOGD("%s%s %.2f, %.2f, %.2f, %.2f, %p",
- (char*) indent, OP_NAMES[op], f1, f2, f3, f4, paint);
+ (char*) indent, OP_NAMES[op], f1, f2, f3, f4, paint);
}
break;
case DrawArc: {
@@ -466,7 +513,7 @@
int i1 = getInt();
SkPaint* paint = getPaint(renderer);
ALOGD("%s%s %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %d, %p",
- (char*) indent, OP_NAMES[op], f1, f2, f3, f4, f5, f6, i1, paint);
+ (char*) indent, OP_NAMES[op], f1, f2, f3, f4, f5, f6, i1, paint);
}
break;
case DrawPath: {
@@ -497,7 +544,7 @@
SkPaint* paint = getPaint(renderer);
float length = getFloat();
ALOGD("%s%s %s, %d, %d, %.2f, %.2f, %p, %.2f", (char*) indent, OP_NAMES[op],
- text.text(), text.length(), count, x, y, paint, length);
+ text.text(), text.length(), count, x, y, paint, length);
}
break;
case DrawTextOnPath: {
@@ -518,7 +565,7 @@
float* positions = getFloats(positionsCount);
SkPaint* paint = getPaint(renderer);
ALOGD("%s%s %s, %d, %d, %p", (char*) indent, OP_NAMES[op],
- text.text(), text.length(), count, paint);
+ text.text(), text.length(), count, paint);
}
case ResetShader: {
ALOGD("%s%s", (char*) indent, OP_NAMES[op]);
@@ -548,7 +595,7 @@
float dy = getFloat();
int color = getInt();
ALOGD("%s%s %.2f, %.2f, %.2f, 0x%x", (char*) indent, OP_NAMES[op],
- radius, dx, dy, color);
+ radius, dx, dy, color);
}
break;
case ResetPaintFilter: {
@@ -563,20 +610,193 @@
break;
default:
ALOGD("Display List error: op not handled: %s%s",
- (char*) indent, OP_NAMES[op]);
+ (char*) indent, OP_NAMES[op]);
break;
}
}
-
- ALOGD("%sDone", (char*) indent + 2);
+ ALOGD("%sDone (%p, %s)", (char*) indent + 2, this, mName.string());
}
+void DisplayList::updateMatrix() {
+ if (mMatrixDirty) {
+ if (!mTransformMatrix) {
+ mTransformMatrix = new SkMatrix();
+ }
+ if (mMatrixFlags == 0 || mMatrixFlags == TRANSLATION) {
+ mTransformMatrix->reset();
+ } else {
+ if (!mPivotExplicitlySet) {
+ if (mWidth != mPrevWidth || mHeight != mPrevHeight) {
+ mPrevWidth = mWidth;
+ mPrevHeight = mHeight;
+ mPivotX = mPrevWidth / 2;
+ mPivotY = mPrevHeight / 2;
+ }
+ }
+ if ((mMatrixFlags & ROTATION_3D) == 0) {
+ mTransformMatrix->setTranslate(mTranslationX, mTranslationY);
+ mTransformMatrix->preRotate(mRotation, mPivotX, mPivotY);
+ mTransformMatrix->preScale(mScaleX, mScaleY, mPivotX, mPivotY);
+ } else {
+ if (!mTransformCamera) {
+ mTransformCamera = new Sk3DView();
+ mTransformMatrix3D = new SkMatrix();
+ }
+ mTransformMatrix->reset();
+ mTransformCamera->save();
+ mTransformMatrix->preScale(mScaleX, mScaleY, mPivotX, mPivotY);
+ mTransformCamera->rotateX(mRotationX);
+ mTransformCamera->rotateY(mRotationY);
+ mTransformCamera->rotateZ(-mRotation);
+ mTransformCamera->getMatrix(mTransformMatrix3D);
+ mTransformMatrix3D->preTranslate(-mPivotX, -mPivotY);
+ mTransformMatrix3D->postTranslate(mPivotX + mTranslationX,
+ mPivotY + mTranslationY);
+ mTransformMatrix->postConcat(*mTransformMatrix3D);
+ mTransformCamera->restore();
+ }
+ }
+ mMatrixDirty = false;
+ }
+}
+
+void DisplayList::outputViewProperties(OpenGLRenderer& renderer, char* indent) {
+ if (USE_DISPLAY_LIST_PROPERTIES) {
+ updateMatrix();
+ if (mApplicationScale >= 0) {
+ ALOGD("%s%s %.2f, %.2f", (char*) indent, "Scale",
+ mApplicationScale, mApplicationScale);
+ }
+ if (mLeft != 0 || mTop != 0) {
+ ALOGD("%s%s %d, %d", indent, "Translate", mLeft, mTop);
+ }
+ if (mAlpha < 1) {
+ // TODO: should be able to store the size of a DL at record time and not
+ // have to pass it into this call. In fact, this information might be in the
+ // location/size info that we store with the new native transform data.
+ int flags = SkCanvas::kHasAlphaLayer_SaveFlag;
+ if (mClipChildren) {
+ flags |= SkCanvas::kClipToLayer_SaveFlag;
+ }
+ ALOGD("%s%s %.2f, %.2f, %.2f, %.2f, %d, 0x%x", indent, "SaveLayerAlpha",
+ (float) 0, (float) 0, (float) mRight - mLeft, (float) mBottom - mTop,
+ mMultipliedAlpha, flags);
+ }
+ if (mMatrixFlags != 0) {
+ if (mMatrixFlags == TRANSLATION) {
+ ALOGD("%s%s %f, %f", indent, "Translate", mTranslationX, mTranslationY);
+ } else {
+ ALOGD("%s%s %p: [%.2f, %.2f, %.2f] [%.2f, %.2f, %.2f] [%.2f, %.2f, %.2f]",
+ indent, "ConcatMatrix", mTransformMatrix,
+ mTransformMatrix->get(0), mTransformMatrix->get(1),
+ mTransformMatrix->get(2), mTransformMatrix->get(3),
+ mTransformMatrix->get(4), mTransformMatrix->get(5),
+ mTransformMatrix->get(6), mTransformMatrix->get(7),
+ mTransformMatrix->get(8));
+ }
+ }
+ if (mClipChildren) {
+ ALOGD("%s%s %.2f, %.2f, %.2f, %.2f", indent, "ClipRect", 0.0f, 0.0f,
+ (float) mRight - mLeft, (float) mBottom - mTop);
+ }
+ }
+}
+
+void DisplayList::setViewProperties(OpenGLRenderer& renderer, uint32_t width, uint32_t height,
+ uint32_t level) {
+ if (USE_DISPLAY_LIST_PROPERTIES) {
+#if DEBUG_DISPLAY_LIST
+ uint32_t count = (level + 1) * 2;
+ char indent[count + 1];
+ for (uint32_t i = 0; i < count; i++) {
+ indent[i] = ' ';
+ }
+ indent[count] = '\0';
+#endif
+ updateMatrix();
+ if (mLeft != 0 || mTop != 0) {
+ DISPLAY_LIST_LOGD("%s%s %d, %d", indent, "Translate", mLeft, mTop);
+ renderer.translate(mLeft, mTop);
+ }
+ if (mApplicationScale >= 0) {
+ DISPLAY_LIST_LOGD("%s%s %.2f, %.2f", (char*) indent, "Scale",
+ mApplicationScale, mApplicationScale);
+ renderer.scale(mApplicationScale, mApplicationScale);
+ }
+ if (mAlpha < 1 && !mCaching) {
+ // TODO: should be able to store the size of a DL at record time and not
+ // have to pass it into this call. In fact, this information might be in the
+ // location/size info that we store with the new native transform data.
+ int flags = SkCanvas::kHasAlphaLayer_SaveFlag;
+ if (mClipChildren) {
+ flags |= SkCanvas::kClipToLayer_SaveFlag;
+ }
+ DISPLAY_LIST_LOGD("%s%s %.2f, %.2f, %.2f, %.2f, %d, 0x%x", indent, "SaveLayerAlpha",
+ (float) 0, (float) 0, (float) mRight - mLeft, (float) mBottom - mTop,
+ mMultipliedAlpha, flags);
+ renderer.saveLayerAlpha(0, 0, mRight - mLeft, mBottom - mTop,
+ mMultipliedAlpha, flags);
+ }
+ if (mMatrixFlags != 0) {
+ if (mMatrixFlags == TRANSLATION) {
+ DISPLAY_LIST_LOGD("%s%s %f, %f", indent, "Translate", mTranslationX, mTranslationY);
+ renderer.translate(mTranslationX, mTranslationY);
+ } else {
+ DISPLAY_LIST_LOGD(
+ "%s%s %p: [%.2f, %.2f, %.2f] [%.2f, %.2f, %.2f] [%.2f, %.2f, %.2f]",
+ indent, "ConcatMatrix", mTransformMatrix,
+ mTransformMatrix->get(0), mTransformMatrix->get(1),
+ mTransformMatrix->get(2), mTransformMatrix->get(3),
+ mTransformMatrix->get(4), mTransformMatrix->get(5),
+ mTransformMatrix->get(6), mTransformMatrix->get(7),
+ mTransformMatrix->get(8));
+ renderer.concatMatrix(mTransformMatrix);
+ }
+ }
+ if (mClipChildren) {
+ DISPLAY_LIST_LOGD("%s%s %.2f, %.2f, %.2f, %.2f", indent, "ClipRect", 0.0f, 0.0f,
+ (float) mRight - mLeft, (float) mBottom - mTop);
+ renderer.clipRect(0, 0, mRight - mLeft, mBottom - mTop,
+ SkRegion::kIntersect_Op);
+ }
+ }
+}
+
+void DisplayList::transformRect(float left, float top, float right, float bottom, Rect& result) {
+ result.left = left + mLeft;
+ result.top = top + mTop;
+ result.right = right + mLeft;
+ result.bottom = bottom + mTop;
+ if (mMatrixFlags != 0) {
+ if (mMatrixFlags == TRANSLATION) {
+ result.left += mTranslationX;
+ result.top += mTranslationY;
+ result.right += mTranslationX;
+ result.bottom += mTranslationY;
+ } else {
+ updateMatrix();
+ SkRect r;
+ r.fLeft = result.left;
+ r.fTop = result.top;
+ r.fRight = result.right;
+ r.fBottom = result.bottom;
+ mTransformMatrix->mapRect(&r);
+ result.left = r.fLeft;
+ result.top = r.fTop;
+ result.right = r.fRight;
+ result.bottom = r.fBottom;
+ }
+ }
+}
+
+
/**
* Changes to replay(), specifically those involving opcode or parameter changes, should be mimicked
* in the output() function, since that function processes the same list of opcodes for the
* purposes of logging display list info for a given view.
*/
-bool DisplayList::replay(OpenGLRenderer& renderer, Rect& dirty, int32_t flags, uint32_t level) {
+bool DisplayList::replay(OpenGLRenderer& renderer, uint32_t width,
+ uint32_t height, Rect& dirty, int32_t flags, uint32_t level) {
bool needsInvalidate = false;
TextContainer text;
mReader.rewind();
@@ -592,6 +812,13 @@
#endif
renderer.startMark(mName.string());
+ int restoreTo = 0;
+ if (USE_DISPLAY_LIST_PROPERTIES) {
+ DISPLAY_LIST_LOGD("%s%s %d", indent, "Save",
+ SkCanvas::kMatrix_SaveFlag | SkCanvas::kClip_SaveFlag);
+ restoreTo = renderer.save(SkCanvas::kMatrix_SaveFlag | SkCanvas::kClip_SaveFlag);
+ }
+ setViewProperties(renderer, width, height, level);
DisplayListLogBuffer& logBuffer = DisplayListLogBuffer::getInstance();
int saveCount = renderer.getSaveCount() - 1;
@@ -644,7 +871,7 @@
SkPaint* paint = getPaint(renderer);
int32_t flags = getInt();
DISPLAY_LIST_LOGD("%s%s %.2f, %.2f, %.2f, %.2f, %p, 0x%x", (char*) indent,
- OP_NAMES[op], f1, f2, f3, f4, paint, flags);
+ OP_NAMES[op], f1, f2, f3, f4, paint, flags);
renderer.saveLayer(f1, f2, f3, f4, paint, flags);
}
break;
@@ -656,7 +883,7 @@
int32_t alpha = getInt();
int32_t flags = getInt();
DISPLAY_LIST_LOGD("%s%s %.2f, %.2f, %.2f, %.2f, %d, 0x%x", (char*) indent,
- OP_NAMES[op], f1, f2, f3, f4, alpha, flags);
+ OP_NAMES[op], f1, f2, f3, f4, alpha, flags);
renderer.saveLayerAlpha(f1, f2, f3, f4, alpha, flags);
}
break;
@@ -695,7 +922,12 @@
break;
case ConcatMatrix: {
SkMatrix* matrix = getMatrix();
- DISPLAY_LIST_LOGD("%s%s %p", (char*) indent, OP_NAMES[op], matrix);
+ DISPLAY_LIST_LOGD(
+ "%s%s %p: [%.2f, %.2f, %.2f] [%.2f, %.2f, %.2f] [%.2f, %.2f, %.2f]",
+ (char*) indent, OP_NAMES[op], matrix,
+ matrix->get(0), matrix->get(1), matrix->get(2),
+ matrix->get(3), matrix->get(4), matrix->get(5),
+ matrix->get(6), matrix->get(7), matrix->get(8));
renderer.concatMatrix(matrix);
}
break;
@@ -706,7 +938,7 @@
float f4 = getFloat();
int32_t regionOp = getInt();
DISPLAY_LIST_LOGD("%s%s %.2f, %.2f, %.2f, %.2f, %d", (char*) indent, OP_NAMES[op],
- f1, f2, f3, f4, regionOp);
+ f1, f2, f3, f4, regionOp);
renderer.clipRect(f1, f2, f3, f4, (SkRegion::Op) regionOp);
}
break;
@@ -716,9 +948,9 @@
uint32_t height = getUInt();
int32_t flags = getInt();
DISPLAY_LIST_LOGD("%s%s %p, %dx%d, 0x%x %d", (char*) indent, OP_NAMES[op],
- displayList, width, height, flags, level + 1);
- needsInvalidate |= renderer.drawDisplayList(displayList, width, height,
- dirty, flags, level + 1);
+ displayList, width, height, flags, level + 1);
+ needsInvalidate |= renderer.drawDisplayList(displayList, width,
+ height, dirty, flags, level + 1);
}
break;
case DrawLayer: {
@@ -726,8 +958,11 @@
float x = getFloat();
float y = getFloat();
SkPaint* paint = getPaint(renderer);
+ if (mCaching && mMultipliedAlpha < 255) {
+ paint->setAlpha(mMultipliedAlpha);
+ }
DISPLAY_LIST_LOGD("%s%s %p, %.2f, %.2f, %p", (char*) indent, OP_NAMES[op],
- layer, x, y, paint);
+ layer, x, y, paint);
renderer.drawLayer(layer, x, y, paint);
}
break;
@@ -737,7 +972,7 @@
float y = getFloat();
SkPaint* paint = getPaint(renderer);
DISPLAY_LIST_LOGD("%s%s %p, %.2f, %.2f, %p", (char*) indent, OP_NAMES[op],
- bitmap, x, y, paint);
+ bitmap, x, y, paint);
renderer.drawBitmap(bitmap, x, y, paint);
}
break;
@@ -746,7 +981,7 @@
SkMatrix* matrix = getMatrix();
SkPaint* paint = getPaint(renderer);
DISPLAY_LIST_LOGD("%s%s %p, %p, %p", (char*) indent, OP_NAMES[op],
- bitmap, matrix, paint);
+ bitmap, matrix, paint);
renderer.drawBitmap(bitmap, matrix, paint);
}
break;
@@ -762,7 +997,8 @@
float f8 = getFloat();
SkPaint* paint = getPaint(renderer);
DISPLAY_LIST_LOGD("%s%s %p, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %p",
- (char*) indent, OP_NAMES[op], bitmap, f1, f2, f3, f4, f5, f6, f7, f8, paint);
+ (char*) indent, OP_NAMES[op], bitmap,
+ f1, f2, f3, f4, f5, f6, f7, f8,paint);
renderer.drawBitmap(bitmap, f1, f2, f3, f4, f5, f6, f7, f8, paint);
}
break;
@@ -821,7 +1057,7 @@
float f4 = getFloat();
SkPaint* paint = getPaint(renderer);
DISPLAY_LIST_LOGD("%s%s %.2f, %.2f, %.2f, %.2f, %p", (char*) indent, OP_NAMES[op],
- f1, f2, f3, f4, paint);
+ f1, f2, f3, f4, paint);
renderer.drawRect(f1, f2, f3, f4, paint);
}
break;
@@ -834,7 +1070,7 @@
float f6 = getFloat();
SkPaint* paint = getPaint(renderer);
DISPLAY_LIST_LOGD("%s%s %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %p",
- (char*) indent, OP_NAMES[op], f1, f2, f3, f4, f5, f6, paint);
+ (char*) indent, OP_NAMES[op], f1, f2, f3, f4, f5, f6, paint);
renderer.drawRoundRect(f1, f2, f3, f4, f5, f6, paint);
}
break;
@@ -844,7 +1080,7 @@
float f3 = getFloat();
SkPaint* paint = getPaint(renderer);
DISPLAY_LIST_LOGD("%s%s %.2f, %.2f, %.2f, %p",
- (char*) indent, OP_NAMES[op], f1, f2, f3, paint);
+ (char*) indent, OP_NAMES[op], f1, f2, f3, paint);
renderer.drawCircle(f1, f2, f3, paint);
}
break;
@@ -855,7 +1091,7 @@
float f4 = getFloat();
SkPaint* paint = getPaint(renderer);
DISPLAY_LIST_LOGD("%s%s %.2f, %.2f, %.2f, %.2f, %p",
- (char*) indent, OP_NAMES[op], f1, f2, f3, f4, paint);
+ (char*) indent, OP_NAMES[op], f1, f2, f3, f4, paint);
renderer.drawOval(f1, f2, f3, f4, paint);
}
break;
@@ -869,7 +1105,7 @@
int32_t i1 = getInt();
SkPaint* paint = getPaint(renderer);
DISPLAY_LIST_LOGD("%s%s %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %d, %p",
- (char*) indent, OP_NAMES[op], f1, f2, f3, f4, f5, f6, i1, paint);
+ (char*) indent, OP_NAMES[op], f1, f2, f3, f4, f5, f6, i1, paint);
renderer.drawArc(f1, f2, f3, f4, f5, f6, i1 == 1, paint);
}
break;
@@ -965,7 +1201,7 @@
float dy = getFloat();
int32_t color = getInt();
DISPLAY_LIST_LOGD("%s%s %.2f, %.2f, %.2f, 0x%x", (char*) indent, OP_NAMES[op],
- radius, dx, dy, color);
+ radius, dx, dy, color);
renderer.setupShadow(radius, dx, dy, color);
}
break;
@@ -984,14 +1220,19 @@
break;
default:
DISPLAY_LIST_LOGD("Display List error: op not handled: %s%s",
- (char*) indent, OP_NAMES[op]);
+ (char*) indent, OP_NAMES[op]);
break;
}
}
+ if (USE_DISPLAY_LIST_PROPERTIES) {
+ DISPLAY_LIST_LOGD("%s%s %d", (char*) indent, "RestoreToCount", restoreTo);
+ renderer.restoreToCount(restoreTo);
+ }
renderer.endMark();
- DISPLAY_LIST_LOGD("%sDone, returning %d", (char*) indent + 2, needsInvalidate);
+ DISPLAY_LIST_LOGD("%sDone (%p, %s), returning %d", (char*) indent + 2, this, mName.string(),
+ needsInvalidate);
return needsInvalidate;
}
@@ -999,7 +1240,7 @@
// Base structure
///////////////////////////////////////////////////////////////////////////////
-DisplayListRenderer::DisplayListRenderer(): mWriter(MIN_WRITER_SIZE),
+DisplayListRenderer::DisplayListRenderer() : mWriter(MIN_WRITER_SIZE),
mTranslateX(0.0f), mTranslateY(0.0f), mHasTranslate(false), mHasDrawOps(false) {
}
@@ -1071,7 +1312,6 @@
void DisplayListRenderer::finish() {
insertRestoreToCount();
insertTranlate();
- OpenGLRenderer::finish();
}
void DisplayListRenderer::interrupt() {
@@ -1178,7 +1418,19 @@
uint32_t width, uint32_t height, Rect& dirty, int32_t flags, uint32_t level) {
// dirty is an out parameter and should not be recorded,
// it matters only when replaying the display list
- const bool reject = quickReject(0.0f, 0.0f, width, height);
+ float top = 0;
+ float left = 0;
+ float right = width;
+ float bottom = height;
+ if (USE_DISPLAY_LIST_PROPERTIES) {
+ Rect transformedRect;
+ displayList->transformRect(left, top, right, bottom, transformedRect);
+ left = transformedRect.left;
+ top = transformedRect.top;
+ right = transformedRect.right;
+ bottom = transformedRect.bottom;
+ }
+ const bool reject = quickReject(left, top, right, bottom);
uint32_t* location = addOp(DisplayList::DrawDisplayList, reject);
addDisplayList(displayList);
addSize(width, height);
@@ -1275,7 +1527,7 @@
}
void DisplayListRenderer::drawRoundRect(float left, float top, float right, float bottom,
- float rx, float ry, SkPaint* paint) {
+ float rx, float ry, SkPaint* paint) {
const bool reject = paint->getStyle() == SkPaint::kFill_Style &&
quickReject(left, top, right, bottom);
uint32_t* location = addOp(DisplayList::DrawRoundRect, reject);
diff --git a/libs/hwui/DisplayListRenderer.h b/libs/hwui/DisplayListRenderer.h
index 02f8438..abe8b82 100644
--- a/libs/hwui/DisplayListRenderer.h
+++ b/libs/hwui/DisplayListRenderer.h
@@ -20,6 +20,7 @@
#include <SkChunkAlloc.h>
#include <SkFlattenable.h>
#include <SkMatrix.h>
+#include <SkCamera.h>
#include <SkPaint.h>
#include <SkPath.h>
#include <SkRefCnt.h>
@@ -28,11 +29,8 @@
#include <cutils/compiler.h>
-#include <utils/String8.h>
-
#include "DisplayListLogBuffer.h"
#include "OpenGLRenderer.h"
-#include "utils/Functor.h"
namespace android {
namespace uirenderer {
@@ -51,6 +49,16 @@
#define DISPLAY_LIST_LOGD(...)
#endif
+// Set to 1 to enable native processing of View properties. 0 by default. Eventually this
+// will go away and we will always use this approach for accelerated apps.
+#define USE_DISPLAY_LIST_PROPERTIES 0
+
+#define TRANSLATION 0x0001
+#define ROTATION 0x0002
+#define ROTATION_3D 0x0004
+#define SCALE 0x0008
+#define PIVOT 0x0010
+
///////////////////////////////////////////////////////////////////////////////
// Display list
///////////////////////////////////////////////////////////////////////////////
@@ -119,13 +127,18 @@
static const char* OP_NAMES[];
+ void setViewProperties(OpenGLRenderer& renderer, uint32_t width, uint32_t height,
+ uint32_t level);
+ void outputViewProperties(OpenGLRenderer& renderer, char* indent);
+
ANDROID_API size_t getSize();
ANDROID_API static void destroyDisplayListDeferred(DisplayList* displayList);
ANDROID_API static void outputLogBuffer(int fd);
void initFromDisplayListRenderer(const DisplayListRenderer& recorder, bool reusing = false);
- bool replay(OpenGLRenderer& renderer, Rect& dirty, int32_t flags, uint32_t level = 0);
+ bool replay(OpenGLRenderer& renderer, uint32_t width, uint32_t height,
+ Rect& dirty, int32_t flags, uint32_t level = 0);
void output(OpenGLRenderer& renderer, uint32_t level = 0);
@@ -143,11 +156,240 @@
}
}
+ void setApplicationScale(float scale) {
+ mApplicationScale = scale;
+ }
+
+ void setClipChildren(bool clipChildren) {
+ mClipChildren = clipChildren;
+ }
+
+ void setAlpha(float alpha) {
+ if (alpha != mAlpha) {
+ mAlpha = alpha;
+ mMultipliedAlpha = (int)(255 * alpha);
+ }
+ }
+
+ void setTranslationX(float translationX) {
+ if (translationX != mTranslationX) {
+ mTranslationX = translationX;
+ mMatrixDirty = true;
+ if (ALMOST_EQUAL(mTranslationX, 0) && ALMOST_EQUAL(mTranslationY, 0)) {
+ mMatrixFlags &= ~TRANSLATION;
+ } else {
+ mMatrixFlags |= TRANSLATION;
+ }
+ }
+ }
+
+ void setTranslationY(float translationY) {
+ if (translationY != mTranslationY) {
+ mTranslationY = translationY;
+ mMatrixDirty = true;
+ if (ALMOST_EQUAL(mTranslationX, 0) && ALMOST_EQUAL(mTranslationY, 0)) {
+ mMatrixFlags &= ~TRANSLATION;
+ } else {
+ mMatrixFlags |= TRANSLATION;
+ }
+ }
+ }
+
+ void setRotation(float rotation) {
+ if (rotation != mRotation) {
+ mRotation = rotation;
+ mMatrixDirty = true;
+ if (ALMOST_EQUAL(mRotation, 0)) {
+ mMatrixFlags &= ~ROTATION;
+ } else {
+ mMatrixFlags |= ROTATION;
+ }
+ }
+ }
+
+ void setRotationX(float rotationX) {
+ if (rotationX != mRotationX) {
+ mRotationX = rotationX;
+ mMatrixDirty = true;
+ if (ALMOST_EQUAL(mRotationX, 0) && ALMOST_EQUAL(mRotationY, 0)) {
+ mMatrixFlags &= ~ROTATION_3D;
+ } else {
+ mMatrixFlags |= ROTATION_3D;
+ }
+ }
+ }
+
+ void setRotationY(float rotationY) {
+ if (rotationY != mRotationY) {
+ mRotationY = rotationY;
+ mMatrixDirty = true;
+ if (ALMOST_EQUAL(mRotationX, 0) && ALMOST_EQUAL(mRotationY, 0)) {
+ mMatrixFlags &= ~ROTATION_3D;
+ } else {
+ mMatrixFlags |= ROTATION_3D;
+ }
+ }
+ }
+
+ void setScaleX(float scaleX) {
+ if (scaleX != mScaleX) {
+ mScaleX = scaleX;
+ mMatrixDirty = true;
+ if (ALMOST_EQUAL(mScaleX, 1) && ALMOST_EQUAL(mScaleY, 1)) {
+ mMatrixFlags &= ~SCALE;
+ } else {
+ mMatrixFlags |= SCALE;
+ }
+ }
+ }
+
+ void setScaleY(float scaleY) {
+ if (scaleY != mScaleY) {
+ mScaleY = scaleY;
+ mMatrixDirty = true;
+ if (ALMOST_EQUAL(mScaleX, 1) && ALMOST_EQUAL(mScaleY, 1)) {
+ mMatrixFlags &= ~SCALE;
+ } else {
+ mMatrixFlags |= SCALE;
+ }
+ }
+ }
+
+ void setPivotX(float pivotX) {
+ mPivotX = pivotX;
+ mMatrixDirty = true;
+ if (ALMOST_EQUAL(mPivotX, 0) && ALMOST_EQUAL(mPivotY, 0)) {
+ mMatrixFlags &= ~PIVOT;
+ } else {
+ mMatrixFlags |= PIVOT;
+ }
+ mPivotExplicitlySet = true;
+ }
+
+ void setPivotY(float pivotY) {
+ mPivotY = pivotY;
+ mMatrixDirty = true;
+ if (ALMOST_EQUAL(mPivotX, 0) && ALMOST_EQUAL(mPivotY, 0)) {
+ mMatrixFlags &= ~PIVOT;
+ } else {
+ mMatrixFlags |= PIVOT;
+ }
+ mPivotExplicitlySet = true;
+ }
+
+ void setCameraDistance(float distance) {
+ if (distance != mCameraDistance) {
+ mCameraDistance = distance;
+ mMatrixDirty = true;
+ if (!mTransformCamera) {
+ mTransformCamera = new Sk3DView();
+ mTransformMatrix3D = new SkMatrix();
+ }
+ mTransformCamera->setCameraLocation(0, 0, distance);
+ }
+ }
+
+ void setLeft(int left) {
+ if (left != mLeft) {
+ mLeft = left;
+ mWidth = mRight - mLeft;
+ if (mMatrixFlags > TRANSLATION && !mPivotExplicitlySet) {
+ mMatrixDirty = true;
+ }
+ }
+ }
+
+ void setTop(int top) {
+ if (top != mTop) {
+ mTop = top;
+ mHeight = mBottom - mTop;
+ if (mMatrixFlags > TRANSLATION && !mPivotExplicitlySet) {
+ mMatrixDirty = true;
+ }
+ }
+ }
+
+ void setRight(int right) {
+ if (right != mRight) {
+ mRight = right;
+ mWidth = mRight - mLeft;
+ if (mMatrixFlags > TRANSLATION && !mPivotExplicitlySet) {
+ mMatrixDirty = true;
+ }
+ }
+ }
+
+ void setBottom(int bottom) {
+ if (bottom != mBottom) {
+ mBottom = bottom;
+ mHeight = mBottom - mTop;
+ if (mMatrixFlags > TRANSLATION && !mPivotExplicitlySet) {
+ mMatrixDirty = true;
+ }
+ }
+ }
+
+ void setLeftTop(int left, int top) {
+ if (left != mLeft || top != mTop) {
+ mLeft = left;
+ mTop = top;
+ mWidth = mRight - mLeft;
+ mHeight = mBottom - mTop;
+ if (mMatrixFlags > TRANSLATION && !mPivotExplicitlySet) {
+ mMatrixDirty = true;
+ }
+ }
+ }
+
+ void setLeftTopRightBottom(int left, int top, int right, int bottom) {
+ if (left != mLeft || top != mTop || right != mRight || bottom != mBottom) {
+ mLeft = left;
+ mTop = top;
+ mRight = right;
+ mBottom = bottom;
+ mWidth = mRight - mLeft;
+ mHeight = mBottom - mTop;
+ if (mMatrixFlags > TRANSLATION && !mPivotExplicitlySet) {
+ mMatrixDirty = true;
+ }
+ }
+ }
+
+ void offsetLeftRight(int offset) {
+ if (offset != 0) {
+ mLeft += offset;
+ mRight += offset;
+ if (mMatrixFlags > TRANSLATION && !mPivotExplicitlySet) {
+ mMatrixDirty = true;
+ }
+ }
+ }
+
+ void offsetTopBottom(int offset) {
+ if (offset != 0) {
+ mTop += offset;
+ mBottom += offset;
+ if (mMatrixFlags > TRANSLATION && !mPivotExplicitlySet) {
+ mMatrixDirty = true;
+ }
+ }
+ }
+
+ void setCaching(bool caching) {
+ mCaching = caching;
+ }
+
+ void transformRect(float left, float top, float right, float bottom, Rect& result);
+
private:
void init();
+ void initProperties();
+
void clearResources();
+ void updateMatrix();
+
class TextContainer {
public:
size_t length() const {
@@ -241,6 +483,28 @@
bool mIsRenderable;
String8 mName;
+
+ // View properties
+ float mApplicationScale;
+ bool mClipChildren;
+ float mAlpha;
+ int mMultipliedAlpha;
+ float mTranslationX, mTranslationY;
+ float mRotation, mRotationX, mRotationY;
+ float mScaleX, mScaleY;
+ float mPivotX, mPivotY;
+ float mCameraDistance;
+ int mLeft, mTop, mRight, mBottom;
+ int mWidth, mHeight;
+ int mPrevWidth, mPrevHeight;
+ bool mPivotExplicitlySet;
+ bool mMatrixDirty;
+ bool mMatrixIsIdentity;
+ uint32_t mMatrixFlags;
+ SkMatrix* mTransformMatrix;
+ Sk3DView* mTransformCamera;
+ SkMatrix* mTransformMatrix3D;
+ bool mCaching;
};
///////////////////////////////////////////////////////////////////////////////
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index b4310ea..685fddc 100644
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -1323,14 +1323,26 @@
bool OpenGLRenderer::drawDisplayList(DisplayList* displayList, uint32_t width, uint32_t height,
Rect& dirty, int32_t flags, uint32_t level) {
- if (quickReject(0.0f, 0.0f, width, height)) {
+ float top = 0;
+ float left = 0;
+ float right = width;
+ float bottom = height;
+ if (USE_DISPLAY_LIST_PROPERTIES) {
+ Rect transformedRect;
+ displayList->transformRect(left, top, right, bottom, transformedRect);
+ left = transformedRect.left;
+ top = transformedRect.top;
+ right = transformedRect.right;
+ bottom = transformedRect.bottom;
+ }
+ if (quickReject(left, top, right, bottom)) {
return false;
}
// All the usual checks and setup operations (quickReject, setupDraw, etc.)
// will be performed by the display list itself
if (displayList && displayList->isRenderable()) {
- return displayList->replay(*this, dirty, flags, level);
+ return displayList->replay(*this, width, height, dirty, flags, level);
}
return false;
@@ -2174,13 +2186,12 @@
return;
}
+ if (length < 0.0f) length = paint->measureText(text, bytesCount);
switch (paint->getTextAlign()) {
case SkPaint::kCenter_Align:
- if (length < 0.0f) length = paint->measureText(text, bytesCount);
x -= length / 2.0f;
break;
case SkPaint::kRight_Align:
- if (length < 0.0f) length = paint->measureText(text, bytesCount);
x -= length;
break;
default:
@@ -2189,7 +2200,6 @@
SkPaint::FontMetrics metrics;
paint->getFontMetrics(&metrics, 0.0f);
- // If no length was specified, just perform the hit test on the Y axis
if (quickReject(x, y + metrics.fTop, x + length, y + metrics.fBottom)) {
return;
}
diff --git a/libs/rs/rsType.cpp b/libs/rs/rsType.cpp
index 9ac553e..b668a78 100644
--- a/libs/rs/rsType.cpp
+++ b/libs/rs/rsType.cpp
@@ -257,14 +257,14 @@
ObjectBaseRef<Type> Type::cloneAndResize1D(Context *rsc, uint32_t dimX) const {
return getTypeRef(rsc, mElement.get(), dimX,
- mHal.state.dimY, mHal.state.dimZ, mHal.state.lodCount, mHal.state.faces);
+ getDimY(), getDimZ(), getDimLOD(), getDimFaces());
}
ObjectBaseRef<Type> Type::cloneAndResize2D(Context *rsc,
uint32_t dimX,
uint32_t dimY) const {
return getTypeRef(rsc, mElement.get(), dimX, dimY,
- mHal.state.dimZ, mHal.state.lodCount, mHal.state.faces);
+ getDimZ(), getDimLOD(), getDimFaces());
}
diff --git a/media/java/android/media/MediaCodec.java b/media/java/android/media/MediaCodec.java
index 7f496ca..bccf1f9 100644
--- a/media/java/android/media/MediaCodec.java
+++ b/media/java/android/media/MediaCodec.java
@@ -92,14 +92,12 @@
* "width" - Integer
* "height" - Integer
* optional "max-input-size" - Integer
- * optional "csd-0", "csd-1" ... - ByteBuffer
*
* Audio formats have the following fields:
* "mime" - String
* "channel-count" - Integer
* "sample-rate" - Integer
* optional "max-input-size" - Integer
- * optional "csd-0", "csd-1" ... - ByteBuffer
*
* If the format is used to configure an encoder, additional
* fields must be included:
@@ -114,7 +112,7 @@
*
* @param surface Specify a surface on which to render the output of this
* decoder.
- * @param flags Specify {@see #CONFIGURE_FLAG_ENCODE} to configure the
+ * @param flags Specify {@link #CONFIGURE_FLAG_ENCODE} to configure the
* component as an encoder.
*/
public void configure(
@@ -155,6 +153,19 @@
/** After filling a range of the input buffer at the specified index
* submit it to the component.
+ *
+ * Many decoders require the actual compressed data stream to be
+ * preceded by "codec specific data", i.e. setup data used to initialize
+ * the codec such as PPS/SPS in the case of AVC video or code tables
+ * in the case of vorbis audio.
+ * The class MediaExtractor provides codec specific data as part of
+ * the returned track format in entries named "csd-0", "csd-1" ...
+ *
+ * These buffers should be submitted using the flag {@link #FLAG_CODECCONFIG}.
+ *
+ * To indicate that this is the final piece of input data (or rather that
+ * no more input data follows unless the decoder is subsequently flushed)
+ * specify the flag {@link FLAG_EOS}.
*/
public native final void queueInputBuffer(
int index,
@@ -184,15 +195,25 @@
public native final void releaseOutputBuffer(int index, boolean render);
/** Call this after dequeueOutputBuffer signals a format change by returning
- * {@see #INFO_OUTPUT_FORMAT_CHANGED}
+ * {@link #INFO_OUTPUT_FORMAT_CHANGED}
*/
public native final Map<String, Object> getOutputFormat();
+ /** Call this after start() returns.
+ */
+ public ByteBuffer[] getInputBuffers() {
+ return getBuffers(true /* input */);
+ }
+
/** Call this after start() returns and whenever dequeueOutputBuffer
* signals an output buffer change by returning
- * {@see #INFO_OUTPUT_BUFFERS_CHANGED}
+ * {@link #INFO_OUTPUT_BUFFERS_CHANGED}
*/
- public native final ByteBuffer[] getBuffers(boolean input);
+ public ByteBuffer[] getOutputBuffers() {
+ return getBuffers(false /* input */);
+ }
+
+ private native final ByteBuffer[] getBuffers(boolean input);
private static native final void native_init();
diff --git a/media/java/android/media/MediaExtractor.java b/media/java/android/media/MediaExtractor.java
index 6a7f2f5..5732c72 100644
--- a/media/java/android/media/MediaExtractor.java
+++ b/media/java/android/media/MediaExtractor.java
@@ -56,7 +56,7 @@
public native boolean advance();
// Retrieve the current encoded sample and store it in the byte buffer
- // starting at the given offset.
+ // starting at the given offset. Returns the sample size.
public native int readSampleData(ByteBuffer byteBuf, int offset);
// Returns the track index the current sample originates from.
diff --git a/media/java/android/media/MediaPlayer.java b/media/java/android/media/MediaPlayer.java
index e663e91..139ff01 100644
--- a/media/java/android/media/MediaPlayer.java
+++ b/media/java/android/media/MediaPlayer.java
@@ -813,6 +813,13 @@
*
* @param path the path of the file, or the http/rtsp URL of the stream you want to play
* @throws IllegalStateException if it is called in an invalid state
+ *
+ * <p>When <code>path</code> refers to a local file, the file may actually be opened by a
+ * process other than the calling application. This implies that the pathname
+ * should be an absolute path (as any other process runs with unspecified current working
+ * directory), and that the pathname should reference a world-readable file.
+ * As an alternative, the application could first open the file for reading,
+ * and then use the file descriptor form {@link #setDataSource(FileDescriptor)}.
*/
public native void setDataSource(String path)
throws IOException, IllegalArgumentException, SecurityException, IllegalStateException;
diff --git a/media/java/android/media/MediaRecorder.java b/media/java/android/media/MediaRecorder.java
index 6319630..2fe45ec 100644
--- a/media/java/android/media/MediaRecorder.java
+++ b/media/java/android/media/MediaRecorder.java
@@ -582,6 +582,7 @@
* Currently not implemented. It does nothing.
* @deprecated Time lapse mode video recording using camera still image capture
* is not desirable, and will not be supported.
+ * @hide
*/
public void setAuxiliaryOutputFile(FileDescriptor fd)
{
@@ -592,6 +593,7 @@
* Currently not implemented. It does nothing.
* @deprecated Time lapse mode video recording using camera still image capture
* is not desirable, and will not be supported.
+ * @hide
*/
public void setAuxiliaryOutputFile(String path)
{
diff --git a/media/jni/android_media_MediaCodec.cpp b/media/jni/android_media_MediaCodec.cpp
index 71e698f..04d7c22 100644
--- a/media/jni/android_media_MediaCodec.cpp
+++ b/media/jni/android_media_MediaCodec.cpp
@@ -134,7 +134,7 @@
uint32_t flags;
status_t err;
if ((err = mCodec->dequeueOutputBuffer(
- index, &size, &offset, &timeUs, &flags, timeoutUs)) != OK) {
+ index, &offset, &size, &timeUs, &flags, timeoutUs)) != OK) {
return err;
}
diff --git a/media/jni/android_media_MediaExtractor.cpp b/media/jni/android_media_MediaExtractor.cpp
index 4757adf..0c86fc2 100644
--- a/media/jni/android_media_MediaExtractor.cpp
+++ b/media/jni/android_media_MediaExtractor.cpp
@@ -101,14 +101,37 @@
void *dst = env->GetDirectBufferAddress(byteBuf);
+ jlong dstSize;
+ jbyteArray byteArray = NULL;
+
if (dst == NULL) {
- // XXX if dst is NULL also fall back to "array()"
- return INVALID_OPERATION;
+ jclass byteBufClass = env->FindClass("java/nio/ByteBuffer");
+ CHECK(byteBufClass != NULL);
+
+ jmethodID arrayID =
+ env->GetMethodID(byteBufClass, "array", "()[B");
+ CHECK(arrayID != NULL);
+
+ byteArray =
+ (jbyteArray)env->CallObjectMethod(byteBuf, arrayID);
+
+ if (byteArray == NULL) {
+ return INVALID_OPERATION;
+ }
+
+ jboolean isCopy;
+ dst = env->GetByteArrayElements(byteArray, &isCopy);
+
+ dstSize = env->GetArrayLength(byteArray);
+ } else {
+ dstSize = env->GetDirectBufferCapacity(byteBuf);
}
- jlong dstSize = env->GetDirectBufferCapacity(byteBuf);
-
if (dstSize < offset) {
+ if (byteArray != NULL) {
+ env->ReleaseByteArrayElements(byteArray, (jbyte *)dst, 0);
+ }
+
return -ERANGE;
}
@@ -116,6 +139,10 @@
status_t err = mImpl->readSampleData(buffer);
+ if (byteArray != NULL) {
+ env->ReleaseByteArrayElements(byteArray, (jbyte *)dst, 0);
+ }
+
if (err != OK) {
return err;
}
diff --git a/media/jni/mediaeditor/Android.mk b/media/jni/mediaeditor/Android.mk
index b17ae45..6003608 100755
--- a/media/jni/mediaeditor/Android.mk
+++ b/media/jni/mediaeditor/Android.mk
@@ -42,7 +42,6 @@
$(TOP)/frameworks/media/libvideoeditor/vss/common/inc \
$(TOP)/frameworks/media/libvideoeditor/vss/mcs/inc \
$(TOP)/frameworks/media/libvideoeditor/vss/stagefrightshells/inc \
- $(TOP)/frameworks/media/libvideoeditor/include \
$(TOP)/frameworks/media/libvideoeditor/lvpp \
$(TOP)/frameworks/media/libvideoeditor/osal/inc
diff --git a/media/libstagefright/WAVExtractor.cpp b/media/libstagefright/WAVExtractor.cpp
index 501f4806..c35a77a 100644
--- a/media/libstagefright/WAVExtractor.cpp
+++ b/media/libstagefright/WAVExtractor.cpp
@@ -28,15 +28,22 @@
#include <media/stagefright/MediaSource.h>
#include <media/stagefright/MetaData.h>
#include <utils/String8.h>
+#include <cutils/bitops.h>
+
+#define CHANNEL_MASK_USE_CHANNEL_ORDER 0
namespace android {
enum {
- WAVE_FORMAT_PCM = 1,
- WAVE_FORMAT_ALAW = 6,
- WAVE_FORMAT_MULAW = 7,
+ WAVE_FORMAT_PCM = 0x0001,
+ WAVE_FORMAT_ALAW = 0x0006,
+ WAVE_FORMAT_MULAW = 0x0007,
+ WAVE_FORMAT_EXTENSIBLE = 0xFFFE
};
+static const char* WAVEEXT_SUBFORMAT = "\x00\x00\x00\x00\x10\x00\x80\x00\x00\xAA\x00\x38\x9B\x71";
+
+
static uint32_t U32_LE_AT(const uint8_t *ptr) {
return ptr[3] << 24 | ptr[2] << 16 | ptr[1] << 8 | ptr[0];
}
@@ -84,7 +91,8 @@
WAVExtractor::WAVExtractor(const sp<DataSource> &source)
: mDataSource(source),
- mValidFormat(false) {
+ mValidFormat(false),
+ mChannelMask(CHANNEL_MASK_USE_CHANNEL_ORDER) {
mInitCheck = init();
}
@@ -161,21 +169,37 @@
return NO_INIT;
}
- uint8_t formatSpec[16];
- if (mDataSource->readAt(offset, formatSpec, 16) < 16) {
+ uint8_t formatSpec[40];
+ if (mDataSource->readAt(offset, formatSpec, 2) < 2) {
return NO_INIT;
}
mWaveFormat = U16_LE_AT(formatSpec);
if (mWaveFormat != WAVE_FORMAT_PCM
&& mWaveFormat != WAVE_FORMAT_ALAW
- && mWaveFormat != WAVE_FORMAT_MULAW) {
+ && mWaveFormat != WAVE_FORMAT_MULAW
+ && mWaveFormat != WAVE_FORMAT_EXTENSIBLE) {
return ERROR_UNSUPPORTED;
}
+ uint8_t fmtSize = 16;
+ if (mWaveFormat == WAVE_FORMAT_EXTENSIBLE) {
+ fmtSize = 40;
+ }
+ if (mDataSource->readAt(offset, formatSpec, fmtSize) < fmtSize) {
+ return NO_INIT;
+ }
+
mNumChannels = U16_LE_AT(&formatSpec[2]);
- if (mNumChannels != 1 && mNumChannels != 2) {
- return ERROR_UNSUPPORTED;
+ if (mWaveFormat != WAVE_FORMAT_EXTENSIBLE) {
+ if (mNumChannels != 1 && mNumChannels != 2) {
+ ALOGW("More than 2 channels (%d) in non-WAVE_EXT, unknown channel mask",
+ mNumChannels);
+ }
+ } else {
+ if (mNumChannels < 1 && mNumChannels > 8) {
+ return ERROR_UNSUPPORTED;
+ }
}
mSampleRate = U32_LE_AT(&formatSpec[4]);
@@ -186,7 +210,8 @@
mBitsPerSample = U16_LE_AT(&formatSpec[14]);
- if (mWaveFormat == WAVE_FORMAT_PCM) {
+ if (mWaveFormat == WAVE_FORMAT_PCM
+ || mWaveFormat == WAVE_FORMAT_EXTENSIBLE) {
if (mBitsPerSample != 8 && mBitsPerSample != 16
&& mBitsPerSample != 24) {
return ERROR_UNSUPPORTED;
@@ -199,6 +224,42 @@
}
}
+ if (mWaveFormat == WAVE_FORMAT_EXTENSIBLE) {
+ uint16_t validBitsPerSample = U16_LE_AT(&formatSpec[18]);
+ if (validBitsPerSample != mBitsPerSample) {
+ ALOGE("validBits(%d) != bitsPerSample(%d) are not supported",
+ validBitsPerSample, mBitsPerSample);
+ return ERROR_UNSUPPORTED;
+ }
+
+ mChannelMask = U32_LE_AT(&formatSpec[20]);
+ ALOGV("numChannels=%d channelMask=0x%x", mNumChannels, mChannelMask);
+ if ((mChannelMask >> 18) != 0) {
+ ALOGE("invalid channel mask 0x%x", mChannelMask);
+ return ERROR_MALFORMED;
+ }
+
+ if ((mChannelMask != CHANNEL_MASK_USE_CHANNEL_ORDER)
+ && (popcount(mChannelMask) != mNumChannels)) {
+ ALOGE("invalid number of channels (%d) in channel mask (0x%x)",
+ popcount(mChannelMask), mChannelMask);
+ return ERROR_MALFORMED;
+ }
+
+ // In a WAVE_EXT header, the first two bytes of the GUID stored at byte 24 contain
+ // the sample format, using the same definitions as a regular WAV header
+ mWaveFormat = U16_LE_AT(&formatSpec[24]);
+ if (mWaveFormat != WAVE_FORMAT_PCM
+ && mWaveFormat != WAVE_FORMAT_ALAW
+ && mWaveFormat != WAVE_FORMAT_MULAW) {
+ return ERROR_UNSUPPORTED;
+ }
+ if (memcmp(&formatSpec[26], WAVEEXT_SUBFORMAT, 14)) {
+ ALOGE("unsupported GUID");
+ return ERROR_UNSUPPORTED;
+ }
+ }
+
mValidFormat = true;
} else if (!memcmp(chunkHeader, "data", 4)) {
if (mValidFormat) {
@@ -224,6 +285,7 @@
}
mTrackMeta->setInt32(kKeyChannelCount, mNumChannels);
+ mTrackMeta->setInt32(kKeyChannelMask, mChannelMask);
mTrackMeta->setInt32(kKeySampleRate, mSampleRate);
size_t bytesPerSample = mBitsPerSample >> 3;
diff --git a/media/libstagefright/include/WAVExtractor.h b/media/libstagefright/include/WAVExtractor.h
index ce1f33a..c567ccd 100644
--- a/media/libstagefright/include/WAVExtractor.h
+++ b/media/libstagefright/include/WAVExtractor.h
@@ -47,6 +47,7 @@
bool mValidFormat;
uint16_t mWaveFormat;
uint16_t mNumChannels;
+ uint32_t mChannelMask;
uint32_t mSampleRate;
uint16_t mBitsPerSample;
off64_t mDataOffset;
diff --git a/media/libstagefright/timedtext/TimedText3GPPSource.h b/media/libstagefright/timedtext/TimedText3GPPSource.h
index cb7e47c..dfc6418 100644
--- a/media/libstagefright/timedtext/TimedText3GPPSource.h
+++ b/media/libstagefright/timedtext/TimedText3GPPSource.h
@@ -28,26 +28,26 @@
class Parcel;
class TimedText3GPPSource : public TimedTextSource {
- public:
- TimedText3GPPSource(const sp<MediaSource>& mediaSource);
- virtual status_t start() { return mSource->start(); }
- virtual status_t stop() { return mSource->stop(); }
- virtual status_t read(
- int64_t *timeUs,
- Parcel *parcel,
- const MediaSource::ReadOptions *options = NULL);
- virtual status_t extractGlobalDescriptions(Parcel *parcel);
+public:
+ TimedText3GPPSource(const sp<MediaSource>& mediaSource);
+ virtual status_t start() { return mSource->start(); }
+ virtual status_t stop() { return mSource->stop(); }
+ virtual status_t read(
+ int64_t *timeUs,
+ Parcel *parcel,
+ const MediaSource::ReadOptions *options = NULL);
+ virtual status_t extractGlobalDescriptions(Parcel *parcel);
- protected:
- virtual ~TimedText3GPPSource();
+protected:
+ virtual ~TimedText3GPPSource();
- private:
- sp<MediaSource> mSource;
+private:
+ sp<MediaSource> mSource;
- status_t extractAndAppendLocalDescriptions(
- int64_t timeUs, const MediaBuffer *textBuffer, Parcel *parcel);
+ status_t extractAndAppendLocalDescriptions(
+ int64_t timeUs, const MediaBuffer *textBuffer, Parcel *parcel);
- DISALLOW_EVIL_CONSTRUCTORS(TimedText3GPPSource);
+ DISALLOW_EVIL_CONSTRUCTORS(TimedText3GPPSource);
};
} // namespace android
diff --git a/media/libstagefright/timedtext/TimedTextSRTSource.h b/media/libstagefright/timedtext/TimedTextSRTSource.h
index a0734d9..acc01f9 100644
--- a/media/libstagefright/timedtext/TimedTextSRTSource.h
+++ b/media/libstagefright/timedtext/TimedTextSRTSource.h
@@ -31,43 +31,43 @@
class Parcel;
class TimedTextSRTSource : public TimedTextSource {
- public:
- TimedTextSRTSource(const sp<DataSource>& dataSource);
- virtual status_t start();
- virtual status_t stop();
- virtual status_t read(
- int64_t *timeUs,
- Parcel *parcel,
- const MediaSource::ReadOptions *options = NULL);
+public:
+ TimedTextSRTSource(const sp<DataSource>& dataSource);
+ virtual status_t start();
+ virtual status_t stop();
+ virtual status_t read(
+ int64_t *timeUs,
+ Parcel *parcel,
+ const MediaSource::ReadOptions *options = NULL);
- protected:
- virtual ~TimedTextSRTSource();
+protected:
+ virtual ~TimedTextSRTSource();
- private:
- sp<DataSource> mSource;
+private:
+ sp<DataSource> mSource;
- struct TextInfo {
- int64_t endTimeUs;
- // The offset of the text in the original file.
- off64_t offset;
- int textLen;
- };
+ struct TextInfo {
+ int64_t endTimeUs;
+ // The offset of the text in the original file.
+ off64_t offset;
+ int textLen;
+ };
- int mIndex;
- KeyedVector<int64_t, TextInfo> mTextVector;
+ int mIndex;
+ KeyedVector<int64_t, TextInfo> mTextVector;
- void reset();
- status_t scanFile();
- status_t getNextSubtitleInfo(
- off64_t *offset, int64_t *startTimeUs, TextInfo *info);
- status_t readNextLine(off64_t *offset, AString *data);
- status_t getText(
- const MediaSource::ReadOptions *options,
- AString *text, int64_t *startTimeUs, int64_t *endTimeUs);
- status_t extractAndAppendLocalDescriptions(
- int64_t timeUs, const AString &text, Parcel *parcel);
+ void reset();
+ status_t scanFile();
+ status_t getNextSubtitleInfo(
+ off64_t *offset, int64_t *startTimeUs, TextInfo *info);
+ status_t readNextLine(off64_t *offset, AString *data);
+ status_t getText(
+ const MediaSource::ReadOptions *options,
+ AString *text, int64_t *startTimeUs, int64_t *endTimeUs);
+ status_t extractAndAppendLocalDescriptions(
+ int64_t timeUs, const AString &text, Parcel *parcel);
- DISALLOW_EVIL_CONSTRUCTORS(TimedTextSRTSource);
+ DISALLOW_EVIL_CONSTRUCTORS(TimedTextSRTSource);
};
} // namespace android
diff --git a/opengl/java/android/opengl/GLUtils.java b/opengl/java/android/opengl/GLUtils.java
index 125c56e..1527f22 100644
--- a/opengl/java/android/opengl/GLUtils.java
+++ b/opengl/java/android/opengl/GLUtils.java
@@ -227,9 +227,9 @@
/**
* Return a string for the EGL error code, or the hex representation
* if the error is unknown.
- *
+ *
* @param error The EGL error to convert into a String.
- *
+ *
* @return An error string corresponding to the EGL error code.
*/
public static String getEGLErrorString(int error) {
@@ -269,6 +269,14 @@
}
}
+ /**
+ * Enable tracing of OpenGL functions for this application.
+ * @hide
+ */
+ public static void enableTracing() {
+ native_enableTracing();
+ }
+
native private static void nativeClassInit();
native private static int native_getInternalFormat(Bitmap bitmap);
@@ -277,4 +285,5 @@
Bitmap bitmap, int type, int border);
native private static int native_texSubImage2D(int target, int level, int xoffset, int yoffset,
Bitmap bitmap, int format, int type);
+ native private static void native_enableTracing();
}
diff --git a/packages/SettingsProvider/res/values-in/strings.xml b/packages/SettingsProvider/res/values-in/strings.xml
index d5aea43..bed20eb 100644
--- a/packages/SettingsProvider/res/values-in/strings.xml
+++ b/packages/SettingsProvider/res/values-in/strings.xml
@@ -19,5 +19,5 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="app_label" msgid="4567566098528588863">"Pengaturan Penyimpanan"</string>
+ <string name="app_label" msgid="4567566098528588863">"Setelan Penyimpanan"</string>
</resources>
diff --git a/packages/SystemUI/res/values-in/strings.xml b/packages/SystemUI/res/values-in/strings.xml
index 1e82646..93d8675 100644
--- a/packages/SystemUI/res/values-in/strings.xml
+++ b/packages/SystemUI/res/values-in/strings.xml
@@ -39,7 +39,7 @@
<string name="battery_low_percent_format" msgid="1077244949318261761">"<xliff:g id="NUMBER">%d%%</xliff:g> tersisa"</string>
<string name="invalid_charger" msgid="4549105996740522523">"Pengisian daya USB tidak didukung."\n"Gunakan hanya pengisi daya yang disediakan."</string>
<string name="battery_low_why" msgid="7279169609518386372">"Penggunaan baterai"</string>
- <string name="status_bar_settings_settings_button" msgid="3023889916699270224">"Pengaturan"</string>
+ <string name="status_bar_settings_settings_button" msgid="3023889916699270224">"Setelan"</string>
<string name="status_bar_settings_wifi_button" msgid="1733928151698311923">"Wi-Fi"</string>
<string name="status_bar_settings_airplane" msgid="4879879698500955300">"Mode pesawat"</string>
<string name="status_bar_settings_auto_rotation" msgid="3790482541357798421">"Putar layar secara otomatis"</string>
@@ -118,7 +118,7 @@
<string name="accessibility_bluetooth_tether" msgid="4102784498140271969">"Penambatan bluetooth."</string>
<string name="accessibility_airplane_mode" msgid="834748999790763092">"Mode pesawat."</string>
<string name="accessibility_battery_level" msgid="7451474187113371965">"Baterai <xliff:g id="NUMBER">%d</xliff:g> persen."</string>
- <string name="accessibility_settings_button" msgid="799583911231893380">"Pengaturan sistem."</string>
+ <string name="accessibility_settings_button" msgid="799583911231893380">"Setelan sistem."</string>
<string name="accessibility_notifications_button" msgid="4498000369779421892">"Pemberitahuan."</string>
<string name="accessibility_remove_notification" msgid="3603099514902182350">"Menghapus pemberitahuan."</string>
<string name="accessibility_gps_enabled" msgid="3511469499240123019">"GPS diaktifkan."</string>
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
index d33ed3f..6574c7d 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
@@ -304,6 +304,8 @@
if (DEBUG) {
Slog.d(TAG, "reorient(): rot=" + mDisplay.getRotation());
}
+
+ setNavigationIconHints(mNavigationIconHints, true);
}
@Override
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
index 1763674..e0a0d2d 100755
--- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -3832,7 +3832,8 @@
int result = ActivityManagerNative.getDefault()
.startActivity(null, dock,
dock.resolveTypeIfNeeded(mContext.getContentResolver()),
- null, 0, null, null, 0, true /* onlyIfNeeded*/, false,
+ null, 0, null, null, 0, true /* onlyIfNeeded*/,
+ false /* debug */, false /* openglTrace */,
null, null, false);
if (result == IActivityManager.START_RETURN_INTENT_TO_CALLER) {
return false;
@@ -3842,7 +3843,8 @@
int result = ActivityManagerNative.getDefault()
.startActivity(null, mHomeIntent,
mHomeIntent.resolveTypeIfNeeded(mContext.getContentResolver()),
- null, 0, null, null, 0, true /* onlyIfNeeded*/, false,
+ null, 0, null, null, 0, true /* onlyIfNeeded*/,
+ false /* debug */, false /* openglTrace */,
null, null, false);
if (result == IActivityManager.START_RETURN_INTENT_TO_CALLER) {
return false;
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index f94ab84..fad7087 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -723,8 +723,9 @@
AutoMutex lock(mHardwareLock);
mHardwareStatus = AUDIO_HW_GET_MASTER_VOLUME;
- assert(NULL != mPrimaryHardwareDev);
- assert(NULL != mPrimaryHardwareDev->get_master_volume);
+ ALOG_ASSERT((NULL != mPrimaryHardwareDev) &&
+ (NULL != mPrimaryHardwareDev->get_master_volume),
+ "can't get master volume");
mPrimaryHardwareDev->get_master_volume(mPrimaryHardwareDev, &ret_val);
mHardwareStatus = AUDIO_HW_IDLE;
@@ -1463,8 +1464,9 @@
// but it would be safer to explicitly pass initial masterVolume as parameter
mMasterVolume(audioFlinger->masterVolumeSW_l()),
mLastWriteTime(0), mNumWrites(0), mNumDelayedWrites(0), mInWrite(false),
- // mMixerStatus
- mPrevMixerStatus(MIXER_IDLE)
+ mMixerStatus(MIXER_IDLE),
+ mPrevMixerStatus(MIXER_IDLE),
+ standbyDelay(AudioFlinger::mStandbyTimeInNsecs)
{
snprintf(mName, kNameLength, "AudioOut_%X", id);
@@ -1997,14 +1999,8 @@
Vector< sp<Track> > tracksToRemove;
standbyTime = systemTime();
- mixBufferSize = mFrameCount * mFrameSize;
// MIXER
- // FIXME: Relaxed timing because of a certain device that can't meet latency
- // Should be reduced to 2x after the vendor fixes the driver issue
- // increase threshold again due to low power audio mode. The way this warning threshold is
- // calculated and its usefulness should be reconsidered anyway.
- nsecs_t maxPeriod = seconds(mFrameCount) / mSampleRate * 15;
nsecs_t lastWarning = 0;
if (mType == MIXER) {
longStandbyExit = false;
@@ -2014,8 +2010,7 @@
// FIXME could this be made local to while loop?
writeFrames = 0;
- activeSleepTime = activeSleepTimeUs();
- idleSleepTime = idleSleepTimeUs();
+ cacheParameters_l();
sleepTime = idleSleepTime;
if (mType == MIXER) {
@@ -2025,13 +2020,6 @@
// MIXER
CpuStats cpuStats;
- // DIRECT
-if (mType == DIRECT) {
- // use shorter standby delay as on normal output to release
- // hardware resources as soon as possible
- standbyDelay = microseconds(activeSleepTime*2);
-}
-
acquireWakeLock();
while (!exitPending())
@@ -2044,31 +2032,12 @@
processConfigEvents();
- mMixerStatus = MIXER_IDLE;
{ // scope for mLock
Mutex::Autolock _l(mLock);
if (checkForNewParameters_l()) {
- mixBufferSize = mFrameCount * mFrameSize;
-
-if (mType == MIXER) {
- // FIXME: Relaxed timing because of a certain device that can't meet latency
- // Should be reduced to 2x after the vendor fixes the driver issue
- // increase threshold again due to low power audio mode. The way this warning
- // threshold is calculated and its usefulness should be reconsidered anyway.
- maxPeriod = seconds(mFrameCount) / mSampleRate * 15;
-}
-
- updateWaitTime_l();
-
- activeSleepTime = activeSleepTimeUs();
- idleSleepTime = idleSleepTimeUs();
-
-if (mType == DIRECT) {
- standbyDelay = microseconds(activeSleepTime*2);
-}
-
+ cacheParameters_l();
}
saveOutputTracks();
@@ -2103,19 +2072,11 @@
checkSilentMode_l();
-if (mType == MIXER || mType == DUPLICATING) {
- standbyTime = systemTime() + mStandbyTimeInNsecs;
-}
-
-if (mType == DIRECT) {
standbyTime = systemTime() + standbyDelay;
-}
-
sleepTime = idleSleepTime;
-
-if (mType == MIXER) {
- sleepTimeShift = 0;
-}
+ if (mType == MIXER) {
+ sleepTimeShift = 0;
+ }
continue;
}
@@ -2261,7 +2222,7 @@
sleepTimeShift--;
}
sleepTime = 0;
- standbyTime = systemTime() + mStandbyTimeInNsecs;
+ standbyTime = systemTime() + standbyDelay;
//TODO: delay standby when effects have a tail
}
@@ -2548,6 +2509,32 @@
return mixerStatus;
}
+/*
+The derived values that are cached:
+ - mixBufferSize from frame count * frame size
+ - activeSleepTime from activeSleepTimeUs()
+ - idleSleepTime from idleSleepTimeUs()
+ - standbyDelay from mActiveSleepTimeUs (DIRECT only)
+ - maxPeriod from frame count and sample rate (MIXER only)
+
+The parameters that affect these derived values are:
+ - frame count
+ - frame size
+ - sample rate
+ - device type: A2DP or not
+ - device latency
+ - format: PCM or not
+ - active sleep time
+ - idle sleep time
+*/
+
+void AudioFlinger::PlaybackThread::cacheParameters_l()
+{
+ mixBufferSize = mFrameCount * mFrameSize;
+ activeSleepTime = activeSleepTimeUs();
+ idleSleepTime = idleSleepTimeUs();
+}
+
void AudioFlinger::MixerThread::invalidateTracks(audio_stream_type_t streamType)
{
ALOGV ("MixerThread::invalidateTracks() mixer %p, streamType %d, mTracks.size %d",
@@ -2718,6 +2705,17 @@
return (uint32_t)(((mFrameCount * 1000) / mSampleRate) * 1000);
}
+void AudioFlinger::MixerThread::cacheParameters_l()
+{
+ PlaybackThread::cacheParameters_l();
+
+ // FIXME: Relaxed timing because of a certain device that can't meet latency
+ // Should be reduced to 2x after the vendor fixes the driver issue
+ // increase threshold again due to low power audio mode. The way this warning
+ // threshold is calculated and its usefulness should be reconsidered anyway.
+ maxPeriod = seconds(mFrameCount) / mSampleRate * 15;
+}
+
// ----------------------------------------------------------------------------
AudioFlinger::DirectOutputThread::DirectOutputThread(const sp<AudioFlinger>& audioFlinger,
AudioStreamOut* output, audio_io_handle_t id, uint32_t device)
@@ -2731,80 +2729,6 @@
{
}
-void AudioFlinger::DirectOutputThread::applyVolume()
-{
- // Do not apply volume on compressed audio
- if (!audio_is_linear_pcm(mFormat)) {
- return;
- }
-
- // convert to signed 16 bit before volume calculation
- if (mFormat == AUDIO_FORMAT_PCM_8_BIT) {
- size_t count = mFrameCount * mChannelCount;
- uint8_t *src = (uint8_t *)mMixBuffer + count-1;
- int16_t *dst = mMixBuffer + count-1;
- while(count--) {
- *dst-- = (int16_t)(*src--^0x80) << 8;
- }
- }
-
- size_t frameCount = mFrameCount;
- int16_t *out = mMixBuffer;
- if (rampVolume) {
- if (mChannelCount == 1) {
- int32_t d = ((int32_t)leftVol - (int32_t)mLeftVolShort) << 16;
- int32_t vlInc = d / (int32_t)frameCount;
- int32_t vl = ((int32_t)mLeftVolShort << 16);
- do {
- out[0] = clamp16(mul(out[0], vl >> 16) >> 12);
- out++;
- vl += vlInc;
- } while (--frameCount);
-
- } else {
- int32_t d = ((int32_t)leftVol - (int32_t)mLeftVolShort) << 16;
- int32_t vlInc = d / (int32_t)frameCount;
- d = ((int32_t)rightVol - (int32_t)mRightVolShort) << 16;
- int32_t vrInc = d / (int32_t)frameCount;
- int32_t vl = ((int32_t)mLeftVolShort << 16);
- int32_t vr = ((int32_t)mRightVolShort << 16);
- do {
- out[0] = clamp16(mul(out[0], vl >> 16) >> 12);
- out[1] = clamp16(mul(out[1], vr >> 16) >> 12);
- out += 2;
- vl += vlInc;
- vr += vrInc;
- } while (--frameCount);
- }
- } else {
- if (mChannelCount == 1) {
- do {
- out[0] = clamp16(mul(out[0], leftVol) >> 12);
- out++;
- } while (--frameCount);
- } else {
- do {
- out[0] = clamp16(mul(out[0], leftVol) >> 12);
- out[1] = clamp16(mul(out[1], rightVol) >> 12);
- out += 2;
- } while (--frameCount);
- }
- }
-
- // convert back to unsigned 8 bit after volume calculation
- if (mFormat == AUDIO_FORMAT_PCM_8_BIT) {
- size_t count = mFrameCount * mChannelCount;
- int16_t *src = mMixBuffer;
- uint8_t *dst = (uint8_t *)mMixBuffer;
- while(count--) {
- *dst++ = (uint8_t)(((int32_t)*src++ + (1<<7)) >> 8)^0x80;
- }
- }
-
- mLeftVolShort = leftVol;
- mRightVolShort = rightVol;
-}
-
AudioFlinger::PlaybackThread::mixer_state AudioFlinger::DirectOutputThread::prepareTracks_l(
Vector< sp<Track> > *tracksToRemove
)
@@ -2932,7 +2856,7 @@
tracksToRemove->add(trackToRemove);
mActiveTracks.remove(trackToRemove);
if (!mEffectChains.isEmpty()) {
- ALOGV("stopping track on chain %p for session Id: %d", effectChains[0].get(),
+ ALOGV("stopping track on chain %p for session Id: %d", mEffectChains[0].get(),
trackToRemove->sessionId());
mEffectChains[0]->decActiveTrackCnt();
}
@@ -2965,7 +2889,79 @@
sleepTime = 0;
standbyTime = systemTime() + standbyDelay;
mActiveTrack.clear();
- applyVolume();
+
+ // apply volume
+
+ // Do not apply volume on compressed audio
+ if (!audio_is_linear_pcm(mFormat)) {
+ return;
+ }
+
+ // convert to signed 16 bit before volume calculation
+ if (mFormat == AUDIO_FORMAT_PCM_8_BIT) {
+ size_t count = mFrameCount * mChannelCount;
+ uint8_t *src = (uint8_t *)mMixBuffer + count-1;
+ int16_t *dst = mMixBuffer + count-1;
+ while(count--) {
+ *dst-- = (int16_t)(*src--^0x80) << 8;
+ }
+ }
+
+ frameCount = mFrameCount;
+ int16_t *out = mMixBuffer;
+ if (rampVolume) {
+ if (mChannelCount == 1) {
+ int32_t d = ((int32_t)leftVol - (int32_t)mLeftVolShort) << 16;
+ int32_t vlInc = d / (int32_t)frameCount;
+ int32_t vl = ((int32_t)mLeftVolShort << 16);
+ do {
+ out[0] = clamp16(mul(out[0], vl >> 16) >> 12);
+ out++;
+ vl += vlInc;
+ } while (--frameCount);
+
+ } else {
+ int32_t d = ((int32_t)leftVol - (int32_t)mLeftVolShort) << 16;
+ int32_t vlInc = d / (int32_t)frameCount;
+ d = ((int32_t)rightVol - (int32_t)mRightVolShort) << 16;
+ int32_t vrInc = d / (int32_t)frameCount;
+ int32_t vl = ((int32_t)mLeftVolShort << 16);
+ int32_t vr = ((int32_t)mRightVolShort << 16);
+ do {
+ out[0] = clamp16(mul(out[0], vl >> 16) >> 12);
+ out[1] = clamp16(mul(out[1], vr >> 16) >> 12);
+ out += 2;
+ vl += vlInc;
+ vr += vrInc;
+ } while (--frameCount);
+ }
+ } else {
+ if (mChannelCount == 1) {
+ do {
+ out[0] = clamp16(mul(out[0], leftVol) >> 12);
+ out++;
+ } while (--frameCount);
+ } else {
+ do {
+ out[0] = clamp16(mul(out[0], leftVol) >> 12);
+ out[1] = clamp16(mul(out[1], rightVol) >> 12);
+ out += 2;
+ } while (--frameCount);
+ }
+ }
+
+ // convert back to unsigned 8 bit after volume calculation
+ if (mFormat == AUDIO_FORMAT_PCM_8_BIT) {
+ size_t count = mFrameCount * mChannelCount;
+ int16_t *src = mMixBuffer;
+ uint8_t *dst = (uint8_t *)mMixBuffer;
+ while(count--) {
+ *dst++ = (uint8_t)(((int32_t)*src++ + (1<<7)) >> 8)^0x80;
+ }
+ }
+
+ mLeftVolShort = leftVol;
+ mRightVolShort = rightVol;
}
void AudioFlinger::DirectOutputThread::threadLoop_sleepTime()
@@ -3074,6 +3070,14 @@
return time;
}
+void AudioFlinger::DirectOutputThread::cacheParameters_l()
+{
+ PlaybackThread::cacheParameters_l();
+
+ // use shorter standby delay as on normal output to release
+ // hardware resources as soon as possible
+ standbyDelay = microseconds(activeSleepTime*2);
+}
// ----------------------------------------------------------------------------
@@ -3127,7 +3131,7 @@
void AudioFlinger::DuplicatingThread::threadLoop_write()
{
- standbyTime = systemTime() + mStandbyTimeInNsecs;
+ standbyTime = systemTime() + standbyDelay;
for (size_t i = 0; i < outputTracks.size(); i++) {
outputTracks[i]->write(mMixBuffer, writeFrames);
}
@@ -3223,6 +3227,14 @@
return (mWaitTimeMs * 1000) / 2;
}
+void AudioFlinger::DuplicatingThread::cacheParameters_l()
+{
+ // updateWaitTime_l() sets mWaitTimeMs, which affects activeSleepTimeUs(), so call it first
+ updateWaitTime_l();
+
+ MixerThread::cacheParameters_l();
+}
+
// ----------------------------------------------------------------------------
// TrackBase constructor must be called with AudioFlinger::mLock held
@@ -3873,7 +3885,7 @@
{
Mutex::Autolock mttLock(mMediaTimeTransformLock);
- assert(mMediaTimeTransformValid);
+ ALOG_ASSERT(mMediaTimeTransformValid, "media time transform invalid");
if (mMediaTimeTransform.a_to_b_denom == 0) {
// the transform represents a pause, so yield silence
@@ -5475,7 +5487,7 @@
if (thread->type() != ThreadBase::DUPLICATING) {
AudioStreamOut *out = thread->clearOutput();
- assert(out != NULL);
+ ALOG_ASSERT(out != NULL, "out shouldn't be NULL");
// from now on thread->mOutput is NULL
out->hwDev->close_output_stream(out->hwDev, out->stream);
delete out;
@@ -5618,7 +5630,7 @@
// but the ThreadBase container still exists.
AudioStreamIn *in = thread->clearInput();
- assert(in != NULL);
+ ALOG_ASSERT(in != NULL, "in shouldn't be NULL");
// from now on thread->mInput is NULL
in->hwDev->close_input_stream(in->hwDev, in->stream);
delete in;
diff --git a/services/audioflinger/AudioFlinger.h b/services/audioflinger/AudioFlinger.h
index 38fff8c..f3c8dd2 100644
--- a/services/audioflinger/AudioFlinger.h
+++ b/services/audioflinger/AudioFlinger.h
@@ -73,7 +73,7 @@
public BinderService<AudioFlinger>,
public BnAudioFlinger
{
- friend class BinderService<AudioFlinger>;
+ friend class BinderService<AudioFlinger>; // for AudioFlinger()
public:
static const char* getServiceName() { return "media.audio_flinger"; }
@@ -222,6 +222,8 @@
audio_hw_device_t* findSuitableHwDev_l(uint32_t devices);
void purgeStaleEffects_l();
+ // standby delay for MIXER and DUPLICATING playback threads is read from property
+ // ro.audio.flinger_standbytime_ms or defaults to kDefaultStandbyTimeInNsecs
static nsecs_t mStandbyTimeInNsecs;
// Internal dump utilites.
@@ -340,13 +342,6 @@
int sessionId() const { return mSessionId; }
protected:
- friend class ThreadBase;
- friend class RecordHandle;
- friend class PlaybackThread;
- friend class RecordThread;
- friend class MixerThread;
- friend class DirectOutputThread;
-
TrackBase(const TrackBase&);
TrackBase& operator = (const TrackBase&);
@@ -532,15 +527,7 @@
// check if some effects must be suspended when an effect chain is added
void checkSuspendOnAddEffectChain_l(const sp<EffectChain>& chain);
- friend class AudioFlinger;
- friend class Track;
- friend class TrackBase;
- friend class PlaybackThread;
- friend class MixerThread;
- friend class DirectOutputThread;
- friend class DuplicatingThread;
- friend class RecordThread;
- friend class RecordTrack;
+ friend class AudioFlinger; // for mEffectChains
const type_t mType;
@@ -655,8 +642,7 @@
int auxEffectId() const { return mAuxEffectId; }
protected:
- friend class ThreadBase;
- friend class TrackHandle;
+ // for numerous
friend class PlaybackThread;
friend class MixerThread;
friend class DirectOutputThread;
@@ -685,7 +671,9 @@
return (mStreamType == AUDIO_STREAM_CNT);
}
+ public:
virtual bool isTimedTrack() const { return false; }
+ protected:
// we don't really need a lock for these
volatile bool mMute;
@@ -824,7 +812,7 @@
audio_io_handle_t id, uint32_t device, type_t type);
virtual ~PlaybackThread();
- virtual status_t dump(int fd, const Vector<String16>& args);
+ status_t dump(int fd, const Vector<String16>& args);
// Thread virtuals
virtual status_t readyToRun();
@@ -840,12 +828,6 @@
virtual void threadLoop_write();
virtual void threadLoop_standby();
- // Non-trivial for DUPLICATING only
- virtual void updateWaitTime_l() { }
-
- // Non-trivial for DIRECT only
- virtual void applyVolume() { }
-
// prepareTracks_l reads and writes mActiveTracks, and also returns the
// pending set of tracks to remove via Vector 'tracksToRemove'. The caller is
// responsible for clearing or destroying this Vector later on, when it
@@ -856,7 +838,8 @@
virtual status_t initCheck() const { return (mOutput == NULL) ? NO_INIT : NO_ERROR; }
- virtual uint32_t latency() const;
+ // return estimated latency in milliseconds, as reported by HAL
+ uint32_t latency() const;
void setMasterVolume(float value);
void setMasterMute(bool muted);
@@ -887,7 +870,7 @@
bool isSuspended() const { return (mSuspended > 0); }
virtual String8 getParameters(const String8& keys);
virtual void audioConfigChanged_l(int event, int param = 0);
- virtual status_t getRenderPosition(uint32_t *halFrames, uint32_t *dspFrames);
+ status_t getRenderPosition(uint32_t *halFrames, uint32_t *dspFrames);
int16_t *mixBuffer() const { return mMixBuffer; };
virtual void detachAuxEffect_l(int effectId);
@@ -929,15 +912,12 @@
virtual void saveOutputTracks() { }
virtual void clearOutputTracks() { }
+ // Cache various calculated values, at threadLoop() entry and after a parameter change
+ virtual void cacheParameters_l();
+
private:
- friend class AudioFlinger;
- friend class OutputTrack;
- friend class Track;
- friend class TrackBase;
- friend class MixerThread;
- friend class DirectOutputThread;
- friend class DuplicatingThread;
+ friend class AudioFlinger; // for numerous
PlaybackThread(const Client&);
PlaybackThread& operator = (const PlaybackThread&);
@@ -964,8 +944,11 @@
// FIXME rename these former local variables of threadLoop to standard "m" names
nsecs_t standbyTime;
size_t mixBufferSize;
+
+ // cached copies of activeSleepTimeUs() and idleSleepTimeUs() made by cacheParameters_l()
uint32_t activeSleepTime;
uint32_t idleSleepTime;
+
uint32_t sleepTime;
// mixer status returned by prepareTracks_l()
@@ -976,8 +959,13 @@
// MIXER only
bool longStandbyExit;
uint32_t sleepTimeShift;
- // DIRECT only
+
+ // same as AudioFlinger::mStandbyTimeInNsecs except for DIRECT which uses a shorter value
nsecs_t standbyDelay;
+
+ // MIXER only
+ nsecs_t maxPeriod;
+
// DUPLICATING only
uint32_t writeFrames;
};
@@ -1003,6 +991,7 @@
virtual void deleteTrackName_l(int name);
virtual uint32_t idleSleepTimeUs();
virtual uint32_t suspendSleepTimeUs();
+ virtual void cacheParameters_l();
// threadLoop snippets
virtual void threadLoop_mix();
@@ -1028,6 +1017,7 @@
virtual uint32_t activeSleepTimeUs();
virtual uint32_t idleSleepTimeUs();
virtual uint32_t suspendSleepTimeUs();
+ virtual void cacheParameters_l();
// threadLoop snippets
virtual mixer_state prepareTracks_l(Vector< sp<Track> > *tracksToRemove);
@@ -1048,8 +1038,6 @@
uint16_t rightVol;
private:
- void applyVolume(); // FIXME inline into threadLoop_mix()
-
// prepareTracks_l() tells threadLoop_mix() the name of the single active track
sp<Track> mActiveTrack;
};
@@ -1075,9 +1063,12 @@
virtual void threadLoop_sleepTime();
virtual void threadLoop_write();
virtual void threadLoop_standby();
+ virtual void cacheParameters_l();
+ private:
// called from threadLoop, addOutputTrack, removeOutputTrack
virtual void updateWaitTime_l();
+ protected:
virtual void saveOutputTracks();
virtual void clearOutputTracks();
private:
@@ -1109,8 +1100,6 @@
PlaybackThread *primaryPlaybackThread_l() const;
uint32_t primaryOutputDevice_l() const;
- friend class AudioBuffer;
-
// server side of the client's IAudioTrack
class TrackHandle : public android::BnAudioTrack {
public:
@@ -1135,10 +1124,6 @@
const sp<PlaybackThread::Track> mTrack;
};
- friend class Client;
- friend class PlaybackThread::Track;
-
-
void removeClient_l(pid_t pid);
void removeNotificationClient(pid_t pid);
@@ -1169,8 +1154,7 @@
void dump(char* buffer, size_t size);
private:
- friend class AudioFlinger;
- friend class RecordThread;
+ friend class AudioFlinger; // for mState
RecordTrack(const RecordTrack&);
RecordTrack& operator = (const RecordTrack&);
@@ -1352,8 +1336,7 @@
status_t dump(int fd, const Vector<String16>& args);
protected:
- friend class EffectHandle;
- friend class AudioFlinger;
+ friend class AudioFlinger; // for mHandles
bool mPinned;
// Maximum time allocated to effect engines to complete the turn off sequence
@@ -1437,8 +1420,7 @@
void dump(char* buffer, size_t size);
protected:
- friend class AudioFlinger;
- friend class EffectModule;
+ friend class AudioFlinger; // for mEffect, mHasControl, mEnabled
EffectHandle(const EffectHandle&);
EffectHandle& operator =(const EffectHandle&);
@@ -1536,7 +1518,7 @@
status_t dump(int fd, const Vector<String16>& args);
protected:
- friend class AudioFlinger;
+ friend class AudioFlinger; // for mThread, mEffects
EffectChain(const EffectChain&);
EffectChain& operator =(const EffectChain&);
@@ -1612,9 +1594,6 @@
int mCnt;
};
- friend class RecordThread;
- friend class PlaybackThread;
-
enum master_volume_support {
// MVS_NONE:
// Audio HAL has no support for master volume, either setting or
diff --git a/services/audioflinger/AudioMixer.cpp b/services/audioflinger/AudioMixer.cpp
index 2cec525..1ec238b 100644
--- a/services/audioflinger/AudioMixer.cpp
+++ b/services/audioflinger/AudioMixer.cpp
@@ -18,7 +18,6 @@
#define LOG_TAG "AudioMixer"
//#define LOG_NDEBUG 0
-#include <assert.h>
#include <stdint.h>
#include <string.h>
#include <stdlib.h>
@@ -29,6 +28,7 @@
#include <cutils/bitops.h>
#include <cutils/compiler.h>
+#include <utils/Debug.h>
#include <system/audio.h>
@@ -46,7 +46,7 @@
: mTrackNames(0), mSampleRate(sampleRate)
{
// AudioMixer is not yet capable of multi-channel beyond stereo
- assert(2 == MAX_NUM_CHANNELS);
+ COMPILE_TIME_ASSERT_FUNCTION_SCOPE(2 == MAX_NUM_CHANNELS);
LocalClock lc;
@@ -124,7 +124,7 @@
void AudioMixer::deleteTrackName(int name)
{
name -= TRACK0;
- assert(uint32_t(name) < MAX_NUM_TRACKS);
+ ALOG_ASSERT(uint32_t(name) < MAX_NUM_TRACKS, "bad track name %d", name);
ALOGV("deleteTrackName(%d)", name);
track_t& track(mState.tracks[ name ]);
if (track.enabled) {
@@ -146,7 +146,7 @@
void AudioMixer::enable(int name)
{
name -= TRACK0;
- assert(uint32_t(name) < MAX_NUM_TRACKS);
+ ALOG_ASSERT(uint32_t(name) < MAX_NUM_TRACKS, "bad track name %d", name);
track_t& track = mState.tracks[name];
if (!track.enabled) {
@@ -159,7 +159,7 @@
void AudioMixer::disable(int name)
{
name -= TRACK0;
- assert(uint32_t(name) < MAX_NUM_TRACKS);
+ ALOG_ASSERT(uint32_t(name) < MAX_NUM_TRACKS, "bad track name %d", name);
track_t& track = mState.tracks[name];
if (track.enabled) {
@@ -172,7 +172,7 @@
void AudioMixer::setParameter(int name, int target, int param, void *value)
{
name -= TRACK0;
- assert(uint32_t(name) < MAX_NUM_TRACKS);
+ ALOG_ASSERT(uint32_t(name) < MAX_NUM_TRACKS, "bad track name %d", name);
track_t& track = mState.tracks[name];
int valueInt = (int)value;
@@ -185,8 +185,9 @@
case CHANNEL_MASK: {
uint32_t mask = (uint32_t)value;
if (track.channelMask != mask) {
- uint8_t channelCount = popcount(mask);
- assert((channelCount <= MAX_NUM_CHANNELS) && (channelCount));
+ uint32_t channelCount = popcount(mask);
+ ALOG_ASSERT((channelCount <= MAX_NUM_CHANNELS) && (channelCount),
+ "bad channel count %u", channelCount);
track.channelMask = mask;
track.channelCount = channelCount;
ALOGV("setParameter(TRACK, CHANNEL_MASK, %x)", mask);
@@ -208,15 +209,14 @@
}
break;
default:
- // bad param
- assert(false);
+ LOG_FATAL("bad param");
}
break;
case RESAMPLE:
switch (param) {
case SAMPLE_RATE:
- assert(valueInt > 0);
+ ALOG_ASSERT(valueInt > 0, "bad sample rate %d", valueInt);
if (track.setResampler(uint32_t(valueInt), mSampleRate)) {
ALOGV("setParameter(RESAMPLE, SAMPLE_RATE, %u)",
uint32_t(valueInt));
@@ -228,8 +228,7 @@
invalidateState(1 << name);
break;
default:
- // bad param
- assert(false);
+ LOG_FATAL("bad param");
}
break;
@@ -257,7 +256,7 @@
}
break;
case AUXLEVEL:
- //assert(0 <= valueInt && valueInt <= MAX_GAIN_INT);
+ //ALOG_ASSERT(0 <= valueInt && valueInt <= MAX_GAIN_INT, "bad aux level %d", valueInt);
if (track.auxLevel != valueInt) {
ALOGV("setParameter(VOLUME, AUXLEVEL: %04x)", valueInt);
track.prevAuxLevel = track.auxLevel << 16;
@@ -277,14 +276,12 @@
}
break;
default:
- // bad param
- assert(false);
+ LOG_FATAL("bad param");
}
break;
default:
- // bad target
- assert(false);
+ LOG_FATAL("bad target");
}
}
@@ -335,7 +332,7 @@
void AudioMixer::setBufferProvider(int name, AudioBufferProvider* bufferProvider)
{
name -= TRACK0;
- assert(uint32_t(name) < MAX_NUM_TRACKS);
+ ALOG_ASSERT(uint32_t(name) < MAX_NUM_TRACKS, "bad track name %d", name);
mState.tracks[name].bufferProvider = bufferProvider;
}
@@ -979,9 +976,9 @@
// This method is only called when state->enabledTracks has exactly
// one bit set. The asserts below would verify this, but are commented out
// since the whole point of this method is to optimize performance.
- //assert(0 != state->enabledTracks);
+ //ALOG_ASSERT(0 != state->enabledTracks, "no tracks enabled");
const int i = 31 - __builtin_clz(state->enabledTracks);
- //assert((1 << i) == state->enabledTracks);
+ //ALOG_ASSERT((1 << i) == state->enabledTracks, "more than 1 track enabled");
const track_t& t = state->tracks[i];
AudioBufferProvider::Buffer& b(t.buffer);
diff --git a/services/input/InputDispatcher.cpp b/services/input/InputDispatcher.cpp
index 149c0d3..da3548f 100644
--- a/services/input/InputDispatcher.cpp
+++ b/services/input/InputDispatcher.cpp
@@ -15,6 +15,7 @@
*/
#define LOG_TAG "InputDispatcher"
+#define ATRACE_TAG ATRACE_TAG_INPUT
//#define LOG_NDEBUG 0
@@ -44,6 +45,7 @@
#include "InputDispatcher.h"
+#include <utils/Trace.h>
#include <cutils/log.h>
#include <androidfw/PowerManager.h>
@@ -280,6 +282,7 @@
} else {
// Inbound queue has at least one entry.
mPendingEvent = mInboundQueue.dequeueAtHead();
+ traceInboundQueueLengthLocked();
}
// Poke user activity for this event.
@@ -379,6 +382,7 @@
bool InputDispatcher::enqueueInboundEventLocked(EventEntry* entry) {
bool needWake = mInboundQueue.isEmpty();
mInboundQueue.enqueueAtTail(entry);
+ traceInboundQueueLengthLocked();
switch (entry->type) {
case EventEntry::TYPE_KEY: {
@@ -572,6 +576,7 @@
EventEntry* entry = mInboundQueue.dequeueAtHead();
releaseInboundEventLocked(entry);
}
+ traceInboundQueueLengthLocked();
}
void InputDispatcher::releasePendingEventLocked() {
@@ -1867,6 +1872,7 @@
// Enqueue the dispatch entry.
connection->outboundQueue.enqueueAtTail(dispatchEntry);
+ traceOutboundQueueLengthLocked(connection);
}
void InputDispatcher::startDispatchCycleLocked(nsecs_t currentTime,
@@ -1978,7 +1984,9 @@
// Re-enqueue the event on the wait queue.
connection->outboundQueue.dequeue(dispatchEntry);
+ traceOutboundQueueLengthLocked(connection);
connection->waitQueue.enqueueAtTail(dispatchEntry);
+ traceWaitQueueLengthLocked(connection);
}
}
@@ -2009,7 +2017,9 @@
// Clear the dispatch queues.
drainDispatchQueueLocked(&connection->outboundQueue);
+ traceOutboundQueueLengthLocked(connection);
drainDispatchQueueLocked(&connection->waitQueue);
+ traceWaitQueueLengthLocked(connection);
// The connection appears to be unrecoverably broken.
// Ignore already broken or zombie connections.
@@ -3311,8 +3321,10 @@
// a few things.
if (dispatchEntry == connection->findWaitQueueEntry(seq)) {
connection->waitQueue.dequeue(dispatchEntry);
+ traceWaitQueueLengthLocked(connection);
if (restartEvent && connection->status == Connection::STATUS_NORMAL) {
connection->outboundQueue.enqueueAtHead(dispatchEntry);
+ traceOutboundQueueLengthLocked(connection);
} else {
releaseDispatchEntryLocked(dispatchEntry);
}
@@ -3498,6 +3510,28 @@
// TODO Write some statistics about how long we spend waiting.
}
+void InputDispatcher::traceInboundQueueLengthLocked() {
+ if (ATRACE_ENABLED()) {
+ ATRACE_INT("iq", mInboundQueue.count());
+ }
+}
+
+void InputDispatcher::traceOutboundQueueLengthLocked(const sp<Connection>& connection) {
+ if (ATRACE_ENABLED()) {
+ char counterName[40];
+ snprintf(counterName, sizeof(counterName), "oq:%s", connection->getWindowName());
+ ATRACE_INT(counterName, connection->outboundQueue.count());
+ }
+}
+
+void InputDispatcher::traceWaitQueueLengthLocked(const sp<Connection>& connection) {
+ if (ATRACE_ENABLED()) {
+ char counterName[40];
+ snprintf(counterName, sizeof(counterName), "wq:%s", connection->getWindowName());
+ ATRACE_INT(counterName, connection->waitQueue.count());
+ }
+}
+
void InputDispatcher::dump(String8& dump) {
AutoMutex _l(mLock);
@@ -4014,6 +4048,16 @@
InputDispatcher::Connection::~Connection() {
}
+const char* InputDispatcher::Connection::getWindowName() const {
+ if (inputWindowHandle != NULL) {
+ return inputWindowHandle->getName().string();
+ }
+ if (monitor) {
+ return "monitor";
+ }
+ return "?";
+}
+
const char* InputDispatcher::Connection::getStatusLabel() const {
switch (status) {
case STATUS_NORMAL:
diff --git a/services/input/InputDispatcher.h b/services/input/InputDispatcher.h
index 4b36480..91f7554 100644
--- a/services/input/InputDispatcher.h
+++ b/services/input/InputDispatcher.h
@@ -805,6 +805,7 @@
inline const char* getInputChannelName() const { return inputChannel->getName().string(); }
+ const char* getWindowName() const;
const char* getStatusLabel() const;
DispatchEntry* findWaitQueueEntry(uint32_t seq);
@@ -1069,6 +1070,9 @@
// Statistics gathering.
void updateDispatchStatisticsLocked(nsecs_t currentTime, const EventEntry* entry,
int32_t injectionResult, nsecs_t timeSpentWaitingForApplication);
+ void traceInboundQueueLengthLocked();
+ void traceOutboundQueueLengthLocked(const sp<Connection>& connection);
+ void traceWaitQueueLengthLocked(const sp<Connection>& connection);
};
/* Enqueues and dispatches input events, endlessly. */
diff --git a/services/java/com/android/server/CountryDetectorService.java b/services/java/com/android/server/CountryDetectorService.java
index ab61a3c..3112b50 100644
--- a/services/java/com/android/server/CountryDetectorService.java
+++ b/services/java/com/android/server/CountryDetectorService.java
@@ -81,6 +81,9 @@
private final static String TAG = "CountryDetector";
+ /** Whether to dump the state of the country detector service to bugreports */
+ private static final boolean DEBUG = false;
+
private final HashMap<IBinder, Receiver> mReceivers;
private final Context mContext;
private ComprehensiveCountryDetector mCountryDetector;
@@ -206,8 +209,10 @@
return mSystemReady;
}
+ @SuppressWarnings("unused")
@Override
protected void dump(FileDescriptor fd, PrintWriter fout, String[] args) {
+ if (!DEBUG) return;
try {
final Printer p = new PrintWriterPrinter(fout);
p.println("CountryDetectorService state:");
diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java
index fd968e0..94b9e91 100644
--- a/services/java/com/android/server/am/ActivityManagerService.java
+++ b/services/java/com/android/server/am/ActivityManagerService.java
@@ -16,6 +16,8 @@
package com.android.server.am;
+import static android.content.pm.PackageManager.PERMISSION_GRANTED;
+
import com.android.internal.R;
import com.android.internal.os.BatteryStatsImpl;
import com.android.internal.os.ProcessStats;
@@ -55,6 +57,7 @@
import android.content.ClipData;
import android.content.ComponentCallbacks2;
import android.content.ComponentName;
+import android.content.ContentProvider;
import android.content.ContentResolver;
import android.content.Context;
import android.content.DialogInterface;
@@ -746,6 +749,7 @@
ParcelFileDescriptor mProfileFd;
int mProfileType = 0;
boolean mAutoStopProfiler = false;
+ String mOpenGlTraceApp = null;
final RemoteCallbackList<IProcessObserver> mProcessObservers
= new RemoteCallbackList<IProcessObserver>();
@@ -2263,7 +2267,8 @@
Intent intent, String resolvedType, Uri[] grantedUriPermissions,
int grantedMode, IBinder resultTo,
String resultWho, int requestCode, boolean onlyIfNeeded, boolean debug,
- String profileFile, ParcelFileDescriptor profileFd, boolean autoStopProfiler) {
+ boolean openglTrace, String profileFile, ParcelFileDescriptor profileFd,
+ boolean autoStopProfiler) {
enforceNotIsolatedCaller("startActivity");
int userId = 0;
if (intent.getCategories() != null && intent.getCategories().contains(Intent.CATEGORY_HOME)) {
@@ -2281,24 +2286,25 @@
}
return mMainStack.startActivityMayWait(caller, -1, intent, resolvedType,
grantedUriPermissions, grantedMode, resultTo, resultWho, requestCode, onlyIfNeeded,
- debug, profileFile, profileFd, autoStopProfiler, null, null, userId);
+ debug, openglTrace, profileFile, profileFd, autoStopProfiler, null, null, userId);
}
public final WaitResult startActivityAndWait(IApplicationThread caller,
Intent intent, String resolvedType, Uri[] grantedUriPermissions,
int grantedMode, IBinder resultTo,
String resultWho, int requestCode, boolean onlyIfNeeded, boolean debug,
- String profileFile, ParcelFileDescriptor profileFd, boolean autoStopProfiler) {
+ boolean openglTrace, String profileFile, ParcelFileDescriptor profileFd,
+ boolean autoStopProfiler) {
enforceNotIsolatedCaller("startActivityAndWait");
WaitResult res = new WaitResult();
int userId = Binder.getOrigCallingUser();
mMainStack.startActivityMayWait(caller, -1, intent, resolvedType,
grantedUriPermissions, grantedMode, resultTo, resultWho,
- requestCode, onlyIfNeeded, debug, profileFile, profileFd, autoStopProfiler,
+ requestCode, onlyIfNeeded, debug, openglTrace, profileFile, profileFd, autoStopProfiler,
res, null, userId);
return res;
}
-
+
public final int startActivityWithConfig(IApplicationThread caller,
Intent intent, String resolvedType, Uri[] grantedUriPermissions,
int grantedMode, IBinder resultTo,
@@ -2308,7 +2314,7 @@
int ret = mMainStack.startActivityMayWait(caller, -1, intent, resolvedType,
grantedUriPermissions, grantedMode, resultTo, resultWho,
requestCode, onlyIfNeeded,
- debug, null, null, false, null, config, Binder.getOrigCallingUser());
+ debug, false, null, null, false, null, config, Binder.getOrigCallingUser());
return ret;
}
@@ -2451,7 +2457,7 @@
}
int ret = mMainStack.startActivityMayWait(null, uid, intent, resolvedType,
- null, 0, resultTo, resultWho, requestCode, onlyIfNeeded, false,
+ null, 0, resultTo, resultWho, requestCode, onlyIfNeeded, false, false,
null, null, false, null, null, userId);
return ret;
}
@@ -3833,6 +3839,11 @@
profileFd = mProfileFd;
profileAutoStop = mAutoStopProfiler;
}
+ boolean enableOpenGlTrace = false;
+ if (mOpenGlTraceApp != null && mOpenGlTraceApp.equals(processName)) {
+ enableOpenGlTrace = true;
+ mOpenGlTraceApp = null;
+ }
// If the app is being launched for restore or full backup, set it up specially
boolean isRestrictedBackupMode = false;
@@ -3858,8 +3869,8 @@
}
thread.bindApplication(processName, appInfo, providers,
app.instrumentationClass, profileFile, profileFd, profileAutoStop,
- app.instrumentationArguments, app.instrumentationWatcher, testMode,
- isRestrictedBackupMode || !normalMode, app.persistent,
+ app.instrumentationArguments, app.instrumentationWatcher, testMode,
+ enableOpenGlTrace, isRestrictedBackupMode || !normalMode, app.persistent,
new Configuration(mConfiguration), app.compat, getCommonServicesLocked(),
mCoreSettingsObserver.getCoreSettingsLocked());
updateLruProcessLocked(app, false, true);
@@ -4543,76 +4554,91 @@
throw new SecurityException(msg);
}
- private final boolean checkHoldingPermissionsLocked(IPackageManager pm,
- ProviderInfo pi, Uri uri, int uid, int modeFlags) {
- boolean readPerm = (modeFlags&Intent.FLAG_GRANT_READ_URI_PERMISSION) == 0;
- boolean writePerm = (modeFlags&Intent.FLAG_GRANT_WRITE_URI_PERMISSION) == 0;
+ /**
+ * Determine if UID is holding permissions required to access {@link Uri} in
+ * the given {@link ProviderInfo}. Final permission checking is always done
+ * in {@link ContentProvider}.
+ */
+ private final boolean checkHoldingPermissionsLocked(
+ IPackageManager pm, ProviderInfo pi, Uri uri, int uid, int modeFlags) {
if (DEBUG_URI_PERMISSION) Slog.v(TAG,
"checkHoldingPermissionsLocked: uri=" + uri + " uid=" + uid);
+
+ if (pi.applicationInfo.uid == uid) {
+ return true;
+ } else if (!pi.exported) {
+ return false;
+ }
+
+ boolean readMet = (modeFlags & Intent.FLAG_GRANT_READ_URI_PERMISSION) == 0;
+ boolean writeMet = (modeFlags & Intent.FLAG_GRANT_WRITE_URI_PERMISSION) == 0;
try {
- // Is the component private from the target uid?
- final boolean prv = !pi.exported && pi.applicationInfo.uid != uid;
-
- // Acceptable if the there is no read permission needed from the
- // target or the target is holding the read permission.
- if (!readPerm) {
- if ((!prv && pi.readPermission == null) ||
- (pm.checkUidPermission(pi.readPermission, uid)
- == PackageManager.PERMISSION_GRANTED)) {
- readPerm = true;
- }
+ // check if target holds top-level <provider> permissions
+ if (!readMet && pi.readPermission != null
+ && (pm.checkUidPermission(pi.readPermission, uid) == PERMISSION_GRANTED)) {
+ readMet = true;
+ }
+ if (!writeMet && pi.writePermission != null
+ && (pm.checkUidPermission(pi.writePermission, uid) == PERMISSION_GRANTED)) {
+ writeMet = true;
}
- // Acceptable if the there is no write permission needed from the
- // target or the target is holding the read permission.
- if (!writePerm) {
- if (!prv && (pi.writePermission == null) ||
- (pm.checkUidPermission(pi.writePermission, uid)
- == PackageManager.PERMISSION_GRANTED)) {
- writePerm = true;
- }
- }
+ // track if unprotected read/write is allowed; any denied
+ // <path-permission> below removes this ability
+ boolean allowDefaultRead = pi.readPermission == null;
+ boolean allowDefaultWrite = pi.writePermission == null;
- // Acceptable if there is a path permission matching the URI that
- // the target holds the permission on.
- PathPermission[] pps = pi.pathPermissions;
- if (pps != null && (!readPerm || !writePerm)) {
+ // check if target holds any <path-permission> that match uri
+ final PathPermission[] pps = pi.pathPermissions;
+ if (pps != null) {
final String path = uri.getPath();
int i = pps.length;
- while (i > 0 && (!readPerm || !writePerm)) {
+ while (i > 0 && (!readMet || !writeMet)) {
i--;
PathPermission pp = pps[i];
- if (!readPerm) {
- final String pprperm = pp.getReadPermission();
- if (DEBUG_URI_PERMISSION) Slog.v(TAG, "Checking read perm for "
- + pprperm + " for " + pp.getPath()
- + ": match=" + pp.match(path)
- + " check=" + pm.checkUidPermission(pprperm, uid));
- if (pprperm != null && pp.match(path) &&
- (pm.checkUidPermission(pprperm, uid)
- == PackageManager.PERMISSION_GRANTED)) {
- readPerm = true;
+ if (pp.match(path)) {
+ if (!readMet) {
+ final String pprperm = pp.getReadPermission();
+ if (DEBUG_URI_PERMISSION) Slog.v(TAG, "Checking read perm for "
+ + pprperm + " for " + pp.getPath()
+ + ": match=" + pp.match(path)
+ + " check=" + pm.checkUidPermission(pprperm, uid));
+ if (pprperm != null) {
+ if (pm.checkUidPermission(pprperm, uid) == PERMISSION_GRANTED) {
+ readMet = true;
+ } else {
+ allowDefaultRead = false;
+ }
+ }
}
- }
- if (!writePerm) {
- final String ppwperm = pp.getWritePermission();
- if (DEBUG_URI_PERMISSION) Slog.v(TAG, "Checking write perm "
- + ppwperm + " for " + pp.getPath()
- + ": match=" + pp.match(path)
- + " check=" + pm.checkUidPermission(ppwperm, uid));
- if (ppwperm != null && pp.match(path) &&
- (pm.checkUidPermission(ppwperm, uid)
- == PackageManager.PERMISSION_GRANTED)) {
- writePerm = true;
+ if (!writeMet) {
+ final String ppwperm = pp.getWritePermission();
+ if (DEBUG_URI_PERMISSION) Slog.v(TAG, "Checking write perm "
+ + ppwperm + " for " + pp.getPath()
+ + ": match=" + pp.match(path)
+ + " check=" + pm.checkUidPermission(ppwperm, uid));
+ if (ppwperm != null) {
+ if (pm.checkUidPermission(ppwperm, uid) == PERMISSION_GRANTED) {
+ writeMet = true;
+ } else {
+ allowDefaultWrite = false;
+ }
+ }
}
}
}
}
+
+ // grant unprotected <provider> read/write, if not blocked by
+ // <path-permission> above
+ if (allowDefaultRead) readMet = true;
+ if (allowDefaultWrite) writeMet = true;
+
} catch (RemoteException e) {
return false;
}
- return readPerm && writePerm;
+ return readMet && writeMet;
}
private final boolean checkUriPermissionLocked(Uri uri, int uid,
@@ -5819,6 +5845,11 @@
return providers;
}
+ /**
+ * Check if {@link ProcessRecord} has a possible chance at accessing the
+ * given {@link ProviderInfo}. Final permission checking is always done
+ * in {@link ContentProvider}.
+ */
private final String checkContentProviderPermissionLocked(
ProviderInfo cpi, ProcessRecord r) {
final int callingPid = (r != null) ? r.pid : Binder.getCallingPid();
@@ -6671,6 +6702,19 @@
}
}
+ void setOpenGlTraceApp(ApplicationInfo app, String processName) {
+ synchronized (this) {
+ boolean isDebuggable = "1".equals(SystemProperties.get(SYSTEM_DEBUGGABLE, "0"));
+ if (!isDebuggable) {
+ if ((app.flags&ApplicationInfo.FLAG_DEBUGGABLE) == 0) {
+ throw new SecurityException("Process not debuggable: " + app.packageName);
+ }
+ }
+
+ mOpenGlTraceApp = processName;
+ }
+ }
+
void setProfileApp(ApplicationInfo app, String processName, String profileFile,
ParcelFileDescriptor profileFd, boolean autoStopProfiler) {
synchronized (this) {
@@ -8625,6 +8669,9 @@
+ " mDebugTransient=" + mDebugTransient
+ " mOrigWaitForDebugger=" + mOrigWaitForDebugger);
}
+ if (mOpenGlTraceApp != null) {
+ pw.println(" mOpenGlTraceApp=" + mOpenGlTraceApp);
+ }
if (mProfileApp != null || mProfileProc != null || mProfileFile != null
|| mProfileFd != null) {
pw.println(" mProfileApp=" + mProfileApp + " mProfileProc=" + mProfileProc);
diff --git a/services/java/com/android/server/am/ActivityStack.java b/services/java/com/android/server/am/ActivityStack.java
index a4e573d..64d52ed 100644
--- a/services/java/com/android/server/am/ActivityStack.java
+++ b/services/java/com/android/server/am/ActivityStack.java
@@ -2828,7 +2828,8 @@
}
ActivityInfo resolveActivity(Intent intent, String resolvedType, boolean debug,
- String profileFile, ParcelFileDescriptor profileFd, boolean autoStopProfiler) {
+ boolean openglTrace, String profileFile, ParcelFileDescriptor profileFd,
+ boolean autoStopProfiler) {
// Collect information about the target of the Intent.
ActivityInfo aInfo;
try {
@@ -2857,6 +2858,12 @@
}
}
+ if (openglTrace) {
+ if (!aInfo.processName.equals("system")) {
+ mService.setOpenGlTraceApp(aInfo.applicationInfo, aInfo.processName);
+ }
+ }
+
if (profileFile != null) {
if (!aInfo.processName.equals("system")) {
mService.setProfileApp(aInfo.applicationInfo, aInfo.processName,
@@ -2871,7 +2878,7 @@
Intent intent, String resolvedType, Uri[] grantedUriPermissions,
int grantedMode, IBinder resultTo,
String resultWho, int requestCode, boolean onlyIfNeeded,
- boolean debug, String profileFile, ParcelFileDescriptor profileFd,
+ boolean debug, boolean openglTrace, String profileFile, ParcelFileDescriptor profileFd,
boolean autoStopProfiler,
WaitResult outResult, Configuration config, int userId) {
// Refuse possible leaked file descriptors
@@ -2884,7 +2891,7 @@
intent = new Intent(intent);
// Collect information about the target of the Intent.
- ActivityInfo aInfo = resolveActivity(intent, resolvedType, debug,
+ ActivityInfo aInfo = resolveActivity(intent, resolvedType, debug, openglTrace,
profileFile, profileFd, autoStopProfiler);
aInfo = mService.getActivityInfoForUser(aInfo, userId);
@@ -3074,7 +3081,7 @@
intent = new Intent(intent);
// Collect information about the target of the Intent.
- ActivityInfo aInfo = resolveActivity(intent, resolvedTypes[i], false,
+ ActivityInfo aInfo = resolveActivity(intent, resolvedTypes[i], false, false,
null, null, false);
// TODO: New, check if this is correct
aInfo = mService.getActivityInfoForUser(aInfo, userId);
diff --git a/services/java/com/android/server/location/ComprehensiveCountryDetector.java b/services/java/com/android/server/location/ComprehensiveCountryDetector.java
index 2d6a148..1026a0d 100755
--- a/services/java/com/android/server/location/ComprehensiveCountryDetector.java
+++ b/services/java/com/android/server/location/ComprehensiveCountryDetector.java
@@ -202,7 +202,7 @@
if (mDebugLogs.size() >= MAX_LENGTH_DEBUG_LOGS) {
mDebugLogs.poll();
}
- if (Log.isLoggable(TAG, Log.DEBUG)) {
+ if (DEBUG) {
Slog.d(TAG, country.toString());
}
mDebugLogs.add(country);
@@ -394,7 +394,7 @@
private void notifyIfCountryChanged(final Country country, final Country detectedCountry) {
if (detectedCountry != null && mListener != null
&& (country == null || !country.equals(detectedCountry))) {
- if (Log.isLoggable(TAG, Log.DEBUG)) {
+ if (DEBUG) {
Slog.d(TAG, "" + country + " --> " + detectedCountry);
}
notifyListener(detectedCountry);
diff --git a/services/java/com/android/server/wm/WindowState.java b/services/java/com/android/server/wm/WindowState.java
index 167746f..e11c87a 100644
--- a/services/java/com/android/server/wm/WindowState.java
+++ b/services/java/com/android/server/wm/WindowState.java
@@ -100,6 +100,8 @@
*/
int mRequestedWidth;
int mRequestedHeight;
+ int mLastRequestedWidth;
+ int mLastRequestedHeight;
int mLayer;
int mAnimLayer;
@@ -391,6 +393,8 @@
mSurface = null;
mRequestedWidth = 0;
mRequestedHeight = 0;
+ mLastRequestedWidth = 0;
+ mLastRequestedHeight = 0;
mXOffset = 0;
mYOffset = 0;
mLayer = 0;
@@ -458,6 +462,11 @@
mParentFrame.set(pf);
mContentChanged = true;
}
+ if (mRequestedWidth != mLastRequestedWidth || mRequestedHeight != mLastRequestedHeight) {
+ mLastRequestedWidth = mRequestedWidth;
+ mLastRequestedHeight = mRequestedHeight;
+ mContentChanged = true;
+ }
final Rect content = mContentFrame;
content.set(cf);
@@ -1701,6 +1710,10 @@
pw.print(prefix); pw.print("Requested w="); pw.print(mRequestedWidth);
pw.print(" h="); pw.print(mRequestedHeight);
pw.print(" mLayoutSeq="); pw.println(mLayoutSeq);
+ if (mRequestedWidth != mLastRequestedWidth || mRequestedHeight != mLastRequestedHeight) {
+ pw.print(prefix); pw.print("LastRequested w="); pw.print(mLastRequestedWidth);
+ pw.print(" h="); pw.println(mLastRequestedHeight);
+ }
if (mAttachedWindow != null || mLayoutAttached) {
pw.print(prefix); pw.print("mAttachedWindow="); pw.print(mAttachedWindow);
pw.print(" mLayoutAttached="); pw.println(mLayoutAttached);
diff --git a/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java b/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java
index 6e4dd58..5f1a014 100644
--- a/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java
+++ b/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java
@@ -231,7 +231,8 @@
internalDataEnabled &&
desiredPowerState &&
!mPendingRestartRadio &&
- !mCdmaPhone.needsOtaServiceProvisioning();
+ ((mPhone.getLteOnCdmaMode() == Phone.LTE_ON_CDMA_TRUE) ||
+ !mCdmaPhone.needsOtaServiceProvisioning());
if (!allowed && DBG) {
String reason = "";
if (!((psState == ServiceState.STATE_IN_SERVICE) || mAutoAttachOnCreation)) {
diff --git a/tests/SmokeTest/tests/AndroidManifest.xml b/tests/SmokeTest/tests/AndroidManifest.xml
index 517eb1e..cad37c5 100644
--- a/tests/SmokeTest/tests/AndroidManifest.xml
+++ b/tests/SmokeTest/tests/AndroidManifest.xml
@@ -18,20 +18,30 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.smoketest.tests">
- <!-- We add an application tag here just so that we can indicate that
- this package needs to link against the android.test library,
- which is needed when building test cases. -->
+ <!--
+ We add an application tag here just so that we can indicate that this package needs to link
+ against the android.test library, which is needed when building test cases.
+ -->
<application>
<uses-library android:name="android.test.runner" />
</application>
<!--
- This declares that this app uses the instrumentation test runner targeting
- the package of com.android.smoketest. To run the tests use the command:
- "adb shell am instrument -w com.android.smoketest.tests/android.test.InstrumentationTestRunner"
+ This declares that this app uses the instrumentation test runner targeting the package of
+ com.android.smoketest. To run the tests use the command:
+ `adb shell am instrument -w com.android.smoketest.tests/android.test.InstrumentationTestRunner`
-->
<instrumentation android:name="android.test.InstrumentationTestRunner"
android:targetPackage="com.android.smoketest"
android:label="System Smoke Tests"/>
+ <!--
+ This declares a method to run the instrumentation with a special runner, which will run each
+ app as a separate testcase. To do so, use the command:
+ `adb shell am instrument -w com.android.smoketest.tests/com.android.smoketest.SmokeTestRunner`
+ -->
+ <instrumentation android:name="com.android.smoketest.SmokeTestRunner"
+ android:targetPackage="com.android.smoketest"
+ android:label="System Smoke Tests"/>
+
</manifest>
diff --git a/tests/SmokeTest/tests/src/com/android/smoketest/ProcessErrorsTest.java b/tests/SmokeTest/tests/src/com/android/smoketest/ProcessErrorsTest.java
index 1a2dcb9..3efd658 100644
--- a/tests/SmokeTest/tests/src/com/android/smoketest/ProcessErrorsTest.java
+++ b/tests/SmokeTest/tests/src/com/android/smoketest/ProcessErrorsTest.java
@@ -16,8 +16,6 @@
package com.android.smoketest;
-import com.android.internal.os.RuntimeInit;
-
import android.app.ActivityManager;
import android.app.ActivityManager.ProcessErrorStateInfo;
import android.content.Context;
@@ -42,10 +40,18 @@
public class ProcessErrorsTest extends AndroidTestCase {
private static final String TAG = "ProcessErrorsTest";
-
+
+ private final Intent mHomeIntent;
+
protected ActivityManager mActivityManager;
protected PackageManager mPackageManager;
+ public ProcessErrorsTest() {
+ mHomeIntent = new Intent(Intent.ACTION_MAIN);
+ mHomeIntent.addCategory(Intent.CATEGORY_HOME);
+ mHomeIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ }
+
@Override
public void setUp() throws Exception {
super.setUp();
@@ -59,7 +65,7 @@
assertNotNull(mPackageManager);
}
- public void testNoProcessErrors() throws Exception {
+ public void testNoProcessErrorsAfterBoot() throws Exception {
final String reportMsg = checkForProcessErrors();
if (reportMsg != null) {
Log.w(TAG, reportMsg);
@@ -72,16 +78,80 @@
private String checkForProcessErrors() throws Exception {
List<ProcessErrorStateInfo> errList;
errList = mActivityManager.getProcessesInErrorState();
-
+
// note: this contains information about each process that is currently in an error
- // condition. if the list is empty (null) then "we're good".
-
+ // condition. if the list is empty (null) then "we're good".
+
// if the list is non-empty, then it's useful to report the contents of the list
final String reportMsg = reportListContents(errList);
return reportMsg;
}
/**
+ * A helper function to query the provided {@link PackageManager} for a list of Activities that
+ * can be launched from Launcher.
+ */
+ static List<ResolveInfo> getLauncherActivities(PackageManager pm) {
+ final Intent launchable = new Intent(Intent.ACTION_MAIN);
+ launchable.addCategory(Intent.CATEGORY_LAUNCHER);
+ final List<ResolveInfo> activities = pm.queryIntentActivities(launchable, 0);
+ return activities;
+ }
+
+ /**
+ * A helper function to create an {@link Intent} to run, given a {@link ResolveInfo} specifying
+ * an activity to be launched.
+ */
+ static Intent intentForActivity(ResolveInfo app) {
+ // build an Intent to launch the specified app
+ final ComponentName component = new ComponentName(app.activityInfo.packageName,
+ app.activityInfo.name);
+ final Intent intent = new Intent(Intent.ACTION_MAIN);
+ intent.setComponent(component);
+ intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ intent.addFlags(Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
+ return intent;
+ }
+
+ /**
+ * A method to run the specified Activity and return a {@link Collection} of the Activities that
+ * were in an error state, as listed by {@link ActivityManager.getProcessesInErrorState()}.
+ * <p />
+ * The method will launch the app, wait for 7 seconds, check for apps in the error state, send
+ * the Home intent, wait for 2 seconds, and then return.
+ */
+ public Collection<ProcessErrorStateInfo> runOneActivity(ResolveInfo app) {
+ final long appLaunchWait = 7000;
+ final long homeLaunchWait = 2000;
+
+ Log.i(TAG, String.format("Running activity %s/%s", app.activityInfo.packageName,
+ app.activityInfo.name));
+
+ // launch app, and wait 7 seconds for it to start/settle
+ final Intent intent = intentForActivity(app);
+ getContext().startActivity(intent);
+ try {
+ Thread.sleep(appLaunchWait);
+ } catch (InterruptedException e) {
+ // ignore
+ }
+
+ // See if there are any errors
+ final Collection<ProcessErrorStateInfo> errProcs =
+ mActivityManager.getProcessesInErrorState();
+
+ // Send the "home" intent and wait 2 seconds for us to get there
+ getContext().startActivity(mHomeIntent);
+ try {
+ Thread.sleep(homeLaunchWait);
+ } catch (InterruptedException e) {
+ // ignore
+ }
+
+ return errProcs;
+ }
+
+ /**
* A test that runs all Launcher-launchable activities and verifies that no ANRs or crashes
* happened while doing so.
* <p />
@@ -89,46 +159,12 @@
* FIXME: first app doesn't go away.
*/
public void testRunAllActivities() throws Exception {
- final Intent home = new Intent(Intent.ACTION_MAIN);
- home.addCategory(Intent.CATEGORY_HOME);
- home.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
-
- final Intent launchable = new Intent(Intent.ACTION_MAIN);
- launchable.addCategory(Intent.CATEGORY_LAUNCHER);
- final List<ResolveInfo> activities = mPackageManager.queryIntentActivities(launchable, 0);
final Set<ProcessError> errSet = new HashSet<ProcessError>();
- for (ResolveInfo info : activities) {
- Log.i(TAG, String.format("Got %s/%s", info.activityInfo.packageName,
- info.activityInfo.name));
-
- // build an Intent to launch the app
- final ComponentName component = new ComponentName(info.activityInfo.packageName,
- info.activityInfo.name);
- final Intent intent = new Intent(Intent.ACTION_MAIN);
- intent.setComponent(component);
- intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
-
- // launch app, and wait 7 seconds for it to start/settle
- getContext().startActivity(intent);
- try {
- Thread.sleep(7000);
- } catch (InterruptedException e) {
- // ignore
- }
-
- // See if there are any errors
- Collection<ProcessErrorStateInfo> procs = mActivityManager.getProcessesInErrorState();
- if (procs != null) {
- errSet.addAll(ProcessError.fromCollection(procs));
- }
-
- // Send the "home" intent and wait 2 seconds for us to get there
- getContext().startActivity(home);
- try {
- Thread.sleep(2000);
- } catch (InterruptedException e) {
- // ignore
+ for (ResolveInfo app : getLauncherActivities(mPackageManager)) {
+ final Collection<ProcessErrorStateInfo> errProcs = runOneActivity(app);
+ if (errProcs != null) {
+ errSet.addAll(ProcessError.fromCollection(errProcs));
}
}
@@ -138,7 +174,7 @@
}
}
- private String reportWrappedListContents(Collection<ProcessError> errList) {
+ String reportWrappedListContents(Collection<ProcessError> errList) {
List<ProcessErrorStateInfo> newList = new ArrayList<ProcessErrorStateInfo>(errList.size());
for (ProcessError err : errList) {
newList.add(err.info);
@@ -186,7 +222,7 @@
* A {@link ProcessErrorStateInfo} wrapper class that hashes how we want (so that equivalent
* crashes are considered equal).
*/
- private static class ProcessError {
+ static class ProcessError {
public final ProcessErrorStateInfo info;
public ProcessError(ProcessErrorStateInfo newInfo) {
diff --git a/tests/SmokeTest/tests/src/com/android/smoketest/SmokeTestRunner.java b/tests/SmokeTest/tests/src/com/android/smoketest/SmokeTestRunner.java
new file mode 100644
index 0000000..40b11c5
--- /dev/null
+++ b/tests/SmokeTest/tests/src/com/android/smoketest/SmokeTestRunner.java
@@ -0,0 +1,94 @@
+/*
+ * Copyright (C) 2012 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.smoketest;
+
+import android.app.ActivityManager;
+import android.app.ActivityManager.ProcessErrorStateInfo;
+import android.content.pm.PackageManager;
+import android.content.pm.ResolveInfo;
+import android.test.InstrumentationTestRunner;
+
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * A special test runner which does a test-start for each app in a separate testcase
+ */
+public class SmokeTestRunner extends InstrumentationTestRunner {
+
+ private static final String SUITE_NAME = "Smoke Test Suite";
+
+ /**
+ * Returns a single testcase for each app to launch
+ */
+ @Override
+ public TestSuite getAllTests() {
+ final TestSuite suite = new TestSuite(SUITE_NAME);
+
+ final PackageManager pm = getTargetContext().getPackageManager();
+ final List<ResolveInfo> apps = ProcessErrorsTest.getLauncherActivities(pm);
+
+ // FIXME: figure out some way to control the reported class names for these anonymous
+ // FIXME: class instances.
+
+ final TestCase setupTest = new ProcessErrorsTest() {
+ @Override
+ public void runTest() throws Exception {
+ testSetUpConditions();
+ }
+ };
+ setupTest.setName("testSetUpConditions");
+ suite.addTest(setupTest);
+
+ final TestCase postBootTest = new ProcessErrorsTest() {
+ @Override
+ public void runTest() throws Exception {
+ testNoProcessErrorsAfterBoot();
+ }
+ };
+ postBootTest.setName("testNoProcessErrorsAfterBoot");
+ suite.addTest(postBootTest);
+
+ for (final ResolveInfo app : apps) {
+ final TestCase appTest = new ProcessErrorsTest() {
+ @Override
+ public void runTest() throws Exception {
+ final Set<ProcessError> errSet = new HashSet<ProcessError>();
+ final Collection<ProcessErrorStateInfo> errProcs = runOneActivity(app);
+ if (errProcs != null) {
+ errSet.addAll(ProcessError.fromCollection(errProcs));
+ }
+
+ if (!errSet.isEmpty()) {
+ fail(String.format("Got %d errors: %s", errSet.size(),
+ reportWrappedListContents(errSet)));
+ }
+ }
+ };
+ appTest.setName(app.activityInfo.name);
+ suite.addTest(appTest);
+ }
+
+ return suite;
+ }
+}
+
diff --git a/tools/aapt/Command.cpp b/tools/aapt/Command.cpp
index c79e243..198fce4 100644
--- a/tools/aapt/Command.cpp
+++ b/tools/aapt/Command.cpp
@@ -636,6 +636,9 @@
bool hasWriteExternalStoragePermission = false;
bool hasReadPhoneStatePermission = false;
+ // If an app requests write storage, they will also get read storage.
+ bool hasReadExternalStoragePermission = false;
+
// This next group of variables is used to implement a group of
// backward-compatibility heuristics necessitated by the addition of
// some new uses-feature constants in 2.1 and 2.2. In most cases, the
@@ -999,6 +1002,8 @@
hasTelephonyPermission = true;
} else if (name == "android.permission.WRITE_EXTERNAL_STORAGE") {
hasWriteExternalStoragePermission = true;
+ } else if (name == "android.permission.READ_EXTERNAL_STORAGE") {
+ hasReadExternalStoragePermission = true;
} else if (name == "android.permission.READ_PHONE_STATE") {
hasReadPhoneStatePermission = true;
}
@@ -1163,12 +1168,19 @@
if (targetSdk < 4) {
if (!hasWriteExternalStoragePermission) {
printf("uses-permission:'android.permission.WRITE_EXTERNAL_STORAGE'\n");
+ hasWriteExternalStoragePermission = true;
}
if (!hasReadPhoneStatePermission) {
printf("uses-permission:'android.permission.READ_PHONE_STATE'\n");
}
}
+ // If the application has requested WRITE_EXTERNAL_STORAGE, we will
+ // force them to always take READ_EXTERNAL_STORAGE as well.
+ if (!hasReadExternalStoragePermission && hasWriteExternalStoragePermission) {
+ printf("uses-permission:'android.permission.READ_EXTERNAL_STORAGE'\n");
+ }
+
/* The following blocks handle printing "inferred" uses-features, based
* on whether related features or permissions are used by the app.
* Note that the various spec*Feature variables denote whether the
diff --git a/wifi/java/android/net/wifi/WifiWatchdogStateMachine.java b/wifi/java/android/net/wifi/WifiWatchdogStateMachine.java
index 5c9bef9..f31ee68 100644
--- a/wifi/java/android/net/wifi/WifiWatchdogStateMachine.java
+++ b/wifi/java/android/net/wifi/WifiWatchdogStateMachine.java
@@ -113,11 +113,14 @@
private static final int RSSI_MONITOR_COUNT = 5;
private int mRssiMonitorCount = 0;
- /* Avoid flapping */
- private static final int MIN_INTERVAL_AVOID_BSSID_MS = 60 * 1000;
- private String mLastAvoidedBssid;
- /* a -ve interval to allow avoidance at boot */
- private long mLastBssidAvoidedTime = -MIN_INTERVAL_AVOID_BSSID_MS;
+ /* Avoid flapping. The interval is changed over time as long as we continue to avoid
+ * under the max interval after which we reset the interval again */
+ private static final int MIN_INTERVAL_AVOID_BSSID_MS[] = {0, 30 * 1000, 60 * 1000,
+ 5 * 60 * 1000, 30 * 60 * 1000};
+ /* Index into the interval array MIN_INTERVAL_AVOID_BSSID_MS */
+ private int mMinIntervalArrayIndex = 0;
+
+ private long mLastBssidAvoidedTime;
private int mCurrentSignalLevel;
@@ -744,11 +747,13 @@
mCurrentSignalLevel = calculateSignalLevel(msg.arg1);
//Ready to avoid bssid again ?
long time = android.os.SystemClock.elapsedRealtime();
- if (time - mLastBssidAvoidedTime > MIN_INTERVAL_AVOID_BSSID_MS) {
+ if (time - mLastBssidAvoidedTime > MIN_INTERVAL_AVOID_BSSID_MS[
+ mMinIntervalArrayIndex]) {
handleRssiChange();
} else {
if (DBG) log("Early to avoid " + mWifiInfo + " time: " + time +
- " last avoided: " + mLastBssidAvoidedTime);
+ " last avoided: " + mLastBssidAvoidedTime +
+ " mMinIntervalArrayIndex: " + mMinIntervalArrayIndex);
}
break;
default:
@@ -892,7 +897,20 @@
private void sendPoorLinkDetected() {
if (DBG) log("send POOR_LINK_DETECTED " + mWifiInfo);
mWsmChannel.sendMessage(POOR_LINK_DETECTED);
- mLastAvoidedBssid = mWifiInfo.getBSSID();
+
+ long time = android.os.SystemClock.elapsedRealtime();
+ if (time - mLastBssidAvoidedTime > MIN_INTERVAL_AVOID_BSSID_MS[
+ MIN_INTERVAL_AVOID_BSSID_MS.length - 1]) {
+ mMinIntervalArrayIndex = 1;
+ if (DBG) log("set mMinIntervalArrayIndex to 1");
+ } else {
+
+ if (mMinIntervalArrayIndex < MIN_INTERVAL_AVOID_BSSID_MS.length - 1) {
+ mMinIntervalArrayIndex++;
+ }
+ if (DBG) log("mMinIntervalArrayIndex: " + mMinIntervalArrayIndex);
+ }
+
mLastBssidAvoidedTime = android.os.SystemClock.elapsedRealtime();
}