Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c848b702 authored by Fred Quintana's avatar Fred Quintana
Browse files

clean up the too many deletes dialog

parent ba176d6c
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ import android.content.pm.IPackageManager;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.content.pm.RegisteredServicesCache;
import android.content.pm.ProviderInfo;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Bundle;
@@ -1996,11 +1997,19 @@ class SyncManager implements OnAccountsUpdatedListener {
        private void installHandleTooManyDeletesNotification(Account account, String authority,
                long numDeletes) {
            if (mNotificationMgr == null) return;

            final ProviderInfo providerInfo = mContext.getPackageManager().resolveContentProvider(
                    authority, 0 /* flags */);
            if (providerInfo == null) {
                return;
            }
            CharSequence authorityName = providerInfo.loadLabel(mContext.getPackageManager());

            Intent clickIntent = new Intent();
            clickIntent.setClassName("com.android.providers.subscribedfeeds",
                    "com.android.settings.SyncActivityTooManyDeletes");
            clickIntent.putExtra("account", account);
            clickIntent.putExtra("provider", authority);
            clickIntent.putExtra("provider", authorityName.toString());
            clickIntent.putExtra("numDeletes", numDeletes);

            if (!isActivityAvailable(clickIntent)) {
@@ -2014,14 +2023,13 @@ class SyncManager implements OnAccountsUpdatedListener {
            CharSequence tooManyDeletesDescFormat = mContext.getResources().getText(
                    R.string.contentServiceTooManyDeletesNotificationDesc);

            String[] authorities = authority.split(";");
            Notification notification =
                new Notification(R.drawable.stat_notify_sync_error,
                        mContext.getString(R.string.contentServiceSync),
                        System.currentTimeMillis());
            notification.setLatestEventInfo(mContext,
                    mContext.getString(R.string.contentServiceSyncNotificationTitle),
                    String.format(tooManyDeletesDescFormat.toString(), authorities[0]),
                    String.format(tooManyDeletesDescFormat.toString(), authorityName),
                    pendingIntent);
            notification.flags |= Notification.FLAG_ONGOING_EVENT;
            mNotificationMgr.notify(account.hashCode() ^ authority.hashCode(), notification);
+2 −1
Original line number Diff line number Diff line
@@ -13,7 +13,8 @@
                 android:label="@string/app_label">
        <uses-library android:name="com.google.android.gtalkservice" />
        <provider android:name="SubscribedFeedsProvider"
                android:authorities="subscribedfeeds" android:syncable="false"
                android:authorities="subscribedfeeds"
                android:label="@string/provider_label"
                android:multiprocess="false"
                android:readPermission="android.permission.SUBSCRIBED_FEEDS_READ"
                android:writePermission="android.permission.SUBSCRIBED_FEEDS_WRITE" />
+4 −0
Original line number Diff line number Diff line
@@ -17,5 +17,9 @@
<resources>
    <!-- Title of the feed synchronization activity. -->
    <string name="app_label">Sync Feeds</string>

    <!-- What to show in messaging that refers to this provider, e.g. AccountSyncSettings -->
    <string name="provider_label">Push Subscriptions</string>

</resources>