mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-05 02:16:49 +00:00
Cleaning Utilities.java
> Removing some unused methods > Moving some specialized methods to corresponding classes > Removing GridProvider check as it is released Bug: 257555083 Test: Presubmit Change-Id: Ib0f8c673d018071d3f4b7d9247e0a35718ab009c Merged-In: Ib0f8c673d018071d3f4b7d9247e0a35718ab009c
This commit is contained in:
@@ -15,10 +15,15 @@
|
||||
*/
|
||||
package com.android.launcher3.util;
|
||||
|
||||
import android.database.ContentObserver;
|
||||
import android.net.Uri;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
|
||||
import androidx.annotation.WorkerThread;
|
||||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
/**
|
||||
* Utility class to define an object which does most of it's processing on a
|
||||
* dedicated background thread.
|
||||
@@ -43,4 +48,16 @@ public abstract class BgObjectWithLooper {
|
||||
*/
|
||||
@WorkerThread
|
||||
protected abstract void onInitialized(Looper looper);
|
||||
|
||||
/**
|
||||
* Helper method to create a content provider
|
||||
*/
|
||||
protected static ContentObserver newContentObserver(Handler handler, Consumer<Uri> command) {
|
||||
return new ContentObserver(handler) {
|
||||
@Override
|
||||
public void onChange(boolean selfChange, Uri uri) {
|
||||
command.accept(uri);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user