Loading packages/DocumentsUI/src/com/android/documentsui/DocumentsApplication.java +1 −0 Original line number Diff line number Diff line Loading @@ -75,6 +75,7 @@ public class DocumentsApplication extends Application { packageFilter.addAction(Intent.ACTION_PACKAGE_ADDED); packageFilter.addAction(Intent.ACTION_PACKAGE_CHANGED); packageFilter.addAction(Intent.ACTION_PACKAGE_REMOVED); packageFilter.addAction(Intent.ACTION_PACKAGE_DATA_CLEARED); packageFilter.addDataScheme("package"); registerReceiver(mCacheReceiver, packageFilter); Loading packages/DocumentsUI/src/com/android/documentsui/RootsCache.java +3 −2 Original line number Diff line number Diff line Loading @@ -60,8 +60,8 @@ import java.util.concurrent.TimeUnit; public class RootsCache { private static final boolean LOGD = true; // TODO: cache roots in local provider to avoid spinning up backends // TODO: root updates should trigger UI refresh public static final Uri sNotificationUri = Uri.parse( "content://com.android.documentsui.roots/"); private final Context mContext; private final ContentObserver mObserver; Loading Loading @@ -201,6 +201,7 @@ public class RootsCache { mStoppedAuthorities = mTaskStoppedAuthorities; } mFirstLoad.countDown(); resolver.notifyChange(sNotificationUri, null, false); return null; } Loading packages/DocumentsUI/src/com/android/documentsui/RootsLoader.java +7 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,8 @@ import com.android.documentsui.model.RootInfo; import java.util.Collection; public class RootsLoader extends AsyncTaskLoader<Collection<RootInfo>> { private final ForceLoadContentObserver mObserver = new ForceLoadContentObserver(); private final RootsCache mRoots; private final State mState; Loading @@ -34,6 +36,9 @@ public class RootsLoader extends AsyncTaskLoader<Collection<RootInfo>> { super(context); mRoots = roots; mState = state; getContext().getContentResolver() .registerContentObserver(RootsCache.sNotificationUri, false, mObserver); } @Override Loading Loading @@ -77,5 +82,7 @@ public class RootsLoader extends AsyncTaskLoader<Collection<RootInfo>> { onStopLoading(); mResult = null; getContext().getContentResolver().unregisterContentObserver(mObserver); } } Loading
packages/DocumentsUI/src/com/android/documentsui/DocumentsApplication.java +1 −0 Original line number Diff line number Diff line Loading @@ -75,6 +75,7 @@ public class DocumentsApplication extends Application { packageFilter.addAction(Intent.ACTION_PACKAGE_ADDED); packageFilter.addAction(Intent.ACTION_PACKAGE_CHANGED); packageFilter.addAction(Intent.ACTION_PACKAGE_REMOVED); packageFilter.addAction(Intent.ACTION_PACKAGE_DATA_CLEARED); packageFilter.addDataScheme("package"); registerReceiver(mCacheReceiver, packageFilter); Loading
packages/DocumentsUI/src/com/android/documentsui/RootsCache.java +3 −2 Original line number Diff line number Diff line Loading @@ -60,8 +60,8 @@ import java.util.concurrent.TimeUnit; public class RootsCache { private static final boolean LOGD = true; // TODO: cache roots in local provider to avoid spinning up backends // TODO: root updates should trigger UI refresh public static final Uri sNotificationUri = Uri.parse( "content://com.android.documentsui.roots/"); private final Context mContext; private final ContentObserver mObserver; Loading Loading @@ -201,6 +201,7 @@ public class RootsCache { mStoppedAuthorities = mTaskStoppedAuthorities; } mFirstLoad.countDown(); resolver.notifyChange(sNotificationUri, null, false); return null; } Loading
packages/DocumentsUI/src/com/android/documentsui/RootsLoader.java +7 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,8 @@ import com.android.documentsui.model.RootInfo; import java.util.Collection; public class RootsLoader extends AsyncTaskLoader<Collection<RootInfo>> { private final ForceLoadContentObserver mObserver = new ForceLoadContentObserver(); private final RootsCache mRoots; private final State mState; Loading @@ -34,6 +36,9 @@ public class RootsLoader extends AsyncTaskLoader<Collection<RootInfo>> { super(context); mRoots = roots; mState = state; getContext().getContentResolver() .registerContentObserver(RootsCache.sNotificationUri, false, mObserver); } @Override Loading Loading @@ -77,5 +82,7 @@ public class RootsLoader extends AsyncTaskLoader<Collection<RootInfo>> { onStopLoading(); mResult = null; getContext().getContentResolver().unregisterContentObserver(mObserver); } }