04d554afcb
Bug: 9621647 Change-Id: I1a713177a08fb737e6799d51f438d55f226006e8
22 lines
825 B
Java
22 lines
825 B
Java
package com.android.launcher3;
|
|
|
|
import android.content.BroadcastReceiver;
|
|
import android.content.Context;
|
|
import android.content.Intent;
|
|
|
|
public class PackageChangedReceiver extends BroadcastReceiver {
|
|
@Override
|
|
public void onReceive(final Context context, Intent intent) {
|
|
final String packageName = intent.getData().getSchemeSpecificPart();
|
|
|
|
if (packageName == null || packageName.length() == 0) {
|
|
// they sent us a bad intent
|
|
return;
|
|
}
|
|
// in rare cases the receiver races with the application to set up LauncherAppState
|
|
LauncherAppState.setApplicationContext(context.getApplicationContext());
|
|
LauncherAppState app = LauncherAppState.getInstance();
|
|
WidgetPreviewLoader.removeFromDb(app.getWidgetPreviewCacheDb(), packageName);
|
|
}
|
|
}
|