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

Commit 33f889ae authored by Fred Quintana's avatar Fred Quintana
Browse files

change to use the new CALLER_IS_SYNCADAPTER flag

parent 294cd985
Loading
Loading
Loading
Loading
+7 −2
Original line number Original line Diff line number Diff line
@@ -1445,13 +1445,18 @@ public class AccountManagerService extends IAccountManager.Stub {
                            intent.getComponent().getClassName())) {
                            intent.getComponent().getClassName())) {
                createNoCredentialsPermissionNotification(account, intent);
                createNoCredentialsPermissionNotification(account, intent);
            } else {
            } else {
                final Integer notificationId = getSigninRequiredNotificationId(account);
                intent.addCategory(String.valueOf(notificationId));
                Notification n = new Notification(android.R.drawable.stat_sys_warning, null,
                Notification n = new Notification(android.R.drawable.stat_sys_warning, null,
                        0 /* when */);
                        0 /* when */);
                n.setLatestEventInfo(mContext, mContext.getText(R.string.notification_title),
                final String notificationTitleFormat =
                        mContext.getText(R.string.notification_title).toString();
                n.setLatestEventInfo(mContext,
                        String.format(notificationTitleFormat, account.name),
                        message, PendingIntent.getActivity(
                        message, PendingIntent.getActivity(
                        mContext, 0, intent, PendingIntent.FLAG_CANCEL_CURRENT));
                        mContext, 0, intent, PendingIntent.FLAG_CANCEL_CURRENT));
                ((NotificationManager) mContext.getSystemService(Context.NOTIFICATION_SERVICE))
                ((NotificationManager) mContext.getSystemService(Context.NOTIFICATION_SERVICE))
                        .notify(getSigninRequiredNotificationId(account), n);
                        .notify(notificationId, n);
            }
            }
        } finally {
        } finally {
            restoreCallingIdentity(identityToken);
            restoreCallingIdentity(identityToken);
+14 −32
Original line number Original line Diff line number Diff line
@@ -46,6 +46,15 @@ public final class ContactsContract {
    /** A content:// style uri to the authority for the contacts provider */
    /** A content:// style uri to the authority for the contacts provider */
    public static final Uri AUTHORITY_URI = Uri.parse("content://" + AUTHORITY);
    public static final Uri AUTHORITY_URI = Uri.parse("content://" + AUTHORITY);


    /**
     * An optional insert, update or delete URI parameter that allows the caller
     * to specify that it is a sync adapter. The default value is false. If true
     * the dirty flag is not automatically set and the "syncToNetwork" parameter
     * is set to false when calling
     * {@link ContentResolver#notifyChange(android.net.Uri, android.database.ContentObserver, boolean)}.
     */
    public static final String CALLER_IS_SYNCADAPTER = "caller_is_syncadapter";

    public interface SyncStateColumns extends SyncStateContract.Columns {
    public interface SyncStateColumns extends SyncStateContract.Columns {
    }
    }


@@ -480,7 +489,8 @@ public final class ContactsContract {
         * called on a raw contact, it is marked for deletion and removed from its
         * called on a raw contact, it is marked for deletion and removed from its
         * aggregate contact. The sync adaptor deletes the raw contact on the server and
         * aggregate contact. The sync adaptor deletes the raw contact on the server and
         * then calls ContactResolver.delete once more, this time passing the
         * then calls ContactResolver.delete once more, this time passing the
         * {@link RawContacts#DELETE_PERMANENTLY} query parameter to finalize the data removal.
         * {@link ContactsContract#CALLER_IS_SYNCADAPTER} query parameter to finalize
         * the data removal.
         * <P>Type: INTEGER</P>
         * <P>Type: INTEGER</P>
         */
         */
        public static final String DELETED = "deleted";
        public static final String DELETED = "deleted";
@@ -516,14 +526,6 @@ public final class ContactsContract {
         */
         */
        public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/raw_contact";
        public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/raw_contact";


        /**
         * Query parameter that can be passed with the {@link #CONTENT_URI} URI
         * to the {@link android.content.ContentResolver#delete} method to
         * indicate that the raw contact can be deleted physically, rather than
         * merely marked as deleted.
         */
        public static final String DELETE_PERMANENTLY = "delete_permanently";

        /**
        /**
         * Aggregation mode: aggregate asynchronously.
         * Aggregation mode: aggregate asynchronously.
         */
         */
@@ -648,13 +650,6 @@ public final class ContactsContract {
        public static final String SYNC3 = "data_sync3";
        public static final String SYNC3 = "data_sync3";
        /** Generic column for use by sync adapters. */
        /** Generic column for use by sync adapters. */
        public static final String SYNC4 = "data_sync4";
        public static final String SYNC4 = "data_sync4";

        /**
         * An optional insert, update or delete URI parameter that determines if
         * the corresponding raw contact should be marked as dirty. The default
         * value is true.
         */
        public static final String MARK_AS_DIRTY = "mark_as_dirty";
    }
    }


    /**
    /**
@@ -1533,8 +1528,9 @@ public final class ContactsContract {
         * for deletion. When {@link android.content.ContentResolver#delete} is
         * for deletion. When {@link android.content.ContentResolver#delete} is
         * called on a raw contact, it is marked for deletion and removed from its
         * called on a raw contact, it is marked for deletion and removed from its
         * aggregate contact. The sync adaptor deletes the raw contact on the server and
         * aggregate contact. The sync adaptor deletes the raw contact on the server and
         * then calls ContactResolver.delete once more, this time passing the
         * then calls ContactResolver.delete once more, this time setting the the
         * {@link RawContacts#DELETE_PERMANENTLY} query parameter to finalize the data removal.
         * {@link ContactsContract#CALLER_IS_SYNCADAPTER} query parameter to finalize 
         * the data removal.
         * <P>Type: INTEGER</P>
         * <P>Type: INTEGER</P>
         */
         */
        public static final String DELETED = "deleted";
        public static final String DELETED = "deleted";
@@ -1579,20 +1575,6 @@ public final class ContactsContract {
         * The MIME type of a single group.
         * The MIME type of a single group.
         */
         */
        public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/group";
        public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/group";

        /**
         * Query parameter that can be passed with the {@link #CONTENT_URI} URI
         * to the {@link android.content.ContentResolver#delete} method to
         * indicate that the raw contact can be deleted physically, rather than
         * merely marked as deleted.
         */
        public static final String DELETE_PERMANENTLY = "delete_permanently";

        /**
         * An optional update or insert URI parameter that determines if the
         * group should be marked as dirty. The default value is true.
         */
        public static final String MARK_AS_DIRTY = "mark_as_dirty";
    }
    }


    /**
    /**
+1 −1
Original line number Original line Diff line number Diff line
@@ -234,7 +234,7 @@
    supply an auth token without prompting the user to re-enter the
    supply an auth token without prompting the user to re-enter the
    password.  This is the text that will scroll through the
    password.  This is the text that will scroll through the
    notification bar (will be seen by the user as he uses another application). -->
    notification bar (will be seen by the user as he uses another application). -->
    <string name="notification_title">Sign-in error</string>
    <string name="notification_title">Sign-in error for <xliff:g id="account" example="foo@gmail.com">%1$s</xliff:g></string>


    <!-- Sync notifications --> <skip />
    <!-- Sync notifications --> <skip />
    <!-- A notification is shown when there is a sync error.  This is the text that will scroll through the notification bar (will be seen by the user as he uses another application). -->
    <!-- A notification is shown when there is a sync error.  This is the text that will scroll through the notification bar (will be seen by the user as he uses another application). -->