am 2d5a14d6: Merge change 22732 into eclair
Merge commit '2d5a14d6bf2bbc5a7e895cd4a0b977dd2f297532' into eclair-plus-aosp * commit '2d5a14d6bf2bbc5a7e895cd4a0b977dd2f297532': clean up the too many deletes dialog
This commit is contained in:
@@ -33,6 +33,7 @@ import android.content.pm.IPackageManager;
|
|||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.content.pm.ResolveInfo;
|
import android.content.pm.ResolveInfo;
|
||||||
import android.content.pm.RegisteredServicesCache;
|
import android.content.pm.RegisteredServicesCache;
|
||||||
|
import android.content.pm.ProviderInfo;
|
||||||
import android.net.ConnectivityManager;
|
import android.net.ConnectivityManager;
|
||||||
import android.net.NetworkInfo;
|
import android.net.NetworkInfo;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
@@ -1996,11 +1997,19 @@ class SyncManager implements OnAccountsUpdatedListener {
|
|||||||
private void installHandleTooManyDeletesNotification(Account account, String authority,
|
private void installHandleTooManyDeletesNotification(Account account, String authority,
|
||||||
long numDeletes) {
|
long numDeletes) {
|
||||||
if (mNotificationMgr == null) return;
|
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();
|
Intent clickIntent = new Intent();
|
||||||
clickIntent.setClassName("com.android.providers.subscribedfeeds",
|
clickIntent.setClassName("com.android.providers.subscribedfeeds",
|
||||||
"com.android.settings.SyncActivityTooManyDeletes");
|
"com.android.settings.SyncActivityTooManyDeletes");
|
||||||
clickIntent.putExtra("account", account);
|
clickIntent.putExtra("account", account);
|
||||||
clickIntent.putExtra("provider", authority);
|
clickIntent.putExtra("provider", authorityName.toString());
|
||||||
clickIntent.putExtra("numDeletes", numDeletes);
|
clickIntent.putExtra("numDeletes", numDeletes);
|
||||||
|
|
||||||
if (!isActivityAvailable(clickIntent)) {
|
if (!isActivityAvailable(clickIntent)) {
|
||||||
@@ -2014,14 +2023,13 @@ class SyncManager implements OnAccountsUpdatedListener {
|
|||||||
CharSequence tooManyDeletesDescFormat = mContext.getResources().getText(
|
CharSequence tooManyDeletesDescFormat = mContext.getResources().getText(
|
||||||
R.string.contentServiceTooManyDeletesNotificationDesc);
|
R.string.contentServiceTooManyDeletesNotificationDesc);
|
||||||
|
|
||||||
String[] authorities = authority.split(";");
|
|
||||||
Notification notification =
|
Notification notification =
|
||||||
new Notification(R.drawable.stat_notify_sync_error,
|
new Notification(R.drawable.stat_notify_sync_error,
|
||||||
mContext.getString(R.string.contentServiceSync),
|
mContext.getString(R.string.contentServiceSync),
|
||||||
System.currentTimeMillis());
|
System.currentTimeMillis());
|
||||||
notification.setLatestEventInfo(mContext,
|
notification.setLatestEventInfo(mContext,
|
||||||
mContext.getString(R.string.contentServiceSyncNotificationTitle),
|
mContext.getString(R.string.contentServiceSyncNotificationTitle),
|
||||||
String.format(tooManyDeletesDescFormat.toString(), authorities[0]),
|
String.format(tooManyDeletesDescFormat.toString(), authorityName),
|
||||||
pendingIntent);
|
pendingIntent);
|
||||||
notification.flags |= Notification.FLAG_ONGOING_EVENT;
|
notification.flags |= Notification.FLAG_ONGOING_EVENT;
|
||||||
mNotificationMgr.notify(account.hashCode() ^ authority.hashCode(), notification);
|
mNotificationMgr.notify(account.hashCode() ^ authority.hashCode(), notification);
|
||||||
|
|||||||
@@ -13,7 +13,8 @@
|
|||||||
android:label="@string/app_label">
|
android:label="@string/app_label">
|
||||||
<uses-library android:name="com.google.android.gtalkservice" />
|
<uses-library android:name="com.google.android.gtalkservice" />
|
||||||
<provider android:name="SubscribedFeedsProvider"
|
<provider android:name="SubscribedFeedsProvider"
|
||||||
android:authorities="subscribedfeeds" android:syncable="false"
|
android:authorities="subscribedfeeds"
|
||||||
|
android:label="@string/provider_label"
|
||||||
android:multiprocess="false"
|
android:multiprocess="false"
|
||||||
android:readPermission="android.permission.SUBSCRIBED_FEEDS_READ"
|
android:readPermission="android.permission.SUBSCRIBED_FEEDS_READ"
|
||||||
android:writePermission="android.permission.SUBSCRIBED_FEEDS_WRITE" />
|
android:writePermission="android.permission.SUBSCRIBED_FEEDS_WRITE" />
|
||||||
|
|||||||
@@ -17,5 +17,9 @@
|
|||||||
<resources>
|
<resources>
|
||||||
<!-- Title of the feed synchronization activity. -->
|
<!-- Title of the feed synchronization activity. -->
|
||||||
<string name="app_label">Sync Feeds</string>
|
<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>
|
</resources>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user