From 99adbe5784a0b8edc9528489576af2329efda7d2 Mon Sep 17 00:00:00 2001 From: Sam Lanning Date: Thu, 13 Aug 2015 00:22:08 +0100 Subject: [PATCH] Made some inner classes static (For Efficiency) (and made one explicitly private) Closes #3932 // FREEBIE --- src/org/thoughtcrime/securesms/DatabaseMigrationActivity.java | 2 +- src/org/thoughtcrime/securesms/GroupMembersDialog.java | 2 +- .../thoughtcrime/securesms/RegistrationProgressActivity.java | 2 +- src/org/thoughtcrime/securesms/components/ThumbnailView.java | 2 +- .../thoughtcrime/securesms/components/camera/CameraView.java | 2 +- .../thoughtcrime/securesms/components/emoji/EmojiProvider.java | 2 +- src/org/thoughtcrime/securesms/database/IdentityDatabase.java | 2 +- .../thoughtcrime/securesms/database/TextSecureDirectory.java | 2 +- .../securesms/database/loaders/CountryListLoader.java | 2 +- src/org/thoughtcrime/securesms/jobs/AttachmentDownloadJob.java | 2 +- .../securesms/service/ApplicationMigrationService.java | 2 +- src/org/thoughtcrime/securesms/util/CharacterCalculator.java | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/org/thoughtcrime/securesms/DatabaseMigrationActivity.java b/src/org/thoughtcrime/securesms/DatabaseMigrationActivity.java index 02619cf860..f53f50064a 100644 --- a/src/org/thoughtcrime/securesms/DatabaseMigrationActivity.java +++ b/src/org/thoughtcrime/securesms/DatabaseMigrationActivity.java @@ -184,7 +184,7 @@ public class DatabaseMigrationActivity extends PassphraseRequiredActionBarActivi } } - private class NullReceiver extends BroadcastReceiver { + private static class NullReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { abortBroadcast(); diff --git a/src/org/thoughtcrime/securesms/GroupMembersDialog.java b/src/org/thoughtcrime/securesms/GroupMembersDialog.java index 16cd6be687..2c8e5dd6ec 100644 --- a/src/org/thoughtcrime/securesms/GroupMembersDialog.java +++ b/src/org/thoughtcrime/securesms/GroupMembersDialog.java @@ -67,7 +67,7 @@ public class GroupMembersDialog extends AsyncTask { else onPostExecute(recipients); } - private class GroupMembersOnClickListener implements DialogInterface.OnClickListener { + private static class GroupMembersOnClickListener implements DialogInterface.OnClickListener { private final GroupMembers groupMembers; private final Context context; diff --git a/src/org/thoughtcrime/securesms/RegistrationProgressActivity.java b/src/org/thoughtcrime/securesms/RegistrationProgressActivity.java index 123d4dd789..ac6bb7340a 100644 --- a/src/org/thoughtcrime/securesms/RegistrationProgressActivity.java +++ b/src/org/thoughtcrime/securesms/RegistrationProgressActivity.java @@ -434,7 +434,7 @@ public class RegistrationProgressActivity extends BaseActionBarActivity { } } - private class RegistrationReceiver extends BroadcastReceiver { + private static class RegistrationReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { abortBroadcast(); diff --git a/src/org/thoughtcrime/securesms/components/ThumbnailView.java b/src/org/thoughtcrime/securesms/components/ThumbnailView.java index 492ff0f1a6..3931d29c4c 100644 --- a/src/org/thoughtcrime/securesms/components/ThumbnailView.java +++ b/src/org/thoughtcrime/securesms/components/ThumbnailView.java @@ -312,7 +312,7 @@ public class ThumbnailView extends FrameLayout { void onClick(View v, Slide slide); } - private class ThumbnailClickDispatcher implements View.OnClickListener { + private static class ThumbnailClickDispatcher implements View.OnClickListener { private ThumbnailClickListener listener; private Slide slide; diff --git a/src/org/thoughtcrime/securesms/components/camera/CameraView.java b/src/org/thoughtcrime/securesms/components/camera/CameraView.java index 194a46091e..1fed90467c 100644 --- a/src/org/thoughtcrime/securesms/components/camera/CameraView.java +++ b/src/org/thoughtcrime/securesms/components/camera/CameraView.java @@ -441,7 +441,7 @@ public class CameraView extends FrameLayout { ApplicationContext.getInstance(getContext()).getJobManager().add(job); } - private abstract class SerializedAsyncTask extends Job { + private static abstract class SerializedAsyncTask extends Job { public SerializedAsyncTask() { super(JobParameters.newBuilder().withGroupId(CameraView.class.getSimpleName()).create()); diff --git a/src/org/thoughtcrime/securesms/components/emoji/EmojiProvider.java b/src/org/thoughtcrime/securesms/components/emoji/EmojiProvider.java index 000b653964..15f56b2656 100644 --- a/src/org/thoughtcrime/securesms/components/emoji/EmojiProvider.java +++ b/src/org/thoughtcrime/securesms/components/emoji/EmojiProvider.java @@ -181,7 +181,7 @@ public class EmojiProvider { public void setColorFilter(ColorFilter cf) { } } - class DrawInfo { + private static class DrawInfo { EmojiPageBitmap page; int index; diff --git a/src/org/thoughtcrime/securesms/database/IdentityDatabase.java b/src/org/thoughtcrime/securesms/database/IdentityDatabase.java index 111cf5bb01..5868bdcc40 100644 --- a/src/org/thoughtcrime/securesms/database/IdentityDatabase.java +++ b/src/org/thoughtcrime/securesms/database/IdentityDatabase.java @@ -142,7 +142,7 @@ public class IdentityDatabase extends Database { } } - public class Identity { + public static class Identity { private final Recipients recipients; private final IdentityKey identityKey; diff --git a/src/org/thoughtcrime/securesms/database/TextSecureDirectory.java b/src/org/thoughtcrime/securesms/database/TextSecureDirectory.java index bd30e51395..ac8a733ca7 100644 --- a/src/org/thoughtcrime/securesms/database/TextSecureDirectory.java +++ b/src/org/thoughtcrime/securesms/database/TextSecureDirectory.java @@ -201,7 +201,7 @@ public class TextSecureDirectory { } } - private class DatabaseHelper extends SQLiteOpenHelper { + private static class DatabaseHelper extends SQLiteOpenHelper { public DatabaseHelper(Context context, String name, SQLiteDatabase.CursorFactory factory, diff --git a/src/org/thoughtcrime/securesms/database/loaders/CountryListLoader.java b/src/org/thoughtcrime/securesms/database/loaders/CountryListLoader.java index 82df50361a..5083f1dc17 100644 --- a/src/org/thoughtcrime/securesms/database/loaders/CountryListLoader.java +++ b/src/org/thoughtcrime/securesms/database/loaders/CountryListLoader.java @@ -38,7 +38,7 @@ public class CountryListLoader extends AsyncTaskLoader> { + private static class RegionComparator implements Comparator> { @Override public int compare(Map lhs, Map rhs) { return lhs.get("country_name").compareTo(rhs.get("country_name")); diff --git a/src/org/thoughtcrime/securesms/jobs/AttachmentDownloadJob.java b/src/org/thoughtcrime/securesms/jobs/AttachmentDownloadJob.java index 1d40683ac2..72293e5670 100644 --- a/src/org/thoughtcrime/securesms/jobs/AttachmentDownloadJob.java +++ b/src/org/thoughtcrime/securesms/jobs/AttachmentDownloadJob.java @@ -153,7 +153,7 @@ public class AttachmentDownloadJob extends MasterSecretJob implements Injectable } } - private class InvalidPartException extends Exception { + private static class InvalidPartException extends Exception { public InvalidPartException(Exception e) {super(e);} } diff --git a/src/org/thoughtcrime/securesms/service/ApplicationMigrationService.java b/src/org/thoughtcrime/securesms/service/ApplicationMigrationService.java index 2410cf1d3d..41c660be9f 100644 --- a/src/org/thoughtcrime/securesms/service/ApplicationMigrationService.java +++ b/src/org/thoughtcrime/securesms/service/ApplicationMigrationService.java @@ -183,7 +183,7 @@ public class ApplicationMigrationService extends Service } } - private class CompletedReceiver extends BroadcastReceiver { + private static class CompletedReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { NotificationCompat.Builder builder = new NotificationCompat.Builder(context); diff --git a/src/org/thoughtcrime/securesms/util/CharacterCalculator.java b/src/org/thoughtcrime/securesms/util/CharacterCalculator.java index 01912c2540..8c21fe7c6a 100644 --- a/src/org/thoughtcrime/securesms/util/CharacterCalculator.java +++ b/src/org/thoughtcrime/securesms/util/CharacterCalculator.java @@ -20,7 +20,7 @@ public abstract class CharacterCalculator { public abstract CharacterState calculateCharacters(int charactersSpent); - public class CharacterState { + public static class CharacterState { public int charactersRemaining; public int messagesSpent; public int maxMessageSize;