diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/inputmethodservice/InputMethodService.java | 2 | ||||
-rw-r--r-- | core/java/android/os/Debug.java | 1 | ||||
-rw-r--r-- | core/java/android/security/IKeystoreService.java | 16 | ||||
-rw-r--r-- | core/java/android/view/KeyEvent.java | 4 | ||||
-rw-r--r-- | core/java/com/android/internal/os/ZygoteInit.java | 30 |
5 files changed, 43 insertions, 10 deletions
diff --git a/core/java/android/inputmethodservice/InputMethodService.java b/core/java/android/inputmethodservice/InputMethodService.java index 6f1cc94..d6b90c3 100644 --- a/core/java/android/inputmethodservice/InputMethodService.java +++ b/core/java/android/inputmethodservice/InputMethodService.java @@ -424,7 +424,7 @@ public class InputMethodService extends AbstractInputMethodService { showWindow(true); } // If user uses hard keyboard, IME button should always be shown. - boolean showing = onEvaluateInputViewShown(); + boolean showing = isInputViewShown(); mImm.setImeWindowStatus(mToken, IME_ACTIVE | (showing ? IME_VISIBLE : 0), mBackDisposition); if (resultReceiver != null) { diff --git a/core/java/android/os/Debug.java b/core/java/android/os/Debug.java index 2e77237..fd01da9 100644 --- a/core/java/android/os/Debug.java +++ b/core/java/android/os/Debug.java @@ -577,6 +577,7 @@ href="{@docRoot}guide/developing/tools/traceview.html">Traceview: A Graphical Lo * * @see #startAllocCounting() */ + @Deprecated public static void stopAllocCounting() { VMDebug.stopAllocCounting(); } diff --git a/core/java/android/security/IKeystoreService.java b/core/java/android/security/IKeystoreService.java index e1cc90e..3d75dc8 100644 --- a/core/java/android/security/IKeystoreService.java +++ b/core/java/android/security/IKeystoreService.java @@ -78,7 +78,7 @@ public interface IKeystoreService extends IInterface { return _result; } - public int insert(String name, byte[] item, int uid) throws RemoteException { + public int insert(String name, byte[] item, int uid, int flags) throws RemoteException { Parcel _data = Parcel.obtain(); Parcel _reply = Parcel.obtain(); int _result; @@ -87,6 +87,7 @@ public interface IKeystoreService extends IInterface { _data.writeString(name); _data.writeByteArray(item); _data.writeInt(uid); + _data.writeInt(flags); mRemote.transact(Stub.TRANSACTION_insert, _data, _reply, 0); _reply.readException(); _result = _reply.readInt(); @@ -243,7 +244,7 @@ public interface IKeystoreService extends IInterface { return _result; } - public int generate(String name, int uid) throws RemoteException { + public int generate(String name, int uid, int flags) throws RemoteException { Parcel _data = Parcel.obtain(); Parcel _reply = Parcel.obtain(); int _result; @@ -251,6 +252,7 @@ public interface IKeystoreService extends IInterface { _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(name); _data.writeInt(uid); + _data.writeInt(flags); mRemote.transact(Stub.TRANSACTION_generate, _data, _reply, 0); _reply.readException(); _result = _reply.readInt(); @@ -261,7 +263,8 @@ public interface IKeystoreService extends IInterface { return _result; } - public int import_key(String name, byte[] data, int uid) throws RemoteException { + public int import_key(String name, byte[] data, int uid, int flags) + throws RemoteException { Parcel _data = Parcel.obtain(); Parcel _reply = Parcel.obtain(); int _result; @@ -270,6 +273,7 @@ public interface IKeystoreService extends IInterface { _data.writeString(name); _data.writeByteArray(data); _data.writeInt(uid); + _data.writeInt(flags); mRemote.transact(Stub.TRANSACTION_import, _data, _reply, 0); _reply.readException(); _result = _reply.readInt(); @@ -538,7 +542,7 @@ public interface IKeystoreService extends IInterface { public byte[] get(String name) throws RemoteException; - public int insert(String name, byte[] item, int uid) throws RemoteException; + public int insert(String name, byte[] item, int uid, int flags) throws RemoteException; public int del(String name, int uid) throws RemoteException; @@ -556,9 +560,9 @@ public interface IKeystoreService extends IInterface { public int zero() throws RemoteException; - public int generate(String name, int uid) throws RemoteException; + public int generate(String name, int uid, int flags) throws RemoteException; - public int import_key(String name, byte[] data, int uid) throws RemoteException; + public int import_key(String name, byte[] data, int uid, int flags) throws RemoteException; public byte[] sign(String name, byte[] data) throws RemoteException; diff --git a/core/java/android/view/KeyEvent.java b/core/java/android/view/KeyEvent.java index c2a3e58..4649a8b 100644 --- a/core/java/android/view/KeyEvent.java +++ b/core/java/android/view/KeyEvent.java @@ -628,8 +628,8 @@ public class KeyEvent extends InputEvent implements Parcelable { // NOTE: If you add a new keycode here you must also add it to: // isSystem() - // native/include/android/keycodes.h - // frameworks/base/include/ui/KeycodeLabels.h + // frameworks/native/include/android/keycodes.h + // frameworks/base/include/androidfw/KeycodeLabels.h // external/webkit/WebKit/android/plugins/ANPKeyCodes.h // frameworks/base/core/res/res/values/attrs.xml // emulator? diff --git a/core/java/com/android/internal/os/ZygoteInit.java b/core/java/com/android/internal/os/ZygoteInit.java index 9e43749..4ac16d8 100644 --- a/core/java/com/android/internal/os/ZygoteInit.java +++ b/core/java/com/android/internal/os/ZygoteInit.java @@ -35,6 +35,7 @@ import dalvik.system.Zygote; import libcore.io.IoUtils; import libcore.io.Libcore; +import libcore.io.OsConstants; import java.io.BufferedReader; import java.io.FileDescriptor; @@ -479,12 +480,25 @@ public class ZygoteInit { */ private static boolean startSystemServer() throws MethodAndArgsCaller, RuntimeException { + long capabilities = posixCapabilitiesAsBits( + OsConstants.CAP_KILL, + OsConstants.CAP_NET_ADMIN, + OsConstants.CAP_NET_BIND_SERVICE, + OsConstants.CAP_NET_BROADCAST, + OsConstants.CAP_NET_RAW, + OsConstants.CAP_SYS_BOOT, + OsConstants.CAP_SYS_MODULE, + OsConstants.CAP_SYS_NICE, + OsConstants.CAP_SYS_RESOURCE, + OsConstants.CAP_SYS_TIME, + OsConstants.CAP_SYS_TTY_CONFIG + ); /* Hardcoded command line to start the system server */ String args[] = { "--setuid=1000", "--setgid=1000", "--setgroups=1001,1002,1003,1004,1005,1006,1007,1008,1009,1010,1018,3001,3002,3003,3006,3007", - "--capabilities=130104352,130104352", + "--capabilities=" + capabilities + "," + capabilities, "--runtime-init", "--nice-name=system_server", "com.android.server.SystemServer", @@ -518,6 +532,20 @@ public class ZygoteInit { return true; } + /** + * Gets the bit array representation of the provided list of POSIX capabilities. + */ + private static long posixCapabilitiesAsBits(int... capabilities) { + long result = 0; + for (int capability : capabilities) { + if ((capability < 0) || (capability > OsConstants.CAP_LAST_CAP)) { + throw new IllegalArgumentException(String.valueOf(capability)); + } + result |= (1L << capability); + } + return result; + } + public static void main(String argv[]) { try { // Start profiling the zygote initialization. |