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

Commit a1feb4cd authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Refine broadcast in commitRollback"

parents f48b706f 74fec184
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2438,7 +2438,7 @@ public class Intent implements Parcelable, Cloneable {
     * Broadcast Action: A rollback has been committed.
     *
     * <p class="note">This is a protected intent that can only be sent
     * by the system.
     * by the system. The receiver must hold MANAGE_ROLLBACK permission.
     *
     * @hide
     */
+3 −5
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ import android.os.HandlerThread;
import android.os.ParcelFileDescriptor;
import android.os.Process;
import android.os.SystemClock;
import android.os.UserHandle;
import android.provider.DeviceConfig;
import android.util.IntArray;
import android.util.Log;
@@ -455,11 +456,8 @@ class RollbackManagerServiceImpl extends IRollbackManager.Stub {

                            Intent broadcast = new Intent(Intent.ACTION_ROLLBACK_COMMITTED);

                            // TODO: This call emits the warning "Calling a method in the
                            // system process without a qualified user". Fix that.
                            // TODO: Limit this to receivers holding the
                            // MANAGE_ROLLBACKS or TEST_MANAGE_ROLLBACKS permissions?
                            mContext.sendBroadcast(broadcast);
                            mContext.sendBroadcastAsUser(broadcast, UserHandle.SYSTEM,
                                    Manifest.permission.MANAGE_ROLLBACKS);
                        });
                    }
            );
+2 −1
Original line number Diff line number Diff line
@@ -84,7 +84,8 @@ public class RollbackTest {
            RollbackTestUtils.adoptShellPermissionIdentity(
                    Manifest.permission.INSTALL_PACKAGES,
                    Manifest.permission.DELETE_PACKAGES,
                    Manifest.permission.TEST_MANAGE_ROLLBACKS);
                    Manifest.permission.TEST_MANAGE_ROLLBACKS,
                    Manifest.permission.MANAGE_ROLLBACKS);

            // Register a broadcast receiver for notification when the
            // rollback has been committed.