Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2ee29c3b authored by android-build SharedAccount's avatar android-build SharedAccount
Browse files

merge and resolved conflicts

Change-Id: I60fe814e8a1fafdc90bac7a4031de9328951e6a4
parents b1db93c9 03aa28fb
Loading
Loading
Loading
Loading
+89 −3
Original line number Diff line number Diff line
@@ -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"
@@ -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"
+25 −8
Original line number Diff line number Diff line
@@ -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:

    /**
@@ -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;

@@ -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);
@@ -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);
@@ -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);
@@ -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
@@ -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;
            }
+13 −7
Original line number Diff line number Diff line
@@ -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();
@@ -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 {
@@ -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 {
@@ -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 {
@@ -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;
                }
@@ -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;
                }
@@ -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;

    /*
@@ -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;

    /*
+12 −7
Original line number Diff line number Diff line
@@ -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;
                }
@@ -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 {
@@ -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;
}
+56 −2
Original line number Diff line number Diff line
@@ -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