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

Commit dc6a7059 authored by Jack He's avatar Jack He
Browse files

[Script] Sort modifiers according to JLS

* Correct order is:
  1. public
  2. protected
  3. private
  4. abstract
  5. default
  6. static
  7. final
  8. transient
  9. volatile
  10. synchronized
  11. native
  12. strictfp
* This is achieve through running automatic code cleanup in Intellij
  using "Missorted modifiers" inspection

Bug: 63597465
Test: make checkbuild, no manual changes, no functional changes
Change-Id: Id9c8a3c6bf1195b43d986c4324da94ca8c44367f
parent 7c198c37
Loading
Loading
Loading
Loading
+11 −11
Original line number Diff line number Diff line
@@ -72,14 +72,14 @@ public abstract class BluetoothMapEmailProvider extends ContentProvider {
     * @param out the FileOurputStream to write to.
     * @throws IOException
     */
    abstract protected void WriteMessageToStream(long accountId, long messageId,
    protected abstract void WriteMessageToStream(long accountId, long messageId,
            boolean includeAttachment, boolean download, FileOutputStream out)
        throws IOException;

    /**
     * @return the CONTENT_URI exposed. This will be used to send out notifications.
     */
    abstract protected Uri getContentUri();
    protected abstract Uri getContentUri();

   /**
    * Implementation is provided by the parent class.
@@ -170,7 +170,7 @@ public abstract class BluetoothMapEmailProvider extends ContentProvider {
     * @param accountId the accountId
     * @param messageId ID of the message to update
     */
    abstract protected void UpdateMimeMessageFromStream(FileInputStream input, long accountId,
    protected abstract void UpdateMimeMessageFromStream(FileInputStream input, long accountId,
            long messageId) throws IOException;

    public class PipeWriter implements PipeDataWriter<Cursor> {
@@ -421,7 +421,7 @@ public abstract class BluetoothMapEmailProvider extends ContentProvider {
     * @param messageId the ID of the message to delete.
     * @return the number of messages deleted - 0 if the message was not found.
     */
    abstract protected int deleteMessage(String accountId, String messageId);
    protected abstract int deleteMessage(String accountId, String messageId);

    /**
     * Insert is used to add new messages to the data base.
@@ -469,7 +469,7 @@ public abstract class BluetoothMapEmailProvider extends ContentProvider {
     * @param folderId the ID of the folder to create a new message in.
     * @return the message id as a string
     */
    abstract protected String insertMessage(String accountId, String folderId);
    protected abstract String insertMessage(String accountId, String folderId);

     /**
     * Utility function to build a projection based on a projectionMap.
@@ -525,7 +525,7 @@ public abstract class BluetoothMapEmailProvider extends ContentProvider {
     * @param sortOrder
     * @return a cursor to the accounts that are subject to exposure over BT.
     */
    abstract protected Cursor queryAccount(String[] projection, String selection, String[] selectionArgs,
    protected abstract Cursor queryAccount(String[] projection, String selection, String[] selectionArgs,
            String sortOrder);

    /**
@@ -538,7 +538,7 @@ public abstract class BluetoothMapEmailProvider extends ContentProvider {
     * @param sortOrder
     * @return
     */
    abstract protected Cursor queryFolder(String accountId, String[] projection, String selection, String[] selectionArgs,
    protected abstract Cursor queryFolder(String accountId, String[] projection, String selection, String[] selectionArgs,
            String sortOrder);
    /**
     * For the message table the selection (where clause) can only include the following columns:
@@ -558,7 +558,7 @@ public abstract class BluetoothMapEmailProvider extends ContentProvider {
     * @param sortOrder
     * @return a cursor to query result
     */
    abstract protected Cursor queryMessage(String accountId, String[] projection, String selection, String[] selectionArgs,
    protected abstract Cursor queryMessage(String accountId, String[] projection, String selection, String[] selectionArgs,
            String sortOrder);

    /**
@@ -623,7 +623,7 @@ public abstract class BluetoothMapEmailProvider extends ContentProvider {
     * @param flagExpose the updated value.
     * @return the number of entries changed - 0 if account not found or value cannot be changed.
     */
    abstract protected int updateAccount(String accountId, int flagExpose);
    protected abstract int updateAccount(String accountId, int flagExpose);

    /**
     * Update an entry in the message table.
@@ -633,7 +633,7 @@ public abstract class BluetoothMapEmailProvider extends ContentProvider {
     * @param flagRead the new flagRead value to set - ignore if null.
     * @return
     */
    abstract protected int updateMessage(String accountId, Long messageId, Long folderId, Boolean flagRead);
    protected abstract int updateMessage(String accountId, Long messageId, Long folderId, Boolean flagRead);


    @Override
@@ -671,7 +671,7 @@ public abstract class BluetoothMapEmailProvider extends ContentProvider {
     * @param folderId the ID of the folder.
     * @return 0 at success
     */
    abstract protected int syncFolder(long accountId, long folderId);
    protected abstract int syncFolder(long accountId, long folderId);

    /**
     * Need this to suppress warning in unit tests.
+12 −12
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ public abstract class BluetoothMapIMProvider extends ContentProvider {
    /**
     * @return the CONTENT_URI exposed. This will be used to send out notifications.
     */
    abstract protected Uri getContentUri();
    protected abstract Uri getContentUri();

    /**
     * Implementation is provided by the parent class.
@@ -222,7 +222,7 @@ public abstract class BluetoothMapIMProvider extends ContentProvider {
     * @param messageId the ID of the message to delete.
     * @return the number of messages deleted - 0 if the message was not found.
     */
    abstract protected int deleteMessage(String accountId, String messageId);
    protected abstract int deleteMessage(String accountId, String messageId);

    /**
     * Insert is used to add new messages to the data base.
@@ -270,7 +270,7 @@ public abstract class BluetoothMapIMProvider extends ContentProvider {
     * @param folderId the ID of the folder to create a new message in.
     * @return the message id as a string
     */
    abstract protected String insertMessage(String accountId, ContentValues values);
    protected abstract String insertMessage(String accountId, ContentValues values);

     /**
     * Utility function to build a projection based on a projectionMap.
@@ -359,7 +359,7 @@ public abstract class BluetoothMapIMProvider extends ContentProvider {
     * @param sortOrder
     * @return a cursor to the accounts that are subject to exposure over BT.
     */
    abstract protected Cursor queryAccount(String[] projection, String selection,
    protected abstract Cursor queryAccount(String[] projection, String selection,
            String[] selectionArgs, String sortOrder);

    /**
@@ -378,7 +378,7 @@ public abstract class BluetoothMapIMProvider extends ContentProvider {
     * @param sortOrder
     * @return a cursor to query result
     */
    abstract protected Cursor queryMessage(String accountId, String[] projection, String selection,
    protected abstract Cursor queryMessage(String accountId, String[] projection, String selection,
            String[] selectionArgs, String sortOrder);

    /**
@@ -426,7 +426,7 @@ public abstract class BluetoothMapIMProvider extends ContentProvider {
     * @param sortOrder  the sort order
     * @return a Cursor representing the query result.
     */
    abstract protected Cursor queryConversation(String accountId, Long threadId, Boolean read,
    protected abstract Cursor queryConversation(String accountId, Long threadId, Boolean read,
            Long periodEnd, Long periodBegin, String searchString, String[] projection,
            String sortOrder);

@@ -450,7 +450,7 @@ public abstract class BluetoothMapIMProvider extends ContentProvider {
     * @param sortOrder
     * @return a cursor to query result
     */
    abstract protected Cursor queryConvoContact(String accountId, Long contactId,
    protected abstract Cursor queryConvoContact(String accountId, Long contactId,
            String[] projection, String selection, String[] selectionArgs, String sortOrder);

    /**
@@ -534,7 +534,7 @@ public abstract class BluetoothMapIMProvider extends ContentProvider {
     * @param flagExpose the updated value.
     * @return the number of entries changed - 0 if account not found or value cannot be changed.
     */
    abstract protected int updateAccount(String accountId, Integer flagExpose);
    protected abstract int updateAccount(String accountId, Integer flagExpose);

    /**
     * Update an entry in the message table.
@@ -544,7 +544,7 @@ public abstract class BluetoothMapIMProvider extends ContentProvider {
     * @param flagRead the new flagRead value to set - ignore if null.
     * @return
     */
    abstract protected int updateMessage(String accountId, Long messageId, Long folderId,
    protected abstract int updateMessage(String accountId, Long messageId, Long folderId,
            Boolean flagRead);

    /**
@@ -637,7 +637,7 @@ public abstract class BluetoothMapIMProvider extends ContentProvider {
     * @param folderId the ID of the folder.
     * @return 0 at success
     */
    abstract protected int syncFolder(long accountId, long folderId);
    protected abstract int syncFolder(long accountId, long folderId);

    /**
     * Set the properties that should change presence or chat state of owner
@@ -650,7 +650,7 @@ public abstract class BluetoothMapIMProvider extends ContentProvider {
     * @param convoId ID to the conversation to change
     * @return 0 at success
     */
    abstract protected int setOwnerStatus(int presenceState, String presenceStatus,
    protected abstract int setOwnerStatus(int presenceState, String presenceStatus,
            long lastActive, int chatState, String convoId);

    /**
@@ -658,7 +658,7 @@ public abstract class BluetoothMapIMProvider extends ContentProvider {
     * @param bluetoothState 'on' of 'off'
     * @return 0 at success
     */
    abstract protected int setBluetoothStatus(boolean bluetoothState);
    protected abstract int setBluetoothStatus(boolean bluetoothState);



+2 −2
Original line number Diff line number Diff line
@@ -42,8 +42,8 @@ public class ObexRejectServer extends ServerRequestHandler implements Callback {
    private final int mResult;
    private final HandlerThread mHandlerThread;
    private final Handler mMessageHandler;
    private final static int MSG_ID_TIMEOUT = 0x01;
    private final static int TIMEOUT_VALUE = 5*1000; // ms
    private static final int MSG_ID_TIMEOUT = 0x01;
    private static final int TIMEOUT_VALUE = 5*1000; // ms
    private final BluetoothSocket mSocket;

    /**
+4 −4
Original line number Diff line number Diff line
@@ -212,7 +212,7 @@ public class ObexServerSockets {
     * Set state to accept new incoming connection. Will cause the next incoming connection to be
     * Signaled through {@link IObexConnectionValidator#onConnect()};
     */
    synchronized public void prepareForNewConnect() {
    public synchronized void prepareForNewConnect() {
        if(D) Log.d(TAG, "prepareForNewConnect()");
        mConAccepted = false;
    }
@@ -226,7 +226,7 @@ public class ObexServerSockets {
     * @param conSocket the socket associated with the connection.
     * @return true if the connection is accepted, false otherwise.
     */
    synchronized private boolean onConnect(BluetoothDevice device, BluetoothSocket conSocket) {
    private synchronized boolean onConnect(BluetoothDevice device, BluetoothSocket conSocket) {
        if(D) Log.d(TAG, "onConnect() socket: " + conSocket + " mConAccepted = " + mConAccepted);
        if(mConAccepted  == false && mConHandler.onConnect(device, conSocket) == true) {
            mConAccepted = true; // TODO: Reset this when ready to accept new connection
@@ -240,7 +240,7 @@ public class ObexServerSockets {
    /**
     * Signal to the {@link IObexConnectionHandler} that an error have occurred.
     */
    synchronized private void onAcceptFailed() {
    private synchronized void onAcceptFailed() {
        shutdown(false);
        BluetoothAdapter mAdapter = BluetoothAdapter.getDefaultAdapter();
        if ((mAdapter != null) && (mAdapter.getState() == BluetoothAdapter.STATE_ON)) {
@@ -254,7 +254,7 @@ public class ObexServerSockets {
     * @param block Set true to block the calling thread until the AcceptThreads
     * has ended execution
     */
    synchronized public void shutdown(boolean block) {
    public synchronized void shutdown(boolean block) {
        if(D) Log.d(TAG, "shutdown(block = " + block + ")");
        if(mRfcommThread != null) {
            mRfcommThread.shutdown();
+1 −1
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@ import java.util.concurrent.TimeUnit;
 * @hide
 */

final public class Utils {
public final class Utils {
    private static final String TAG = "BluetoothUtils";
    private static final int MICROS_PER_UNIT = 625;

Loading