Loading api/current.xml +89 −3 Original line number Diff line number Diff line Loading @@ -131704,9 +131704,97 @@ > <parameter name="path" type="java.lang.String"> </parameter> <parameter name="state" type="java.lang.String"> <parameter name="state" type="int"> </parameter> </method> <field name="ERROR_ALREADY_MOUNTED" type="int" transient="false" volatile="false" value="24" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="ERROR_COULD_NOT_MOUNT" type="int" transient="false" volatile="false" value="21" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="ERROR_COULD_NOT_UNMOUNT" type="int" transient="false" volatile="false" value="22" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="ERROR_INTERNAL" type="int" transient="false" volatile="false" value="20" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="ERROR_NOT_MOUNTED" type="int" transient="false" volatile="false" value="23" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="ERROR_PERMISSION_DENIED" type="int" transient="false" volatile="false" value="25" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="MOUNTED" type="int" transient="false" volatile="false" value="1" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="UNMOUNTED" type="int" transient="false" volatile="false" value="2" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> </class> <class name="StorageManager" extends="java.lang.Object" Loading Loading @@ -131741,8 +131829,6 @@ > <parameter name="filename" type="java.lang.String"> </parameter> <exception name="IllegalArgumentException" type="java.lang.IllegalArgumentException"> </exception> </method> <method name="mountObb" return="boolean" core/java/android/os/StrictMode.java +25 −8 Original line number Diff line number Diff line Loading @@ -104,6 +104,10 @@ public final class StrictMode { // Only show an annoying dialog at most every 30 seconds private static final long MIN_DIALOG_INTERVAL_MS = 30000; // How many offending stacks to keep track of (and time) per loop // of the Looper. private static final int MAX_OFFENSES_PER_LOOP = 10; // Thread-policy: /** Loading Loading @@ -680,6 +684,17 @@ public final class StrictMode { } } private static final ThreadLocal<ArrayList<ViolationInfo>> violationsBeingTimed = new ThreadLocal<ArrayList<ViolationInfo>>() { @Override protected ArrayList<ViolationInfo> initialValue() { return new ArrayList<ViolationInfo>(); } }; private static boolean tooManyViolationsThisLoop() { return violationsBeingTimed.get().size() >= MAX_OFFENSES_PER_LOOP; } private static class AndroidBlockGuardPolicy implements BlockGuard.Policy { private int mPolicyMask; Loading Loading @@ -707,6 +722,9 @@ public final class StrictMode { if ((mPolicyMask & DETECT_DISK_WRITE) == 0) { return; } if (tooManyViolationsThisLoop()) { return; } BlockGuard.BlockGuardPolicyException e = new StrictModeDiskWriteViolation(mPolicyMask); e.fillInStackTrace(); startHandlingViolationException(e); Loading @@ -717,6 +735,9 @@ public final class StrictMode { if ((mPolicyMask & DETECT_DISK_READ) == 0) { return; } if (tooManyViolationsThisLoop()) { return; } BlockGuard.BlockGuardPolicyException e = new StrictModeDiskReadViolation(mPolicyMask); e.fillInStackTrace(); startHandlingViolationException(e); Loading @@ -727,6 +748,9 @@ public final class StrictMode { if ((mPolicyMask & DETECT_NETWORK) == 0) { return; } if (tooManyViolationsThisLoop()) { return; } BlockGuard.BlockGuardPolicyException e = new StrictModeNetworkViolation(mPolicyMask); e.fillInStackTrace(); startHandlingViolationException(e); Loading @@ -747,13 +771,6 @@ public final class StrictMode { handleViolationWithTimingAttempt(info); } private static final ThreadLocal<ArrayList<ViolationInfo>> violationsBeingTimed = new ThreadLocal<ArrayList<ViolationInfo>>() { @Override protected ArrayList<ViolationInfo> initialValue() { return new ArrayList<ViolationInfo>(); } }; // Attempts to fill in the provided ViolationInfo's // durationMillis field if this thread has a Looper we can use // to measure with. We measure from the time of violation Loading @@ -780,7 +797,7 @@ public final class StrictMode { MessageQueue queue = Looper.myQueue(); final ArrayList<ViolationInfo> records = violationsBeingTimed.get(); if (records.size() >= 10) { if (records.size() >= MAX_OFFENSES_PER_LOOP) { // Not worth measuring. Too many offenses in one loop. return; } Loading core/java/android/os/storage/IMountService.java +13 −7 Original line number Diff line number Diff line Loading @@ -484,7 +484,7 @@ public interface IMountService extends IInterface { * IObbActionListener to inform it of the terminal state of the * call. */ public void mountObb(String filename, String key, IObbActionListener token) public void mountObb(String filename, String key, IObbActionListener token, int nonce) throws RemoteException { Parcel _data = Parcel.obtain(); Parcel _reply = Parcel.obtain(); Loading @@ -493,6 +493,7 @@ public interface IMountService extends IInterface { _data.writeString(filename); _data.writeString(key); _data.writeStrongBinder((token != null ? token.asBinder() : null)); _data.writeInt(nonce); mRemote.transact(Stub.TRANSACTION_mountObb, _data, _reply, 0); _reply.readException(); } finally { Loading @@ -508,8 +509,8 @@ public interface IMountService extends IInterface { * IObbActionListener to inform it of the terminal state of the * call. */ public void unmountObb(String filename, boolean force, IObbActionListener token) throws RemoteException { public void unmountObb(String filename, boolean force, IObbActionListener token, int nonce) throws RemoteException { Parcel _data = Parcel.obtain(); Parcel _reply = Parcel.obtain(); try { Loading @@ -517,6 +518,7 @@ public interface IMountService extends IInterface { _data.writeString(filename); _data.writeInt((force ? 1 : 0)); _data.writeStrongBinder((token != null ? token.asBinder() : null)); _data.writeInt(nonce); mRemote.transact(Stub.TRANSACTION_unmountObb, _data, _reply, 0); _reply.readException(); } finally { Loading Loading @@ -855,7 +857,9 @@ public interface IMountService extends IInterface { key = data.readString(); IObbActionListener observer; observer = IObbActionListener.Stub.asInterface(data.readStrongBinder()); mountObb(filename, key, observer); int nonce; nonce = data.readInt(); mountObb(filename, key, observer, nonce); reply.writeNoException(); return true; } Loading @@ -867,7 +871,9 @@ public interface IMountService extends IInterface { force = 0 != data.readInt(); IObbActionListener observer; observer = IObbActionListener.Stub.asInterface(data.readStrongBinder()); unmountObb(filename, force, observer); int nonce; nonce = data.readInt(); unmountObb(filename, force, observer, nonce); reply.writeNoException(); return true; } Loading Loading @@ -979,7 +985,7 @@ public interface IMountService extends IInterface { * MountService will call back to the supplied IObbActionListener to inform * it of the terminal state of the call. */ public void mountObb(String filename, String key, IObbActionListener token) public void mountObb(String filename, String key, IObbActionListener token, int nonce) throws RemoteException; /* Loading Loading @@ -1023,7 +1029,7 @@ public interface IMountService extends IInterface { * MountService will call back to the supplied IObbActionListener to inform * it of the terminal state of the call. */ public void unmountObb(String filename, boolean force, IObbActionListener token) public void unmountObb(String filename, boolean force, IObbActionListener token, int nonce) throws RemoteException; /* Loading core/java/android/os/storage/IObbActionListener.java +12 −7 Original line number Diff line number Diff line Loading @@ -69,9 +69,11 @@ public interface IObbActionListener extends IInterface { data.enforceInterface(DESCRIPTOR); String filename; filename = data.readString(); String status; status = data.readString(); this.onObbResult(filename, status); int nonce; nonce = data.readInt(); int status; status = data.readInt(); this.onObbResult(filename, nonce, status); reply.writeNoException(); return true; } Loading Loading @@ -101,13 +103,15 @@ public interface IObbActionListener extends IInterface { * on * @param returnCode status of the operation */ public void onObbResult(String filename, String status) throws RemoteException { public void onObbResult(String filename, int nonce, int status) throws RemoteException { Parcel _data = Parcel.obtain(); Parcel _reply = Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(filename); _data.writeString(status); _data.writeInt(nonce); _data.writeInt(status); mRemote.transact(Stub.TRANSACTION_onObbResult, _data, _reply, 0); _reply.readException(); } finally { Loading @@ -124,7 +128,8 @@ public interface IObbActionListener extends IInterface { * Return from an OBB action result. * * @param filename the path to the OBB the operation was performed on * @param returnCode status of the operation * @param nonce identifier that is meaningful to the receiver * @param status status code as defined in {@link OnObbStateChangeListener} */ public void onObbResult(String filename, String status) throws RemoteException; public void onObbResult(String filename, int nonce, int status) throws RemoteException; } core/java/android/os/storage/OnObbStateChangeListener.java +56 −2 Original line number Diff line number Diff line Loading @@ -17,15 +17,69 @@ package android.os.storage; /** * Used for receiving notifications from {@link StorageManager}. * Used for receiving notifications from {@link StorageManager} about OBB file * states. */ public abstract class OnObbStateChangeListener { /** * The OBB container is now mounted and ready for use. Returned in status * messages from calls made via {@link StorageManager} */ public static final int MOUNTED = 1; /** * The OBB container is now unmounted and not usable. Returned in status * messages from calls made via {@link StorageManager} */ public static final int UNMOUNTED = 2; /** * There was an internal system error encountered while trying to mount the * OBB. Returned in status messages from calls made via * {@link StorageManager} */ public static final int ERROR_INTERNAL = 20; /** * The OBB could not be mounted by the system. Returned in status messages * from calls made via {@link StorageManager} */ public static final int ERROR_COULD_NOT_MOUNT = 21; /** * The OBB could not be unmounted. This most likely indicates that a file is * in use on the OBB. Returned in status messages from calls made via * {@link StorageManager} */ public static final int ERROR_COULD_NOT_UNMOUNT = 22; /** * A call was made to unmount the OBB when it was not mounted. Returned in * status messages from calls made via {@link StorageManager} */ public static final int ERROR_NOT_MOUNTED = 23; /** * The OBB has already been mounted. Returned in status messages from calls * made via {@link StorageManager} */ public static final int ERROR_ALREADY_MOUNTED = 24; /** * The current application does not have permission to use this OBB because * the OBB indicates it's owned by a different package or the key used to * open it is incorrect. Returned in status messages from calls made via * {@link StorageManager} */ public static final int ERROR_PERMISSION_DENIED = 25; /** * Called when an OBB has changed states. * * @param path path to the OBB file the state change has happened on * @param state the current state of the OBB */ public void onObbStateChange(String path, String state) { public void onObbStateChange(String path, int state) { } } Loading
api/current.xml +89 −3 Original line number Diff line number Diff line Loading @@ -131704,9 +131704,97 @@ > <parameter name="path" type="java.lang.String"> </parameter> <parameter name="state" type="java.lang.String"> <parameter name="state" type="int"> </parameter> </method> <field name="ERROR_ALREADY_MOUNTED" type="int" transient="false" volatile="false" value="24" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="ERROR_COULD_NOT_MOUNT" type="int" transient="false" volatile="false" value="21" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="ERROR_COULD_NOT_UNMOUNT" type="int" transient="false" volatile="false" value="22" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="ERROR_INTERNAL" type="int" transient="false" volatile="false" value="20" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="ERROR_NOT_MOUNTED" type="int" transient="false" volatile="false" value="23" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="ERROR_PERMISSION_DENIED" type="int" transient="false" volatile="false" value="25" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="MOUNTED" type="int" transient="false" volatile="false" value="1" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="UNMOUNTED" type="int" transient="false" volatile="false" value="2" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> </class> <class name="StorageManager" extends="java.lang.Object" Loading Loading @@ -131741,8 +131829,6 @@ > <parameter name="filename" type="java.lang.String"> </parameter> <exception name="IllegalArgumentException" type="java.lang.IllegalArgumentException"> </exception> </method> <method name="mountObb" return="boolean"
core/java/android/os/StrictMode.java +25 −8 Original line number Diff line number Diff line Loading @@ -104,6 +104,10 @@ public final class StrictMode { // Only show an annoying dialog at most every 30 seconds private static final long MIN_DIALOG_INTERVAL_MS = 30000; // How many offending stacks to keep track of (and time) per loop // of the Looper. private static final int MAX_OFFENSES_PER_LOOP = 10; // Thread-policy: /** Loading Loading @@ -680,6 +684,17 @@ public final class StrictMode { } } private static final ThreadLocal<ArrayList<ViolationInfo>> violationsBeingTimed = new ThreadLocal<ArrayList<ViolationInfo>>() { @Override protected ArrayList<ViolationInfo> initialValue() { return new ArrayList<ViolationInfo>(); } }; private static boolean tooManyViolationsThisLoop() { return violationsBeingTimed.get().size() >= MAX_OFFENSES_PER_LOOP; } private static class AndroidBlockGuardPolicy implements BlockGuard.Policy { private int mPolicyMask; Loading Loading @@ -707,6 +722,9 @@ public final class StrictMode { if ((mPolicyMask & DETECT_DISK_WRITE) == 0) { return; } if (tooManyViolationsThisLoop()) { return; } BlockGuard.BlockGuardPolicyException e = new StrictModeDiskWriteViolation(mPolicyMask); e.fillInStackTrace(); startHandlingViolationException(e); Loading @@ -717,6 +735,9 @@ public final class StrictMode { if ((mPolicyMask & DETECT_DISK_READ) == 0) { return; } if (tooManyViolationsThisLoop()) { return; } BlockGuard.BlockGuardPolicyException e = new StrictModeDiskReadViolation(mPolicyMask); e.fillInStackTrace(); startHandlingViolationException(e); Loading @@ -727,6 +748,9 @@ public final class StrictMode { if ((mPolicyMask & DETECT_NETWORK) == 0) { return; } if (tooManyViolationsThisLoop()) { return; } BlockGuard.BlockGuardPolicyException e = new StrictModeNetworkViolation(mPolicyMask); e.fillInStackTrace(); startHandlingViolationException(e); Loading @@ -747,13 +771,6 @@ public final class StrictMode { handleViolationWithTimingAttempt(info); } private static final ThreadLocal<ArrayList<ViolationInfo>> violationsBeingTimed = new ThreadLocal<ArrayList<ViolationInfo>>() { @Override protected ArrayList<ViolationInfo> initialValue() { return new ArrayList<ViolationInfo>(); } }; // Attempts to fill in the provided ViolationInfo's // durationMillis field if this thread has a Looper we can use // to measure with. We measure from the time of violation Loading @@ -780,7 +797,7 @@ public final class StrictMode { MessageQueue queue = Looper.myQueue(); final ArrayList<ViolationInfo> records = violationsBeingTimed.get(); if (records.size() >= 10) { if (records.size() >= MAX_OFFENSES_PER_LOOP) { // Not worth measuring. Too many offenses in one loop. return; } Loading
core/java/android/os/storage/IMountService.java +13 −7 Original line number Diff line number Diff line Loading @@ -484,7 +484,7 @@ public interface IMountService extends IInterface { * IObbActionListener to inform it of the terminal state of the * call. */ public void mountObb(String filename, String key, IObbActionListener token) public void mountObb(String filename, String key, IObbActionListener token, int nonce) throws RemoteException { Parcel _data = Parcel.obtain(); Parcel _reply = Parcel.obtain(); Loading @@ -493,6 +493,7 @@ public interface IMountService extends IInterface { _data.writeString(filename); _data.writeString(key); _data.writeStrongBinder((token != null ? token.asBinder() : null)); _data.writeInt(nonce); mRemote.transact(Stub.TRANSACTION_mountObb, _data, _reply, 0); _reply.readException(); } finally { Loading @@ -508,8 +509,8 @@ public interface IMountService extends IInterface { * IObbActionListener to inform it of the terminal state of the * call. */ public void unmountObb(String filename, boolean force, IObbActionListener token) throws RemoteException { public void unmountObb(String filename, boolean force, IObbActionListener token, int nonce) throws RemoteException { Parcel _data = Parcel.obtain(); Parcel _reply = Parcel.obtain(); try { Loading @@ -517,6 +518,7 @@ public interface IMountService extends IInterface { _data.writeString(filename); _data.writeInt((force ? 1 : 0)); _data.writeStrongBinder((token != null ? token.asBinder() : null)); _data.writeInt(nonce); mRemote.transact(Stub.TRANSACTION_unmountObb, _data, _reply, 0); _reply.readException(); } finally { Loading Loading @@ -855,7 +857,9 @@ public interface IMountService extends IInterface { key = data.readString(); IObbActionListener observer; observer = IObbActionListener.Stub.asInterface(data.readStrongBinder()); mountObb(filename, key, observer); int nonce; nonce = data.readInt(); mountObb(filename, key, observer, nonce); reply.writeNoException(); return true; } Loading @@ -867,7 +871,9 @@ public interface IMountService extends IInterface { force = 0 != data.readInt(); IObbActionListener observer; observer = IObbActionListener.Stub.asInterface(data.readStrongBinder()); unmountObb(filename, force, observer); int nonce; nonce = data.readInt(); unmountObb(filename, force, observer, nonce); reply.writeNoException(); return true; } Loading Loading @@ -979,7 +985,7 @@ public interface IMountService extends IInterface { * MountService will call back to the supplied IObbActionListener to inform * it of the terminal state of the call. */ public void mountObb(String filename, String key, IObbActionListener token) public void mountObb(String filename, String key, IObbActionListener token, int nonce) throws RemoteException; /* Loading Loading @@ -1023,7 +1029,7 @@ public interface IMountService extends IInterface { * MountService will call back to the supplied IObbActionListener to inform * it of the terminal state of the call. */ public void unmountObb(String filename, boolean force, IObbActionListener token) public void unmountObb(String filename, boolean force, IObbActionListener token, int nonce) throws RemoteException; /* Loading
core/java/android/os/storage/IObbActionListener.java +12 −7 Original line number Diff line number Diff line Loading @@ -69,9 +69,11 @@ public interface IObbActionListener extends IInterface { data.enforceInterface(DESCRIPTOR); String filename; filename = data.readString(); String status; status = data.readString(); this.onObbResult(filename, status); int nonce; nonce = data.readInt(); int status; status = data.readInt(); this.onObbResult(filename, nonce, status); reply.writeNoException(); return true; } Loading Loading @@ -101,13 +103,15 @@ public interface IObbActionListener extends IInterface { * on * @param returnCode status of the operation */ public void onObbResult(String filename, String status) throws RemoteException { public void onObbResult(String filename, int nonce, int status) throws RemoteException { Parcel _data = Parcel.obtain(); Parcel _reply = Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(filename); _data.writeString(status); _data.writeInt(nonce); _data.writeInt(status); mRemote.transact(Stub.TRANSACTION_onObbResult, _data, _reply, 0); _reply.readException(); } finally { Loading @@ -124,7 +128,8 @@ public interface IObbActionListener extends IInterface { * Return from an OBB action result. * * @param filename the path to the OBB the operation was performed on * @param returnCode status of the operation * @param nonce identifier that is meaningful to the receiver * @param status status code as defined in {@link OnObbStateChangeListener} */ public void onObbResult(String filename, String status) throws RemoteException; public void onObbResult(String filename, int nonce, int status) throws RemoteException; }
core/java/android/os/storage/OnObbStateChangeListener.java +56 −2 Original line number Diff line number Diff line Loading @@ -17,15 +17,69 @@ package android.os.storage; /** * Used for receiving notifications from {@link StorageManager}. * Used for receiving notifications from {@link StorageManager} about OBB file * states. */ public abstract class OnObbStateChangeListener { /** * The OBB container is now mounted and ready for use. Returned in status * messages from calls made via {@link StorageManager} */ public static final int MOUNTED = 1; /** * The OBB container is now unmounted and not usable. Returned in status * messages from calls made via {@link StorageManager} */ public static final int UNMOUNTED = 2; /** * There was an internal system error encountered while trying to mount the * OBB. Returned in status messages from calls made via * {@link StorageManager} */ public static final int ERROR_INTERNAL = 20; /** * The OBB could not be mounted by the system. Returned in status messages * from calls made via {@link StorageManager} */ public static final int ERROR_COULD_NOT_MOUNT = 21; /** * The OBB could not be unmounted. This most likely indicates that a file is * in use on the OBB. Returned in status messages from calls made via * {@link StorageManager} */ public static final int ERROR_COULD_NOT_UNMOUNT = 22; /** * A call was made to unmount the OBB when it was not mounted. Returned in * status messages from calls made via {@link StorageManager} */ public static final int ERROR_NOT_MOUNTED = 23; /** * The OBB has already been mounted. Returned in status messages from calls * made via {@link StorageManager} */ public static final int ERROR_ALREADY_MOUNTED = 24; /** * The current application does not have permission to use this OBB because * the OBB indicates it's owned by a different package or the key used to * open it is incorrect. Returned in status messages from calls made via * {@link StorageManager} */ public static final int ERROR_PERMISSION_DENIED = 25; /** * Called when an OBB has changed states. * * @param path path to the OBB file the state change has happened on * @param state the current state of the OBB */ public void onObbStateChange(String path, String state) { public void onObbStateChange(String path, int state) { } }