diff options
Diffstat (limited to 'core/java')
62 files changed, 545 insertions, 352 deletions
diff --git a/core/java/android/animation/ValueAnimator.java b/core/java/android/animation/ValueAnimator.java index f7460c4..f7460c4 100755..100644 --- a/core/java/android/animation/ValueAnimator.java +++ b/core/java/android/animation/ValueAnimator.java diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java index c136a4d..456d757 100644 --- a/core/java/android/app/ActivityThread.java +++ b/core/java/android/app/ActivityThread.java @@ -113,6 +113,7 @@ import java.util.TimeZone; import java.util.regex.Pattern; import libcore.io.DropBox; +import libcore.io.EventLogger; import libcore.io.IoUtils; import dalvik.system.CloseGuard; @@ -4978,6 +4979,13 @@ public final class ActivityThread { } } + private static class EventLoggingReporter implements EventLogger.Reporter { + @Override + public void report (int code, Object... list) { + EventLog.writeEvent(code, list); + } + } + private class DropBoxReporter implements DropBox.Reporter { private DropBoxManager dropBox; @@ -5007,6 +5015,9 @@ public final class ActivityThread { Environment.initForCurrentUser(); + // Set the reporter for event logging in libcore + EventLogger.setReporter(new EventLoggingReporter()); + Process.setArgV0("<pre-initialized>"); Looper.prepareMainLooper(); diff --git a/core/java/android/app/IAlarmManager.aidl b/core/java/android/app/IAlarmManager.aidl index edb40ed..edb40ed 100755..100644 --- a/core/java/android/app/IAlarmManager.aidl +++ b/core/java/android/app/IAlarmManager.aidl diff --git a/core/java/android/app/IThumbnailReceiver.aidl b/core/java/android/app/IThumbnailReceiver.aidl index 7943f2c..7943f2c 100755..100644 --- a/core/java/android/app/IThumbnailReceiver.aidl +++ b/core/java/android/app/IThumbnailReceiver.aidl diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java index 4c0eba0..4c0eba0 100755..100644 --- a/core/java/android/app/admin/DevicePolicyManager.java +++ b/core/java/android/app/admin/DevicePolicyManager.java diff --git a/core/java/android/appwidget/AppWidgetProvider.java b/core/java/android/appwidget/AppWidgetProvider.java index edf142b..edf142b 100755..100644 --- a/core/java/android/appwidget/AppWidgetProvider.java +++ b/core/java/android/appwidget/AppWidgetProvider.java diff --git a/core/java/android/content/IIntentReceiver.aidl b/core/java/android/content/IIntentReceiver.aidl index 3d92723..3d92723 100755..100644 --- a/core/java/android/content/IIntentReceiver.aidl +++ b/core/java/android/content/IIntentReceiver.aidl diff --git a/core/java/android/content/res/Configuration.aidl b/core/java/android/content/res/Configuration.aidl index bb7f2dd..bb7f2dd 100755..100644 --- a/core/java/android/content/res/Configuration.aidl +++ b/core/java/android/content/res/Configuration.aidl diff --git a/core/java/android/content/res/ObbInfo.aidl b/core/java/android/content/res/ObbInfo.aidl index 636ad6a..636ad6a 100755..100644 --- a/core/java/android/content/res/ObbInfo.aidl +++ b/core/java/android/content/res/ObbInfo.aidl diff --git a/core/java/android/content/res/Resources.java b/core/java/android/content/res/Resources.java index b316f23..b316f23 100755..100644 --- a/core/java/android/content/res/Resources.java +++ b/core/java/android/content/res/Resources.java diff --git a/core/java/android/database/IContentObserver.aidl b/core/java/android/database/IContentObserver.aidl index 13aff05..13aff05 100755..100644 --- a/core/java/android/database/IContentObserver.aidl +++ b/core/java/android/database/IContentObserver.aidl diff --git a/core/java/android/ddm/package.html b/core/java/android/ddm/package.html index 1c9bf9d..1c9bf9d 100755..100644 --- a/core/java/android/ddm/package.html +++ b/core/java/android/ddm/package.html diff --git a/core/java/android/debug/package.html b/core/java/android/debug/package.html index c9f96a6..c9f96a6 100755..100644 --- a/core/java/android/debug/package.html +++ b/core/java/android/debug/package.html diff --git a/core/java/android/gesture/Gesture.java b/core/java/android/gesture/Gesture.java index c6a2a87..c6a2a87 100755..100644 --- a/core/java/android/gesture/Gesture.java +++ b/core/java/android/gesture/Gesture.java diff --git a/core/java/android/gesture/GestureOverlayView.java b/core/java/android/gesture/GestureOverlayView.java index b6c260f..b6c260f 100755..100644 --- a/core/java/android/gesture/GestureOverlayView.java +++ b/core/java/android/gesture/GestureOverlayView.java diff --git a/core/java/android/gesture/GestureUtils.java b/core/java/android/gesture/GestureUtils.java index dd221fc..dd221fc 100755..100644 --- a/core/java/android/gesture/GestureUtils.java +++ b/core/java/android/gesture/GestureUtils.java diff --git a/core/java/android/gesture/Instance.java b/core/java/android/gesture/Instance.java index 02a6519..02a6519 100755..100644 --- a/core/java/android/gesture/Instance.java +++ b/core/java/android/gesture/Instance.java diff --git a/core/java/android/gesture/Learner.java b/core/java/android/gesture/Learner.java index a105652..a105652 100755..100644 --- a/core/java/android/gesture/Learner.java +++ b/core/java/android/gesture/Learner.java diff --git a/core/java/android/gesture/Prediction.java b/core/java/android/gesture/Prediction.java index ce6ad57..ce6ad57 100755..100644 --- a/core/java/android/gesture/Prediction.java +++ b/core/java/android/gesture/Prediction.java diff --git a/core/java/android/hardware/SystemSensorManager.java b/core/java/android/hardware/SystemSensorManager.java index 0204e94..7375e7d 100644 --- a/core/java/android/hardware/SystemSensorManager.java +++ b/core/java/android/hardware/SystemSensorManager.java @@ -373,7 +373,8 @@ public class SystemSensorManager extends SensorManager { for (Sensor s : l.getSensors()) { disableSensorLocked(s); } - } else if (l.removeSensor(sensor) == 0) { + // Check if the ListenerDelegate has the sensor it is trying to unregister. + } else if (l.hasSensor(sensor) && l.removeSensor(sensor) == 0) { // if we have no more sensors enabled on this listener, // take it off the list. sListeners.remove(i); diff --git a/core/java/android/hardware/input/InputManager.java b/core/java/android/hardware/input/InputManager.java index 262d87d..262d87d 100755..100644 --- a/core/java/android/hardware/input/InputManager.java +++ b/core/java/android/hardware/input/InputManager.java diff --git a/core/java/android/net/Uri.aidl b/core/java/android/net/Uri.aidl index 6bd3be5..6bd3be5 100755..100644 --- a/core/java/android/net/Uri.aidl +++ b/core/java/android/net/Uri.aidl diff --git a/core/java/android/net/http/AndroidHttpClient.java b/core/java/android/net/http/AndroidHttpClient.java index c534e58..fabe018 100644 --- a/core/java/android/net/http/AndroidHttpClient.java +++ b/core/java/android/net/http/AndroidHttpClient.java @@ -66,8 +66,7 @@ import android.util.Log; /** * Implementation of the Apache {@link DefaultHttpClient} that is configured with - * reasonable default settings and registered schemes for Android, and - * also lets the user add {@link HttpRequestInterceptor} classes. + * reasonable default settings and registered schemes for Android. * Don't create this directly, use the {@link #newInstance} factory method. * * <p>This client processes cookies but does not retain them by default. diff --git a/core/java/android/net/http/package.html b/core/java/android/net/http/package.html index a81cbce..a81cbce 100755..100644 --- a/core/java/android/net/http/package.html +++ b/core/java/android/net/http/package.html diff --git a/core/java/android/net/package.html b/core/java/android/net/package.html index 47c57e6..47c57e6 100755..100644 --- a/core/java/android/net/package.html +++ b/core/java/android/net/package.html diff --git a/core/java/android/os/CommonTimeUtils.java b/core/java/android/os/CommonTimeUtils.java index 9081ee4..20755d9 100644 --- a/core/java/android/os/CommonTimeUtils.java +++ b/core/java/android/os/CommonTimeUtils.java @@ -19,6 +19,7 @@ import java.net.InetAddress; import java.net.Inet4Address; import java.net.Inet6Address; import java.net.InetSocketAddress; +import java.util.Locale; import static libcore.io.OsConstants.*; class CommonTimeUtils { @@ -192,10 +193,11 @@ class CommonTimeUtils { if (AF_INET == type) { int addr = reply.readInt(); port = reply.readInt(); - addrStr = String.format("%d.%d.%d.%d", (addr >> 24) & 0xFF, - (addr >> 16) & 0xFF, - (addr >> 8) & 0xFF, - addr & 0xFF); + addrStr = String.format(Locale.US, "%d.%d.%d.%d", + (addr >> 24) & 0xFF, + (addr >> 16) & 0xFF, + (addr >> 8) & 0xFF, + addr & 0xFF); } else if (AF_INET6 == type) { int addr1 = reply.readInt(); int addr2 = reply.readInt(); @@ -207,11 +209,11 @@ class CommonTimeUtils { int flowinfo = reply.readInt(); int scope_id = reply.readInt(); - addrStr = String.format("[%04X:%04X:%04X:%04X:%04X:%04X:%04X:%04X]", - (addr1 >> 16) & 0xFFFF, addr1 & 0xFFFF, - (addr2 >> 16) & 0xFFFF, addr2 & 0xFFFF, - (addr3 >> 16) & 0xFFFF, addr3 & 0xFFFF, - (addr4 >> 16) & 0xFFFF, addr4 & 0xFFFF); + addrStr = String.format(Locale.US, "[%04X:%04X:%04X:%04X:%04X:%04X:%04X:%04X]", + (addr1 >> 16) & 0xFFFF, addr1 & 0xFFFF, + (addr2 >> 16) & 0xFFFF, addr2 & 0xFFFF, + (addr3 >> 16) & 0xFFFF, addr3 & 0xFFFF, + (addr4 >> 16) & 0xFFFF, addr4 & 0xFFFF); } if (null != addrStr) { diff --git a/core/java/android/os/IHardwareService.aidl b/core/java/android/os/IHardwareService.aidl index 38abfc0..38abfc0 100755..100644 --- a/core/java/android/os/IHardwareService.aidl +++ b/core/java/android/os/IHardwareService.aidl diff --git a/core/java/android/os/IVibratorService.aidl b/core/java/android/os/IVibratorService.aidl index 2c2fe8a..2c2fe8a 100755..100644 --- a/core/java/android/os/IVibratorService.aidl +++ b/core/java/android/os/IVibratorService.aidl diff --git a/core/java/android/os/TokenWatcher.java b/core/java/android/os/TokenWatcher.java index 9b3a2d6..9b3a2d6 100755..100644 --- a/core/java/android/os/TokenWatcher.java +++ b/core/java/android/os/TokenWatcher.java diff --git a/core/java/android/provider/ContactsContract.java b/core/java/android/provider/ContactsContract.java index 5b49ba3..5b49ba3 100755..100644 --- a/core/java/android/provider/ContactsContract.java +++ b/core/java/android/provider/ContactsContract.java diff --git a/core/java/android/security/IKeystoreService.java b/core/java/android/security/IKeystoreService.java new file mode 100644 index 0000000..f8a49e6 --- /dev/null +++ b/core/java/android/security/IKeystoreService.java @@ -0,0 +1,505 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.security; + +import android.os.Binder; +import android.os.IBinder; +import android.os.IInterface; +import android.os.Parcel; +import android.os.RemoteException; + +/** + * This must be kept manually in sync with system/security/keystore until AIDL + * can generate both Java and C++ bindings. + * + * @hide + */ +public interface IKeystoreService extends IInterface { + public static abstract class Stub extends Binder implements IKeystoreService { + private static class Proxy implements IKeystoreService { + private final IBinder mRemote; + + Proxy(IBinder remote) { + mRemote = remote; + } + + public IBinder asBinder() { + return mRemote; + } + + public String getInterfaceDescriptor() { + return DESCRIPTOR; + } + + public int test() throws RemoteException { + Parcel _data = Parcel.obtain(); + Parcel _reply = Parcel.obtain(); + int _result; + try { + _data.writeInterfaceToken(DESCRIPTOR); + mRemote.transact(Stub.TRANSACTION_test, _data, _reply, 0); + _reply.readException(); + _result = _reply.readInt(); + } finally { + _reply.recycle(); + _data.recycle(); + } + return _result; + } + + public byte[] get(String name) throws RemoteException { + Parcel _data = Parcel.obtain(); + Parcel _reply = Parcel.obtain(); + byte[] _result; + try { + _data.writeInterfaceToken(DESCRIPTOR); + _data.writeString(name); + mRemote.transact(Stub.TRANSACTION_get, _data, _reply, 0); + _reply.readException(); + _result = _reply.createByteArray(); + } finally { + _reply.recycle(); + _data.recycle(); + } + return _result; + } + + public int insert(String name, byte[] item) throws RemoteException { + Parcel _data = Parcel.obtain(); + Parcel _reply = Parcel.obtain(); + int _result; + try { + _data.writeInterfaceToken(DESCRIPTOR); + _data.writeString(name); + _data.writeByteArray(item); + mRemote.transact(Stub.TRANSACTION_insert, _data, _reply, 0); + _reply.readException(); + _result = _reply.readInt(); + } finally { + _reply.recycle(); + _data.recycle(); + } + return _result; + } + + public int del(String name) throws RemoteException { + Parcel _data = Parcel.obtain(); + Parcel _reply = Parcel.obtain(); + int _result; + try { + _data.writeInterfaceToken(DESCRIPTOR); + _data.writeString(name); + mRemote.transact(Stub.TRANSACTION_del, _data, _reply, 0); + _reply.readException(); + _result = _reply.readInt(); + } finally { + _reply.recycle(); + _data.recycle(); + } + return _result; + } + + public int exist(String name) throws RemoteException { + Parcel _data = Parcel.obtain(); + Parcel _reply = Parcel.obtain(); + int _result; + try { + _data.writeInterfaceToken(DESCRIPTOR); + _data.writeString(name); + mRemote.transact(Stub.TRANSACTION_exist, _data, _reply, 0); + _reply.readException(); + _result = _reply.readInt(); + } finally { + _reply.recycle(); + _data.recycle(); + } + return _result; + } + + public String[] saw(String name) throws RemoteException { + Parcel _data = Parcel.obtain(); + Parcel _reply = Parcel.obtain(); + String[] _result; + try { + _data.writeInterfaceToken(DESCRIPTOR); + _data.writeString(name); + mRemote.transact(Stub.TRANSACTION_saw, _data, _reply, 0); + _reply.readException(); + int size = _reply.readInt(); + _result = new String[size]; + for (int i = 0; i < size; i++) { + _result[i] = _reply.readString(); + } + } finally { + _reply.recycle(); + _data.recycle(); + } + return _result; + } + + @Override + public int reset() throws RemoteException { + Parcel _data = Parcel.obtain(); + Parcel _reply = Parcel.obtain(); + int _result; + try { + _data.writeInterfaceToken(DESCRIPTOR); + mRemote.transact(Stub.TRANSACTION_reset, _data, _reply, 0); + _reply.readException(); + _result = _reply.readInt(); + } finally { + _reply.recycle(); + _data.recycle(); + } + return _result; + } + + public int password(String password) throws RemoteException { + Parcel _data = Parcel.obtain(); + Parcel _reply = Parcel.obtain(); + int _result; + try { + _data.writeInterfaceToken(DESCRIPTOR); + _data.writeString(password); + mRemote.transact(Stub.TRANSACTION_password, _data, _reply, 0); + _reply.readException(); + _result = _reply.readInt(); + } finally { + _reply.recycle(); + _data.recycle(); + } + return _result; + } + + public int lock() throws RemoteException { + Parcel _data = Parcel.obtain(); + Parcel _reply = Parcel.obtain(); + int _result; + try { + _data.writeInterfaceToken(DESCRIPTOR); + mRemote.transact(Stub.TRANSACTION_lock, _data, _reply, 0); + _reply.readException(); + _result = _reply.readInt(); + } finally { + _reply.recycle(); + _data.recycle(); + } + return _result; + } + + public int unlock(String password) throws RemoteException { + Parcel _data = Parcel.obtain(); + Parcel _reply = Parcel.obtain(); + int _result; + try { + _data.writeInterfaceToken(DESCRIPTOR); + _data.writeString(password); + mRemote.transact(Stub.TRANSACTION_unlock, _data, _reply, 0); + _reply.readException(); + _result = _reply.readInt(); + } finally { + _reply.recycle(); + _data.recycle(); + } + return _result; + } + + @Override + public int zero() throws RemoteException { + Parcel _data = Parcel.obtain(); + Parcel _reply = Parcel.obtain(); + int _result; + try { + _data.writeInterfaceToken(DESCRIPTOR); + mRemote.transact(Stub.TRANSACTION_zero, _data, _reply, 0); + _reply.readException(); + _result = _reply.readInt(); + } finally { + _reply.recycle(); + _data.recycle(); + } + return _result; + } + + public int generate(String name) throws RemoteException { + Parcel _data = Parcel.obtain(); + Parcel _reply = Parcel.obtain(); + int _result; + try { + _data.writeInterfaceToken(DESCRIPTOR); + _data.writeString(name); + mRemote.transact(Stub.TRANSACTION_generate, _data, _reply, 0); + _reply.readException(); + _result = _reply.readInt(); + } finally { + _reply.recycle(); + _data.recycle(); + } + return _result; + } + + public int import_key(String name, byte[] data) throws RemoteException { + Parcel _data = Parcel.obtain(); + Parcel _reply = Parcel.obtain(); + int _result; + try { + _data.writeInterfaceToken(DESCRIPTOR); + _data.writeString(name); + _data.writeByteArray(data); + mRemote.transact(Stub.TRANSACTION_import, _data, _reply, 0); + _reply.readException(); + _result = _reply.readInt(); + } finally { + _reply.recycle(); + _data.recycle(); + } + return _result; + } + + public byte[] sign(String name, byte[] data) throws RemoteException { + Parcel _data = Parcel.obtain(); + Parcel _reply = Parcel.obtain(); + byte[] _result; + try { + _data.writeInterfaceToken(DESCRIPTOR); + _data.writeString(name); + _data.writeByteArray(data); + mRemote.transact(Stub.TRANSACTION_sign, _data, _reply, 0); + _reply.readException(); + _result = _reply.createByteArray(); + } finally { + _reply.recycle(); + _data.recycle(); + } + return _result; + } + + public int verify(String name, byte[] data, byte[] signature) throws RemoteException { + Parcel _data = Parcel.obtain(); + Parcel _reply = Parcel.obtain(); + int _result; + try { + _data.writeInterfaceToken(DESCRIPTOR); + _data.writeString(name); + _data.writeByteArray(data); + _data.writeByteArray(signature); + mRemote.transact(Stub.TRANSACTION_verify, _data, _reply, 0); + _reply.readException(); + _result = _reply.readInt(); + } finally { + _reply.recycle(); + _data.recycle(); + } + return _result; + } + + public byte[] get_pubkey(String name) throws RemoteException { + Parcel _data = Parcel.obtain(); + Parcel _reply = Parcel.obtain(); + byte[] _result; + try { + _data.writeInterfaceToken(DESCRIPTOR); + _data.writeString(name); + mRemote.transact(Stub.TRANSACTION_get_pubkey, _data, _reply, 0); + _reply.readException(); + _result = _reply.createByteArray(); + } finally { + _reply.recycle(); + _data.recycle(); + } + return _result; + } + + public int del_key(String name) throws RemoteException { + Parcel _data = Parcel.obtain(); + Parcel _reply = Parcel.obtain(); + int _result; + try { + _data.writeInterfaceToken(DESCRIPTOR); + _data.writeString(name); + mRemote.transact(Stub.TRANSACTION_del_key, _data, _reply, 0); + _reply.readException(); + _result = _reply.readInt(); + } finally { + _reply.recycle(); + _data.recycle(); + } + return _result; + } + + public int grant(String name, int granteeUid) throws RemoteException { + Parcel _data = Parcel.obtain(); + Parcel _reply = Parcel.obtain(); + int _result; + try { + _data.writeInterfaceToken(DESCRIPTOR); + _data.writeString(name); + _data.writeInt(granteeUid); + mRemote.transact(Stub.TRANSACTION_grant, _data, _reply, 0); + _reply.readException(); + _result = _reply.readInt(); + } finally { + _reply.recycle(); + _data.recycle(); + } + return _result; + } + + public int ungrant(String name, int granteeUid) throws RemoteException { + Parcel _data = Parcel.obtain(); + Parcel _reply = Parcel.obtain(); + int _result; + try { + _data.writeInterfaceToken(DESCRIPTOR); + _data.writeString(name); + _data.writeInt(granteeUid); + mRemote.transact(Stub.TRANSACTION_ungrant, _data, _reply, 0); + _reply.readException(); + _result = _reply.readInt(); + } finally { + _reply.recycle(); + _data.recycle(); + } + return _result; + } + + @Override + public long getmtime(String name) throws RemoteException { + Parcel _data = Parcel.obtain(); + Parcel _reply = Parcel.obtain(); + long _result; + try { + _data.writeInterfaceToken(DESCRIPTOR); + _data.writeString(name); + mRemote.transact(Stub.TRANSACTION_getmtime, _data, _reply, 0); + _reply.readException(); + _result = _reply.readLong(); + } finally { + _reply.recycle(); + _data.recycle(); + } + return _result; + } + } + + private static final String DESCRIPTOR = "android.security.keystore"; + + static final int TRANSACTION_test = IBinder.FIRST_CALL_TRANSACTION + 0; + static final int TRANSACTION_get = IBinder.FIRST_CALL_TRANSACTION + 1; + static final int TRANSACTION_insert = IBinder.FIRST_CALL_TRANSACTION + 2; + static final int TRANSACTION_del = IBinder.FIRST_CALL_TRANSACTION + 3; + static final int TRANSACTION_exist = IBinder.FIRST_CALL_TRANSACTION + 4; + static final int TRANSACTION_saw = IBinder.FIRST_CALL_TRANSACTION + 5; + static final int TRANSACTION_reset = IBinder.FIRST_CALL_TRANSACTION + 6; + static final int TRANSACTION_password = IBinder.FIRST_CALL_TRANSACTION + 7; + static final int TRANSACTION_lock = IBinder.FIRST_CALL_TRANSACTION + 8; + static final int TRANSACTION_unlock = IBinder.FIRST_CALL_TRANSACTION + 9; + static final int TRANSACTION_zero = IBinder.FIRST_CALL_TRANSACTION + 10; + static final int TRANSACTION_generate = IBinder.FIRST_CALL_TRANSACTION + 11; + static final int TRANSACTION_import = IBinder.FIRST_CALL_TRANSACTION + 12; + static final int TRANSACTION_sign = IBinder.FIRST_CALL_TRANSACTION + 13; + static final int TRANSACTION_verify = IBinder.FIRST_CALL_TRANSACTION + 14; + static final int TRANSACTION_get_pubkey = IBinder.FIRST_CALL_TRANSACTION + 15; + static final int TRANSACTION_del_key = IBinder.FIRST_CALL_TRANSACTION + 16; + static final int TRANSACTION_grant = IBinder.FIRST_CALL_TRANSACTION + 17; + static final int TRANSACTION_ungrant = IBinder.FIRST_CALL_TRANSACTION + 18; + static final int TRANSACTION_getmtime = IBinder.FIRST_CALL_TRANSACTION + 19; + + /** + * Cast an IBinder object into an IKeystoreService interface, generating + * a proxy if needed. + */ + public static IKeystoreService asInterface(IBinder obj) { + if (obj == null) { + return null; + } + IInterface iin = obj.queryLocalInterface(DESCRIPTOR); + if (iin != null && iin instanceof IKeystoreService) { + return (IKeystoreService) iin; + } + return new IKeystoreService.Stub.Proxy(obj); + } + + /** Construct the stub at attach it to the interface. */ + public Stub() { + attachInterface(this, DESCRIPTOR); + } + + public IBinder asBinder() { + return this; + } + + @Override + public boolean onTransact(int code, Parcel data, Parcel reply, int flags) + throws RemoteException { + switch (code) { + case INTERFACE_TRANSACTION: { + reply.writeString(DESCRIPTOR); + return true; + } + case TRANSACTION_test: { + data.enforceInterface(DESCRIPTOR); + int resultCode = test(); + reply.writeNoException(); + reply.writeInt(resultCode); + return true; + } + } + return super.onTransact(code, data, reply, flags); + } + } + + public int test() throws RemoteException; + + public byte[] get(String name) throws RemoteException; + + public int insert(String name, byte[] item) throws RemoteException; + + public int del(String name) throws RemoteException; + + public int exist(String name) throws RemoteException; + + public String[] saw(String name) throws RemoteException; + + public int reset() throws RemoteException; + + public int password(String password) throws RemoteException; + + public int lock() throws RemoteException; + + public int unlock(String password) throws RemoteException; + + public int zero() throws RemoteException; + + public int generate(String name) throws RemoteException; + + public int import_key(String name, byte[] data) throws RemoteException; + + public byte[] sign(String name, byte[] data) throws RemoteException; + + public int verify(String name, byte[] data, byte[] signature) throws RemoteException; + + public byte[] get_pubkey(String name) throws RemoteException; + + public int del_key(String name) throws RemoteException; + + public int grant(String name, int granteeUid) throws RemoteException; + + public int ungrant(String name, int granteeUid) throws RemoteException; + + public long getmtime(String name) throws RemoteException; +} diff --git a/core/java/android/server/package.html b/core/java/android/server/package.html index c9f96a6..c9f96a6 100755..100644 --- a/core/java/android/server/package.html +++ b/core/java/android/server/package.html diff --git a/core/java/android/speech/tts/ITextToSpeechCallback.aidl b/core/java/android/speech/tts/ITextToSpeechCallback.aidl index f0287d4..f0287d4 100755..100644 --- a/core/java/android/speech/tts/ITextToSpeechCallback.aidl +++ b/core/java/android/speech/tts/ITextToSpeechCallback.aidl diff --git a/core/java/android/speech/tts/TextToSpeech.java b/core/java/android/speech/tts/TextToSpeech.java index 5e367cb..5e367cb 100755..100644 --- a/core/java/android/speech/tts/TextToSpeech.java +++ b/core/java/android/speech/tts/TextToSpeech.java diff --git a/core/java/android/text/format/Time.java b/core/java/android/text/format/Time.java index 200b57b..5ef86b1 100644 --- a/core/java/android/text/format/Time.java +++ b/core/java/android/text/format/Time.java @@ -411,6 +411,9 @@ public class Time { * @throws android.util.TimeFormatException if s cannot be parsed. */ public boolean parse(String s) { + if (s == null) { + throw new NullPointerException("time string is null"); + } if (nativeParse(s)) { timezone = TIMEZONE_UTC; return true; diff --git a/core/java/android/util/PropertyValueModel.java b/core/java/android/util/PropertyValueModel.java deleted file mode 100755 index eb9c47d..0000000 --- a/core/java/android/util/PropertyValueModel.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (C) 2012 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.util; - -/** - * A value model for a {@link Property property} of a host object. This class can be used for - * both reflective and non-reflective property implementations. - * - * @param <H> the host type, where the host is the object that holds this property - * @param <T> the value type - * - * @see Property - * @see ValueModel - */ -public class PropertyValueModel<H, T> extends ValueModel<T> { - private final H mHost; - private final Property<H, T> mProperty; - - private PropertyValueModel(H host, Property<H, T> property) { - mProperty = property; - mHost = host; - } - - /** - * Returns the host. - * - * @return the host - */ - public H getHost() { - return mHost; - } - - /** - * Returns the property. - * - * @return the property - */ - public Property<H, T> getProperty() { - return mProperty; - } - - @Override - public Class<T> getType() { - return mProperty.getType(); - } - - @Override - public T get() { - return mProperty.get(mHost); - } - - @Override - public void set(T value) { - mProperty.set(mHost, value); - } - - /** - * Return an appropriate PropertyValueModel for this host and property. - * - * @param host the host - * @param property the property - * @return the value model - */ - public static <H, T> PropertyValueModel<H, T> of(H host, Property<H, T> property) { - return new PropertyValueModel<H, T>(host, property); - } - - /** - * Return a PropertyValueModel for this {@code host} and a - * reflective property, constructed from this {@code propertyType} and {@code propertyName}. - * - * @param host - * @param propertyType the property type - * @param propertyName the property name - * @return a value model with this host and a reflective property with this type and name - * - * @see Property#of - */ - public static <H, T> PropertyValueModel<H, T> of(H host, Class<T> propertyType, - String propertyName) { - return of(host, Property.of((Class<H>) host.getClass(), propertyType, propertyName)); - } - - private static Class getNullaryMethodReturnType(Class c, String name) { - try { - return c.getMethod(name).getReturnType(); - } catch (NoSuchMethodException e) { - return null; - } - } - - private static Class getFieldType(Class c, String name) { - try { - return c.getField(name).getType(); - } catch (NoSuchFieldException e) { - return null; - } - } - - private static String capitalize(String name) { - if (name.isEmpty()) { - return name; - } - return Character.toUpperCase(name.charAt(0)) + name.substring(1); - } - - /** - * Return a PropertyValueModel for this {@code host} and and {@code propertyName}. - * - * @param host the host - * @param propertyName the property name - * @return a value model with this host and a reflective property with this name - */ - public static PropertyValueModel of(Object host, String propertyName) { - Class clazz = host.getClass(); - String suffix = capitalize(propertyName); - Class propertyType = getNullaryMethodReturnType(clazz, "get" + suffix); - if (propertyType == null) { - propertyType = getNullaryMethodReturnType(clazz, "is" + suffix); - } - if (propertyType == null) { - propertyType = getFieldType(clazz, propertyName); - } - if (propertyType == null) { - throw new NoSuchPropertyException(propertyName); - } - return of(host, propertyType, propertyName); - } -} diff --git a/core/java/android/util/ValueModel.java b/core/java/android/util/ValueModel.java deleted file mode 100755 index 4789682..0000000 --- a/core/java/android/util/ValueModel.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (C) 2012 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.util; - -/** - * A ValueModel is an abstraction for a 'slot' or place in memory in which a value - * may be stored and retrieved. A common implementation of ValueModel is a regular property of - * an object, whose value may be retrieved by calling the appropriate <em>getter</em> - * method and set by calling the corresponding <em>setter</em> method. - * - * @param <T> the value type - * - * @see PropertyValueModel - */ -public abstract class ValueModel<T> { - /** - * The empty model should be used in place of {@code null} to indicate that a - * model has not been set. The empty model has no value and does nothing when it is set. - */ - public static final ValueModel EMPTY = new ValueModel() { - @Override - public Class getType() { - return Object.class; - } - - @Override - public Object get() { - return null; - } - - @Override - public void set(Object value) { - - } - }; - - protected ValueModel() { - } - - /** - * Returns the type of this property. - * - * @return the property type - */ - public abstract Class<T> getType(); - - /** - * Returns the value of this property. - * - * @return the property value - */ - public abstract T get(); - - /** - * Sets the value of this property. - * - * @param value the new value for this property - */ - public abstract void set(T value); -}
\ No newline at end of file diff --git a/core/java/android/view/InputDevice.java b/core/java/android/view/InputDevice.java index 3bb9c01..3bb9c01 100755..100644 --- a/core/java/android/view/InputDevice.java +++ b/core/java/android/view/InputDevice.java diff --git a/core/java/android/view/InputEvent.java b/core/java/android/view/InputEvent.java index ef810a3..ef810a3 100755..100644 --- a/core/java/android/view/InputEvent.java +++ b/core/java/android/view/InputEvent.java diff --git a/core/java/android/view/KeyEvent.java b/core/java/android/view/KeyEvent.java index c2a3e58..c2a3e58 100755..100644 --- a/core/java/android/view/KeyEvent.java +++ b/core/java/android/view/KeyEvent.java diff --git a/core/java/android/view/OrientationEventListener.java b/core/java/android/view/OrientationEventListener.java index cd48a4f..cd48a4f 100755..100644 --- a/core/java/android/view/OrientationEventListener.java +++ b/core/java/android/view/OrientationEventListener.java diff --git a/core/java/android/view/ViewStub.java b/core/java/android/view/ViewStub.java index 69a26c2..a5dc3ae 100644 --- a/core/java/android/view/ViewStub.java +++ b/core/java/android/view/ViewStub.java @@ -212,7 +212,8 @@ public final class ViewStub extends View { /** * When visibility is set to {@link #VISIBLE} or {@link #INVISIBLE}, * {@link #inflate()} is invoked and this StubbedView is replaced in its parent - * by the inflated layout resource. + * by the inflated layout resource. After that calls to this function are passed + * through to the inflated view. * * @param visibility One of {@link #VISIBLE}, {@link #INVISIBLE}, or {@link #GONE}. * diff --git a/core/java/android/view/WindowManager.aidl b/core/java/android/view/WindowManager.aidl index 556dc72..556dc72 100755..100644 --- a/core/java/android/view/WindowManager.aidl +++ b/core/java/android/view/WindowManager.aidl diff --git a/core/java/android/view/WindowOrientationListener.java b/core/java/android/view/WindowOrientationListener.java index 4c34dd4..4c34dd4 100755..100644 --- a/core/java/android/view/WindowOrientationListener.java +++ b/core/java/android/view/WindowOrientationListener.java diff --git a/core/java/android/view/animation/package.html b/core/java/android/view/animation/package.html index 87c99bb..87c99bb 100755..100644 --- a/core/java/android/view/animation/package.html +++ b/core/java/android/view/animation/package.html diff --git a/core/java/android/webkit/DeviceMotionService.java b/core/java/android/webkit/DeviceMotionService.java index 9121429..9121429 100755..100644 --- a/core/java/android/webkit/DeviceMotionService.java +++ b/core/java/android/webkit/DeviceMotionService.java diff --git a/core/java/android/webkit/DeviceOrientationService.java b/core/java/android/webkit/DeviceOrientationService.java index a4d240d..a4d240d 100755..100644 --- a/core/java/android/webkit/DeviceOrientationService.java +++ b/core/java/android/webkit/DeviceOrientationService.java diff --git a/core/java/android/webkit/GeolocationPermissions.java b/core/java/android/webkit/GeolocationPermissions.java index 9c0f754..9c0f754 100755..100644 --- a/core/java/android/webkit/GeolocationPermissions.java +++ b/core/java/android/webkit/GeolocationPermissions.java diff --git a/core/java/android/webkit/GeolocationPermissionsClassic.java b/core/java/android/webkit/GeolocationPermissionsClassic.java index 8a9df39..8a9df39 100755..100644 --- a/core/java/android/webkit/GeolocationPermissionsClassic.java +++ b/core/java/android/webkit/GeolocationPermissionsClassic.java diff --git a/core/java/android/webkit/GeolocationService.java b/core/java/android/webkit/GeolocationService.java index 225053b..225053b 100755..100644 --- a/core/java/android/webkit/GeolocationService.java +++ b/core/java/android/webkit/GeolocationService.java diff --git a/core/java/android/widget/AppSecurityPermissions.java b/core/java/android/widget/AppSecurityPermissions.java index 06dadb0..06dadb0 100755..100644 --- a/core/java/android/widget/AppSecurityPermissions.java +++ b/core/java/android/widget/AppSecurityPermissions.java diff --git a/core/java/android/widget/CheckBox.java b/core/java/android/widget/CheckBox.java index 41ab5f2..f1804f8 100644 --- a/core/java/android/widget/CheckBox.java +++ b/core/java/android/widget/CheckBox.java @@ -20,7 +20,6 @@ import android.content.Context; import android.util.AttributeSet; import android.view.accessibility.AccessibilityEvent; import android.view.accessibility.AccessibilityNodeInfo; -import android.util.ValueModel; /** @@ -56,9 +55,7 @@ import android.util.ValueModel; * {@link android.R.styleable#View View Attributes} * </p> */ -public class CheckBox extends CompoundButton implements ValueEditor<Boolean> { - private ValueModel<Boolean> mValueModel = ValueModel.EMPTY; - +public class CheckBox extends CompoundButton { public CheckBox(Context context) { this(context, null); } @@ -82,22 +79,4 @@ public class CheckBox extends CompoundButton implements ValueEditor<Boolean> { super.onInitializeAccessibilityNodeInfo(info); info.setClassName(CheckBox.class.getName()); } - - @Override - public ValueModel<Boolean> getValueModel() { - return mValueModel; - } - - @Override - public void setValueModel(ValueModel<Boolean> valueModel) { - mValueModel = valueModel; - setChecked(mValueModel.get()); - } - - @Override - public boolean performClick() { - boolean handled = super.performClick(); - mValueModel.set(isChecked()); - return handled; - } } diff --git a/core/java/android/widget/EditText.java b/core/java/android/widget/EditText.java index ec81214..57e51c2 100644 --- a/core/java/android/widget/EditText.java +++ b/core/java/android/widget/EditText.java @@ -17,7 +17,6 @@ package android.widget; import android.content.Context; -import android.graphics.Rect; import android.text.Editable; import android.text.Selection; import android.text.Spannable; @@ -25,7 +24,6 @@ import android.text.TextUtils; import android.text.method.ArrowKeyMovementMethod; import android.text.method.MovementMethod; import android.util.AttributeSet; -import android.util.ValueModel; import android.view.accessibility.AccessibilityEvent; import android.view.accessibility.AccessibilityNodeInfo; @@ -49,9 +47,7 @@ import android.view.accessibility.AccessibilityNodeInfo; * {@link android.R.styleable#TextView TextView Attributes}, * {@link android.R.styleable#View View Attributes} */ -public class EditText extends TextView implements ValueEditor<CharSequence> { - private ValueModel<CharSequence> mValueModel = ValueModel.EMPTY; - +public class EditText extends TextView { public EditText(Context context) { this(context, null); } @@ -132,21 +128,4 @@ public class EditText extends TextView implements ValueEditor<CharSequence> { super.onInitializeAccessibilityNodeInfo(info); info.setClassName(EditText.class.getName()); } - - @Override - public ValueModel<CharSequence> getValueModel() { - return mValueModel; - } - - @Override - public void setValueModel(ValueModel<CharSequence> valueModel) { - mValueModel = valueModel; - setText(mValueModel.get()); - } - - @Override - void sendAfterTextChanged(Editable text) { - super.sendAfterTextChanged(text); - mValueModel.set(text); - } } diff --git a/core/java/android/widget/ListView.java b/core/java/android/widget/ListView.java index 03507b5..69e3177 100644 --- a/core/java/android/widget/ListView.java +++ b/core/java/android/widget/ListView.java @@ -2981,11 +2981,9 @@ public class ListView extends AbsListView { while (first.getBottom() < listTop) { AbsListView.LayoutParams layoutParams = (LayoutParams) first.getLayoutParams(); if (recycleBin.shouldRecycleViewType(layoutParams.viewType)) { - detachViewFromParent(first); recycleBin.addScrapView(first, mFirstPosition); - } else { - removeViewInLayout(first); } + detachViewFromParent(first); first = getChildAt(0); mFirstPosition++; } @@ -3012,11 +3010,9 @@ public class ListView extends AbsListView { while (last.getTop() > listBottom) { AbsListView.LayoutParams layoutParams = (LayoutParams) last.getLayoutParams(); if (recycleBin.shouldRecycleViewType(layoutParams.viewType)) { - detachViewFromParent(last); recycleBin.addScrapView(last, mFirstPosition+lastIndex); - } else { - removeViewInLayout(last); } + detachViewFromParent(last); last = getChildAt(--lastIndex); } } diff --git a/core/java/android/widget/SeekBar.java b/core/java/android/widget/SeekBar.java index a6486a8..2737f94 100644 --- a/core/java/android/widget/SeekBar.java +++ b/core/java/android/widget/SeekBar.java @@ -18,7 +18,6 @@ package android.widget; import android.content.Context; import android.util.AttributeSet; -import android.util.ValueModel; import android.view.accessibility.AccessibilityEvent; import android.view.accessibility.AccessibilityNodeInfo; @@ -34,7 +33,7 @@ import android.view.accessibility.AccessibilityNodeInfo; * * @attr ref android.R.styleable#SeekBar_thumb */ -public class SeekBar extends AbsSeekBar implements ValueEditor<Integer> { +public class SeekBar extends AbsSeekBar { /** * A callback that notifies clients when the progress level has been @@ -70,9 +69,8 @@ public class SeekBar extends AbsSeekBar implements ValueEditor<Integer> { void onStopTrackingTouch(SeekBar seekBar); } - private ValueModel<Integer> mValueModel = ValueModel.EMPTY; private OnSeekBarChangeListener mOnSeekBarChangeListener; - + public SeekBar(Context context) { this(context, null); } @@ -91,23 +89,9 @@ public class SeekBar extends AbsSeekBar implements ValueEditor<Integer> { if (mOnSeekBarChangeListener != null) { mOnSeekBarChangeListener.onProgressChanged(this, getProgress(), fromUser); - if (fromUser) { - mValueModel.set(getProgress()); - } } } - @Override - public ValueModel<Integer> getValueModel() { - return mValueModel; - } - - @Override - public void setValueModel(ValueModel<Integer> valueModel) { - mValueModel = valueModel; - setProgress(mValueModel.get()); - } - /** * Sets a listener to receive notifications of changes to the SeekBar's progress level. Also * provides notifications of when the user starts and stops a touch gesture within the SeekBar. diff --git a/core/java/android/widget/ValueEditor.java b/core/java/android/widget/ValueEditor.java deleted file mode 100755 index 2b91abf..0000000 --- a/core/java/android/widget/ValueEditor.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (C) 2012 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.widget; - -import android.util.ValueModel; - -/** - * An interface for editors of simple values. Classes implementing this interface are normally - * UI controls (subclasses of {@link android.view.View View}) that can provide a suitable - * user interface to display and edit values of the specified type. This interface is - * intended to describe editors for simple types, like {@code boolean}, {@code int} or - * {@code String}, where the values themselves are immutable. - * <p> - * For example, {@link android.widget.CheckBox CheckBox} implements - * this interface for the Boolean type as it is capable of providing an appropriate - * mechanism for displaying and changing the value of a Boolean property. - * - * @param <T> the value type that this editor supports - */ -public interface ValueEditor<T> { - /** - * Return the last value model that was set. If no value model has been set, the editor - * should return the value {@link android.util.ValueModel#EMPTY}. - * - * @return the value model - */ - public ValueModel<T> getValueModel(); - - /** - * Sets the value model for this editor. When the value model is set, the editor should - * retrieve the value from the value model, using {@link android.util.ValueModel#get()}, - * and set its internal state accordingly. Likewise, when the editor's internal state changes - * it should update the value model by calling {@link android.util.ValueModel#set(T)} - * with the appropriate value. - * - * @param valueModel the new value model for this editor. - */ - public void setValueModel(ValueModel<T> valueModel); -} diff --git a/core/java/com/android/internal/app/IMediaContainerService.aidl b/core/java/com/android/internal/app/IMediaContainerService.aidl index 03d3b22..03d3b22 100755..100644 --- a/core/java/com/android/internal/app/IMediaContainerService.aidl +++ b/core/java/com/android/internal/app/IMediaContainerService.aidl diff --git a/core/java/com/android/internal/app/IUsageStats.aidl b/core/java/com/android/internal/app/IUsageStats.aidl index 1ea7409..1ea7409 100755..100644 --- a/core/java/com/android/internal/app/IUsageStats.aidl +++ b/core/java/com/android/internal/app/IUsageStats.aidl diff --git a/core/java/com/android/internal/app/NetInitiatedActivity.java b/core/java/com/android/internal/app/NetInitiatedActivity.java index e1166f1..e1166f1 100755..100644 --- a/core/java/com/android/internal/app/NetInitiatedActivity.java +++ b/core/java/com/android/internal/app/NetInitiatedActivity.java diff --git a/core/java/com/android/internal/os/PkgUsageStats.aidl b/core/java/com/android/internal/os/PkgUsageStats.aidl index 8305271..8305271 100755..100644 --- a/core/java/com/android/internal/os/PkgUsageStats.aidl +++ b/core/java/com/android/internal/os/PkgUsageStats.aidl diff --git a/core/java/com/android/internal/os/PkgUsageStats.java b/core/java/com/android/internal/os/PkgUsageStats.java index 8c2c405..8c2c405 100755..100644 --- a/core/java/com/android/internal/os/PkgUsageStats.java +++ b/core/java/com/android/internal/os/PkgUsageStats.java diff --git a/core/java/com/android/internal/view/menu/MenuItemImpl.java b/core/java/com/android/internal/view/menu/MenuItemImpl.java index 9f7441d..7189610 100644 --- a/core/java/com/android/internal/view/menu/MenuItemImpl.java +++ b/core/java/com/android/internal/view/menu/MenuItemImpl.java @@ -93,6 +93,7 @@ public final class MenuItemImpl implements MenuItem { */ private ContextMenuInfo mMenuInfo; + private static String sLanguage; private static String sPrependShortcutLabel; private static String sEnterShortcutLabel; private static String sDeleteShortcutLabel; @@ -114,7 +115,9 @@ public final class MenuItemImpl implements MenuItem { MenuItemImpl(MenuBuilder menu, int group, int id, int categoryOrder, int ordering, CharSequence title, int showAsAction) { - if (sPrependShortcutLabel == null) { + String lang = menu.getContext().getResources().getConfiguration().locale.toString(); + if (sPrependShortcutLabel == null || !lang.equals(sLanguage)) { + sLanguage = lang; // This is instantiated from the UI thread, so no chance of sync issues sPrependShortcutLabel = menu.getContext().getResources().getString( com.android.internal.R.string.prepend_shortcut_label); |