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

Commit e128e8a7 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 7766788 from a5468521 to sc-qpr1-release

Change-Id: I560362ce78dc41b5df5d65f183a966db756dffe2
parents 57b2b936 a5468521
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -2738,6 +2738,22 @@ public class Intent implements Parcelable, Cloneable {
     */
    @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
    public static final String ACTION_PACKAGES_UNSUSPENDED = "android.intent.action.PACKAGES_UNSUSPENDED";
    /**
     * Broadcast Action: One of the suspend conditions have been modified for the packages.
     * <p>Includes the following extras:
     * <ul>
     * <li> {@link #EXTRA_CHANGED_PACKAGE_LIST} is the set of packages which have been modified
     * <li> {@link #EXTRA_CHANGED_UID_LIST} is the set of uids which have been modified
     * </ul>
     *
     * <p class="note">This is a protected intent that can only be sent
     * by the system. It is only sent to registered receivers.
     *
     * @hide
     */
    @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
    public static final String ACTION_PACKAGES_SUSPENSION_CHANGED =
            "android.intent.action.PACKAGES_SUSPENSION_CHANGED";

    /**
     * Broadcast Action: Distracting packages have been changed.
+1 −1
Original line number Diff line number Diff line
@@ -74,7 +74,7 @@ public final class BinderProxy implements IBinder {
        private static final int MAIN_INDEX_SIZE = 1 <<  LOG_MAIN_INDEX_SIZE;
        private static final int MAIN_INDEX_MASK = MAIN_INDEX_SIZE - 1;
        // Debuggable builds will throw an AssertionError if the number of map entries exceeds:
        private static final int CRASH_AT_SIZE = 20_000;
        private static final int CRASH_AT_SIZE = 25_000;

        /**
         * We next warn when we exceed this bucket size.
+16 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package android.os.storage;

import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.UserIdInt;
import android.os.IVold;

import java.util.List;
@@ -135,4 +136,19 @@ public abstract class StorageManagerInternal {
     * {@link VolumeInfo#isPrimary()}
     */
    public abstract List<String> getPrimaryVolumeIds();

    /**
     * Tells StorageManager that CE storage for this user has been prepared.
     *
     * @param userId userId for which CE storage has been prepared
     */
    public abstract void markCeStoragePrepared(@UserIdInt int userId);

    /**
     * Returns true when CE storage for this user has been prepared.
     *
     * When the user key is unlocked and CE storage has been prepared,
     * it's ok to access and modify CE directories on volumes for this user.
     */
    public abstract boolean isCeStoragePrepared(@UserIdInt int userId);
}
+8 −2
Original line number Diff line number Diff line
@@ -548,12 +548,16 @@ public abstract class WallpaperService extends Service {
         */
        public void reportEngineShown(boolean waitForEngineShown) {
            if (mIWallpaperEngine.mShownReported) return;
            Message message = mCaller.obtainMessage(MSG_REPORT_SHOWN);
            if (!waitForEngineShown) {
                Message message = mCaller.obtainMessage(MSG_REPORT_SHOWN);
                mCaller.removeMessages(MSG_REPORT_SHOWN);
                mCaller.sendMessage(message);
            } else {
                mCaller.sendMessageDelayed(message, TimeUnit.SECONDS.toMillis(1));
                // if we are already waiting, no need to reset the timeout.
                if (!mCaller.hasMessages(MSG_REPORT_SHOWN)) {
                    Message message = mCaller.obtainMessage(MSG_REPORT_SHOWN);
                    mCaller.sendMessageDelayed(message, TimeUnit.SECONDS.toMillis(5));
                }
            }
        }

@@ -2078,6 +2082,8 @@ public abstract class WallpaperService extends Service {
                mShownReported = true;
                try {
                    mConnection.engineShown(this);
                    Log.d(TAG, "Wallpaper has updated the surface:"
                            + mWallpaperManager.getWallpaperInfo());
                } catch (RemoteException e) {
                    Log.w(TAG, "Wallpaper host disappeared", e);
                    return;
+13 −10
Original line number Diff line number Diff line
@@ -72,17 +72,19 @@ public class SuspendedAppActivity extends AlertActivity
    private Resources mSuspendingAppResources;
    private SuspendDialogInfo mSuppliedDialogInfo;
    private Bundle mOptions;
    private BroadcastReceiver mUnsuspendReceiver = new BroadcastReceiver() {
    private BroadcastReceiver mSuspendModifiedReceiver = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {
            if (Intent.ACTION_PACKAGES_UNSUSPENDED.equals(intent.getAction())) {
                final String[] unsuspended = intent.getStringArrayExtra(
            if (Intent.ACTION_PACKAGES_SUSPENSION_CHANGED.equals(intent.getAction())) {
                // Suspension conditions were modified, dismiss any related visible dialogs.
                final String[] modified = intent.getStringArrayExtra(
                        Intent.EXTRA_CHANGED_PACKAGE_LIST);
                if (ArrayUtils.contains(unsuspended, mSuspendedPackage)) {
                if (ArrayUtils.contains(modified, mSuspendedPackage)) {
                    if (!isFinishing()) {
                        Slog.w(TAG, "Package " + mSuspendedPackage
                                + " got unsuspended while the dialog was visible. Finishing.");
                        Slog.w(TAG, "Package " + mSuspendedPackage + " has modified"
                                + " suspension conditions while dialog was visible. Finishing.");
                        SuspendedAppActivity.this.finish();
                        // TODO (b/198201994): reload the suspend dialog to show most relevant info
                    }
                }
            }
@@ -245,15 +247,16 @@ public class SuspendedAppActivity extends AlertActivity

        setupAlert();

        final IntentFilter unsuspendFilter = new IntentFilter(Intent.ACTION_PACKAGES_UNSUSPENDED);
        registerReceiverAsUser(mUnsuspendReceiver, UserHandle.of(mUserId), unsuspendFilter, null,
                null);
        final IntentFilter suspendModifiedFilter =
                new IntentFilter(Intent.ACTION_PACKAGES_SUSPENSION_CHANGED);
        registerReceiverAsUser(mSuspendModifiedReceiver, UserHandle.of(mUserId),
                suspendModifiedFilter, null, null);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        unregisterReceiver(mUnsuspendReceiver);
        unregisterReceiver(mSuspendModifiedReceiver);
    }

    private void requestDismissKeyguardIfNeeded(CharSequence dismissMessage) {
Loading