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

Commit 9e3de7f0 authored by Sudheer Shanka's avatar Sudheer Shanka Committed by Automerger Merge Worker
Browse files

Merge "Apply delivery group policies to CLOSE_SYSTEM_DIALOG broadcast." into udc-dev am: dfe57f71

parents 73b494d8 dfe57f71
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -3619,6 +3619,17 @@ class ContextImpl extends Context {
        scheduleFinalCleanup(getClass().getName(), getOuterContext().getClass().getSimpleName());
    }

    @Override
    public void closeSystemDialogs() {
        final Intent intent = new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS)
                .addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
        final Bundle options = BroadcastOptions.makeBasic()
                .setDeliveryGroupPolicy(BroadcastOptions.DELIVERY_GROUP_POLICY_MOST_RECENT)
                .setDeferralPolicy(BroadcastOptions.DEFERRAL_POLICY_UNTIL_ACTIVE)
                .toBundle();
        sendBroadcast(intent, null /* receiverPermission */, options);
    }

    // ----------------------------------------------------------------------
    // ----------------------------------------------------------------------
    // ----------------------------------------------------------------------
+11 −0
Original line number Diff line number Diff line
@@ -7873,4 +7873,15 @@ public abstract class Context {
    public boolean isConfigurationContext() {
        throw new RuntimeException("Not implemented. Must override in a subclass.");
    }

    /**
     * Closes temporary system dialogs. Some examples of temporary system dialogs are the
     * notification window-shade and the recent tasks dialog.
     *
     * @hide
     */
    @RequiresPermission(android.Manifest.permission.BROADCAST_CLOSE_SYSTEM_DIALOGS)
    public void closeSystemDialogs() {
        throw new RuntimeException("Not implemented. Must override in a subclass.");
    }
}
+11 −0
Original line number Diff line number Diff line
@@ -1484,4 +1484,15 @@ public class ContextWrapper extends Context {
        // Do nothing if the callback hasn't been registered to Application Context by
        // super.unregisterComponentCallbacks() for Application that is targeting prior to T.
    }

    /**
     * Closes temporary system dialogs. Some examples of temporary system dialogs are the
     * notification window-shade and the recent tasks dialog.
     *
     * @hide
     */
    @RequiresPermission(android.Manifest.permission.BROADCAST_CLOSE_SYSTEM_DIALOGS)
    public void closeSystemDialogs() {
        mBase.closeSystemDialogs();
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -422,7 +422,7 @@ public class DynamicSystemInstallationService extends Service
            Log.e(TAG, "Failed to disable DynamicSystem.");

            // Dismiss status bar and show a toast.
            sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS));
            closeSystemDialogs();
            Toast.makeText(this,
                    getString(R.string.toast_failed_to_disable_dynsystem),
                    Toast.LENGTH_LONG).show();
+1 −1
Original line number Diff line number Diff line
@@ -1697,7 +1697,7 @@ public class BugreportProgressService extends Service {
    }

    private void collapseNotificationBar() {
        sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS));
        closeSystemDialogs();
    }

    private static Looper newLooper(String name) {
Loading