Loading core/java/android/app/ActivityManagerNative.java +44 −0 Original line number Diff line number Diff line Loading @@ -1167,6 +1167,24 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM overridePendingTransition(token, packageName, enterAnim, exitAnim); return true; } case NOTE_START_WAKELOCK_TRANSACTION: { data.enforceInterface(IActivityManager.descriptor); int uid = data.readInt(); String tag = data.readString(); int type = data.readInt(); noteStartWakeLock(uid, tag, type); return true; } case NOTE_STOP_WAKELOCK_TRANSACTION: { data.enforceInterface(IActivityManager.descriptor); int uid = data.readInt(); String tag = data.readString(); int type = data.readInt(); noteStopWakeLock(uid, tag, type); return true; } } return super.onTransact(code, data, reply, flags); Loading Loading @@ -2565,5 +2583,31 @@ class ActivityManagerProxy implements IActivityManager reply.recycle(); } public void noteStartWakeLock(int uid, String tag, int type) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); data.writeInt(uid); data.writeString(tag); data.writeInt(type); mRemote.transact(NOTE_START_WAKELOCK_TRANSACTION, data, reply, 0); reply.readException(); data.recycle(); reply.recycle(); } public void noteStopWakeLock(int uid, String tag, int type) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); data.writeInt(uid); data.writeString(tag); data.writeInt(type); mRemote.transact(NOTE_STOP_WAKELOCK_TRANSACTION, data, reply, 0); reply.readException(); data.recycle(); reply.recycle(); } private IBinder mRemote; } core/java/android/app/IActivityManager.java +5 −0 Original line number Diff line number Diff line Loading @@ -288,6 +288,9 @@ public interface IActivityManager extends IInterface { public void overridePendingTransition(IBinder token, String packageName, int enterAnim, int exitAnim) throws RemoteException; public void noteStartWakeLock(int uid, String tag, int type) throws RemoteException; public void noteStopWakeLock(int uid, String tag, int type) throws RemoteException; /* * Private non-Binder interfaces */ Loading Loading @@ -448,4 +451,6 @@ public interface IActivityManager extends IInterface { int KILL_APPLICATION_PROCESS_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+98; int START_ACTIVITY_INTENT_SENDER_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+99; int OVERRIDE_PENDING_TRANSITION_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+100; int NOTE_START_WAKELOCK_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+101; int NOTE_STOP_WAKELOCK_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+102; } core/java/android/database/Cursor.java +3 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,9 @@ import java.util.Map; /** * This interface provides random read-write access to the result set returned * by a database query. * * Cursor implementations are not required to be synchronized so code using a Cursor from multiple * threads should perform its own synchronization when using the Cursor. */ public interface Cursor { /** Loading core/java/android/database/sqlite/SQLiteCursor.java +3 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,9 @@ import java.util.concurrent.locks.ReentrantLock; /** * A Cursor implementation that exposes results from a query on a * {@link SQLiteDatabase}. * * SQLiteCursor is not internally synchronized so code using a SQLiteCursor from multiple * threads should perform its own synchronization when using the SQLiteCursor. */ public class SQLiteCursor extends AbstractWindowedCursor { static final String TAG = "Cursor"; Loading core/java/android/database/sqlite/SQLiteDatabase.java +16 −8 Original line number Diff line number Diff line Loading @@ -1019,7 +1019,8 @@ public class SQLiteDatabase extends SQLiteClosable { * * @param sql The raw SQL statement, may contain ? for unknown values to be * bound later. * @return a pre-compiled statement object. * @return A pre-compiled {@link SQLiteStatement} object. Note that * {@link SQLiteStatement}s are not synchronized, see the documentation for more details. */ public SQLiteStatement compileStatement(String sql) throws SQLException { lock(); Loading Loading @@ -1057,7 +1058,8 @@ public class SQLiteDatabase extends SQLiteClosable { * default sort order, which may be unordered. * @param limit Limits the number of rows returned by the query, * formatted as LIMIT clause. Passing null denotes no LIMIT clause. * @return A Cursor object, which is positioned before the first entry * @return A {@link Cursor} object, which is positioned before the first entry. Note that * {@link Cursor}s are not synchronized, see the documentation for more details. * @see Cursor */ public Cursor query(boolean distinct, String table, String[] columns, Loading Loading @@ -1095,7 +1097,8 @@ public class SQLiteDatabase extends SQLiteClosable { * default sort order, which may be unordered. * @param limit Limits the number of rows returned by the query, * formatted as LIMIT clause. Passing null denotes no LIMIT clause. * @return A Cursor object, which is positioned before the first entry * @return A {@link Cursor} object, which is positioned before the first entry. Note that * {@link Cursor}s are not synchronized, see the documentation for more details. * @see Cursor */ public Cursor queryWithFactory(CursorFactory cursorFactory, Loading Loading @@ -1133,7 +1136,8 @@ public class SQLiteDatabase extends SQLiteClosable { * @param orderBy How to order the rows, formatted as an SQL ORDER BY clause * (excluding the ORDER BY itself). Passing null will use the * default sort order, which may be unordered. * @return A {@link Cursor} object, which is positioned before the first entry * @return A {@link Cursor} object, which is positioned before the first entry. Note that * {@link Cursor}s are not synchronized, see the documentation for more details. * @see Cursor */ public Cursor query(String table, String[] columns, String selection, Loading Loading @@ -1170,7 +1174,8 @@ public class SQLiteDatabase extends SQLiteClosable { * default sort order, which may be unordered. * @param limit Limits the number of rows returned by the query, * formatted as LIMIT clause. Passing null denotes no LIMIT clause. * @return A {@link Cursor} object, which is positioned before the first entry * @return A {@link Cursor} object, which is positioned before the first entry. Note that * {@link Cursor}s are not synchronized, see the documentation for more details. * @see Cursor */ public Cursor query(String table, String[] columns, String selection, Loading @@ -1188,7 +1193,8 @@ public class SQLiteDatabase extends SQLiteClosable { * @param selectionArgs You may include ?s in where clause in the query, * which will be replaced by the values from selectionArgs. The * values will be bound as Strings. * @return A {@link Cursor} object, which is positioned before the first entry * @return A {@link Cursor} object, which is positioned before the first entry. Note that * {@link Cursor}s are not synchronized, see the documentation for more details. */ public Cursor rawQuery(String sql, String[] selectionArgs) { return rawQueryWithFactory(null, sql, selectionArgs, null); Loading @@ -1203,7 +1209,8 @@ public class SQLiteDatabase extends SQLiteClosable { * which will be replaced by the values from selectionArgs. The * values will be bound as Strings. * @param editTable the name of the first table, which is editable * @return A {@link Cursor} object, which is positioned before the first entry * @return A {@link Cursor} object, which is positioned before the first entry. Note that * {@link Cursor}s are not synchronized, see the documentation for more details. */ public Cursor rawQueryWithFactory( CursorFactory cursorFactory, String sql, String[] selectionArgs, Loading Loading @@ -1255,7 +1262,8 @@ public class SQLiteDatabase extends SQLiteClosable { * values will be bound as Strings. * @param initialRead set the initial count of items to read from the cursor * @param maxRead set the count of items to read on each iteration after the first * @return A {@link Cursor} object, which is positioned before the first entry * @return A {@link Cursor} object, which is positioned before the first entry. Note that * {@link Cursor}s are not synchronized, see the documentation for more details. * * This work is incomplete and not fully tested or reviewed, so currently * hidden. Loading Loading
core/java/android/app/ActivityManagerNative.java +44 −0 Original line number Diff line number Diff line Loading @@ -1167,6 +1167,24 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM overridePendingTransition(token, packageName, enterAnim, exitAnim); return true; } case NOTE_START_WAKELOCK_TRANSACTION: { data.enforceInterface(IActivityManager.descriptor); int uid = data.readInt(); String tag = data.readString(); int type = data.readInt(); noteStartWakeLock(uid, tag, type); return true; } case NOTE_STOP_WAKELOCK_TRANSACTION: { data.enforceInterface(IActivityManager.descriptor); int uid = data.readInt(); String tag = data.readString(); int type = data.readInt(); noteStopWakeLock(uid, tag, type); return true; } } return super.onTransact(code, data, reply, flags); Loading Loading @@ -2565,5 +2583,31 @@ class ActivityManagerProxy implements IActivityManager reply.recycle(); } public void noteStartWakeLock(int uid, String tag, int type) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); data.writeInt(uid); data.writeString(tag); data.writeInt(type); mRemote.transact(NOTE_START_WAKELOCK_TRANSACTION, data, reply, 0); reply.readException(); data.recycle(); reply.recycle(); } public void noteStopWakeLock(int uid, String tag, int type) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); data.writeInt(uid); data.writeString(tag); data.writeInt(type); mRemote.transact(NOTE_STOP_WAKELOCK_TRANSACTION, data, reply, 0); reply.readException(); data.recycle(); reply.recycle(); } private IBinder mRemote; }
core/java/android/app/IActivityManager.java +5 −0 Original line number Diff line number Diff line Loading @@ -288,6 +288,9 @@ public interface IActivityManager extends IInterface { public void overridePendingTransition(IBinder token, String packageName, int enterAnim, int exitAnim) throws RemoteException; public void noteStartWakeLock(int uid, String tag, int type) throws RemoteException; public void noteStopWakeLock(int uid, String tag, int type) throws RemoteException; /* * Private non-Binder interfaces */ Loading Loading @@ -448,4 +451,6 @@ public interface IActivityManager extends IInterface { int KILL_APPLICATION_PROCESS_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+98; int START_ACTIVITY_INTENT_SENDER_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+99; int OVERRIDE_PENDING_TRANSITION_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+100; int NOTE_START_WAKELOCK_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+101; int NOTE_STOP_WAKELOCK_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+102; }
core/java/android/database/Cursor.java +3 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,9 @@ import java.util.Map; /** * This interface provides random read-write access to the result set returned * by a database query. * * Cursor implementations are not required to be synchronized so code using a Cursor from multiple * threads should perform its own synchronization when using the Cursor. */ public interface Cursor { /** Loading
core/java/android/database/sqlite/SQLiteCursor.java +3 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,9 @@ import java.util.concurrent.locks.ReentrantLock; /** * A Cursor implementation that exposes results from a query on a * {@link SQLiteDatabase}. * * SQLiteCursor is not internally synchronized so code using a SQLiteCursor from multiple * threads should perform its own synchronization when using the SQLiteCursor. */ public class SQLiteCursor extends AbstractWindowedCursor { static final String TAG = "Cursor"; Loading
core/java/android/database/sqlite/SQLiteDatabase.java +16 −8 Original line number Diff line number Diff line Loading @@ -1019,7 +1019,8 @@ public class SQLiteDatabase extends SQLiteClosable { * * @param sql The raw SQL statement, may contain ? for unknown values to be * bound later. * @return a pre-compiled statement object. * @return A pre-compiled {@link SQLiteStatement} object. Note that * {@link SQLiteStatement}s are not synchronized, see the documentation for more details. */ public SQLiteStatement compileStatement(String sql) throws SQLException { lock(); Loading Loading @@ -1057,7 +1058,8 @@ public class SQLiteDatabase extends SQLiteClosable { * default sort order, which may be unordered. * @param limit Limits the number of rows returned by the query, * formatted as LIMIT clause. Passing null denotes no LIMIT clause. * @return A Cursor object, which is positioned before the first entry * @return A {@link Cursor} object, which is positioned before the first entry. Note that * {@link Cursor}s are not synchronized, see the documentation for more details. * @see Cursor */ public Cursor query(boolean distinct, String table, String[] columns, Loading Loading @@ -1095,7 +1097,8 @@ public class SQLiteDatabase extends SQLiteClosable { * default sort order, which may be unordered. * @param limit Limits the number of rows returned by the query, * formatted as LIMIT clause. Passing null denotes no LIMIT clause. * @return A Cursor object, which is positioned before the first entry * @return A {@link Cursor} object, which is positioned before the first entry. Note that * {@link Cursor}s are not synchronized, see the documentation for more details. * @see Cursor */ public Cursor queryWithFactory(CursorFactory cursorFactory, Loading Loading @@ -1133,7 +1136,8 @@ public class SQLiteDatabase extends SQLiteClosable { * @param orderBy How to order the rows, formatted as an SQL ORDER BY clause * (excluding the ORDER BY itself). Passing null will use the * default sort order, which may be unordered. * @return A {@link Cursor} object, which is positioned before the first entry * @return A {@link Cursor} object, which is positioned before the first entry. Note that * {@link Cursor}s are not synchronized, see the documentation for more details. * @see Cursor */ public Cursor query(String table, String[] columns, String selection, Loading Loading @@ -1170,7 +1174,8 @@ public class SQLiteDatabase extends SQLiteClosable { * default sort order, which may be unordered. * @param limit Limits the number of rows returned by the query, * formatted as LIMIT clause. Passing null denotes no LIMIT clause. * @return A {@link Cursor} object, which is positioned before the first entry * @return A {@link Cursor} object, which is positioned before the first entry. Note that * {@link Cursor}s are not synchronized, see the documentation for more details. * @see Cursor */ public Cursor query(String table, String[] columns, String selection, Loading @@ -1188,7 +1193,8 @@ public class SQLiteDatabase extends SQLiteClosable { * @param selectionArgs You may include ?s in where clause in the query, * which will be replaced by the values from selectionArgs. The * values will be bound as Strings. * @return A {@link Cursor} object, which is positioned before the first entry * @return A {@link Cursor} object, which is positioned before the first entry. Note that * {@link Cursor}s are not synchronized, see the documentation for more details. */ public Cursor rawQuery(String sql, String[] selectionArgs) { return rawQueryWithFactory(null, sql, selectionArgs, null); Loading @@ -1203,7 +1209,8 @@ public class SQLiteDatabase extends SQLiteClosable { * which will be replaced by the values from selectionArgs. The * values will be bound as Strings. * @param editTable the name of the first table, which is editable * @return A {@link Cursor} object, which is positioned before the first entry * @return A {@link Cursor} object, which is positioned before the first entry. Note that * {@link Cursor}s are not synchronized, see the documentation for more details. */ public Cursor rawQueryWithFactory( CursorFactory cursorFactory, String sql, String[] selectionArgs, Loading Loading @@ -1255,7 +1262,8 @@ public class SQLiteDatabase extends SQLiteClosable { * values will be bound as Strings. * @param initialRead set the initial count of items to read from the cursor * @param maxRead set the count of items to read on each iteration after the first * @return A {@link Cursor} object, which is positioned before the first entry * @return A {@link Cursor} object, which is positioned before the first entry. Note that * {@link Cursor}s are not synchronized, see the documentation for more details. * * This work is incomplete and not fully tested or reviewed, so currently * hidden. Loading