Messaging: Convert further parts to androidx
CursorLoader, LoaderManager, Preferences, Fragments, ... Change-Id: I8787b2db365249839547c6d5c21ab7cd5ff42082
This commit is contained in:
@@ -17,17 +17,19 @@
|
||||
|
||||
package com.android.messaging.datamodel.data;
|
||||
|
||||
import android.app.LoaderManager;
|
||||
import android.content.Context;
|
||||
import android.content.Loader;
|
||||
import android.database.Cursor;
|
||||
import android.database.CursorWrapper;
|
||||
import android.database.sqlite.SQLiteFullException;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import androidx.annotation.Nullable;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.loader.app.LoaderManager;
|
||||
import androidx.loader.content.Loader;
|
||||
|
||||
import com.android.common.contacts.DataUsageStatUpdater;
|
||||
import com.android.messaging.Factory;
|
||||
import com.android.messaging.R;
|
||||
@@ -180,6 +182,7 @@ public class ConversationData extends BindableData {
|
||||
* A trampoline class so that we can inherit from LoaderManager.LoaderCallbacks multiple times.
|
||||
*/
|
||||
private class MetadataLoaderCallbacks implements LoaderManager.LoaderCallbacks<Cursor> {
|
||||
@NonNull
|
||||
@Override
|
||||
public Loader<Cursor> onCreateLoader(final int id, final Bundle args) {
|
||||
Assert.equals(CONVERSATION_META_DATA_LOADER, id);
|
||||
@@ -200,7 +203,7 @@ public class ConversationData extends BindableData {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadFinished(final Loader<Cursor> generic, final Cursor data) {
|
||||
public void onLoadFinished(@NonNull final Loader<Cursor> generic, final Cursor data) {
|
||||
final BoundCursorLoader loader = (BoundCursorLoader) generic;
|
||||
|
||||
// Check if data still bound to the requesting ui element
|
||||
@@ -227,7 +230,7 @@ public class ConversationData extends BindableData {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoaderReset(final Loader<Cursor> generic) {
|
||||
public void onLoaderReset(@NonNull final Loader<Cursor> generic) {
|
||||
final BoundCursorLoader loader = (BoundCursorLoader) generic;
|
||||
|
||||
// Check if data still bound to the requesting ui element
|
||||
@@ -246,6 +249,7 @@ public class ConversationData extends BindableData {
|
||||
* A trampoline class so that we can inherit from LoaderManager.LoaderCallbacks multiple times.
|
||||
*/
|
||||
private class MessagesLoaderCallbacks implements LoaderManager.LoaderCallbacks<Cursor> {
|
||||
@NonNull
|
||||
@Override
|
||||
public Loader<Cursor> onCreateLoader(final int id, final Bundle args) {
|
||||
Assert.equals(CONVERSATION_MESSAGES_LOADER, id);
|
||||
@@ -268,7 +272,7 @@ public class ConversationData extends BindableData {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadFinished(final Loader<Cursor> generic, final Cursor rawData) {
|
||||
public void onLoadFinished(@NonNull final Loader<Cursor> generic, final Cursor rawData) {
|
||||
final BoundCursorLoader loader = (BoundCursorLoader) generic;
|
||||
|
||||
// Check if data still bound to the requesting ui element
|
||||
@@ -316,7 +320,7 @@ public class ConversationData extends BindableData {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoaderReset(final Loader<Cursor> generic) {
|
||||
public void onLoaderReset(@NonNull final Loader<Cursor> generic) {
|
||||
final BoundCursorLoader loader = (BoundCursorLoader) generic;
|
||||
|
||||
// Check if data still bound to the requesting ui element
|
||||
@@ -349,6 +353,7 @@ public class ConversationData extends BindableData {
|
||||
* A trampoline class so that we can inherit from LoaderManager.LoaderCallbacks multiple times.
|
||||
*/
|
||||
private class ParticipantLoaderCallbacks implements LoaderManager.LoaderCallbacks<Cursor> {
|
||||
@NonNull
|
||||
@Override
|
||||
public Loader<Cursor> onCreateLoader(final int id, final Bundle args) {
|
||||
Assert.equals(PARTICIPANT_LOADER, id);
|
||||
@@ -369,7 +374,7 @@ public class ConversationData extends BindableData {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadFinished(final Loader<Cursor> generic, final Cursor data) {
|
||||
public void onLoadFinished(@NonNull final Loader<Cursor> generic, final Cursor data) {
|
||||
final BoundCursorLoader loader = (BoundCursorLoader) generic;
|
||||
|
||||
// Check if data still bound to the requesting ui element
|
||||
@@ -383,7 +388,7 @@ public class ConversationData extends BindableData {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoaderReset(final Loader<Cursor> generic) {
|
||||
public void onLoaderReset(@NonNull final Loader<Cursor> generic) {
|
||||
final BoundCursorLoader loader = (BoundCursorLoader) generic;
|
||||
|
||||
// Check if data still bound to the requesting ui element
|
||||
@@ -400,6 +405,7 @@ public class ConversationData extends BindableData {
|
||||
* A trampoline class so that we can inherit from LoaderManager.LoaderCallbacks multiple times.
|
||||
*/
|
||||
private class SelfParticipantLoaderCallbacks implements LoaderManager.LoaderCallbacks<Cursor> {
|
||||
@NonNull
|
||||
@Override
|
||||
public Loader<Cursor> onCreateLoader(final int id, final Bundle args) {
|
||||
Assert.equals(SELF_PARTICIPANT_LOADER, id);
|
||||
@@ -422,7 +428,7 @@ public class ConversationData extends BindableData {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadFinished(final Loader<Cursor> generic, final Cursor data) {
|
||||
public void onLoadFinished(@NonNull final Loader<Cursor> generic, final Cursor data) {
|
||||
final BoundCursorLoader loader = (BoundCursorLoader) generic;
|
||||
|
||||
// Check if data still bound to the requesting ui element
|
||||
@@ -437,7 +443,7 @@ public class ConversationData extends BindableData {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoaderReset(final Loader<Cursor> generic) {
|
||||
public void onLoaderReset(@NonNull final Loader<Cursor> generic) {
|
||||
final BoundCursorLoader loader = (BoundCursorLoader) generic;
|
||||
|
||||
// Check if data still bound to the requesting ui element
|
||||
|
||||
Reference in New Issue
Block a user