Skip to content

Commit

Permalink
Merge pull request #2022 from moneymanagerex/orm
Browse files Browse the repository at this point in the history
Widget: permission and flag fix
  • Loading branch information
guanlisheng authored Dec 28, 2024
2 parents b3009c8 + e31da5f commit 441629b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
4 changes: 2 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@
<provider
android:name=".MmxContentProvider"
android:authorities="${applicationId}.provider"
android:exported="false" />
android:exported="true" />
<!-- used for qif export -->
<provider
android:name="androidx.core.content.FileProvider"
Expand All @@ -382,7 +382,7 @@

<service
android:name=".widget.AccountBillsWidgetService"
android:permission="android.permission.BIND_JOB_SERVICE" />
android:permission="android.permission.BIND_REMOTEVIEWS" />
<service
android:name=".sync.SyncService"
android:exported="false"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,5 +202,4 @@ private Account insert(Account entity) {

return entity;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,16 @@ private static long getCellsForSize(long size) {
@Override
public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
// There may be multiple widgets active, so update all of them
final long N = appWidgetIds.length;
for (int i = 0; i < N; i++) {
updateAppWidget(context, appWidgetManager, appWidgetIds[i]);
for (int appWidgetId : appWidgetIds) {
updateAppWidget(context, appWidgetManager, appWidgetId);
}
}

@Override
public void onDeleted(Context context, int[] appWidgetIds) {
// When the user deletes the widget, delete the preference associated with it.
final long N = appWidgetIds.length;
for (int i = 0; i < N; i++) {
SingleAccountWidgetConfigureActivity.deleteTitlePref(context, appWidgetIds[i]);
for (int appWidgetId : appWidgetIds) {
SingleAccountWidgetConfigureActivity.deleteTitlePref(context, appWidgetId);
}
}

Expand Down Expand Up @@ -260,7 +258,7 @@ private void initializeRefreshDataCommand(Context context, RemoteViews views, in
intent.setAction(AppWidgetManager.ACTION_APPWIDGET_UPDATE);
intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS, new int[]{appWidgetId});
PendingIntent pendingIntent = PendingIntent.getBroadcast(context,
0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
0, intent, PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE);

views.setOnClickPendingIntent(R.id.refreshDataPanel, pendingIntent);
}
Expand Down

0 comments on commit 441629b

Please sign in to comment.