summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--api/current.xml205
-rw-r--r--cmds/pm/src/com/android/commands/pm/Pm.java59
-rw-r--r--core/java/android/animation/LayoutTransition.java20
-rw-r--r--core/java/android/content/AsyncTaskLoader.java28
-rw-r--r--core/java/android/content/pm/PackageParser.java6
-rw-r--r--core/java/android/os/AsyncTask.java83
-rw-r--r--core/java/android/util/CalendarUtils.java6
-rw-r--r--core/java/android/view/ViewGroup.java3
-rw-r--r--core/java/android/widget/AbsListView.java9
-rw-r--r--core/res/res/drawable-hdpi/dialog_bottom_holo_dark.9.pngbin4951 -> 4975 bytes
-rw-r--r--core/res/res/drawable-hdpi/dialog_bottom_holo_light.9.pngbin5220 -> 5083 bytes
-rw-r--r--core/res/res/drawable-hdpi/dialog_full_holo.9.pngbin6619 -> 0 bytes
-rw-r--r--core/res/res/drawable-hdpi/dialog_full_holo_dark.9.pngbin8974 -> 9201 bytes
-rw-r--r--core/res/res/drawable-hdpi/dialog_full_holo_light.9.pngbin19481 -> 8827 bytes
-rw-r--r--core/res/res/drawable-hdpi/dialog_middle_holo_dark.9.pngbin1715 -> 354 bytes
-rw-r--r--core/res/res/drawable-hdpi/dialog_middle_holo_light.9.pngbin1339 -> 352 bytes
-rw-r--r--core/res/res/drawable-hdpi/dialog_top_holo.9.pngbin44055 -> 0 bytes
-rw-r--r--core/res/res/drawable-hdpi/dialog_top_holo_dark.9.pngbin13835 -> 4888 bytes
-rw-r--r--core/res/res/drawable-hdpi/dialog_top_holo_light.9.pngbin13413 -> 5053 bytes
-rw-r--r--core/res/res/drawable-hdpi/progress_bg_holo_dark.9.pngbin313 -> 178 bytes
-rw-r--r--core/res/res/drawable-hdpi/progress_bg_holo_light.9.pngbin156 -> 175 bytes
-rw-r--r--core/res/res/drawable-hdpi/progress_primary_holo_dark.9.pngbin1618 -> 597 bytes
-rw-r--r--core/res/res/drawable-hdpi/progress_primary_holo_light.9.pngbin1654 -> 597 bytes
-rw-r--r--core/res/res/drawable-hdpi/progress_secondary_holo_dark.9.pngbin163 -> 188 bytes
-rw-r--r--core/res/res/drawable-hdpi/progress_secondary_holo_light.9.pngbin168 -> 188 bytes
-rw-r--r--core/res/res/drawable-hdpi/progressbar_indeterminate_holo1.pngbin0 -> 2759 bytes
-rw-r--r--core/res/res/drawable-hdpi/progressbar_indeterminate_holo2.pngbin0 -> 2854 bytes
-rw-r--r--core/res/res/drawable-hdpi/progressbar_indeterminate_holo3.pngbin0 -> 2844 bytes
-rw-r--r--core/res/res/drawable-hdpi/progressbar_indeterminate_holo4.pngbin0 -> 2777 bytes
-rw-r--r--core/res/res/drawable-hdpi/progressbar_indeterminate_holo5.pngbin0 -> 2797 bytes
-rw-r--r--core/res/res/drawable-hdpi/progressbar_indeterminate_holo6.pngbin0 -> 2836 bytes
-rw-r--r--core/res/res/drawable-hdpi/progressbar_indeterminate_holo7.pngbin0 -> 2819 bytes
-rw-r--r--core/res/res/drawable-hdpi/progressbar_indeterminate_holo8.pngbin0 -> 2811 bytes
-rw-r--r--core/res/res/drawable-hdpi/scrubber_control_disabled_holo.pngbin0 -> 1815 bytes
-rw-r--r--core/res/res/drawable-hdpi/scrubber_control_holo.pngbin3943 -> 3082 bytes
-rw-r--r--core/res/res/drawable-hdpi/scrubber_primary_holo.9.pngbin0 -> 180 bytes
-rw-r--r--core/res/res/drawable-hdpi/scrubber_secondary_holo.9.pngbin0 -> 180 bytes
-rw-r--r--core/res/res/drawable-hdpi/scrubber_track_holo_dark.9.pngbin316 -> 176 bytes
-rw-r--r--core/res/res/drawable-hdpi/scrubber_track_holo_light.9.pngbin326 -> 172 bytes
-rw-r--r--core/res/res/drawable-hdpi/toast_frame.9.pngbin2461 -> 6428 bytes
-rw-r--r--core/res/res/drawable-mdpi/dialog_bottom_holo_dark.9.pngbin2932 -> 2998 bytes
-rw-r--r--core/res/res/drawable-mdpi/dialog_bottom_holo_light.9.pngbin3072 -> 2888 bytes
-rw-r--r--core/res/res/drawable-mdpi/dialog_full_holo.9.pngbin3705 -> 0 bytes
-rw-r--r--core/res/res/drawable-mdpi/dialog_full_holo_dark.9.pngbin5215 -> 5278 bytes
-rw-r--r--core/res/res/drawable-mdpi/dialog_full_holo_light.9.pngbin12512 -> 4995 bytes
-rw-r--r--core/res/res/drawable-mdpi/dialog_middle_holo_dark.9.pngbin1119 -> 309 bytes
-rw-r--r--core/res/res/drawable-mdpi/dialog_middle_holo_light.9.pngbin932 -> 307 bytes
-rw-r--r--core/res/res/drawable-mdpi/dialog_top_holo.9.pngbin22907 -> 0 bytes
-rw-r--r--core/res/res/drawable-mdpi/dialog_top_holo_dark.9.pngbin9009 -> 2913 bytes
-rw-r--r--core/res/res/drawable-mdpi/dialog_top_holo_light.9.pngbin8747 -> 2838 bytes
-rw-r--r--core/res/res/drawable-mdpi/progress_bg_holo_dark.9.pngbin1170 -> 165 bytes
-rw-r--r--core/res/res/drawable-mdpi/progress_bg_holo_light.9.pngbin1074 -> 159 bytes
-rw-r--r--core/res/res/drawable-mdpi/progress_primary_holo_dark.9.pngbin2269 -> 425 bytes
-rw-r--r--core/res/res/drawable-mdpi/progress_primary_holo_light.9.pngbin2296 -> 425 bytes
-rw-r--r--core/res/res/drawable-mdpi/progress_secondary_holo_dark.9.pngbin1067 -> 174 bytes
-rw-r--r--core/res/res/drawable-mdpi/progress_secondary_holo_light.9.pngbin1080 -> 174 bytes
-rw-r--r--core/res/res/drawable-mdpi/progressbar_indeterminate_holo1.pngbin0 -> 1012 bytes
-rw-r--r--core/res/res/drawable-mdpi/progressbar_indeterminate_holo2.pngbin0 -> 1002 bytes
-rw-r--r--core/res/res/drawable-mdpi/progressbar_indeterminate_holo3.pngbin0 -> 1001 bytes
-rw-r--r--core/res/res/drawable-mdpi/progressbar_indeterminate_holo4.pngbin0 -> 960 bytes
-rw-r--r--core/res/res/drawable-mdpi/progressbar_indeterminate_holo5.pngbin0 -> 969 bytes
-rw-r--r--core/res/res/drawable-mdpi/progressbar_indeterminate_holo6.pngbin0 -> 956 bytes
-rw-r--r--core/res/res/drawable-mdpi/progressbar_indeterminate_holo7.pngbin0 -> 963 bytes
-rw-r--r--core/res/res/drawable-mdpi/progressbar_indeterminate_holo8.pngbin0 -> 958 bytes
-rw-r--r--core/res/res/drawable-mdpi/scrubber_control_disabled_holo.pngbin0 -> 1183 bytes
-rw-r--r--core/res/res/drawable-mdpi/scrubber_control_holo.pngbin2763 -> 1951 bytes
-rw-r--r--core/res/res/drawable-mdpi/scrubber_primary_holo.9.pngbin1074 -> 157 bytes
-rw-r--r--core/res/res/drawable-mdpi/scrubber_secondary_holo.9.pngbin1075 -> 159 bytes
-rw-r--r--core/res/res/drawable-mdpi/scrubber_track_holo_dark.9.pngbin1116 -> 167 bytes
-rw-r--r--core/res/res/drawable-mdpi/scrubber_track_holo_light.9.pngbin1120 -> 160 bytes
-rwxr-xr-xcore/res/res/drawable-mdpi/toast_frame.9.pngbin4328 -> 3568 bytes
-rw-r--r--core/res/res/drawable-xlarge-mdpi/ic_lock_idle_alarm.pngbin2831 -> 650 bytes
-rw-r--r--core/res/res/drawable-xlarge-mdpi/ic_lock_idle_charging.pngbin1762 -> 679 bytes
-rw-r--r--core/res/res/drawable-xlarge-mdpi/ic_lock_idle_lock.pngbin1554 -> 521 bytes
-rw-r--r--core/res/res/drawable-xlarge-mdpi/ic_lock_idle_low_battery.pngbin1782 -> 607 bytes
-rw-r--r--core/res/res/drawable/progress_indeterminate_horizontal_holo.xml30
-rw-r--r--core/res/res/drawable/scrubber_control_selector_holo.xml20
-rw-r--r--core/res/res/layout-xlarge/alert_dialog_holo.xml8
-rw-r--r--core/res/res/layout-xlarge/keyguard_screen_password_landscape.xml29
-rw-r--r--core/res/res/layout-xlarge/keyguard_screen_password_portrait.xml28
-rw-r--r--core/res/res/layout-xlarge/keyguard_screen_status_land.xml42
-rw-r--r--core/res/res/layout-xlarge/keyguard_screen_status_port.xml40
-rw-r--r--core/res/res/layout-xlarge/keyguard_screen_tab_unlock.xml18
-rw-r--r--core/res/res/layout-xlarge/keyguard_screen_tab_unlock_land.xml25
-rw-r--r--core/res/res/layout-xlarge/keyguard_screen_unlock_landscape.xml137
-rw-r--r--core/res/res/layout-xlarge/keyguard_screen_unlock_portrait.xml19
-rw-r--r--core/res/res/layout/alert_dialog_holo.xml8
-rw-r--r--core/res/res/layout/keyguard_screen_tab_unlock.xml15
-rw-r--r--core/res/res/layout/keyguard_screen_tab_unlock_land.xml15
-rw-r--r--core/res/res/layout/keyguard_screen_unlock_landscape.xml9
-rw-r--r--core/res/res/layout/keyguard_screen_unlock_portrait.xml9
-rw-r--r--core/res/res/values/colors.xml5
-rw-r--r--core/res/res/values/styles.xml3
-rw-r--r--graphics/java/android/renderscript/Mesh.java234
-rw-r--r--graphics/java/android/renderscript/Program.java69
-rw-r--r--graphics/java/android/renderscript/ProgramFragment.java13
-rw-r--r--graphics/java/android/renderscript/ProgramFragmentFixedFunction.java59
-rw-r--r--graphics/java/android/renderscript/ProgramVertex.java28
-rw-r--r--graphics/java/android/renderscript/ProgramVertexFixedFunction.java64
-rw-r--r--graphics/java/android/renderscript/Script.java102
-rw-r--r--graphics/java/android/renderscript/ScriptC.java18
-rw-r--r--packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java35
-rw-r--r--policy/src/com/android/internal/policy/impl/LockScreen.java41
-rw-r--r--policy/src/com/android/internal/policy/impl/PatternUnlockScreen.java8
-rw-r--r--policy/src/com/android/internal/policy/impl/StatusView.java158
-rw-r--r--services/java/com/android/server/PackageManagerService.java92
-rwxr-xr-x[-rw-r--r--]services/java/com/android/server/am/ActivityManagerService.java2
-rw-r--r--tools/layoutlib/bridge/src/android/graphics/Canvas_Delegate.java25
-rw-r--r--tools/layoutlib/bridge/src/android/graphics/Matrix_Delegate.java16
-rw-r--r--tools/layoutlib/bridge/src/android/graphics/Paint_Delegate.java2
-rw-r--r--tools/layoutlib/bridge/src/android/graphics/Path_Delegate.java30
-rw-r--r--tools/layoutlib/bridge/src/android/graphics/Typeface_Delegate.java10
-rw-r--r--tools/layoutlib/bridge/src/com/android/layoutlib/bridge/Bridge.java5
-rw-r--r--tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java50
114 files changed, 1265 insertions, 675 deletions
diff --git a/api/current.xml b/api/current.xml
index 7e81eb714707..4f0898e88ce1 100644
--- a/api/current.xml
+++ b/api/current.xml
@@ -170972,49 +170972,6 @@
deprecated="not deprecated"
visibility="public"
>
-<method name="bindAllocation"
- return="void"
- abstract="false"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<parameter name="va" type="android.renderscript.Allocation">
-</parameter>
-<parameter name="slot" type="int">
-</parameter>
-</method>
-<method name="invoke"
- return="void"
- abstract="false"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="protected"
->
-<parameter name="slot" type="int">
-</parameter>
-</method>
-<method name="invoke"
- return="void"
- abstract="false"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="protected"
->
-<parameter name="slot" type="int">
-</parameter>
-<parameter name="v" type="android.renderscript.FieldPacker">
-</parameter>
-</method>
<method name="setTimeZone"
return="void"
abstract="false"
@@ -171028,122 +170985,6 @@
<parameter name="timeZone" type="java.lang.String">
</parameter>
</method>
-<method name="setVar"
- return="void"
- abstract="false"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<parameter name="index" type="int">
-</parameter>
-<parameter name="v" type="float">
-</parameter>
-</method>
-<method name="setVar"
- return="void"
- abstract="false"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<parameter name="index" type="int">
-</parameter>
-<parameter name="v" type="double">
-</parameter>
-</method>
-<method name="setVar"
- return="void"
- abstract="false"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<parameter name="index" type="int">
-</parameter>
-<parameter name="v" type="int">
-</parameter>
-</method>
-<method name="setVar"
- return="void"
- abstract="false"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<parameter name="index" type="int">
-</parameter>
-<parameter name="v" type="long">
-</parameter>
-</method>
-<method name="setVar"
- return="void"
- abstract="false"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<parameter name="index" type="int">
-</parameter>
-<parameter name="v" type="boolean">
-</parameter>
-</method>
-<method name="setVar"
- return="void"
- abstract="false"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<parameter name="index" type="int">
-</parameter>
-<parameter name="o" type="android.renderscript.BaseObj">
-</parameter>
-</method>
-<method name="setVar"
- return="void"
- abstract="false"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<parameter name="index" type="int">
-</parameter>
-<parameter name="v" type="android.renderscript.FieldPacker">
-</parameter>
-</method>
-<field name="MAX_SLOT"
- type="int"
- transient="false"
- volatile="false"
- value="16"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
</class>
<class name="Script.Builder"
extends="java.lang.Object"
@@ -171267,26 +171108,6 @@
>
</field>
</class>
-<class name="Script.Invokable"
- extends="java.lang.Object"
- abstract="false"
- static="true"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<method name="execute"
- return="void"
- abstract="false"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-</method>
-</class>
<class name="ScriptC"
extends="android.renderscript.Script"
abstract="false"
@@ -171295,32 +171116,6 @@
deprecated="not deprecated"
visibility="public"
>
-<constructor name="ScriptC"
- type="android.renderscript.ScriptC"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="protected"
->
-<parameter name="id" type="int">
-</parameter>
-<parameter name="rs" type="android.renderscript.RenderScript">
-</parameter>
-</constructor>
-<constructor name="ScriptC"
- type="android.renderscript.ScriptC"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="protected"
->
-<parameter name="rs" type="android.renderscript.RenderScript">
-</parameter>
-<parameter name="resources" type="android.content.res.Resources">
-</parameter>
-<parameter name="resourceID" type="int">
-</parameter>
-</constructor>
</class>
<class name="Short2"
extends="java.lang.Object"
diff --git a/cmds/pm/src/com/android/commands/pm/Pm.java b/cmds/pm/src/com/android/commands/pm/Pm.java
index a236a3c722d5..cc6e739649d9 100644
--- a/cmds/pm/src/com/android/commands/pm/Pm.java
+++ b/cmds/pm/src/com/android/commands/pm/Pm.java
@@ -18,9 +18,11 @@ package com.android.commands.pm;
import com.android.internal.content.PackageHelper;
+import android.app.ActivityManagerNative;
import android.content.ComponentName;
import android.content.pm.ApplicationInfo;
import android.content.pm.FeatureInfo;
+import android.content.pm.IPackageDataObserver;
import android.content.pm.IPackageDeleteObserver;
import android.content.pm.IPackageInstallObserver;
import android.content.pm.IPackageManager;
@@ -100,6 +102,11 @@ public final class Pm {
return;
}
+ if ("clear".equals(op)) {
+ runClear();
+ return;
+ }
+
if ("enable".equals(op)) {
runSetEnabledSetting(PackageManager.COMPONENT_ENABLED_STATE_ENABLED);
return;
@@ -811,6 +818,55 @@ public final class Pm {
return obs.result;
}
+ class ClearDataObserver extends IPackageDataObserver.Stub {
+ boolean finished;
+ boolean result;
+
+ @Override
+ public void onRemoveCompleted(String packageName, boolean succeeded) throws RemoteException {
+ synchronized (this) {
+ finished = true;
+ result = succeeded;
+ notifyAll();
+ }
+ }
+
+ }
+
+ private void runClear() {
+ String pkg = nextArg();
+ if (pkg == null) {
+ System.err.println("Error: no package specified");
+ showUsage();
+ return;
+ }
+
+ ClearDataObserver obs = new ClearDataObserver();
+ try {
+ if (!ActivityManagerNative.getDefault().clearApplicationUserData(pkg, obs)) {
+ System.err.println("Failed");
+ }
+
+ synchronized (obs) {
+ while (!obs.finished) {
+ try {
+ obs.wait();
+ } catch (InterruptedException e) {
+ }
+ }
+ }
+
+ if (obs.result) {
+ System.err.println("Success");
+ } else {
+ System.err.println("Failed");
+ }
+ } catch (RemoteException e) {
+ System.err.println(e.toString());
+ System.err.println(PM_NOT_RUNNING_ERR);
+ }
+ }
+
private static String enabledSettingToString(int state) {
switch (state) {
case PackageManager.COMPONENT_ENABLED_STATE_DEFAULT:
@@ -946,6 +1002,7 @@ public final class Pm {
System.err.println(" pm path PACKAGE");
System.err.println(" pm install [-l] [-r] [-t] [-i INSTALLER_PACKAGE_NAME] [-s] [-f] PATH");
System.err.println(" pm uninstall [-k] PACKAGE");
+ System.err.println(" pm clear PACKAGE");
System.err.println(" pm enable PACKAGE_OR_COMPONENT");
System.err.println(" pm disable PACKAGE_OR_COMPONENT");
System.err.println(" pm setInstallLocation [0/auto] [1/internal] [2/external]");
@@ -991,6 +1048,8 @@ public final class Pm {
System.err.println(" -k: keep the data and cache directories around.");
System.err.println("after the package removal.");
System.err.println("");
+ System.err.println("The clear command deletes all data associated with a package.");
+ System.err.println("");
System.err.println("The enable and disable commands change the enabled state of");
System.err.println("a given package or component (written as \"package/class\").");
System.err.println("");
diff --git a/core/java/android/animation/LayoutTransition.java b/core/java/android/animation/LayoutTransition.java
index 8931450b3fa2..d534163725b9 100644
--- a/core/java/android/animation/LayoutTransition.java
+++ b/core/java/android/animation/LayoutTransition.java
@@ -600,6 +600,18 @@ public class LayoutTransition {
// Remove the animation from the cache when it ends
anim.addListener(new AnimatorListenerAdapter() {
private boolean canceled = false;
+
+ @Override
+ public void onAnimationStart(Animator animator) {
+ if (mListeners != null) {
+ for (TransitionListener listener : mListeners) {
+ listener.startTransition(LayoutTransition.this, parent, child,
+ changeReason == APPEARING ?
+ CHANGE_APPEARING : CHANGE_DISAPPEARING);
+ }
+ }
+ }
+
@Override
public void onAnimationCancel(Animator animator) {
// we remove canceled animations immediately, not here
@@ -607,11 +619,19 @@ public class LayoutTransition {
child.removeOnLayoutChangeListener(listener);
layoutChangeListenerMap.remove(child);
}
+
@Override
public void onAnimationEnd(Animator animator) {
if (!canceled) {
currentChangingAnimations.remove(child);
}
+ if (mListeners != null) {
+ for (TransitionListener listener : mListeners) {
+ listener.endTransition(LayoutTransition.this, parent, child,
+ changeReason == APPEARING ?
+ CHANGE_APPEARING : CHANGE_DISAPPEARING);
+ }
+ }
}
});
diff --git a/core/java/android/content/AsyncTaskLoader.java b/core/java/android/content/AsyncTaskLoader.java
index ec4e578725e9..98710558ce18 100644
--- a/core/java/android/content/AsyncTaskLoader.java
+++ b/core/java/android/content/AsyncTaskLoader.java
@@ -19,12 +19,11 @@ package android.content;
import android.os.AsyncTask;
import android.os.Handler;
import android.os.SystemClock;
-import android.util.Log;
import android.util.TimeUtils;
import java.io.FileDescriptor;
import java.io.PrintWriter;
-import java.util.concurrent.ExecutionException;
+import java.util.concurrent.CountDownLatch;
/**
* Abstract Loader that provides an {@link AsyncTask} to do the work.
@@ -33,6 +32,7 @@ import java.util.concurrent.ExecutionException;
*/
public abstract class AsyncTaskLoader<D> extends Loader<D> {
+
private static final String TAG = "AsyncTaskLoader";
final class LoadTask extends AsyncTask<Void, Void, D> implements Runnable {
@@ -40,6 +40,8 @@ public abstract class AsyncTaskLoader<D> extends Loader<D> {
D result;
boolean waiting;
+ private CountDownLatch done = new CountDownLatch(1);
+
/* Runs on a worker thread */
@Override
protected D doInBackground(Void... params) {
@@ -50,12 +52,20 @@ public abstract class AsyncTaskLoader<D> extends Loader<D> {
/* Runs on the UI thread */
@Override
protected void onPostExecute(D data) {
- AsyncTaskLoader.this.dispatchOnLoadComplete(this, data);
+ try {
+ AsyncTaskLoader.this.dispatchOnLoadComplete(this, data);
+ } finally {
+ done.countDown();
+ }
}
@Override
protected void onCancelled() {
- AsyncTaskLoader.this.dispatchOnCancelled(this, result);
+ try {
+ AsyncTaskLoader.this.dispatchOnCancelled(this, result);
+ } finally {
+ done.countDown();
+ }
}
@Override
@@ -209,7 +219,8 @@ public abstract class AsyncTaskLoader<D> extends Loader<D> {
/**
* Locks the current thread until the loader completes the current load
* operation. Returns immediately if there is no load operation running.
- * Should not be called from the UI thread.
+ * Should not be called from the UI thread: calling it from the UI
+ * thread would cause a deadlock.
* <p>
* Use for testing only. <b>Never</b> call this from a UI thread.
*/
@@ -217,12 +228,9 @@ public abstract class AsyncTaskLoader<D> extends Loader<D> {
LoadTask task = mTask;
if (task != null) {
try {
- task.get();
+ task.done.await();
} catch (InterruptedException e) {
- Log.w(TAG, e);
- } catch (ExecutionException e) {
- throw new RuntimeException("An error occured while executing waitForLoader()",
- e.getCause());
+ // Ignore
}
}
}
diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java
index ad747077c481..c8ca080d836c 100644
--- a/core/java/android/content/pm/PackageParser.java
+++ b/core/java/android/content/pm/PackageParser.java
@@ -3086,7 +3086,11 @@ public class PackageParser {
if (!sCompatibilityModeEnabled) {
ai.disableCompatibilityMode();
}
- ai.enabled = p.mSetEnabled == PackageManager.COMPONENT_ENABLED_STATE_ENABLED;
+ if (p.mSetEnabled == PackageManager.COMPONENT_ENABLED_STATE_ENABLED) {
+ ai.enabled = true;
+ } else if (p.mSetEnabled == PackageManager.COMPONENT_ENABLED_STATE_DISABLED) {
+ ai.enabled = false;
+ }
return ai;
}
diff --git a/core/java/android/os/AsyncTask.java b/core/java/android/os/AsyncTask.java
index 9d5d742220f9..46a29a9a7960 100644
--- a/core/java/android/os/AsyncTask.java
+++ b/core/java/android/os/AsyncTask.java
@@ -111,6 +111,15 @@ import java.util.concurrent.atomic.AtomicInteger;
* computation finishes. The result of the background computation is passed to
* this step as a parameter.</li>
* </ol>
+ *
+ * <h2>Cancelling a task</h2>
+ * <p>A task can be cancelled at any time by invoking {@link #cancel(boolean)}. Invoking
+ * this method will cause subsequent calls to {@link #isCancelled()} to return true.
+ * After invoking this method, {@link #onCancelled()}, instead of {@link #onPostExecute(Object)}
+ * will be invoked after {@link #doInBackground(Object[])} returns. To ensure that
+ * a task is cancelled as quickly as possible, you should always check the return
+ * value of {@link #isCancelled()} periodically from {@link #doInBackground(Object[])},
+ * if possible (inside a loop for instance.)</p>
*
* <h2>Threading rules</h2>
* <p>There are a few threading rules that must be followed for this class to
@@ -157,7 +166,6 @@ public abstract class AsyncTask<Params, Progress, Result> {
private static final int MESSAGE_POST_RESULT = 0x1;
private static final int MESSAGE_POST_PROGRESS = 0x2;
- private static final int MESSAGE_POST_CANCEL = 0x3;
private static final InternalHandler sHandler = new InternalHandler();
@@ -197,47 +205,33 @@ public abstract class AsyncTask<Params, Progress, Result> {
mWorker = new WorkerRunnable<Params, Result>() {
public Result call() throws Exception {
Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND);
- return doInBackground(mParams);
- }
- };
- mFuture = new FutureTask<Result>(mWorker) {
+ Result result = doInBackground(mParams);
- @Override
- protected void set(Result v) {
- super.set(v);
- if (isCancelled()) {
- Message message = sHandler.obtainMessage(MESSAGE_POST_CANCEL,
- new AsyncTaskResult<Result>(AsyncTask.this, (Result[]) null));
- message.sendToTarget();
- }
+ Message message = sHandler.obtainMessage(MESSAGE_POST_RESULT,
+ new AsyncTaskResult<Result>(AsyncTask.this, result));
+ message.sendToTarget();
+
+ return result;
}
+ };
+ mFuture = new FutureTask<Result>(mWorker) {
@Override
protected void done() {
- Message message;
- Result result = null;
-
try {
- result = get();
+ get();
} catch (InterruptedException e) {
android.util.Log.w(LOG_TAG, e);
} catch (ExecutionException e) {
throw new RuntimeException("An error occured while executing doInBackground()",
e.getCause());
} catch (CancellationException e) {
- message = sHandler.obtainMessage(MESSAGE_POST_CANCEL,
- new AsyncTaskResult<Result>(AsyncTask.this, (Result[]) null));
- message.sendToTarget();
- return;
+ // Taken care of in the WorkerRunnable
} catch (Throwable t) {
throw new RuntimeException("An error occured while executing "
+ "doInBackground()", t);
}
-
- message = sHandler.obtainMessage(MESSAGE_POST_RESULT,
- new AsyncTaskResult<Result>(AsyncTask.this, result));
- message.sendToTarget();
}
};
}
@@ -279,14 +273,16 @@ public abstract class AsyncTask<Params, Progress, Result> {
}
/**
- * Runs on the UI thread after {@link #doInBackground}. The
- * specified result is the value returned by {@link #doInBackground}
- * or null if the task was cancelled or an exception occurred.
+ * <p>Runs on the UI thread after {@link #doInBackground}. The
+ * specified result is the value returned by {@link #doInBackground}.</p>
+ *
+ * <p>This method won't be invoked if the task was cancelled.</p>
*
* @param result The result of the operation computed by {@link #doInBackground}.
*
* @see #onPreExecute
* @see #doInBackground
+ * @see #onCancelled()
*/
@SuppressWarnings({"UnusedDeclaration"})
protected void onPostExecute(Result result) {
@@ -306,7 +302,8 @@ public abstract class AsyncTask<Params, Progress, Result> {
}
/**
- * Runs on the UI thread after {@link #cancel(boolean)} is invoked.
+ * Runs on the UI thread after {@link #cancel(boolean)} is invoked and
+ * {@link #doInBackground(Object[])} has finished.
*
* @see #cancel(boolean)
* @see #isCancelled()
@@ -316,7 +313,9 @@ public abstract class AsyncTask<Params, Progress, Result> {
/**
* Returns <tt>true</tt> if this task was cancelled before it completed
- * normally.
+ * normally. If you are calling {@link #cancel(boolean)} on the task,
+ * the value returned by this method should be checked periodically from
+ * {@link #doInBackground(Object[])} to end the task as soon as possible.
*
* @return <tt>true</tt> if task was cancelled before it completed
*
@@ -327,14 +326,22 @@ public abstract class AsyncTask<Params, Progress, Result> {
}
/**
- * Attempts to cancel execution of this task. This attempt will
+ * <p>Attempts to cancel execution of this task. This attempt will
* fail if the task has already completed, already been cancelled,
* or could not be cancelled for some other reason. If successful,
* and this task has not started when <tt>cancel</tt> is called,
- * this task should never run. If the task has already started,
+ * this task should never run. If the task has already started,
* then the <tt>mayInterruptIfRunning</tt> parameter determines
* whether the thread executing this task should be interrupted in
- * an attempt to stop the task.
+ * an attempt to stop the task.</p>
+ *
+ * <p>Calling this method will result in {@link #onCancelled()} being
+ * invoked on the UI thread after {@link #doInBackground(Object[])}
+ * returns. Calling this method guarantees that {@link #onPostExecute(Object)}
+ * is never invoked. After invoking this method, you should check the
+ * value returned by {@link #isCancelled()} periodically from
+ * {@link #doInBackground(Object[])} to finish the task as early as
+ * possible.</p>
*
* @param mayInterruptIfRunning <tt>true</tt> if the thread executing this
* task should be interrupted; otherwise, in-progress tasks are allowed
@@ -444,8 +451,11 @@ public abstract class AsyncTask<Params, Progress, Result> {
}
private void finish(Result result) {
- if (isCancelled()) result = null;
- onPostExecute(result);
+ if (isCancelled()) {
+ onCancelled();
+ } else {
+ onPostExecute(result);
+ }
mStatus = Status.FINISHED;
}
@@ -462,9 +472,6 @@ public abstract class AsyncTask<Params, Progress, Result> {
case MESSAGE_POST_PROGRESS:
result.mTask.onProgressUpdate(result.mData);
break;
- case MESSAGE_POST_CANCEL:
- result.mTask.onCancelled();
- break;
}
}
}
diff --git a/core/java/android/util/CalendarUtils.java b/core/java/android/util/CalendarUtils.java
index 1b2a8943ca1d..b2b48972c508 100644
--- a/core/java/android/util/CalendarUtils.java
+++ b/core/java/android/util/CalendarUtils.java
@@ -88,6 +88,12 @@ public class CalendarUtils {
@Override
protected void onQueryComplete(int token, Object cookie, Cursor cursor) {
synchronized (mTZCallbacks) {
+ if (cursor == null) {
+ mTZQueryInProgress = false;
+ mFirstTZRequest = true;
+ return;
+ }
+
boolean writePrefs = false;
// Check the values in the db
int keyColumn = cursor.getColumnIndexOrThrow(CalendarCache.KEY);
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java
index bde467ba7b80..7af611ea36b5 100644
--- a/core/java/android/view/ViewGroup.java
+++ b/core/java/android/view/ViewGroup.java
@@ -130,12 +130,15 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
private MotionEvent.PointerCoords[] mTmpPointerCoords;
// For debugging only. You can see these in hierarchyviewer.
+ @SuppressWarnings({"FieldCanBeLocal", "UnusedDeclaration"})
@ViewDebug.ExportedProperty(category = "events")
private long mLastTouchDownTime;
@ViewDebug.ExportedProperty(category = "events")
private int mLastTouchDownIndex = -1;
+ @SuppressWarnings({"FieldCanBeLocal", "UnusedDeclaration"})
@ViewDebug.ExportedProperty(category = "events")
private float mLastTouchDownX;
+ @SuppressWarnings({"FieldCanBeLocal", "UnusedDeclaration"})
@ViewDebug.ExportedProperty(category = "events")
private float mLastTouchDownY;
diff --git a/core/java/android/widget/AbsListView.java b/core/java/android/widget/AbsListView.java
index da27ea894b0b..b85670c233d6 100644
--- a/core/java/android/widget/AbsListView.java
+++ b/core/java/android/widget/AbsListView.java
@@ -2424,7 +2424,6 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
}
private class PerformClick extends WindowRunnnable implements Runnable {
- View mChild;
int mClickMotionPosition;
public void run() {
@@ -2437,7 +2436,8 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
if (adapter != null && mItemCount > 0 &&
motionPosition != INVALID_POSITION &&
motionPosition < adapter.getCount() && sameWindow()) {
- performItemClick(mChild, motionPosition, adapter.getItemId(motionPosition));
+ performItemClick(getChildAt(motionPosition - mFirstPosition), motionPosition,
+ adapter.getItemId(motionPosition));
}
}
}
@@ -3010,7 +3010,6 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
}
final AbsListView.PerformClick performClick = mPerformClick;
- performClick.mChild = child;
performClick.mClickMotionPosition = motionPosition;
performClick.rememberWindowAttachCount();
@@ -3046,7 +3045,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
child.setPressed(false);
setPressed(false);
if (!mDataChanged) {
- post(performClick);
+ performClick.run();
}
}
};
@@ -3058,7 +3057,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
}
return true;
} else if (!mDataChanged && mAdapter.isEnabled(motionPosition)) {
- post(performClick);
+ performClick.run();
}
}
mTouchMode = TOUCH_MODE_REST;
diff --git a/core/res/res/drawable-hdpi/dialog_bottom_holo_dark.9.png b/core/res/res/drawable-hdpi/dialog_bottom_holo_dark.9.png
index bbfb9f73e2d5..065cc9cb65e6 100644
--- a/core/res/res/drawable-hdpi/dialog_bottom_holo_dark.9.png
+++ b/core/res/res/drawable-hdpi/dialog_bottom_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/dialog_bottom_holo_light.9.png b/core/res/res/drawable-hdpi/dialog_bottom_holo_light.9.png
index af69ee5e6e4b..94deceeab32f 100644
--- a/core/res/res/drawable-hdpi/dialog_bottom_holo_light.9.png
+++ b/core/res/res/drawable-hdpi/dialog_bottom_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/dialog_full_holo.9.png b/core/res/res/drawable-hdpi/dialog_full_holo.9.png
deleted file mode 100644
index 5d2e4e1da98b..000000000000
--- a/core/res/res/drawable-hdpi/dialog_full_holo.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-hdpi/dialog_full_holo_dark.9.png b/core/res/res/drawable-hdpi/dialog_full_holo_dark.9.png
index 59b9b1376954..f0b204179a56 100644
--- a/core/res/res/drawable-hdpi/dialog_full_holo_dark.9.png
+++ b/core/res/res/drawable-hdpi/dialog_full_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/dialog_full_holo_light.9.png b/core/res/res/drawable-hdpi/dialog_full_holo_light.9.png
index e1ec9dc4deda..5b93be7098ee 100644
--- a/core/res/res/drawable-hdpi/dialog_full_holo_light.9.png
+++ b/core/res/res/drawable-hdpi/dialog_full_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/dialog_middle_holo_dark.9.png b/core/res/res/drawable-hdpi/dialog_middle_holo_dark.9.png
index a9f85eadd43b..dc62ab26ac3f 100644
--- a/core/res/res/drawable-hdpi/dialog_middle_holo_dark.9.png
+++ b/core/res/res/drawable-hdpi/dialog_middle_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/dialog_middle_holo_light.9.png b/core/res/res/drawable-hdpi/dialog_middle_holo_light.9.png
index c4c46525514b..e78e13415c62 100644
--- a/core/res/res/drawable-hdpi/dialog_middle_holo_light.9.png
+++ b/core/res/res/drawable-hdpi/dialog_middle_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/dialog_top_holo.9.png b/core/res/res/drawable-hdpi/dialog_top_holo.9.png
deleted file mode 100644
index 0275c18d7ed5..000000000000
--- a/core/res/res/drawable-hdpi/dialog_top_holo.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-hdpi/dialog_top_holo_dark.9.png b/core/res/res/drawable-hdpi/dialog_top_holo_dark.9.png
index 32c2cb440461..ae223c8775ce 100644
--- a/core/res/res/drawable-hdpi/dialog_top_holo_dark.9.png
+++ b/core/res/res/drawable-hdpi/dialog_top_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/dialog_top_holo_light.9.png b/core/res/res/drawable-hdpi/dialog_top_holo_light.9.png
index 7a8fb0e700bd..7baced0ecd6e 100644
--- a/core/res/res/drawable-hdpi/dialog_top_holo_light.9.png
+++ b/core/res/res/drawable-hdpi/dialog_top_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/progress_bg_holo_dark.9.png b/core/res/res/drawable-hdpi/progress_bg_holo_dark.9.png
index 079de6196b77..5aea3d98a641 100644
--- a/core/res/res/drawable-hdpi/progress_bg_holo_dark.9.png
+++ b/core/res/res/drawable-hdpi/progress_bg_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/progress_bg_holo_light.9.png b/core/res/res/drawable-hdpi/progress_bg_holo_light.9.png
index 2272b4160748..5743d06ae886 100644
--- a/core/res/res/drawable-hdpi/progress_bg_holo_light.9.png
+++ b/core/res/res/drawable-hdpi/progress_bg_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/progress_primary_holo_dark.9.png b/core/res/res/drawable-hdpi/progress_primary_holo_dark.9.png
index 16b7349739a5..f134a5958c37 100644
--- a/core/res/res/drawable-hdpi/progress_primary_holo_dark.9.png
+++ b/core/res/res/drawable-hdpi/progress_primary_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/progress_primary_holo_light.9.png b/core/res/res/drawable-hdpi/progress_primary_holo_light.9.png
index 722934383ae4..f134a5958c37 100644
--- a/core/res/res/drawable-hdpi/progress_primary_holo_light.9.png
+++ b/core/res/res/drawable-hdpi/progress_primary_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/progress_secondary_holo_dark.9.png b/core/res/res/drawable-hdpi/progress_secondary_holo_dark.9.png
index 894dfcf16645..22d608ac78e4 100644
--- a/core/res/res/drawable-hdpi/progress_secondary_holo_dark.9.png
+++ b/core/res/res/drawable-hdpi/progress_secondary_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/progress_secondary_holo_light.9.png b/core/res/res/drawable-hdpi/progress_secondary_holo_light.9.png
index f553ba6777db..22d608ac78e4 100644
--- a/core/res/res/drawable-hdpi/progress_secondary_holo_light.9.png
+++ b/core/res/res/drawable-hdpi/progress_secondary_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/progressbar_indeterminate_holo1.png b/core/res/res/drawable-hdpi/progressbar_indeterminate_holo1.png
new file mode 100644
index 000000000000..595e0a4de046
--- /dev/null
+++ b/core/res/res/drawable-hdpi/progressbar_indeterminate_holo1.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/progressbar_indeterminate_holo2.png b/core/res/res/drawable-hdpi/progressbar_indeterminate_holo2.png
new file mode 100644
index 000000000000..75ad3d6860bc
--- /dev/null
+++ b/core/res/res/drawable-hdpi/progressbar_indeterminate_holo2.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/progressbar_indeterminate_holo3.png b/core/res/res/drawable-hdpi/progressbar_indeterminate_holo3.png
new file mode 100644
index 000000000000..74e90fdd2256
--- /dev/null
+++ b/core/res/res/drawable-hdpi/progressbar_indeterminate_holo3.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/progressbar_indeterminate_holo4.png b/core/res/res/drawable-hdpi/progressbar_indeterminate_holo4.png
new file mode 100644
index 000000000000..7e6948afb5bc
--- /dev/null
+++ b/core/res/res/drawable-hdpi/progressbar_indeterminate_holo4.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/progressbar_indeterminate_holo5.png b/core/res/res/drawable-hdpi/progressbar_indeterminate_holo5.png
new file mode 100644
index 000000000000..38b376cdf7d7
--- /dev/null
+++ b/core/res/res/drawable-hdpi/progressbar_indeterminate_holo5.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/progressbar_indeterminate_holo6.png b/core/res/res/drawable-hdpi/progressbar_indeterminate_holo6.png
new file mode 100644
index 000000000000..7cbdcf897699
--- /dev/null
+++ b/core/res/res/drawable-hdpi/progressbar_indeterminate_holo6.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/progressbar_indeterminate_holo7.png b/core/res/res/drawable-hdpi/progressbar_indeterminate_holo7.png
new file mode 100644
index 000000000000..b362b20ecaa4
--- /dev/null
+++ b/core/res/res/drawable-hdpi/progressbar_indeterminate_holo7.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/progressbar_indeterminate_holo8.png b/core/res/res/drawable-hdpi/progressbar_indeterminate_holo8.png
new file mode 100644
index 000000000000..45f4f59a11a2
--- /dev/null
+++ b/core/res/res/drawable-hdpi/progressbar_indeterminate_holo8.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/scrubber_control_disabled_holo.png b/core/res/res/drawable-hdpi/scrubber_control_disabled_holo.png
new file mode 100644
index 000000000000..401e90495524
--- /dev/null
+++ b/core/res/res/drawable-hdpi/scrubber_control_disabled_holo.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/scrubber_control_holo.png b/core/res/res/drawable-hdpi/scrubber_control_holo.png
index 3a723076535f..175917ea327e 100644
--- a/core/res/res/drawable-hdpi/scrubber_control_holo.png
+++ b/core/res/res/drawable-hdpi/scrubber_control_holo.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/scrubber_primary_holo.9.png b/core/res/res/drawable-hdpi/scrubber_primary_holo.9.png
new file mode 100644
index 000000000000..3bc78a85b36d
--- /dev/null
+++ b/core/res/res/drawable-hdpi/scrubber_primary_holo.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/scrubber_secondary_holo.9.png b/core/res/res/drawable-hdpi/scrubber_secondary_holo.9.png
new file mode 100644
index 000000000000..8eadf0024a25
--- /dev/null
+++ b/core/res/res/drawable-hdpi/scrubber_secondary_holo.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/scrubber_track_holo_dark.9.png b/core/res/res/drawable-hdpi/scrubber_track_holo_dark.9.png
index e6d7123b6340..14ce98538339 100644
--- a/core/res/res/drawable-hdpi/scrubber_track_holo_dark.9.png
+++ b/core/res/res/drawable-hdpi/scrubber_track_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/scrubber_track_holo_light.9.png b/core/res/res/drawable-hdpi/scrubber_track_holo_light.9.png
index f75bfa0a2b48..5edaed5bc001 100644
--- a/core/res/res/drawable-hdpi/scrubber_track_holo_light.9.png
+++ b/core/res/res/drawable-hdpi/scrubber_track_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/toast_frame.9.png b/core/res/res/drawable-hdpi/toast_frame.9.png
index 8f5d8119c12a..7f830bcd7cf9 100644
--- a/core/res/res/drawable-hdpi/toast_frame.9.png
+++ b/core/res/res/drawable-hdpi/toast_frame.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/dialog_bottom_holo_dark.9.png b/core/res/res/drawable-mdpi/dialog_bottom_holo_dark.9.png
index 1e2d3270874a..43e652811ad5 100644
--- a/core/res/res/drawable-mdpi/dialog_bottom_holo_dark.9.png
+++ b/core/res/res/drawable-mdpi/dialog_bottom_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/dialog_bottom_holo_light.9.png b/core/res/res/drawable-mdpi/dialog_bottom_holo_light.9.png
index ac2d7a3727c2..09a1cd85e183 100644
--- a/core/res/res/drawable-mdpi/dialog_bottom_holo_light.9.png
+++ b/core/res/res/drawable-mdpi/dialog_bottom_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/dialog_full_holo.9.png b/core/res/res/drawable-mdpi/dialog_full_holo.9.png
deleted file mode 100644
index 0ec942153ed2..000000000000
--- a/core/res/res/drawable-mdpi/dialog_full_holo.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-mdpi/dialog_full_holo_dark.9.png b/core/res/res/drawable-mdpi/dialog_full_holo_dark.9.png
index 9d934034a6b6..a71af8d45429 100644
--- a/core/res/res/drawable-mdpi/dialog_full_holo_dark.9.png
+++ b/core/res/res/drawable-mdpi/dialog_full_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/dialog_full_holo_light.9.png b/core/res/res/drawable-mdpi/dialog_full_holo_light.9.png
index 1c08e6a06c89..4017bf71cc83 100644
--- a/core/res/res/drawable-mdpi/dialog_full_holo_light.9.png
+++ b/core/res/res/drawable-mdpi/dialog_full_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/dialog_middle_holo_dark.9.png b/core/res/res/drawable-mdpi/dialog_middle_holo_dark.9.png
index 741b8dcbfad4..8082ddd97d66 100644
--- a/core/res/res/drawable-mdpi/dialog_middle_holo_dark.9.png
+++ b/core/res/res/drawable-mdpi/dialog_middle_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/dialog_middle_holo_light.9.png b/core/res/res/drawable-mdpi/dialog_middle_holo_light.9.png
index 0854fe5c2e2f..ccdcd1d19047 100644
--- a/core/res/res/drawable-mdpi/dialog_middle_holo_light.9.png
+++ b/core/res/res/drawable-mdpi/dialog_middle_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/dialog_top_holo.9.png b/core/res/res/drawable-mdpi/dialog_top_holo.9.png
deleted file mode 100644
index 1ed519b61db4..000000000000
--- a/core/res/res/drawable-mdpi/dialog_top_holo.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-mdpi/dialog_top_holo_dark.9.png b/core/res/res/drawable-mdpi/dialog_top_holo_dark.9.png
index 43c0050f6d71..79aaffbd3c4d 100644
--- a/core/res/res/drawable-mdpi/dialog_top_holo_dark.9.png
+++ b/core/res/res/drawable-mdpi/dialog_top_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/dialog_top_holo_light.9.png b/core/res/res/drawable-mdpi/dialog_top_holo_light.9.png
index bc5fc92bdd26..074005112a97 100644
--- a/core/res/res/drawable-mdpi/dialog_top_holo_light.9.png
+++ b/core/res/res/drawable-mdpi/dialog_top_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/progress_bg_holo_dark.9.png b/core/res/res/drawable-mdpi/progress_bg_holo_dark.9.png
index 0376e537ae0a..c5418f9efc33 100644
--- a/core/res/res/drawable-mdpi/progress_bg_holo_dark.9.png
+++ b/core/res/res/drawable-mdpi/progress_bg_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/progress_bg_holo_light.9.png b/core/res/res/drawable-mdpi/progress_bg_holo_light.9.png
index e825119b461e..c943b2e8228c 100644
--- a/core/res/res/drawable-mdpi/progress_bg_holo_light.9.png
+++ b/core/res/res/drawable-mdpi/progress_bg_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/progress_primary_holo_dark.9.png b/core/res/res/drawable-mdpi/progress_primary_holo_dark.9.png
index e525eafaa471..bac0a23b430e 100644
--- a/core/res/res/drawable-mdpi/progress_primary_holo_dark.9.png
+++ b/core/res/res/drawable-mdpi/progress_primary_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/progress_primary_holo_light.9.png b/core/res/res/drawable-mdpi/progress_primary_holo_light.9.png
index 0532f0e910f5..bac0a23b430e 100644
--- a/core/res/res/drawable-mdpi/progress_primary_holo_light.9.png
+++ b/core/res/res/drawable-mdpi/progress_primary_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/progress_secondary_holo_dark.9.png b/core/res/res/drawable-mdpi/progress_secondary_holo_dark.9.png
index 99f8f0678bd1..8be8656b62a7 100644
--- a/core/res/res/drawable-mdpi/progress_secondary_holo_dark.9.png
+++ b/core/res/res/drawable-mdpi/progress_secondary_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/progress_secondary_holo_light.9.png b/core/res/res/drawable-mdpi/progress_secondary_holo_light.9.png
index 198d7d9dbe19..8be8656b62a7 100644
--- a/core/res/res/drawable-mdpi/progress_secondary_holo_light.9.png
+++ b/core/res/res/drawable-mdpi/progress_secondary_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/progressbar_indeterminate_holo1.png b/core/res/res/drawable-mdpi/progressbar_indeterminate_holo1.png
new file mode 100644
index 000000000000..c22a53a3eb15
--- /dev/null
+++ b/core/res/res/drawable-mdpi/progressbar_indeterminate_holo1.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/progressbar_indeterminate_holo2.png b/core/res/res/drawable-mdpi/progressbar_indeterminate_holo2.png
new file mode 100644
index 000000000000..c288541902d4
--- /dev/null
+++ b/core/res/res/drawable-mdpi/progressbar_indeterminate_holo2.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/progressbar_indeterminate_holo3.png b/core/res/res/drawable-mdpi/progressbar_indeterminate_holo3.png
new file mode 100644
index 000000000000..25df6b933ec2
--- /dev/null
+++ b/core/res/res/drawable-mdpi/progressbar_indeterminate_holo3.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/progressbar_indeterminate_holo4.png b/core/res/res/drawable-mdpi/progressbar_indeterminate_holo4.png
new file mode 100644
index 000000000000..65718e1bbd21
--- /dev/null
+++ b/core/res/res/drawable-mdpi/progressbar_indeterminate_holo4.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/progressbar_indeterminate_holo5.png b/core/res/res/drawable-mdpi/progressbar_indeterminate_holo5.png
new file mode 100644
index 000000000000..39148e0bd82f
--- /dev/null
+++ b/core/res/res/drawable-mdpi/progressbar_indeterminate_holo5.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/progressbar_indeterminate_holo6.png b/core/res/res/drawable-mdpi/progressbar_indeterminate_holo6.png
new file mode 100644
index 000000000000..8ff7b246100b
--- /dev/null
+++ b/core/res/res/drawable-mdpi/progressbar_indeterminate_holo6.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/progressbar_indeterminate_holo7.png b/core/res/res/drawable-mdpi/progressbar_indeterminate_holo7.png
new file mode 100644
index 000000000000..a7302c1bbe2e
--- /dev/null
+++ b/core/res/res/drawable-mdpi/progressbar_indeterminate_holo7.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/progressbar_indeterminate_holo8.png b/core/res/res/drawable-mdpi/progressbar_indeterminate_holo8.png
new file mode 100644
index 000000000000..70bf210f8495
--- /dev/null
+++ b/core/res/res/drawable-mdpi/progressbar_indeterminate_holo8.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/scrubber_control_disabled_holo.png b/core/res/res/drawable-mdpi/scrubber_control_disabled_holo.png
new file mode 100644
index 000000000000..26f018f28cd8
--- /dev/null
+++ b/core/res/res/drawable-mdpi/scrubber_control_disabled_holo.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/scrubber_control_holo.png b/core/res/res/drawable-mdpi/scrubber_control_holo.png
index 8457833723aa..242c16dffccb 100644
--- a/core/res/res/drawable-mdpi/scrubber_control_holo.png
+++ b/core/res/res/drawable-mdpi/scrubber_control_holo.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/scrubber_primary_holo.9.png b/core/res/res/drawable-mdpi/scrubber_primary_holo.9.png
index 8582b1327bb4..ac63e7d2dc52 100644
--- a/core/res/res/drawable-mdpi/scrubber_primary_holo.9.png
+++ b/core/res/res/drawable-mdpi/scrubber_primary_holo.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/scrubber_secondary_holo.9.png b/core/res/res/drawable-mdpi/scrubber_secondary_holo.9.png
index 6ad876e555f7..9590bdc24a8c 100644
--- a/core/res/res/drawable-mdpi/scrubber_secondary_holo.9.png
+++ b/core/res/res/drawable-mdpi/scrubber_secondary_holo.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/scrubber_track_holo_dark.9.png b/core/res/res/drawable-mdpi/scrubber_track_holo_dark.9.png
index baf70cd84977..017b593cef3b 100644
--- a/core/res/res/drawable-mdpi/scrubber_track_holo_dark.9.png
+++ b/core/res/res/drawable-mdpi/scrubber_track_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/scrubber_track_holo_light.9.png b/core/res/res/drawable-mdpi/scrubber_track_holo_light.9.png
index 6f314972f72c..12c6e21072ca 100644
--- a/core/res/res/drawable-mdpi/scrubber_track_holo_light.9.png
+++ b/core/res/res/drawable-mdpi/scrubber_track_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/toast_frame.9.png b/core/res/res/drawable-mdpi/toast_frame.9.png
index 08c4f869e019..911f86d73ce6 100755
--- a/core/res/res/drawable-mdpi/toast_frame.9.png
+++ b/core/res/res/drawable-mdpi/toast_frame.9.png
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/ic_lock_idle_alarm.png b/core/res/res/drawable-xlarge-mdpi/ic_lock_idle_alarm.png
index 336a82068ad3..97ac02361a2d 100644
--- a/core/res/res/drawable-xlarge-mdpi/ic_lock_idle_alarm.png
+++ b/core/res/res/drawable-xlarge-mdpi/ic_lock_idle_alarm.png
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/ic_lock_idle_charging.png b/core/res/res/drawable-xlarge-mdpi/ic_lock_idle_charging.png
index ebef53189a18..4210db26765a 100644
--- a/core/res/res/drawable-xlarge-mdpi/ic_lock_idle_charging.png
+++ b/core/res/res/drawable-xlarge-mdpi/ic_lock_idle_charging.png
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/ic_lock_idle_lock.png b/core/res/res/drawable-xlarge-mdpi/ic_lock_idle_lock.png
index 405e21862123..1060f5a8da15 100644
--- a/core/res/res/drawable-xlarge-mdpi/ic_lock_idle_lock.png
+++ b/core/res/res/drawable-xlarge-mdpi/ic_lock_idle_lock.png
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/ic_lock_idle_low_battery.png b/core/res/res/drawable-xlarge-mdpi/ic_lock_idle_low_battery.png
index f349b633498d..72e4afa14bec 100644
--- a/core/res/res/drawable-xlarge-mdpi/ic_lock_idle_low_battery.png
+++ b/core/res/res/drawable-xlarge-mdpi/ic_lock_idle_low_battery.png
Binary files differ
diff --git a/core/res/res/drawable/progress_indeterminate_horizontal_holo.xml b/core/res/res/drawable/progress_indeterminate_horizontal_holo.xml
new file mode 100644
index 000000000000..e99c35bc79de
--- /dev/null
+++ b/core/res/res/drawable/progress_indeterminate_horizontal_holo.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2011, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+<animation-list
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:oneshot="false">
+ <item android:drawable="@drawable/progressbar_indeterminate_holo1" android:duration="50" />
+ <item android:drawable="@drawable/progressbar_indeterminate_holo2" android:duration="50" />
+ <item android:drawable="@drawable/progressbar_indeterminate_holo3" android:duration="50" />
+ <item android:drawable="@drawable/progressbar_indeterminate_holo4" android:duration="50" />
+ <item android:drawable="@drawable/progressbar_indeterminate_holo5" android:duration="50" />
+ <item android:drawable="@drawable/progressbar_indeterminate_holo6" android:duration="50" />
+ <item android:drawable="@drawable/progressbar_indeterminate_holo7" android:duration="50" />
+ <item android:drawable="@drawable/progressbar_indeterminate_holo8" android:duration="50" />
+</animation-list>
diff --git a/core/res/res/drawable/scrubber_control_selector_holo.xml b/core/res/res/drawable/scrubber_control_selector_holo.xml
new file mode 100644
index 000000000000..c7b8854ef21d
--- /dev/null
+++ b/core/res/res/drawable/scrubber_control_selector_holo.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2011 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_enabled="true" android:drawable="@android:drawable/scrubber_control_holo" />
+ <item android:drawable="@android:drawable/scrubber_control_disabled_holo" />
+</selector>
diff --git a/core/res/res/layout-xlarge/alert_dialog_holo.xml b/core/res/res/layout-xlarge/alert_dialog_holo.xml
index fca7c78fc2c2..2ae8db774d9e 100644
--- a/core/res/res/layout-xlarge/alert_dialog_holo.xml
+++ b/core/res/res/layout-xlarge/alert_dialog_holo.xml
@@ -33,7 +33,7 @@
<LinearLayout android:id="@+id/topPanel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:minHeight="48dip"
+ android:minHeight="64dip"
android:orientation="vertical">
<LinearLayout android:id="@+id/title_template"
android:layout_width="match_parent"
@@ -58,11 +58,13 @@
</LinearLayout>
<ImageView android:id="@+id/titleDivider"
android:layout_width="match_parent"
- android:layout_height="1dip"
+ android:layout_height="4dip"
android:visibility="gone"
android:scaleType="fitXY"
android:gravity="fill_horizontal"
- android:src="@android:drawable/divider_horizontal_dark" />
+ android:paddingLeft="16dip"
+ android:paddingRight="16dip"
+ android:src="@android:drawable/divider_strong_holo" />
<!-- If the client uses a customTitle, it will be added here. -->
</LinearLayout>
diff --git a/core/res/res/layout-xlarge/keyguard_screen_password_landscape.xml b/core/res/res/layout-xlarge/keyguard_screen_password_landscape.xml
index c2d87a2a4792..4bc729248c3f 100644
--- a/core/res/res/layout-xlarge/keyguard_screen_password_landscape.xml
+++ b/core/res/res/layout-xlarge/keyguard_screen_password_landscape.xml
@@ -22,18 +22,23 @@
android:layout_height="match_parent"
android:orientation="horizontal"
>
-
- <!-- left side: status and emergency call button -->
- <LinearLayout
- android:layout_height="match_parent"
- android:layout_weight="1"
- android:layout_width="0dip"
- android:orientation="vertical"
- android:gravity="center_vertical"
- >
- <include layout="@layout/keyguard_screen_status_land" />
- </LinearLayout>
-
+
+ <!-- left side: status -->
+ <RelativeLayout
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:layout_width="0dip">
+
+ <include layout="@layout/keyguard_screen_status_land"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="102dip"
+ android:layout_marginTop="320dip"
+ android:layout_alignParentTop="true"
+ android:layout_alignParentLeft="true"/>
+
+ </RelativeLayout>
+
<!-- right side: password -->
<LinearLayout
android:layout_width="0dip"
diff --git a/core/res/res/layout-xlarge/keyguard_screen_password_portrait.xml b/core/res/res/layout-xlarge/keyguard_screen_password_portrait.xml
index 0927e5912e64..e63fb9bffd3a 100644
--- a/core/res/res/layout-xlarge/keyguard_screen_password_portrait.xml
+++ b/core/res/res/layout-xlarge/keyguard_screen_password_portrait.xml
@@ -19,21 +19,23 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:orientation="vertical"
- >
-
- <!-- left side: status and emergency call button -->
- <LinearLayout
+ android:orientation="vertical">
+
+ <!-- top: status -->
+ <RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dip"
- android:layout_weight="1"
- android:orientation="vertical"
- android:gravity="center_vertical"
- >
- <include layout="@layout/keyguard_screen_status_land" />
- </LinearLayout>
-
- <!-- right side: password -->
+ android:layout_weight="1">
+ <include layout="@layout/keyguard_screen_status_port"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="134dip"
+ android:layout_marginLeft="266dip"
+ android:layout_alignParentTop="true"
+ android:layout_alignParentLeft="true"/>
+ </RelativeLayout>
+
+ <!-- bottom: password -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dip"
diff --git a/core/res/res/layout-xlarge/keyguard_screen_status_land.xml b/core/res/res/layout-xlarge/keyguard_screen_status_land.xml
index f91fe4f185d6..0a485e2fd0d1 100644
--- a/core/res/res/layout-xlarge/keyguard_screen_status_land.xml
+++ b/core/res/res/layout-xlarge/keyguard_screen_status_land.xml
@@ -23,8 +23,6 @@
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginLeft="140dip"
- android:layout_marginTop="20dip"
android:gravity="left"
>
@@ -58,7 +56,7 @@
android:layout_height="wrap_content"
android:singleLine="true"
android:ellipsize="none"
- android:textSize="120sp"
+ android:textSize="98sp"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@color/lockscreen_clock_background"
android:layout_marginBottom="6dip"
@@ -69,7 +67,7 @@
android:layout_height="wrap_content"
android:singleLine="true"
android:ellipsize="none"
- android:textSize="120sp"
+ android:textSize="98sp"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@color/lockscreen_clock_foreground"
android:layout_alignLeft="@id/timeDisplayBackground"
@@ -92,15 +90,29 @@
</com.android.internal.widget.DigitalClock>
- <TextView
- android:id="@+id/date"
+ <LinearLayout
+ android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/time"
- android:layout_marginTop="10dip"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:textSize="22sp"
- />
+ android:layout_marginTop="10dip">
+
+ <TextView
+ android:id="@+id/date"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:textSize="17sp"/>
+
+ <TextView
+ android:id="@+id/alarm_status"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="30dip"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:textSize="17sp"/>
+
+ </LinearLayout>
<!-- Status2 is generally charge status -->
<TextView
@@ -109,18 +121,19 @@
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:textAppearance="?android:attr/textAppearanceMedium"
- android:textSize="22sp"
+ android:textSize="17sp"
android:layout_marginTop="10dip"
android:drawablePadding="4dip"
+ android:visibility="gone"
/>
- <!-- Status1 is generally alarm status -->
+ <!-- Status1 is generally battery status and informational messages -->
<TextView
android:id="@+id/status1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dip"
- android:textSize="22sp"
+ android:textSize="17sp"
android:textAppearance="?android:attr/textAppearanceMedium"
/>
@@ -130,9 +143,10 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
- android:textSize="22sp"
+ android:textSize="17sp"
android:layout_marginTop="20dip"
android:singleLine="false"
+ android:textColor="@color/lockscreen_owner_info"
android:visibility="invisible"
/>
</LinearLayout>
diff --git a/core/res/res/layout-xlarge/keyguard_screen_status_port.xml b/core/res/res/layout-xlarge/keyguard_screen_status_port.xml
index c529e0bddb7a..346b21e87b84 100644
--- a/core/res/res/layout-xlarge/keyguard_screen_status_port.xml
+++ b/core/res/res/layout-xlarge/keyguard_screen_status_port.xml
@@ -44,8 +44,6 @@
<com.android.internal.widget.DigitalClock android:id="@+id/time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_alignParentTop="true"
- android:layout_alignParentLeft="true"
android:layout_marginTop="8dip"
android:layout_marginBottom="8dip"
android_layout_marginLeft="-10dip">
@@ -57,7 +55,7 @@
android:layout_height="wrap_content"
android:singleLine="true"
android:ellipsize="none"
- android:textSize="120sp"
+ android:textSize="98sp"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@color/lockscreen_clock_background"
android:layout_marginBottom="6dip"
@@ -68,7 +66,7 @@
android:layout_height="wrap_content"
android:singleLine="true"
android:ellipsize="none"
- android:textSize="120sp"
+ android:textSize="98sp"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@color/lockscreen_clock_foreground"
android:layout_marginBottom="6dip"
@@ -91,15 +89,29 @@
</com.android.internal.widget.DigitalClock>
- <TextView
- android:id="@+id/date"
+ <LinearLayout
+ android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/time"
- android:layout_marginTop="10dip"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:textSize="22sp"
- />
+ android:layout_marginTop="10dip">
+
+ <TextView
+ android:id="@+id/date"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:textSize="17sp"/>
+
+ <TextView
+ android:id="@+id/alarm_status"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="30dip"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:textSize="17sp"/>
+
+ </LinearLayout>
<!-- used for status such as the next alarm, and charging status. -->
<TextView
@@ -108,9 +120,10 @@
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:textAppearance="?android:attr/textAppearanceMedium"
- android:textSize="22sp"
+ android:textSize="17sp"
android:layout_marginTop="10dip"
android:drawablePadding="4dip"
+ android:visibility="gone"
/>
<TextView
@@ -118,7 +131,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dip"
- android:textSize="22sp"
+ android:textSize="17sp"
android:textAppearance="?android:attr/textAppearanceMedium"
/>
@@ -129,8 +142,9 @@
android:layout_height="wrap_content"
android:layout_marginTop="20dip"
android:textAppearance="?android:attr/textAppearanceMedium"
- android:textSize="22sp"
+ android:textSize="17sp"
android:singleLine="false"
android:visibility="invisible"
+ android:textColor="@color/lockscreen_owner_info"
/>
</LinearLayout>
diff --git a/core/res/res/layout-xlarge/keyguard_screen_tab_unlock.xml b/core/res/res/layout-xlarge/keyguard_screen_tab_unlock.xml
index c76e8339bdc9..1c7b7e210aed 100644
--- a/core/res/res/layout-xlarge/keyguard_screen_tab_unlock.xml
+++ b/core/res/res/layout-xlarge/keyguard_screen_tab_unlock.xml
@@ -29,15 +29,18 @@
android:id="@+id/root"
android:background="#70000000">
- <!-- left side: status and emergency call button -->
- <LinearLayout
+ <!-- top: status -->
+ <RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_weight="1"
- android:orientation="vertical"
- android:gravity="center_vertical">
- <include layout="@layout/keyguard_screen_status_port" />
- </LinearLayout>
+ android:orientation="vertical">
+ <include layout="@layout/keyguard_screen_status_port"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="134dip"
+ android:layout_marginLeft="266dip"/>
+ </RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
@@ -75,6 +78,7 @@
android:text="@string/emergency_calls_only"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/white"
+ android:visibility="gone"
/>
<!-- emergency call button shown when sim is PUKd and tab_selector is
@@ -86,7 +90,7 @@
android:drawableLeft="@drawable/ic_emergency"
android:layout_centerInParent="true"
android:layout_alignParentBottom="true"
- android:layout_marginBottom="80dip"
+ android:layout_marginBottom="90dip"
style="@style/Widget.Button.Transparent"
android:drawablePadding="8dip"
android:visibility="gone"
diff --git a/core/res/res/layout-xlarge/keyguard_screen_tab_unlock_land.xml b/core/res/res/layout-xlarge/keyguard_screen_tab_unlock_land.xml
index 6c99ccac7729..c24eecc5c385 100644
--- a/core/res/res/layout-xlarge/keyguard_screen_tab_unlock_land.xml
+++ b/core/res/res/layout-xlarge/keyguard_screen_tab_unlock_land.xml
@@ -28,16 +28,21 @@
android:background="#70000000"
android:id="@+id/root">
- <!-- left side: status and emergency call button -->
- <LinearLayout
- android:layout_height="match_parent"
- android:layout_weight="1"
- android:layout_width="0dip"
- android:orientation="vertical"
- android:gravity="center_vertical"
- >
- <include layout="@layout/keyguard_screen_status_land" />
- </LinearLayout>
+ <!-- left side: status -->
+ <RelativeLayout
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:layout_width="0dip">
+
+ <include layout="@layout/keyguard_screen_status_land"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="102dip"
+ android:layout_marginTop="320dip"
+ android:layout_alignParentTop="true"
+ android:layout_alignParentLeft="true"/>
+
+ </RelativeLayout>
<!-- right side -->
<LinearLayout
diff --git a/core/res/res/layout-xlarge/keyguard_screen_unlock_landscape.xml b/core/res/res/layout-xlarge/keyguard_screen_unlock_landscape.xml
index 52be82c290d0..ec7c2721201a 100644
--- a/core/res/res/layout-xlarge/keyguard_screen_unlock_landscape.xml
+++ b/core/res/res/layout-xlarge/keyguard_screen_unlock_landscape.xml
@@ -26,81 +26,92 @@
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
- >
+ android:background="#70000000">
- <!-- left side: status and emergency call button -->
- <LinearLayout
- android:layout_height="match_parent"
- android:layout_weight="1"
- android:layout_width="0dip"
- android:orientation="vertical"
- android:gravity="center_vertical"
- >
-
- <include layout="@layout/keyguard_screen_status_land" />
+ <!-- left side: status -->
+ <RelativeLayout
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:layout_width="0dip">
+
+ <include layout="@layout/keyguard_screen_status_land"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="102dip"
+ android:layout_marginTop="320dip"
+ android:layout_alignParentTop="true"
+ android:layout_alignParentLeft="true"/>
+
+ </RelativeLayout>
+
+ <!-- right side: lock pattern -->
+ <RelativeLayout
+ android:layout_weight="1"
+ android:layout_width="0dip"
+ android:layout_height="match_parent">
+
+ <com.android.internal.widget.LockPatternView android:id="@+id/lockPattern"
+ android:layout_width="354dip"
+ android:layout_height="354dip"
+ android:layout_marginLeft="143dip"
+ android:layout_marginTop="201dip"
+ android:layout_gravity="center_vertical"
+ />
<!-- footer -->
- <FrameLayout
+
+ <!-- option 1: a single emergency call button -->
+ <RelativeLayout android:id="@+id/footerNormal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginLeft="140dip"
+ android:layout_below="@id/lockPattern"
+ android:layout_alignLeft="@id/lockPattern"
+ android:layout_alignRight="@id/lockPattern"
+ android:layout_marginTop="28dip"
+ android:layout_marginLeft="28dip"
+ android:layout_marginRight="28dip"
>
+ <Button android:id="@+id/emergencyCallAlone"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/lockscreen_emergency_call"
+ style="@style/Widget.Button.Transparent"
+ android:drawableLeft="@drawable/ic_emergency"
+ android:drawablePadding="8dip"
+ android:visibility="gone"
+ />
+ </RelativeLayout>
- <!-- option 1: a single emergency call button -->
- <RelativeLayout android:id="@+id/footerNormal"
+ <!-- option 2: an emergency call button, and a 'forgot pattern?' button -->
+ <LinearLayout android:id="@+id/footerForgotPattern"
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_below="@id/footerNormal"
+ android:layout_alignLeft="@id/lockPattern"
+ android:layout_alignRight="@id/lockPattern"
+ android:layout_marginTop="28dip"
+ android:layout_marginLeft="28dip"
+ android:layout_marginRight="28dip">
+
+ <Button android:id="@+id/forgotPattern"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:gravity="left"
- >
- <Button android:id="@+id/emergencyCallAlone"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/lockscreen_emergency_call"
- style="@style/Widget.Button.Transparent"
- android:drawableLeft="@drawable/ic_emergency"
- android:drawablePadding="8dip"
- android:visibility="gone"
- />
- </RelativeLayout>
+ style="@style/Widget.Button.Transparent"
+ />
- <!-- option 2: an emergency call button, and a 'forgot pattern?' button -->
- <LinearLayout android:id="@+id/footerForgotPattern"
- android:orientation="vertical"
+ <Button android:id="@+id/emergencyCallTogether"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:gravity="left"
- >
- <Button android:id="@+id/forgotPattern"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- style="@style/Widget.Button.Transparent"
- />
- <Button android:id="@+id/emergencyCallTogether"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="@string/lockscreen_emergency_call"
- style="@style/Widget.Button.Transparent"
- android:drawableLeft="@drawable/ic_emergency"
- android:drawablePadding="8dip"
- android:visibility="gone"
- />
- </LinearLayout>
- </FrameLayout>
- </LinearLayout>
+ android:text="@string/lockscreen_emergency_call"
+ style="@style/Widget.Button.Transparent"
+ android:drawableLeft="@drawable/ic_emergency"
+ android:drawablePadding="8dip"
+ android:visibility="gone"
+ />
- <!-- right side: lock pattern -->
- <LinearLayout
- android:layout_weight="1"
- android:layout_width="0dip"
- android:layout_height="match_parent"
- android:gravity="center"
- >
- <com.android.internal.widget.LockPatternView android:id="@+id/lockPattern"
- android:layout_width="354dip"
- android:layout_height="354dip"
- android:layout_marginTop="90dip"
- android:layout_marginRight="90dip"
- />
- </LinearLayout>
+ </LinearLayout>
+
+ </RelativeLayout>
</com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient>
diff --git a/core/res/res/layout-xlarge/keyguard_screen_unlock_portrait.xml b/core/res/res/layout-xlarge/keyguard_screen_unlock_portrait.xml
index e170a76d773a..84ddd6a6076b 100644
--- a/core/res/res/layout-xlarge/keyguard_screen_unlock_portrait.xml
+++ b/core/res/res/layout-xlarge/keyguard_screen_unlock_portrait.xml
@@ -22,18 +22,21 @@
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
+ android:background="#70000000"
>
- <!-- left side: status and emergency call button -->
+ <!-- top: status -->
<LinearLayout
- android:layout_height="0dip"
- android:layout_weight="1"
- android:layout_width="match_parent"
- android:orientation="vertical"
- android:gravity="center_vertical"
- >
+ android:layout_height="0dip"
+ android:layout_weight="1"
+ android:layout_width="match_parent"
+ android:orientation="vertical">
- <include layout="@layout/keyguard_screen_status_port" />
+ <include layout="@layout/keyguard_screen_status_port"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="134dip"
+ android:layout_marginLeft="266dip"/>
<!-- footer -->
<FrameLayout
diff --git a/core/res/res/layout/alert_dialog_holo.xml b/core/res/res/layout/alert_dialog_holo.xml
index ea6e11eb5203..07a2853cba78 100644
--- a/core/res/res/layout/alert_dialog_holo.xml
+++ b/core/res/res/layout/alert_dialog_holo.xml
@@ -33,7 +33,7 @@
<LinearLayout android:id="@+id/topPanel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:minHeight="48dip"
+ android:minHeight="64dip"
android:orientation="vertical">
<LinearLayout android:id="@+id/title_template"
android:layout_width="match_parent"
@@ -58,11 +58,13 @@
</LinearLayout>
<ImageView android:id="@+id/titleDivider"
android:layout_width="match_parent"
- android:layout_height="1dip"
+ android:layout_height="4dip"
android:visibility="gone"
android:scaleType="fitXY"
android:gravity="fill_horizontal"
- android:src="@android:drawable/divider_horizontal_dark" />
+ android:paddingLeft="16dip"
+ android:paddingRight="16dip"
+ android:src="@android:drawable/divider_strong_holo" />
<!-- If the client uses a customTitle, it will be added here. -->
</LinearLayout>
diff --git a/core/res/res/layout/keyguard_screen_tab_unlock.xml b/core/res/res/layout/keyguard_screen_tab_unlock.xml
index 77ae0d3f5a28..8367157316b9 100644
--- a/core/res/res/layout/keyguard_screen_tab_unlock.xml
+++ b/core/res/res/layout/keyguard_screen_tab_unlock.xml
@@ -117,13 +117,26 @@
android:textAppearance="?android:attr/textAppearanceMedium"
/>
+ <!-- TODO: Redo layout when we release on phones -->
<TextView
- android:id="@+id/status1"
+ android:id="@+id/alarm_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:textSize="18sp"
+ android:drawablePadding="4dip"
android:layout_below="@id/date"
android:layout_marginTop="4dip"
android:layout_marginLeft="24dip"
+ />
+
+ <TextView
+ android:id="@+id/status1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_below="@id/alarm_status"
+ android:layout_marginTop="4dip"
+ android:layout_marginLeft="24dip"
android:textAppearance="?android:attr/textAppearanceMedium"
android:drawablePadding="4dip"
/>
diff --git a/core/res/res/layout/keyguard_screen_tab_unlock_land.xml b/core/res/res/layout/keyguard_screen_tab_unlock_land.xml
index e48df2033aec..954766019582 100644
--- a/core/res/res/layout/keyguard_screen_tab_unlock_land.xml
+++ b/core/res/res/layout/keyguard_screen_tab_unlock_land.xml
@@ -118,11 +118,24 @@
android:textAppearance="?android:attr/textAppearanceMedium"
/>
+ <!-- TODO: Redo layout when we release on phones -->
<TextView
- android:id="@+id/status1"
+ android:id="@+id/alarm_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:textSize="18sp"
+ android:drawablePadding="4dip"
android:layout_below="@id/date"
+ android:layout_marginTop="4dip"
+ android:layout_marginLeft="24dip"
+ />
+
+ <TextView
+ android:id="@+id/status1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_below="@id/alarm_status"
android:layout_marginTop="6dip"
android:textAppearance="?android:attr/textAppearanceMedium"
android:drawablePadding="4dip"
diff --git a/core/res/res/layout/keyguard_screen_unlock_landscape.xml b/core/res/res/layout/keyguard_screen_unlock_landscape.xml
index c14afbf1a4d5..759c90672114 100644
--- a/core/res/res/layout/keyguard_screen_unlock_landscape.xml
+++ b/core/res/res/layout/keyguard_screen_unlock_landscape.xml
@@ -38,6 +38,15 @@
android:layout_marginLeft="24dip"
android:gravity="left"
>
+
+ <TextView
+ android:id="@+id/alarm_status"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:textSize="18sp"
+ android:drawablePadding="4dip"
+ />
<TextView
android:id="@+id/status1"
android:layout_width="wrap_content"
diff --git a/core/res/res/layout/keyguard_screen_unlock_portrait.xml b/core/res/res/layout/keyguard_screen_unlock_portrait.xml
index 85e1db190fba..c4384120df55 100644
--- a/core/res/res/layout/keyguard_screen_unlock_portrait.xml
+++ b/core/res/res/layout/keyguard_screen_unlock_portrait.xml
@@ -127,6 +127,15 @@
android:layout_marginLeft="12dip"
android:gravity="left"
>
+ <!-- TODO: Redo layout when we release on phones -->
+ <TextView
+ android:id="@+id/alarm_status"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:textSize="18sp"
+ android:drawablePadding="4dip"
+ />
<TextView
android:id="@+id/status1"
android:layout_width="wrap_content"
diff --git a/core/res/res/values/colors.xml b/core/res/res/values/colors.xml
index a286265fdc53..2e87883416b4 100644
--- a/core/res/res/values/colors.xml
+++ b/core/res/res/values/colors.xml
@@ -104,9 +104,10 @@
<color name="keyguard_text_color_decline">#fe0a5a</color>
<!-- keyguard clock -->
- <color name="lockscreen_clock_background">#ff9a9a9a</color>
- <color name="lockscreen_clock_foreground">#ff666666</color>
+ <color name="lockscreen_clock_background">#b3ffffff</color>
+ <color name="lockscreen_clock_foreground">#40000000</color>
<color name="lockscreen_clock_am_pm">#ff9a9a9a</color>
+ <color name="lockscreen_owner_info">#ff9a9a9a</color>
<!-- For holo theme -->
<drawable name="screen_background_holo_light">#fff3f3f3</drawable>
diff --git a/core/res/res/values/styles.xml b/core/res/res/values/styles.xml
index 2ea013545cf2..96e60f29f191 100644
--- a/core/res/res/values/styles.xml
+++ b/core/res/res/values/styles.xml
@@ -1511,6 +1511,7 @@
<style name="Widget.Holo.ProgressBar.Horizontal" parent="Widget.ProgressBar.Horizontal">
<item name="android:progressDrawable">@android:drawable/progress_horizontal_holo_dark</item>
+ <item name="android:indeterminateDrawable">@android:drawable/progress_indeterminate_horizontal_holo</item>
<item name="android:minHeight">24dip</item>
<item name="android:maxHeight">24dip</item>
</style>
@@ -1541,7 +1542,7 @@
<item name="android:indeterminateDrawable">@android:drawable/scrubber_progress_horizontal_holo_dark</item>
<item name="android:minHeight">13dip</item>
<item name="android:maxHeight">13dip</item>
- <item name="android:thumb">@android:drawable/scrubber_control_holo</item>
+ <item name="android:thumb">@android:drawable/scrubber_control_selector_holo</item>
<item name="android:thumbOffset">16dip</item>
<item name="android:focusable">true</item>
</style>
diff --git a/graphics/java/android/renderscript/Mesh.java b/graphics/java/android/renderscript/Mesh.java
index 59e3dd9991ce..b77fe7d459ed 100644
--- a/graphics/java/android/renderscript/Mesh.java
+++ b/graphics/java/android/renderscript/Mesh.java
@@ -23,10 +23,29 @@ import android.util.Log;
/**
* @hide
+ * Mesh class is a container for geometric data displayed in
+ * renderscript.
+ *
+ * Internally, mesh is a collection of allocations that
+ * represent vertex data (positions, normals, texture
+ * coordinates) and index data such as triangles and lines.
+ *
+ * Vertex data could either be interlieved within one
+ * allocation, provided separately as multiple allocation
+ * objects or done as a combination of the above. When a
+ * vertex channel name matches an input in the vertex program,
+ * renderscript will automatically connect the two together.
+ *
+ * Parts of the mesh could be rendered with either explicit
+ * index sets or primitive types.
*
**/
public class Mesh extends BaseObj {
+ /**
+ * Describes the way mesh vertex data is interpreted when rendering
+ *
+ **/
public enum Primitive {
POINT (0),
LINE (1),
@@ -49,25 +68,50 @@ public class Mesh extends BaseObj {
super(id, rs);
}
+ /**
+ * @return number of allocations containing vertex data
+ *
+ **/
public int getVertexAllocationCount() {
if(mVertexBuffers == null) {
return 0;
}
return mVertexBuffers.length;
}
+ /**
+ * @param slot index in the list of allocations to return
+ * @return vertex data allocation at the given index
+ *
+ **/
public Allocation getVertexAllocation(int slot) {
return mVertexBuffers[slot];
}
+ /**
+ * @return number of primitives or index sets in the mesh
+ *
+ **/
public int getPrimitiveCount() {
if(mIndexBuffers == null) {
return 0;
}
return mIndexBuffers.length;
}
+
+ /**
+ * @param slot locaton within the list of index set allocation
+ * @return allocation containing primtive index data or null if
+ * the index data is not specified explicitly
+ *
+ **/
public Allocation getIndexSetAllocation(int slot) {
return mIndexBuffers[slot];
}
+ /**
+ * @param slot locaiton within the list of index set primitives
+ * @return index set primitive type
+ *
+ **/
public Primitive getPrimitive(int slot) {
return mPrimitives[slot];
}
@@ -105,6 +149,12 @@ public class Mesh extends BaseObj {
}
}
+ /**
+ * Mesh builder object. It starts empty and requires the user to
+ * add the types necessary to create vertex and index
+ * allocations
+ *
+ */
public static class Builder {
RenderScript mRS;
int mUsage;
@@ -121,6 +171,13 @@ public class Mesh extends BaseObj {
Entry[] mVertexTypes;
Vector mIndexTypes;
+ /**
+ * Creates builder object
+ * @param rs
+ * @param usage specifies how the mesh allocations are to be
+ * handled, whether they need to be uploaded to a
+ * buffer on the gpu, maintain a cpu copy, etc
+ */
public Builder(RenderScript rs, int usage) {
mRS = rs;
mUsage = usage;
@@ -129,14 +186,29 @@ public class Mesh extends BaseObj {
mIndexTypes = new Vector();
}
+ /**
+ * @return internal index of the last vertex buffer type added to
+ * builder
+ **/
public int getCurrentVertexTypeIndex() {
return mVertexTypeCount - 1;
}
+ /**
+ * @return internal index of the last index set added to the
+ * builder
+ **/
public int getCurrentIndexSetIndex() {
return mIndexTypes.size() - 1;
}
+ /**
+ * Adds a vertex data type to the builder object
+ *
+ * @param r type of the vertex data allocation to be created
+ *
+ * @return this
+ **/
public Builder addVertexType(Type t) throws IllegalStateException {
if (mVertexTypeCount >= mVertexTypes.length) {
throw new IllegalStateException("Max vertex types exceeded.");
@@ -149,6 +221,14 @@ public class Mesh extends BaseObj {
return this;
}
+ /**
+ * Adds a vertex data type to the builder object
+ *
+ * @param e element describing the vertex data layout
+ * @param size number of elements in the buffer
+ *
+ * @return this
+ **/
public Builder addVertexType(Element e, int size) throws IllegalStateException {
if (mVertexTypeCount >= mVertexTypes.length) {
throw new IllegalStateException("Max vertex types exceeded.");
@@ -162,6 +242,14 @@ public class Mesh extends BaseObj {
return this;
}
+ /**
+ * Adds an index set data type to the builder object
+ *
+ * @param t type of the index set data, could be null
+ * @param p primitive type
+ *
+ * @return this
+ **/
public Builder addIndexSetType(Type t, Primitive p) {
Entry indexType = new Entry();
indexType.t = t;
@@ -172,6 +260,13 @@ public class Mesh extends BaseObj {
return this;
}
+ /**
+ * Adds an index set primitive type to the builder object
+ *
+ * @param p primitive type
+ *
+ * @return this
+ **/
public Builder addIndexSetType(Primitive p) {
Entry indexType = new Entry();
indexType.t = null;
@@ -182,6 +277,15 @@ public class Mesh extends BaseObj {
return this;
}
+ /**
+ * Adds an index set data type to the builder object
+ *
+ * @param e element describing the index set data layout
+ * @param size number of elements in the buffer
+ * @param p primitive type
+ *
+ * @return this
+ **/
public Builder addIndexSetType(Element e, int size, Primitive p) {
Entry indexType = new Entry();
indexType.t = null;
@@ -237,6 +341,10 @@ public class Mesh extends BaseObj {
return newMesh;
}
+ /**
+ * Create a Mesh object from the current state of the builder
+ *
+ **/
public Mesh create() {
mRS.validate();
Mesh sm = internalCreate(mRS, this);
@@ -244,6 +352,12 @@ public class Mesh extends BaseObj {
}
}
+ /**
+ * Mesh builder object. It starts empty and requires the user to
+ * add all the vertex and index allocations that comprise the
+ * mesh
+ *
+ */
public static class AllocationBuilder {
RenderScript mRS;
@@ -264,14 +378,30 @@ public class Mesh extends BaseObj {
mIndexTypes = new Vector();
}
+ /**
+ * @return internal index of the last vertex buffer type added to
+ * builder
+ **/
public int getCurrentVertexTypeIndex() {
return mVertexTypeCount - 1;
}
+ /**
+ * @return internal index of the last index set added to the
+ * builder
+ **/
public int getCurrentIndexSetIndex() {
return mIndexTypes.size() - 1;
}
+ /**
+ * Adds an allocation containing vertex buffer data to the
+ * builder
+ *
+ * @param a vertex data allocation
+ *
+ * @return this
+ **/
public AllocationBuilder addVertexAllocation(Allocation a) throws IllegalStateException {
if (mVertexTypeCount >= mVertexTypes.length) {
throw new IllegalStateException("Max vertex types exceeded.");
@@ -283,6 +413,15 @@ public class Mesh extends BaseObj {
return this;
}
+ /**
+ * Adds an allocation containing index buffer data and index type
+ * to the builder
+ *
+ * @param a index set data allocation, could be null
+ * @param p index set primitive type
+ *
+ * @return this
+ **/
public AllocationBuilder addIndexSetAllocation(Allocation a, Primitive p) {
Entry indexType = new Entry();
indexType.a = a;
@@ -291,6 +430,13 @@ public class Mesh extends BaseObj {
return this;
}
+ /**
+ * Adds an index set type to the builder
+ *
+ * @param p index set primitive type
+ *
+ * @return this
+ **/
public AllocationBuilder addIndexSetType(Primitive p) {
Entry indexType = new Entry();
indexType.a = null;
@@ -325,6 +471,10 @@ public class Mesh extends BaseObj {
return newMesh;
}
+ /**
+ * Create a Mesh object from the current state of the builder
+ *
+ **/
public Mesh create() {
mRS.validate();
Mesh sm = internalCreate(mRS, this);
@@ -332,7 +482,11 @@ public class Mesh extends BaseObj {
}
}
-
+ /**
+ * Builder that allows creation of a mesh object point by point
+ * and triangle by triangle
+ *
+ **/
public static class TriangleMeshBuilder {
float mVtxData[];
int mVtxCount;
@@ -358,6 +512,15 @@ public class Mesh extends BaseObj {
public static final int NORMAL = 0x0002;
public static final int TEXTURE_0 = 0x0100;
+ /**
+ * @param rs
+ * @param vtxSize specifies whether the vertex is a float2 or
+ * float3
+ * @param flags bitfield that is a combination of COLOR, NORMAL,
+ * and TEXTURE_0 that specifies what vertex data
+ * channels are present in the mesh
+ *
+ **/
public TriangleMeshBuilder(RenderScript rs, int vtxSize, int flags) {
mRS = rs;
mVtxCount = 0;
@@ -401,6 +564,15 @@ public class Mesh extends BaseObj {
}
}
+ /**
+ * Adds a float2 vertex to the mesh
+ *
+ * @param x position x
+ * @param y position y
+ *
+ * @return this
+ *
+ **/
public TriangleMeshBuilder addVertex(float x, float y) {
if (mVtxSize != 2) {
throw new IllegalStateException("add mistmatch with declared components.");
@@ -412,6 +584,16 @@ public class Mesh extends BaseObj {
return this;
}
+ /**
+ * Adds a float3 vertex to the mesh
+ *
+ * @param x position x
+ * @param y position y
+ * @param z position z
+ *
+ * @return this
+ *
+ **/
public TriangleMeshBuilder addVertex(float x, float y, float z) {
if (mVtxSize != 3) {
throw new IllegalStateException("add mistmatch with declared components.");
@@ -424,6 +606,14 @@ public class Mesh extends BaseObj {
return this;
}
+ /**
+ * Sets the texture coordinate for the last added vertex
+ *
+ * @param s texture coordinate s
+ * @param t texture coordinate t
+ *
+ * @return this
+ **/
public TriangleMeshBuilder setTexture(float s, float t) {
if ((mFlags & TEXTURE_0) == 0) {
throw new IllegalStateException("add mistmatch with declared components.");
@@ -433,6 +623,15 @@ public class Mesh extends BaseObj {
return this;
}
+ /**
+ * Sets the normal vector for the last added vertex
+ *
+ * @param x normal vector x
+ * @param y normal vector y
+ * @param z normal vector z
+ *
+ * @return this
+ **/
public TriangleMeshBuilder setNormal(float x, float y, float z) {
if ((mFlags & NORMAL) == 0) {
throw new IllegalStateException("add mistmatch with declared components.");
@@ -443,6 +642,16 @@ public class Mesh extends BaseObj {
return this;
}
+ /**
+ * Sets the color for the last added vertex
+ *
+ * @param r red component
+ * @param g green component
+ * @param b blue component
+ * @param a alpha component
+ *
+ * @return this
+ **/
public TriangleMeshBuilder setColor(float r, float g, float b, float a) {
if ((mFlags & COLOR) == 0) {
throw new IllegalStateException("add mistmatch with declared components.");
@@ -454,6 +663,15 @@ public class Mesh extends BaseObj {
return this;
}
+ /**
+ * Adds a new triangle to the mesh builder
+ *
+ * @param idx1 index of the first vertex in the triangle
+ * @param idx2 index of the second vertex in the triangle
+ * @param idx3 index of the third vertex in the triangle
+ *
+ * @return this
+ **/
public TriangleMeshBuilder addTriangle(int idx1, int idx2, int idx3) {
if((idx1 >= mVtxCount) || (idx1 < 0) ||
(idx2 >= mVtxCount) || (idx2 < 0) ||
@@ -471,6 +689,20 @@ public class Mesh extends BaseObj {
return this;
}
+ /**
+ * Creates the mesh object from the current state of the builder
+ *
+ * @param uploadToBufferObject specifies whether the vertex data
+ * is to be uploaded into the buffer
+ * object indicating that it's likely
+ * not going to be modified and
+ * rendered many times.
+ * Alternatively, it indicates the
+ * mesh data will be updated
+ * frequently and remain in script
+ * accessible memory
+ *
+ **/
public Mesh create(boolean uploadToBufferObject) {
Element.Builder b = new Element.Builder(mRS);
int floatCount = mVtxSize;
diff --git a/graphics/java/android/renderscript/Program.java b/graphics/java/android/renderscript/Program.java
index b07ae7d53f76..fdd138ca72b9 100644
--- a/graphics/java/android/renderscript/Program.java
+++ b/graphics/java/android/renderscript/Program.java
@@ -28,6 +28,9 @@ import android.util.Log;
/**
*
+ * Program is a base class for all the objects that modify
+ * various stages of the graphics pipeline
+ *
**/
public class Program extends BaseObj {
public static final int MAX_INPUT = 8;
@@ -35,6 +38,12 @@ public class Program extends BaseObj {
public static final int MAX_CONSTANT = 8;
public static final int MAX_TEXTURE = 8;
+ /**
+ *
+ * TextureType specifies what textures are attached to Program
+ * objects
+ *
+ **/
public enum TextureType {
TEXTURE_2D (0),
TEXTURE_CUBE (1);
@@ -68,6 +77,14 @@ public class Program extends BaseObj {
super(id, rs);
}
+ /**
+ * Binds a constant buffer to be used as uniform inputs to the
+ * program
+ *
+ * @param a allocation containing uniform data
+ * @param slot index within the program's list of constant
+ * buffer allocations
+ */
public void bindConstants(Allocation a, int slot) {
if (slot < 0 || slot >= mConstants.length) {
throw new IllegalArgumentException("Slot ID out of range.");
@@ -80,6 +97,13 @@ public class Program extends BaseObj {
mRS.nProgramBindConstants(getID(), slot, id);
}
+ /**
+ * Binds a texture to be used in the program
+ *
+ * @param va allocation containing texture data
+ * @param slot index within the program's list of textures
+ *
+ */
public void bindTexture(Allocation va, int slot)
throws IllegalArgumentException {
mRS.validate();
@@ -95,6 +119,15 @@ public class Program extends BaseObj {
mRS.nProgramBindTexture(getID(), slot, id);
}
+ /**
+ * Binds an object that describes how a texture at the
+ * corresponding location is sampled
+ *
+ * @param vs sampler for a corresponding texture
+ * @param slot index within the program's list of textures to
+ * use the sampler on
+ *
+ */
public void bindSampler(Sampler vs, int slot)
throws IllegalArgumentException {
mRS.validate();
@@ -133,11 +166,25 @@ public class Program extends BaseObj {
mTextureTypes = new TextureType[MAX_TEXTURE];
}
+ /**
+ * Sets the GLSL shader code to be used in the program
+ *
+ * @param s GLSL shader string
+ * @return self
+ */
public BaseProgramBuilder setShader(String s) {
mShader = s;
return this;
}
+ /**
+ * Sets the GLSL shader code to be used in the program
+ *
+ * @param resources application resources
+ * @param resourceID id of the file containing GLSL shader code
+ *
+ * @return self
+ */
public BaseProgramBuilder setShader(Resources resources, int resourceID) {
byte[] str;
int strLength;
@@ -176,14 +223,29 @@ public class Program extends BaseObj {
return this;
}
+ /**
+ * Queries the index of the last added constant buffer type
+ *
+ */
public int getCurrentConstantIndex() {
return mConstantCount - 1;
}
+ /**
+ * Queries the index of the last added texture type
+ *
+ */
public int getCurrentTextureIndex() {
return mTextureCount - 1;
}
+ /**
+ * Adds constant (uniform) inputs to the program
+ *
+ * @param t Type that describes the layout of the Allocation
+ * object to be used as constant inputs to the Program
+ * @return self
+ */
public BaseProgramBuilder addConstant(Type t) throws IllegalStateException {
// Should check for consistant and non-conflicting names...
if(mConstantCount >= MAX_CONSTANT) {
@@ -197,6 +259,13 @@ public class Program extends BaseObj {
return this;
}
+ /**
+ * Adds a texture input to the Program
+ *
+ * @param texType describes that the texture to append it (2D,
+ * Cubemap, etc.)
+ * @return self
+ */
public BaseProgramBuilder addTexture(TextureType texType) throws IllegalArgumentException {
if(mTextureCount >= MAX_TEXTURE) {
throw new IllegalArgumentException("Max texture count exceeded.");
diff --git a/graphics/java/android/renderscript/ProgramFragment.java b/graphics/java/android/renderscript/ProgramFragment.java
index 7f12661ba22d..14c0c01ca34d 100644
--- a/graphics/java/android/renderscript/ProgramFragment.java
+++ b/graphics/java/android/renderscript/ProgramFragment.java
@@ -22,6 +22,9 @@ import android.util.Log;
/**
+ * ProgramFragment, also know as a fragment shader, describes a
+ * stage in the graphics pipeline responsible for manipulating
+ * pixel data in a user-defined way.
*
**/
public class ProgramFragment extends Program {
@@ -30,10 +33,20 @@ public class ProgramFragment extends Program {
}
public static class Builder extends BaseProgramBuilder {
+ /**
+ * Create a builder object.
+ *
+ * @param rs
+ */
public Builder(RenderScript rs) {
super(rs);
}
+ /**
+ * Creates ProgramFragment from the current state of the builder
+ *
+ * @return ProgramFragment
+ */
public ProgramFragment create() {
mRS.validate();
int[] tmp = new int[(mInputCount + mOutputCount + mConstantCount + mTextureCount) * 2];
diff --git a/graphics/java/android/renderscript/ProgramFragmentFixedFunction.java b/graphics/java/android/renderscript/ProgramFragmentFixedFunction.java
index f0040c64efd3..663bc9fae2d5 100644
--- a/graphics/java/android/renderscript/ProgramFragmentFixedFunction.java
+++ b/graphics/java/android/renderscript/ProgramFragmentFixedFunction.java
@@ -22,6 +22,13 @@ import android.util.Log;
/**
+ * ProgramFragmentFixedFunction is a helper class that provides
+ * a way to make a simple fragment shader without writing any
+ * GLSL code.
+ *
+ * This class allows for display of constant color, interpolated
+ * color from vertex shader, or combinations of the above
+ * blended with results of up to two texture lookups.
*
**/
public class ProgramFragmentFixedFunction extends ProgramFragment {
@@ -34,6 +41,12 @@ public class ProgramFragmentFixedFunction extends ProgramFragment {
super(rs);
}
+ /**
+ * Creates ProgramFragmentFixedFunction from the current state
+ * of the builder
+ *
+ * @return ProgramFragmentFixedFunction
+ */
public ProgramFragmentFixedFunction create() {
mRS.validate();
int[] tmp = new int[(mInputCount + mOutputCount + mConstantCount + mTextureCount) * 2];
@@ -71,6 +84,11 @@ public class ProgramFragmentFixedFunction extends ProgramFragment {
String mShader;
RenderScript mRS;
+ /**
+ * EnvMode describes how textures are combined with the existing
+ * color in the fixed function fragment shader
+ *
+ **/
public enum EnvMode {
REPLACE (1),
MODULATE (2),
@@ -82,6 +100,11 @@ public class ProgramFragmentFixedFunction extends ProgramFragment {
}
}
+ /**
+ * Format describes the pixel format of textures in the fixed
+ * function fragment shader and how they are sampled
+ *
+ **/
public enum Format {
ALPHA (1),
LUMINANCE_ALPHA (2),
@@ -168,12 +191,30 @@ public class ProgramFragmentFixedFunction extends ProgramFragment {
mShader += "}\n";
}
+ /**
+ * Creates a builder for fixed function fragment program
+ *
+ * @param rs
+ */
public Builder(RenderScript rs) {
mRS = rs;
mSlots = new Slot[MAX_TEXTURE];
mPointSpriteEnable = false;
}
+ /**
+ * Adds a texture to be fetched as part of the fixed function
+ * fragment program
+ *
+ * @param env specifies how the texture is combined with the
+ * current color
+ * @param fmt specifies the format of the texture and how its
+ * components will be used to combine with the
+ * current color
+ * @param slot index of the texture to apply the operations on
+ *
+ * @return this
+ */
public Builder setTexture(EnvMode env, Format fmt, int slot)
throws IllegalArgumentException {
if((slot < 0) || (slot >= MAX_TEXTURE)) {
@@ -183,16 +224,34 @@ public class ProgramFragmentFixedFunction extends ProgramFragment {
return this;
}
+ /**
+ * Specifies whether the texture coordinate passed from the
+ * vertex program is replaced with an openGL internal point
+ * sprite texture coordinate
+ *
+ **/
public Builder setPointSpriteTexCoordinateReplacement(boolean enable) {
mPointSpriteEnable = enable;
return this;
}
+ /**
+ * Specifies whether the varying color passed from the vertex
+ * program or the constant color set on the fragment program is
+ * used in the final color calculation in the fixed function
+ * fragment shader
+ *
+ **/
public Builder setVaryingColor(boolean enable) {
mVaryingColorEnable = enable;
return this;
}
+ /**
+ * Creates the fixed function fragment program from the current
+ * state of the builder.
+ *
+ */
public ProgramFragmentFixedFunction create() {
InternalBuilder sb = new InternalBuilder(mRS);
mNumTextures = 0;
diff --git a/graphics/java/android/renderscript/ProgramVertex.java b/graphics/java/android/renderscript/ProgramVertex.java
index 13800ff7b594..7ba8b8202c4e 100644
--- a/graphics/java/android/renderscript/ProgramVertex.java
+++ b/graphics/java/android/renderscript/ProgramVertex.java
@@ -23,6 +23,9 @@ import android.util.Log;
/**
+ * ProgramVertex, also know as a vertex shader, describes a
+ * stage in the graphics pipeline responsible for manipulating
+ * geometric data in a user-defined way.
*
**/
public class ProgramVertex extends Program {
@@ -31,11 +34,31 @@ public class ProgramVertex extends Program {
super(id, rs);
}
+ /**
+ * Builder class for creating ProgramVertex objects.
+ * The builder starts empty and the user must minimally provide
+ * the GLSL shader code, and the varying inputs. Constant, or
+ * uniform parameters to the shader may optionally be provided as
+ * well.
+ *
+ **/
public static class Builder extends BaseProgramBuilder {
+ /**
+ * Create a builder object.
+ *
+ * @param rs
+ */
public Builder(RenderScript rs) {
super(rs);
}
+ /**
+ * Add varying inputs to the program
+ *
+ * @param e element describing the layout of the varying input
+ * structure
+ * @return self
+ */
public Builder addInput(Element e) throws IllegalStateException {
// Should check for consistant and non-conflicting names...
if(mInputCount >= MAX_INPUT) {
@@ -48,6 +71,11 @@ public class ProgramVertex extends Program {
return this;
}
+ /**
+ * Creates ProgramVertex from the current state of the builder
+ *
+ * @return ProgramVertex
+ */
public ProgramVertex create() {
mRS.validate();
int[] tmp = new int[(mInputCount + mOutputCount + mConstantCount + mTextureCount) * 2];
diff --git a/graphics/java/android/renderscript/ProgramVertexFixedFunction.java b/graphics/java/android/renderscript/ProgramVertexFixedFunction.java
index 1b69efe3c02c..b9537c7bcae8 100644
--- a/graphics/java/android/renderscript/ProgramVertexFixedFunction.java
+++ b/graphics/java/android/renderscript/ProgramVertexFixedFunction.java
@@ -23,6 +23,9 @@ import android.util.Log;
/**
+ * ProgramVertexFixedFunction is a helper class that provides a
+ * simple way to create a fixed function emulation vertex shader
+ * without writing any GLSL code.
*
**/
public class ProgramVertexFixedFunction extends ProgramVertex {
@@ -31,6 +34,12 @@ public class ProgramVertexFixedFunction extends ProgramVertex {
super(id, rs);
}
+ /**
+ * Binds the constant buffer containing fixed function emulation
+ * matrices
+ *
+ * @param va allocation containing fixed function matrices
+ */
public void bindConstants(Constants va) {
mRS.validate();
bindConstants(va.getAllocation(), 0);
@@ -53,6 +62,12 @@ public class ProgramVertexFixedFunction extends ProgramVertex {
return this;
}
+ /**
+ * Creates ProgramVertexFixedFunction from the current state of
+ * the builder
+ *
+ * @return ProgramVertexFixedFunction
+ */
public ProgramVertexFixedFunction create() {
mRS.validate();
int[] tmp = new int[(mInputCount + mOutputCount + mConstantCount + mTextureCount) * 2];
@@ -87,10 +102,20 @@ public class ProgramVertexFixedFunction extends ProgramVertex {
String mShader;
RenderScript mRS;
+ /**
+ * Creates a builder for fixed function vertex program
+ *
+ * @param rs
+ */
public Builder(RenderScript rs) {
mRS = rs;
}
+ /**
+ * Specifies whether texture matrix calculations are to be added
+ * to the shader
+ *
+ */
public Builder setTextureMatrixEnable(boolean enable) {
mTextureMatrixEnable = enable;
return this;
@@ -126,6 +151,12 @@ public class ProgramVertexFixedFunction extends ProgramVertex {
mShader += "}\n";
}
+ /**
+ * Creates ProgramVertexFixedFunction from the current state of
+ * the builder
+ *
+ * @return Fixed function emulation ProgramVertex
+ */
public ProgramVertexFixedFunction create() {
buildShaderString();
@@ -144,6 +175,11 @@ public class ProgramVertexFixedFunction extends ProgramVertex {
}
}
+ /**
+ * Helper class to store modelview, projection and texture
+ * matrices for ProgramVertexFixedFunction
+ *
+ */
public static class Constants {
static final int MODELVIEW_OFFSET = 0;
static final int PROJECTION_OFFSET = 16;
@@ -159,6 +195,11 @@ public class ProgramVertexFixedFunction extends ProgramVertex {
}
private FieldPacker mIOBuffer;
+ /**
+ * Creates buffer to store fixed function emulation matrices
+ *
+ * @param rs
+ **/
public Constants(RenderScript rs) {
Type constInputType = ProgramVertexFixedFunction.Builder.getConstantInputType(rs);
mAlloc = Allocation.createTyped(rs, constInputType);
@@ -173,6 +214,11 @@ public class ProgramVertexFixedFunction extends ProgramVertex {
setTexture(new Matrix4f());
}
+ /**
+ * Forces deallocation of memory backing the contant matrices.
+ * Normally, this is unnecessary and will be garbage collected
+ *
+ */
public void destroy() {
mAlloc.destroy();
mAlloc = null;
@@ -186,16 +232,34 @@ public class ProgramVertexFixedFunction extends ProgramVertex {
mAlloc.copyFrom(mIOBuffer.getData());
}
+ /**
+ * Sets the modelview matrix in the fixed function matrix buffer
+ *
+ * @param m modelview matrix
+ */
public void setModelview(Matrix4f m) {
mModel.load(m);
addToBuffer(MODELVIEW_OFFSET*4, m);
}
+ /**
+ * Sets the projection matrix in the fixed function matrix buffer
+ *
+ * @param m projection matrix
+ */
public void setProjection(Matrix4f m) {
mProjection.load(m);
addToBuffer(PROJECTION_OFFSET*4, m);
}
+ /**
+ * Sets the texture matrix in the fixed function matrix buffer.
+ * Texture matrix must be enabled in the
+ * ProgramVertexFixedFunction builder for the shader to utilize
+ * it.
+ *
+ * @param m modelview matrix
+ */
public void setTexture(Matrix4f m) {
mTexture.load(m);
addToBuffer(TEXTURE_OFFSET*4, m);
diff --git a/graphics/java/android/renderscript/Script.java b/graphics/java/android/renderscript/Script.java
index ddf41cb3c7ce..b3ad20a3bf4d 100644
--- a/graphics/java/android/renderscript/Script.java
+++ b/graphics/java/android/renderscript/Script.java
@@ -20,32 +20,25 @@ package android.renderscript;
*
**/
public class Script extends BaseObj {
- public static final int MAX_SLOT = 16;
-
- boolean mIsRoot;
- Type[] mTypes;
- boolean[] mWritable;
- Invokable[] mInvokables;
-
- public static class Invokable {
- RenderScript mRS;
- Script mScript;
- int mSlot;
- String mName;
-
- Invokable() {
- mSlot = -1;
- }
-
- public void execute() {
- mRS.nScriptInvoke(mScript.getID(), mSlot);
- }
- }
-
+ /**
+ * @hide
+ *
+ * Only intended for use by generated reflected code.
+ *
+ * @param slot
+ */
protected void invoke(int slot) {
mRS.nScriptInvoke(getID(), slot);
}
+ /**
+ * @hide
+ *
+ * Only intended for use by generated reflected code.
+ *
+ * @param slot
+ * @param v
+ */
protected void invoke(int slot, FieldPacker v) {
if (v != null) {
mRS.nScriptInvokeV(getID(), slot, v.getData());
@@ -59,6 +52,15 @@ public class Script extends BaseObj {
super(id, rs);
}
+
+ /**
+ * @hide
+ *
+ * Only intended for use by generated reflected code.
+ *
+ * @param va
+ * @param slot
+ */
public void bindAllocation(Allocation va, int slot) {
mRS.validate();
if (va != null) {
@@ -68,30 +70,86 @@ public class Script extends BaseObj {
}
}
+ /**
+ * @hide
+ *
+ * Only intended for use by generated reflected code.
+ *
+ * @param index
+ * @param v
+ */
public void setVar(int index, float v) {
mRS.nScriptSetVarF(getID(), index, v);
}
+ /**
+ * @hide
+ *
+ * Only intended for use by generated reflected code.
+ *
+ * @param index
+ * @param v
+ */
public void setVar(int index, double v) {
mRS.nScriptSetVarD(getID(), index, v);
}
+ /**
+ * @hide
+ *
+ * Only intended for use by generated reflected code.
+ *
+ * @param index
+ * @param v
+ */
public void setVar(int index, int v) {
mRS.nScriptSetVarI(getID(), index, v);
}
+ /**
+ * @hide
+ *
+ * Only intended for use by generated reflected code.
+ *
+ * @param index
+ * @param v
+ */
public void setVar(int index, long v) {
mRS.nScriptSetVarJ(getID(), index, v);
}
+ /**
+ * @hide
+ *
+ * Only intended for use by generated reflected code.
+ *
+ * @param index
+ * @param v
+ */
public void setVar(int index, boolean v) {
mRS.nScriptSetVarI(getID(), index, v ? 1 : 0);
}
+ /**
+ * @hide
+ *
+ * Only intended for use by generated reflected code.
+ *
+ * @param index
+ * @param o
+ */
public void setVar(int index, BaseObj o) {
mRS.nScriptSetVarObj(getID(), index, (o == null) ? 0 : o.getID());
}
+ /**
+ * @hide
+ *
+ * Only intended for use by generated reflected code.
+ *
+ * @param index
+ * @param v
+ */
public void setVar(int index, FieldPacker v) {
mRS.nScriptSetVarV(getID(), index, v.getData());
}
diff --git a/graphics/java/android/renderscript/ScriptC.java b/graphics/java/android/renderscript/ScriptC.java
index 984edd373a28..14e4ab5a00f2 100644
--- a/graphics/java/android/renderscript/ScriptC.java
+++ b/graphics/java/android/renderscript/ScriptC.java
@@ -35,10 +35,28 @@ import java.lang.reflect.Modifier;
public class ScriptC extends Script {
private static final String TAG = "ScriptC";
+ /**
+ * @hide
+ *
+ * Only intended for use by the generated derived classes.
+ *
+ * @param id
+ * @param rs
+ */
protected ScriptC(int id, RenderScript rs) {
super(id, rs);
}
+ /**
+ * @hide
+ *
+ * Only intended for use by the generated derived classes.
+ *
+ *
+ * @param rs
+ * @param resources
+ * @param resourceID
+ */
protected ScriptC(RenderScript rs, Resources resources, int resourceID) {
super(0, rs);
int id = internalCreate(rs, resources, resourceID);
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
index d11a18e6d5fe..bc7473e1d73c 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
@@ -61,7 +61,7 @@ public class DatabaseHelper extends SQLiteOpenHelper {
// database gets upgraded properly. At a minimum, please confirm that 'upgradeVersion'
// is properly propagated through your change. Not doing so will result in a loss of user
// settings.
- private static final int DATABASE_VERSION = 62;
+ private static final int DATABASE_VERSION = 63;
private Context mContext;
@@ -441,18 +441,7 @@ public class DatabaseHelper extends SQLiteOpenHelper {
}
if (upgradeVersion == 39) {
- db.beginTransaction();
- try {
- String value =
- mContext.getResources().getBoolean(
- R.bool.def_screen_brightness_automatic_mode) ? "1" : "0";
- db.execSQL("INSERT OR IGNORE INTO system(name,value) values('" +
- Settings.System.SCREEN_BRIGHTNESS_MODE + "','" + value + "');");
- db.setTransactionSuccessful();
- } finally {
- db.endTransaction();
- }
-
+ upgradeAutoBrightness(db);
upgradeVersion = 40;
}
@@ -802,6 +791,12 @@ public class DatabaseHelper extends SQLiteOpenHelper {
upgradeVersion = 62;
}
+ // Change the default for screen auto-brightness mode
+ if (upgradeVersion == 62) {
+ upgradeAutoBrightness(db);
+ upgradeVersion = 63;
+ }
+
// *** Remember to update DATABASE_VERSION above!
if (upgradeVersion != currentVersion) {
@@ -924,6 +919,20 @@ public class DatabaseHelper extends SQLiteOpenHelper {
}
}
+ private void upgradeAutoBrightness(SQLiteDatabase db) {
+ db.beginTransaction();
+ try {
+ String value =
+ mContext.getResources().getBoolean(
+ R.bool.def_screen_brightness_automatic_mode) ? "1" : "0";
+ db.execSQL("INSERT OR REPLACE INTO system(name,value) values('" +
+ Settings.System.SCREEN_BRIGHTNESS_MODE + "','" + value + "');");
+ db.setTransactionSuccessful();
+ } finally {
+ db.endTransaction();
+ }
+ }
+
/**
* Loads the default set of bookmarked shortcuts from an xml file.
*
diff --git a/policy/src/com/android/internal/policy/impl/LockScreen.java b/policy/src/com/android/internal/policy/impl/LockScreen.java
index 50d10bf8b512..4daf84f33f9c 100644
--- a/policy/src/com/android/internal/policy/impl/LockScreen.java
+++ b/policy/src/com/android/internal/policy/impl/LockScreen.java
@@ -80,11 +80,6 @@ class LockScreen extends LinearLayout implements KeyguardScreen,
// last known battery level
private int mBatteryLevel = 100;
- private String mNextAlarm = null;
- private Drawable mAlarmIcon = null;
- private String mCharging = null;
- private Drawable mChargingIcon = null;
-
private boolean mSilentMode;
private AudioManager mAudioManager;
private String mDateFormatString;
@@ -356,9 +351,6 @@ class LockScreen extends LinearLayout implements KeyguardScreen,
mStatus = getCurrentStatus(updateMonitor.getSimState());
updateLayout(mStatus);
- refreshBatteryStringAndIcon();
- refreshAlarmDisplay();
-
mTimeFormat = DateFormat.getTimeFormat(getContext());
mDateFormatString = getContext().getString(R.string.full_wday_month_day_no_year);
refreshTimeAndDateDisplay();
@@ -417,14 +409,6 @@ class LockScreen extends LinearLayout implements KeyguardScreen,
private Runnable mPendingR1;
private Runnable mPendingR2;
- private void refreshAlarmDisplay() {
- mNextAlarm = mLockPatternUtils.getNextAlarm();
- if (mNextAlarm != null) {
- mAlarmIcon = getContext().getResources().getDrawable(R.drawable.ic_lock_idle_alarm);
- }
- updateStatusLines();
- }
-
/** {@inheritDoc} */
public void onRefreshBatteryInfo(boolean showBatteryInfo, boolean pluggedIn,
int batteryLevel) {
@@ -433,32 +417,9 @@ class LockScreen extends LinearLayout implements KeyguardScreen,
mPluggedIn = pluggedIn;
mBatteryLevel = batteryLevel;
- refreshBatteryStringAndIcon();
updateStatusLines();
}
- private void refreshBatteryStringAndIcon() {
- if (!mShowingBatteryInfo) {
- mCharging = null;
- return;
- }
-
- if (mChargingIcon == null) {
- mChargingIcon =
- getContext().getResources().getDrawable(R.drawable.ic_lock_idle_charging);
- }
-
- if (mPluggedIn) {
- if (mBatteryLevel >= 100) {
- mCharging = getContext().getString(R.string.lockscreen_charged);
- } else {
- mCharging = getContext().getString(R.string.lockscreen_plugged_in, mBatteryLevel);
- }
- } else {
- mCharging = getContext().getString(R.string.lockscreen_low_battery);
- }
- }
-
/** {@inheritDoc} */
public void onTimeChanged() {
refreshTimeAndDateDisplay();
@@ -469,7 +430,7 @@ class LockScreen extends LinearLayout implements KeyguardScreen,
}
private void updateStatusLines() {
- mStatusView.updateStatusLines(mStatus.showStatusLines(), mCharging, mChargingIcon, mAlarmIcon);
+ mStatusView.updateStatusLines(mStatus.showStatusLines());
}
/** {@inheritDoc} */
diff --git a/policy/src/com/android/internal/policy/impl/PatternUnlockScreen.java b/policy/src/com/android/internal/policy/impl/PatternUnlockScreen.java
index 35fa3e50953f..5d1455e5b935 100644
--- a/policy/src/com/android/internal/policy/impl/PatternUnlockScreen.java
+++ b/policy/src/com/android/internal/policy/impl/PatternUnlockScreen.java
@@ -396,7 +396,7 @@ class PatternUnlockScreen extends LinearLayoutWithDefaultTouchRecepient
mLockPatternView
.setDisplayMode(LockPatternView.DisplayMode.Correct);
mStatusView.setInstructions("");
- mStatusView.updateStatusLines();
+ mStatusView.updateStatusLines(true);
mCallback.keyguardDone(true);
mCallback.reportSuccessfulUnlockAttempt();
} else {
@@ -416,7 +416,7 @@ class PatternUnlockScreen extends LinearLayoutWithDefaultTouchRecepient
// TODO mUnlockIcon.setVisibility(View.VISIBLE);
mStatusView.setInstructions(
getContext().getString(R.string.lockscreen_pattern_wrong));
- mStatusView.updateStatusLines();
+ mStatusView.updateStatusLines(true);
mLockPatternView.postDelayed(
mCancelPatternRunnable,
PATTERN_CLEAR_TIMEOUT_MS);
@@ -437,7 +437,7 @@ class PatternUnlockScreen extends LinearLayoutWithDefaultTouchRecepient
mStatusView.setInstructions(getContext().getString(
R.string.lockscreen_too_many_failed_attempts_countdown,
secondsRemaining));
- mStatusView.updateStatusLines();
+ mStatusView.updateStatusLines(true);
}
@Override
@@ -445,7 +445,7 @@ class PatternUnlockScreen extends LinearLayoutWithDefaultTouchRecepient
mLockPatternView.setEnabled(true);
mStatusView.setInstructions(getContext().getString(
R.string.lockscreen_pattern_instructions));
- mStatusView.updateStatusLines();
+ mStatusView.updateStatusLines(true);
// TODO mUnlockIcon.setVisibility(View.VISIBLE);
mFailedPatternAttemptsSinceLastTimeout = 0;
if (mEnableFallback) {
diff --git a/policy/src/com/android/internal/policy/impl/StatusView.java b/policy/src/com/android/internal/policy/impl/StatusView.java
index 2b788514df70..1caf0b724022 100644
--- a/policy/src/com/android/internal/policy/impl/StatusView.java
+++ b/policy/src/com/android/internal/policy/impl/StatusView.java
@@ -19,6 +19,11 @@ import android.view.View;
import android.widget.TextView;
class StatusView {
+ private static final int LOCK_ICON = R.drawable.ic_lock_idle_lock;
+ private static final int ALARM_ICON = R.drawable.ic_lock_idle_alarm;
+ private static final int CHARGING_ICON = R.drawable.ic_lock_idle_charging;
+ private static final int BATTERY_LOW_ICON = R.drawable.ic_lock_idle_low_battery;
+
private String mDateFormatString;
private TextView mCarrier;
@@ -33,20 +38,18 @@ class StatusView {
// last known battery level
private int mBatteryLevel = 100;
- private String mNextAlarm = null;
-
private String mInstructions = null;
private TextView mStatus1;
- private TextView mStatus2;
private TextView mPropertyOf;
- private boolean mHasStatus2;
private boolean mHasCarrier;
private boolean mHasDate;
- private boolean mHasProperty;
private View mView;
+ private TextView mAlarmStatus;
+ private LockPatternUtils mLockPatternUtils;
+
private View findViewById(int id) {
return mView.findViewById(id);
}
@@ -69,7 +72,7 @@ class StatusView {
mShowingBatteryInfo = showBatteryInfo;
mPluggedIn = pluggedIn;
mBatteryLevel = batteryLevel;
- updateStatusLines();
+ updateStatusLines(true);
}
void onTimeChanged() {
@@ -91,14 +94,14 @@ class StatusView {
mDate = (TextView) findViewById(R.id.date);
mHasDate = (mDate != null);
mDateFormatString = getContext().getString(R.string.full_wday_month_day_no_year);
+ mLockPatternUtils = lockPatternUtils;
refreshTimeAndDateDisplay();
mStatus1 = (TextView) findViewById(R.id.status1);
- mStatus2 = (TextView) findViewById(R.id.status2);
- mHasStatus2 = (mStatus2 != null);
+ mAlarmStatus = (TextView) findViewById(R.id.alarm_status);
+ mAlarmStatus.setCompoundDrawablesWithIntrinsicBounds(ALARM_ICON, 0, 0, 0);
mPropertyOf = (TextView) findViewById(R.id.propertyOf);
- mHasProperty = (mPropertyOf != null);
resetStatusInfo(updateMonitor, lockPatternUtils);
@@ -107,7 +110,6 @@ class StatusView {
mCarrier.setSelected(true);
mCarrier.setTextColor(0xffffffff);
}
-
}
void resetStatusInfo(KeyguardUpdateMonitor updateMonitor, LockPatternUtils lockPatternUtils) {
@@ -115,19 +117,18 @@ class StatusView {
mShowingBatteryInfo = updateMonitor.shouldShowBatteryInfo();
mPluggedIn = updateMonitor.isDevicePluggedIn();
mBatteryLevel = updateMonitor.getBatteryLevel();
- mNextAlarm = lockPatternUtils.getNextAlarm();
- updateStatusLines();
+ updateStatusLines(true);
}
void setInstructionText(int stringId) {
mStatus1.setText(stringId);
- mStatus1.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_lock_idle_lock, 0, 0, 0);
+ mStatus1.setCompoundDrawablesWithIntrinsicBounds(LOCK_ICON, 0, 0, 0);
mStatus1.setVisibility(View.VISIBLE);
}
void setInstructionText(String string) {
mStatus1.setText(string);
- mStatus1.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_lock_idle_lock, 0, 0, 0);
+ mStatus1.setCompoundDrawablesWithIntrinsicBounds(LOCK_ICON, 0, 0, 0);
mStatus1.setVisibility(View.VISIBLE);
}
@@ -138,9 +139,22 @@ class StatusView {
mCarrier.setText(string);
}
- /** Originated from PatternUnlockScreen **/
- void updateStatusLines() {
- if (mHasProperty) {
+ /**
+ * Update the status lines based on these rules:
+ * AlarmStatus: Alarm state always gets it's own line.
+ * Status1 is shared between help, battery status and generic unlock instructions,
+ * prioritized in that order.
+ * @param showStatusLines status lines are shown if true
+ */
+ void updateStatusLines(boolean showStatusLines) {
+ if (!showStatusLines) {
+ mStatus1.setVisibility(showStatusLines ? View.VISIBLE : View.GONE);
+ mAlarmStatus.setVisibility(showStatusLines ? View.VISIBLE : View.GONE);
+ return;
+ }
+
+ // Update owner info
+ if (mPropertyOf != null) {
ContentResolver res = getContext().getContentResolver();
String info = Settings.Secure.getString(res, Settings.Secure.LOCK_SCREEN_OWNER_INFO);
boolean enabled = Settings.Secure.getInt(res,
@@ -151,104 +165,44 @@ class StatusView {
View.VISIBLE : View.INVISIBLE);
}
- if (!mHasStatus2) return;
+ // Update Alarm status
+ String nextAlarm = mLockPatternUtils.getNextAlarm();
+ if (!TextUtils.isEmpty(nextAlarm)) {
+ mAlarmStatus.setText(nextAlarm);
+ mAlarmStatus.setVisibility(View.VISIBLE);
+ } else {
+ mAlarmStatus.setVisibility(View.GONE);
+ }
+ // Update Status1
if (mInstructions != null) {
- // instructions only
+ // Instructions only
+ final int resId = TextUtils.isEmpty(mInstructions) ? 0 : LOCK_ICON;
mStatus1.setText(mInstructions);
- if (TextUtils.isEmpty(mInstructions)) {
- mStatus1.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);
- } else {
- mStatus1.setCompoundDrawablesWithIntrinsicBounds(
- R.drawable.ic_lock_idle_lock, 0, 0, 0);
- }
-
+ mStatus1.setCompoundDrawablesWithIntrinsicBounds(resId, 0, 0, 0);
mStatus1.setVisibility(View.VISIBLE);
- mStatus2.setVisibility(View.INVISIBLE);
- } else if (mShowingBatteryInfo && mNextAlarm == null) {
- // battery only
+ } else if (mShowingBatteryInfo) {
+ // Battery status
if (mPluggedIn) {
- if (mBatteryLevel >= 100) {
- mStatus1.setText(getContext().getString(R.string.lockscreen_charged));
- } else {
- mStatus1.setText(getContext().getString(R.string.lockscreen_plugged_in,
- mBatteryLevel));
- }
+ // Charging or charged
+ if (mBatteryLevel >= 100) {
+ mStatus1.setText(getContext().getString(R.string.lockscreen_charged));
+ } else {
+ mStatus1.setText(getContext().getString(R.string.lockscreen_plugged_in,
+ mBatteryLevel));
+ }
+ mStatus1.setCompoundDrawablesWithIntrinsicBounds(CHARGING_ICON, 0, 0, 0);
} else {
+ // Battery is low
mStatus1.setText(getContext().getString(R.string.lockscreen_low_battery));
+ mStatus1.setCompoundDrawablesWithIntrinsicBounds(BATTERY_LOW_ICON, 0, 0, 0);
}
- mStatus1.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_lock_idle_charging, 0,
- 0, 0);
-
- mStatus1.setVisibility(View.VISIBLE);
- mStatus2.setVisibility(View.INVISIBLE);
-
- } else if (mNextAlarm != null && !mShowingBatteryInfo) {
- // alarm only
- mStatus1.setText(mNextAlarm);
- mStatus1.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_lock_idle_alarm, 0,
- 0, 0);
-
- mStatus1.setVisibility(View.VISIBLE);
- mStatus2.setVisibility(View.INVISIBLE);
- } else if (mNextAlarm != null && mShowingBatteryInfo) {
- // both battery and next alarm
- mStatus1.setText(mNextAlarm);
- mStatus2.setText(getContext().getString(
- R.string.lockscreen_battery_short,
- Math.min(100, mBatteryLevel)));
- mStatus1.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_lock_idle_alarm, 0,
- 0, 0);
- if (mPluggedIn) {
- mStatus2.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_lock_idle_charging,
- 0, 0, 0);
- } else {
- mStatus2.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);
- }
-
mStatus1.setVisibility(View.VISIBLE);
- mStatus2.setVisibility(View.VISIBLE);
} else {
// nothing specific to show; show general instructions
mStatus1.setText(R.string.lockscreen_pattern_instructions);
- mStatus1.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_lock_idle_lock, 0,
- 0, 0);
-
+ mStatus1.setCompoundDrawablesWithIntrinsicBounds(LOCK_ICON, 0,0, 0);
mStatus1.setVisibility(View.VISIBLE);
- mStatus2.setVisibility(View.INVISIBLE);
- }
- }
-
- /** Originated from LockScreen **/
- // TODO Merge with function above
- void updateStatusLines(boolean showStatusLines, String charging, Drawable chargingIcon,
- Drawable alarmIcon) {
- if (!showStatusLines || (charging == null && mNextAlarm == null)) {
- mStatus1.setVisibility(View.INVISIBLE);
- mStatus2.setVisibility(View.INVISIBLE);
- } else if (charging != null && mNextAlarm == null) {
- // charging only
- mStatus1.setVisibility(View.VISIBLE);
- mStatus2.setVisibility(View.INVISIBLE);
-
- mStatus1.setText(charging);
- mStatus1.setCompoundDrawablesWithIntrinsicBounds(chargingIcon, null, null, null);
- } else if (mNextAlarm != null && charging == null) {
- // next alarm only
- mStatus1.setVisibility(View.VISIBLE);
- mStatus2.setVisibility(View.INVISIBLE);
-
- mStatus1.setText(mNextAlarm);
- mStatus1.setCompoundDrawablesWithIntrinsicBounds(alarmIcon, null, null, null);
- } else if (charging != null && mNextAlarm != null) {
- // both charging and next alarm
- mStatus1.setVisibility(View.VISIBLE);
- mStatus2.setVisibility(View.VISIBLE);
-
- mStatus1.setText(charging);
- mStatus1.setCompoundDrawablesWithIntrinsicBounds(chargingIcon, null, null, null);
- mStatus2.setText(mNextAlarm);
- mStatus2.setCompoundDrawablesWithIntrinsicBounds(alarmIcon, null, null, null);
}
}
diff --git a/services/java/com/android/server/PackageManagerService.java b/services/java/com/android/server/PackageManagerService.java
index 79ec92059ec9..435a2a510c4c 100644
--- a/services/java/com/android/server/PackageManagerService.java
+++ b/services/java/com/android/server/PackageManagerService.java
@@ -3663,17 +3663,6 @@ class PackageManagerService extends IPackageManager.Stub {
mAppDirs.remove(pkg.mPath);
}
- PackageSetting ps = (PackageSetting)pkg.mExtras;
- if (ps != null && ps.sharedUser != null) {
- // XXX don't do this until the data is removed.
- if (false) {
- ps.sharedUser.packages.remove(ps);
- if (ps.sharedUser.packages.size() == 0) {
- // Remove.
- }
- }
- }
-
int N = pkg.providers.size();
StringBuilder r = null;
int i;
@@ -5769,12 +5758,26 @@ class PackageManagerService extends IPackageManager.Stub {
return;
}
}
+
+ killApplication(packageName, oldPkg.applicationInfo.uid);
+
res.removedInfo.uid = oldPkg.applicationInfo.uid;
res.removedInfo.removedPackage = packageName;
// Remove existing system package
removePackageLI(oldPkg, true);
synchronized (mPackages) {
- mSettings.disableSystemPackageLP(packageName);
+ if (!mSettings.disableSystemPackageLP(packageName) && deletedPackage != null) {
+ // We didn't need to disable the .apk as a current system package,
+ // which means we are replacing another update that is already
+ // installed. We need to make sure to delete the older one's .apk.
+ res.removedInfo.args = createInstallArgs(isExternal(pkg)
+ ? PackageManager.INSTALL_EXTERNAL : PackageManager.INSTALL_INTERNAL,
+ deletedPackage.applicationInfo.sourceDir,
+ deletedPackage.applicationInfo.publicSourceDir,
+ deletedPackage.applicationInfo.nativeLibraryDir);
+ } else {
+ res.removedInfo.args = null;
+ }
}
// Successfully disabled the old package. Now proceed with re-installation
@@ -5813,17 +5816,6 @@ class PackageManagerService extends IPackageManager.Stub {
}
mSettings.writeLP();
}
- } else {
- // If this is an update to an existing update, setup
- // to remove the existing update.
- synchronized (mPackages) {
- PackageSetting ps = mSettings.getDisabledSystemPkg(packageName);
- if (ps != null && ps.codePathString != null &&
- !ps.codePathString.equals(oldPkgSetting.codePathString)) {
- res.removedInfo.args = createInstallArgs(0, oldPkgSetting.codePathString,
- oldPkgSetting.resourcePathString, oldPkgSetting.nativeLibraryPathString);
- }
- }
}
}
@@ -6326,24 +6318,21 @@ class PackageManagerService extends IPackageManager.Stub {
ps = mSettings.getDisabledSystemPkg(p.packageName);
}
if (ps == null) {
- Slog.w(TAG, "Attempt to delete system package "+ p.packageName);
+ Slog.w(TAG, "Attempt to delete unknown system package "+ p.packageName);
return false;
} else {
Log.i(TAG, "Deleting system pkg from data partition");
}
// Delete the updated package
outInfo.isRemovedPackageSystemUpdate = true;
- final boolean deleteCodeAndResources;
if (ps.versionCode < p.mVersionCode) {
- // Delete code and resources for downgrades
- deleteCodeAndResources = true;
+ // Delete data for downgrades
flags &= ~PackageManager.DONT_DELETE_DATA;
} else {
// Preserve data by setting flag
- deleteCodeAndResources = false;
flags |= PackageManager.DONT_DELETE_DATA;
}
- boolean ret = deleteInstalledPackageLI(p, deleteCodeAndResources, flags, outInfo,
+ boolean ret = deleteInstalledPackageLI(p, true, flags, outInfo,
writeSettings);
if (!ret) {
return false;
@@ -7931,6 +7920,12 @@ class PackageManagerService extends IPackageManager.Stub {
pkgFlags);
}
+ PackageSetting(PackageSetting orig) {
+ super(orig.name, orig.realName, orig.codePath, orig.resourcePath,
+ orig.nativeLibraryPathString, orig.versionCode, orig.pkgFlags);
+ copyFrom(orig);
+ }
+
@Override
public String toString() {
return "PackageSetting{"
@@ -8143,21 +8138,29 @@ class PackageManagerService extends IPackageManager.Stub {
return s;
}
- int disableSystemPackageLP(String name) {
+ boolean disableSystemPackageLP(String name) {
PackageSetting p = mPackages.get(name);
if(p == null) {
Log.w(TAG, "Package:"+name+" is not an installed package");
- return -1;
+ return false;
}
PackageSetting dp = mDisabledSysPackages.get(name);
// always make sure the system package code and resource paths dont change
- if(dp == null) {
+ if (dp == null) {
if((p.pkg != null) && (p.pkg.applicationInfo != null)) {
p.pkg.applicationInfo.flags |= ApplicationInfo.FLAG_UPDATED_SYSTEM_APP;
}
mDisabledSysPackages.put(name, p);
+
+ // a little trick... when we install the new package, we don't
+ // want to modify the existing PackageSetting for the built-in
+ // version. so at this point we need a new PackageSetting that
+ // is okay to much with.
+ PackageSetting newp = new PackageSetting(p);
+ replacePackageLP(name, newp);
+ return true;
}
- return removePackageLP(name);
+ return false;
}
PackageSetting enableSystemPackageLP(String name) {
@@ -8491,6 +8494,19 @@ class PackageManagerService extends IPackageManager.Stub {
return -1;
}
+ private void replacePackageLP(String name, PackageSetting newp) {
+ PackageSetting p = mPackages.get(name);
+ if (p != null) {
+ if (p.sharedUser != null) {
+ p.sharedUser.packages.remove(p);
+ p.sharedUser.packages.add(newp);
+ } else {
+ replaceUserIdLP(p.userId, newp);
+ }
+ }
+ mPackages.put(name, newp);
+ }
+
private boolean addUserIdLP(int uid, Object obj, Object name) {
if (uid >= FIRST_APPLICATION_UID + MAX_APPLICATION_UIDS) {
return false;
@@ -8553,6 +8569,16 @@ class PackageManagerService extends IPackageManager.Stub {
}
}
+ private void replaceUserIdLP(int uid, Object obj) {
+ if (uid >= FIRST_APPLICATION_UID) {
+ int N = mUserIds.size();
+ final int index = uid - FIRST_APPLICATION_UID;
+ if (index < N) mUserIds.set(index, obj);
+ } else {
+ mOtherUserIds.put(uid, obj);
+ }
+ }
+
void writeLP() {
//Debug.startMethodTracing("/data/system/packageprof", 8 * 1024 * 1024);
diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java
index 3c8fb017e9a3..761dcd180863 100644..100755
--- a/services/java/com/android/server/am/ActivityManagerService.java
+++ b/services/java/com/android/server/am/ActivityManagerService.java
@@ -9574,7 +9574,7 @@ public final class ActivityManagerService extends ActivityManagerNative
// r.record is null if findServiceLocked() failed the caller permission check
if (r.record == null) {
throw new SecurityException(
- "Permission Denial: Accessing service " + r.record.name
+ "Permission Denial: Accessing service "
+ " from pid=" + Binder.getCallingPid()
+ ", uid=" + Binder.getCallingUid()
+ " requires " + r.permission);
diff --git a/tools/layoutlib/bridge/src/android/graphics/Canvas_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/Canvas_Delegate.java
index 0c78952defc7..26b43cd03d65 100644
--- a/tools/layoutlib/bridge/src/android/graphics/Canvas_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/Canvas_Delegate.java
@@ -20,6 +20,7 @@ import com.android.layoutlib.bridge.Bridge;
import com.android.layoutlib.bridge.impl.DelegateManager;
import com.android.layoutlib.bridge.impl.GcSnapshot;
+import android.graphics.Bitmap.Config;
import android.graphics.Paint_Delegate.FontInfo;
import android.text.TextUtils;
@@ -98,8 +99,13 @@ public final class Canvas_Delegate {
// ---- native methods ----
/*package*/ static boolean isOpaque(Canvas thisCanvas) {
- // FIXME
- throw new UnsupportedOperationException();
+ // get the delegate from the native int.
+ Canvas_Delegate canvasDelegate = sManager.getDelegate(thisCanvas.mNativeCanvas);
+ if (canvasDelegate == null) {
+ return false;
+ }
+
+ return canvasDelegate.mBitmap.getConfig() == Config.RGB_565;
}
/*package*/ static int getWidth(Canvas thisCanvas) {
@@ -511,8 +517,19 @@ public final class Canvas_Delegate {
}
/*package*/ static void native_getCTM(int canvas, int matrix) {
- // FIXME
- throw new UnsupportedOperationException();
+ // get the delegate from the native int.
+ Canvas_Delegate canvasDelegate = sManager.getDelegate(canvas);
+ if (canvasDelegate == null) {
+ return;
+ }
+
+ Matrix_Delegate matrixDelegate = Matrix_Delegate.getDelegate(matrix);
+ if (matrixDelegate == null) {
+ return;
+ }
+
+ AffineTransform transform = canvasDelegate.getSnapshot().getTransform();
+ matrixDelegate.set(Matrix_Delegate.makeValues(transform));
}
/*package*/ static boolean native_quickReject(int nativeCanvas,
diff --git a/tools/layoutlib/bridge/src/android/graphics/Matrix_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/Matrix_Delegate.java
index 22c216d650fc..c1f34dc1c052 100644
--- a/tools/layoutlib/bridge/src/android/graphics/Matrix_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/Matrix_Delegate.java
@@ -84,6 +84,14 @@ public final class Matrix_Delegate {
}
/**
+ * Sets the content of the matrix with the content of another matrix represented as an array
+ * of values.
+ */
+ public void set(float[] values) {
+ System.arraycopy(values, 0, mValues, 0, MATRIX_SIZE);
+ }
+
+ /**
* Resets the matrix to be the identity matrix.
*/
public void reset() {
@@ -105,7 +113,7 @@ public final class Matrix_Delegate {
return true;
}
- public static Matrix_Delegate make(AffineTransform matrix) {
+ public static float[] makeValues(AffineTransform matrix) {
float[] values = new float[MATRIX_SIZE];
values[0] = (float) matrix.getScaleX();
values[1] = (float) matrix.getShearX();
@@ -117,7 +125,11 @@ public final class Matrix_Delegate {
values[7] = 0.f;
values[8] = 1.f;
- return new Matrix_Delegate(values);
+ return values;
+ }
+
+ public static Matrix_Delegate make(AffineTransform matrix) {
+ return new Matrix_Delegate(makeValues(matrix));
}
public boolean mapRect(RectF dst, RectF src) {
diff --git a/tools/layoutlib/bridge/src/android/graphics/Paint_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/Paint_Delegate.java
index 9d4970f4150c..43cf91a6bb8c 100644
--- a/tools/layoutlib/bridge/src/android/graphics/Paint_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/Paint_Delegate.java
@@ -375,7 +375,7 @@ public class Paint_Delegate {
/*package*/ static void nSetShadowLayer(Paint thisPaint, float radius, float dx, float dy,
int color) {
// FIXME
- throw new UnsupportedOperationException();
+ Bridge.getLog().fidelityWarning(null, "Paint.setShadowLayer is not supported.", null);
}
/*package*/ static float getTextSize(Paint thisPaint) {
diff --git a/tools/layoutlib/bridge/src/android/graphics/Path_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/Path_Delegate.java
index 03a1815447db..8a50b34a10e9 100644
--- a/tools/layoutlib/bridge/src/android/graphics/Path_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/Path_Delegate.java
@@ -237,8 +237,7 @@ public final class Path_Delegate {
pathDelegate.quadTo(x1, y1, x2, y2);
}
- /*package*/ static void native_rQuadTo(int nPath, float dx1, float dy1,
- float dx2, float dy2) {
+ /*package*/ static void native_rQuadTo(int nPath, float dx1, float dy1, float dx2, float dy2) {
Path_Delegate pathDelegate = sManager.getDelegate(nPath);
if (pathDelegate == null) {
return;
@@ -248,7 +247,7 @@ public final class Path_Delegate {
}
/*package*/ static void native_cubicTo(int nPath, float x1, float y1,
- float x2, float y2, float x3, float y3) {
+ float x2, float y2, float x3, float y3) {
Path_Delegate pathDelegate = sManager.getDelegate(nPath);
if (pathDelegate == null) {
return;
@@ -258,7 +257,7 @@ public final class Path_Delegate {
}
/*package*/ static void native_rCubicTo(int nPath, float x1, float y1,
- float x2, float y2, float x3, float y3) {
+ float x2, float y2, float x3, float y3) {
Path_Delegate pathDelegate = sManager.getDelegate(nPath);
if (pathDelegate == null) {
return;
@@ -295,8 +294,8 @@ public final class Path_Delegate {
pathDelegate.addRect(rect.left, rect.top, rect.right, rect.bottom, dir);
}
- /*package*/ static void native_addRect(int nPath, float left, float top,
- float right, float bottom, int dir) {
+ /*package*/ static void native_addRect(int nPath,
+ float left, float top, float right, float bottom, int dir) {
Path_Delegate pathDelegate = sManager.getDelegate(nPath);
if (pathDelegate == null) {
return;
@@ -310,39 +309,35 @@ public final class Path_Delegate {
throw new UnsupportedOperationException();
}
- /*package*/ static void native_addCircle(int nPath, float x, float y,
- float radius, int dir) {
+ /*package*/ static void native_addCircle(int nPath, float x, float y, float radius, int dir) {
// FIXME
throw new UnsupportedOperationException();
}
/*package*/ static void native_addArc(int nPath, RectF oval,
- float startAngle, float sweepAngle) {
+ float startAngle, float sweepAngle) {
// FIXME
throw new UnsupportedOperationException();
}
/*package*/ static void native_addRoundRect(int nPath, RectF rect,
- float rx, float ry, int dir) {
+ float rx, float ry, int dir) {
// FIXME
throw new UnsupportedOperationException();
}
- /*package*/ static void native_addRoundRect(int nPath, RectF r,
- float[] radii, int dir) {
+ /*package*/ static void native_addRoundRect(int nPath, RectF r, float[] radii, int dir) {
// FIXME
throw new UnsupportedOperationException();
}
- /*package*/ static void native_addPath(int nPath, int src, float dx,
- float dy) {
+ /*package*/ static void native_addPath(int nPath, int src, float dx, float dy) {
// FIXME
throw new UnsupportedOperationException();
}
/*package*/ static void native_addPath(int nPath, int src) {
- // FIXME
- throw new UnsupportedOperationException();
+ native_addPath(nPath, src, 0, 0);
}
/*package*/ static void native_addPath(int nPath, int src, int matrix) {
@@ -350,8 +345,7 @@ public final class Path_Delegate {
throw new UnsupportedOperationException();
}
- /*package*/ static void native_offset(int nPath, float dx, float dy,
- int dst_path) {
+ /*package*/ static void native_offset(int nPath, float dx, float dy, int dst_path) {
Path_Delegate pathDelegate = sManager.getDelegate(nPath);
if (pathDelegate == null) {
return;
diff --git a/tools/layoutlib/bridge/src/android/graphics/Typeface_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/Typeface_Delegate.java
index c7362c0ebd34..11e1ca786b3f 100644
--- a/tools/layoutlib/bridge/src/android/graphics/Typeface_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/Typeface_Delegate.java
@@ -16,6 +16,7 @@
package android.graphics;
+import com.android.layoutlib.bridge.Bridge;
import com.android.layoutlib.bridge.impl.DelegateManager;
import com.android.layoutlib.bridge.impl.FontLoader;
@@ -84,7 +85,6 @@ public final class Typeface_Delegate {
return delegate.mFonts;
}
-
// ---- native methods ----
/*package*/ static synchronized int nativeCreate(String familyName, int style) {
@@ -125,13 +125,13 @@ public final class Typeface_Delegate {
}
/*package*/ static synchronized int nativeCreateFromAsset(AssetManager mgr, String path) {
- // FIXME
- throw new UnsupportedOperationException("Native delegate needed: Typeface_Delegate.nativeCreateFromAsset");
+ Bridge.getLog().fidelityWarning(null, "Typeface.createFromAsset() is not supported.", null);
+ return 0;
}
/*package*/ static synchronized int nativeCreateFromFile(String path) {
- // FIXME
- throw new UnsupportedOperationException("Native delegate needed: Typeface_Delegate.nativeCreateFromFile");
+ Bridge.getLog().fidelityWarning(null, "Typeface.createFromFile() is not supported.", null);
+ return 0;
}
/*package*/ static void nativeUnref(int native_instance) {
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/Bridge.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/Bridge.java
index 7a95c0998866..e1bf9251e0b1 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/Bridge.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/Bridge.java
@@ -32,6 +32,7 @@ import com.android.tools.layoutlib.create.MethodAdapter;
import com.android.tools.layoutlib.create.OverrideMethod;
import android.graphics.Bitmap;
+import android.graphics.Typeface;
import android.graphics.Typeface_Delegate;
import android.os.Looper;
@@ -283,6 +284,10 @@ public final class Bridge extends com.android.ide.common.rendering.api.Bridge {
@Override
public boolean dispose() {
BridgeAssetManager.clearSystem();
+
+ // dispose of the default typeface.
+ Typeface.sDefaults = null;
+
return true;
}
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java
index 19c3891708ee..025a318f0e57 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java
@@ -344,6 +344,7 @@ public class RenderSessionImpl {
info.mHasWindowFocus = true;
info.mWindowVisibility = View.VISIBLE;
info.mInTouchMode = false; // this is so that we can display selections.
+ info.mHardwareAccelerated = false;
mViewRoot.dispatchAttachedToWindow(info, 0);
// get the background drawable
@@ -654,25 +655,25 @@ public class RenderSessionImpl {
LayoutTransition removeTransition = new LayoutTransition();
previousParent.setLayoutTransition(removeTransition);
- // no fade-out
- // FIXME: set a non-null do-nothing Animator.
- // setting a null animator doesn't work because the child gets its parent
- // set to null too late.
- //removeTransition.setAnimator(LayoutTransition.DISAPPEARING, null);
+ // no fade-out. Because we can't rely on layout transition listeners when
+ // there is no Animator at all, instead we keep the animator but set its
+ // duration to 0.
+ // Note: Cannot user Animation.setDuration() directly. Have to set it
+ // on the LayoutTransition.
+ removeTransition.setDuration(LayoutTransition.DISAPPEARING, 0);
- // now for the new parent, if different
if (previousParent != newParentView) {
- LayoutTransition addTransition = new LayoutTransition();
-
- // no fade-in
- // FIXME: set a non-null do-nothing Animator.
- // setting a null animator doesn't work because the child gets its parent
- // set to null too late.
- //addTransition.setAnimator(LayoutTransition.APPEARING, null);
-
- newParentView.setLayoutTransition(addTransition);
+ // different parent, set a Layout transition on the new parent.
+ newParentView.setLayoutTransition(new LayoutTransition());
}
+ // no fade-in. Because we can't rely on layout transition listeners when
+ // there is no Animator at all, instead we keep the animator but set its
+ // duration to 0.
+ // Note: Cannot user Animation.setDuration() directly. Have to set it
+ // on the LayoutTransition.
+ newParentView.getLayoutTransition().setDuration(LayoutTransition.APPEARING, 0);
+
return moveView(previousParent, newParentView, childView, index, params);
}
@@ -720,9 +721,20 @@ public class RenderSessionImpl {
// check if there is a transition on the previousParent.
LayoutTransition transition = previousParent.getLayoutTransition();
if (transition != null) {
- // in this case there is an animation. This means we have to listener for the
- // disappearing animation to be done before we can add the view to the new parent.
- // TODO: check that if the disappearing animation is null, the removal is done during the removeView call which would simplify the code.
+ // in this case there is an animation. This means we have to wait for the child's
+ // parent reference to be null'ed out so that we can add it to the new parent.
+ // It is technically removed right before the DISAPPEARING animation is done (if
+ // the animation of this type is not null, otherwise it's after which is impossible
+ // to handle).
+ // Because there is no move animation, if the new parent is the same as the old
+ // parent, we need to wait until the CHANGE_DISAPPEARING animation is done before
+ // adding the child or the child will appear in its new location before the
+ // other children have made room for it.
+ // If the parents are different, then we can add the child to its new parent right
+ // after the DISAPPEARING animation is done.
+
+ final int waitForType = newParent == previousParent ?
+ LayoutTransition.CHANGE_DISAPPEARING : LayoutTransition.DISAPPEARING;
// add a listener to the transition to be notified of the actual removal.
transition.addTransitionListener(new TransitionListener() {
@@ -734,7 +746,7 @@ public class RenderSessionImpl {
public void endTransition(LayoutTransition transition, ViewGroup container,
View view, int transitionType) {
- if (transitionType == LayoutTransition.DISAPPEARING) {
+ if (transitionType == waitForType) {
// add it to the parentView in the correct location
if (params != null) {
newParent.addView(view, index, params);