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

Commit 35f5857a authored by Mateus Azis's avatar Mateus Azis Committed by Automerger Merge Worker
Browse files

Merge "Address code warnings in the android.app package." am: a750dcaa am:...

Merge "Address code warnings in the android.app package." am: a750dcaa am: 34321c6d am: ccd04f87

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2553030



Change-Id: I076ff7260409473034c75fed8c9e03d50094382b
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 084768d6 ccd04f87
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -966,7 +966,7 @@ public class Activity extends ContextThemeWrapper
    private int mDefaultKeyMode = DEFAULT_KEYS_DISABLE;
    private SpannableStringBuilder mDefaultKeySsb = null;

    private ActivityManager.TaskDescription mTaskDescription =
    private final ActivityManager.TaskDescription mTaskDescription =
            new ActivityManager.TaskDescription();

    protected static final int[] FOCUSED_STATE_SET = {com.android.internal.R.attr.state_focused};
@@ -977,7 +977,7 @@ public class Activity extends ContextThemeWrapper
    private Thread mUiThread;

    @UnsupportedAppUsage
    ActivityTransitionState mActivityTransitionState = new ActivityTransitionState();
    final ActivityTransitionState mActivityTransitionState = new ActivityTransitionState();
    SharedElementCallback mEnterTransitionListener = SharedElementCallback.NULL_CALLBACK;
    SharedElementCallback mExitTransitionListener = SharedElementCallback.NULL_CALLBACK;

@@ -1883,7 +1883,7 @@ public class Activity extends ContextThemeWrapper
        final int numDialogs = ids.length;
        mManagedDialogs = new SparseArray<ManagedDialog>(numDialogs);
        for (int i = 0; i < numDialogs; i++) {
            final Integer dialogId = ids[i];
            final int dialogId = ids[i];
            Bundle dialogState = b.getBundle(savedDialogKeyFor(dialogId));
            if (dialogState != null) {
                // Calling onRestoreInstanceState() below will invoke dispatchOnCreate
@@ -1953,7 +1953,7 @@ public class Activity extends ContextThemeWrapper
     * <code>persistAcrossReboots</code>.
     *
     * @param savedInstanceState The data most recently supplied in {@link #onSaveInstanceState}
     * @param persistentState The data caming from the PersistableBundle first
     * @param persistentState The data coming from the PersistableBundle first
     * saved in {@link #onSaveInstanceState(Bundle, PersistableBundle)}.
     *
     * @see #onCreate
@@ -5141,7 +5141,7 @@ public class Activity extends ContextThemeWrapper
     * This hook is called when the user signals the desire to start a search.
     *
     * <p>You can use this function as a simple way to launch the search UI, in response to a
     * menu item, search button, or other widgets within your activity. Unless overidden,
     * menu item, search button, or other widgets within your activity. Unless overridden,
     * calling this function is the same as calling
     * {@link #startSearch startSearch(null, false, null, false)}, which launches
     * search for the current activity as specified in its manifest, see {@link SearchManager}.
@@ -9076,7 +9076,7 @@ public class Activity extends ContextThemeWrapper
         * @see Activity#convertFromTranslucent()
         * @see Activity#convertToTranslucent(TranslucentConversionListener, ActivityOptions)
         */
        public void onTranslucentConversionComplete(boolean drawComplete);
        void onTranslucentConversionComplete(boolean drawComplete);
    }

    private void dispatchRequestPermissionsResult(int requestCode, Intent data) {
@@ -9218,7 +9218,7 @@ public class Activity extends ContextThemeWrapper
    /**
     * Registers remote animations per transition type for this activity.
     *
     * @param definition The remote animation definition that defines which transition whould run
     * @param definition The remote animation definition that defines which transition would run
     *                   which remote animation.
     * @hide
     */
+10 −18
Original line number Diff line number Diff line
@@ -268,7 +268,6 @@ public final class ActivityThread extends ClientTransactionHandler
        implements ActivityThreadInternal {
    /** @hide */
    public static final String TAG = "ActivityThread";
    private static final android.graphics.Bitmap.Config THUMBNAIL_FORMAT = Bitmap.Config.RGB_565;
    static final boolean localLOGV = false;
    static final boolean DEBUG_MESSAGES = false;
    /** @hide */
@@ -369,7 +368,7 @@ public final class ActivityThread extends ClientTransactionHandler
    private final AtomicInteger mNumLaunchingActivities = new AtomicInteger();
    @GuardedBy("mAppThread")
    private int mLastProcessState = PROCESS_STATE_UNKNOWN;
    ArrayList<WeakReference<AssistStructure>> mLastAssistStructures = new ArrayList<>();
    final ArrayList<WeakReference<AssistStructure>> mLastAssistStructures = new ArrayList<>();
    private int mLastSessionId;
    // Holds the value of the last reported device ID value from the server for the top activity.
    int mLastReportedDeviceId;
@@ -560,7 +559,7 @@ public final class ActivityThread extends ClientTransactionHandler
        Configuration createdConfig;
        Configuration overrideConfig;
        // Used for consolidating configs before sending on to Activity.
        private Configuration tmpConfig = new Configuration();
        private final Configuration tmpConfig = new Configuration();
        // Callback used for updating activity override config and camera compat control state.
        ViewRootImpl.ActivityConfigCallback activityConfigCallback;

@@ -768,7 +767,7 @@ public final class ActivityThread extends ClientTransactionHandler
        }
    }

    final class ProviderClientRecord {
    static final class ProviderClientRecord {
        final String[] mNames;
        @UnsupportedAppUsage
        final IContentProvider mProvider;
@@ -797,7 +796,7 @@ public final class ActivityThread extends ClientTransactionHandler
        }

        @UnsupportedAppUsage
        Intent intent;
        final Intent intent;
        @UnsupportedAppUsage
        ActivityInfo info;
        @UnsupportedAppUsage
@@ -3459,11 +3458,8 @@ public final class ActivityThread extends ClientTransactionHandler
    public void registerOnActivityPausedListener(Activity activity,
            OnActivityPausedListener listener) {
        synchronized (mOnPauseListeners) {
            ArrayList<OnActivityPausedListener> list = mOnPauseListeners.get(activity);
            if (list == null) {
                list = new ArrayList<OnActivityPausedListener>();
                mOnPauseListeners.put(activity, list);
            }
            ArrayList<OnActivityPausedListener> list =
                    mOnPauseListeners.computeIfAbsent(activity, k -> new ArrayList<>());
            list.add(listener);
        }
    }
@@ -5570,7 +5566,7 @@ public final class ActivityThread extends ClientTransactionHandler
    /** Core implementation of activity destroy call. */
    void performDestroyActivity(ActivityClientRecord r, boolean finishing,
            int configChanges, boolean getNonConfigInstance, String reason) {
        Class<? extends Activity> activityClass = null;
        Class<? extends Activity> activityClass;
        if (localLOGV) Slog.v(TAG, "Performing finish of " + r);
        activityClass = r.activity.getClass();
        r.activity.mConfigChangeFlags |= configChanges;
@@ -7296,7 +7292,7 @@ public final class ActivityThread extends ClientTransactionHandler
        // Note that we cannot hold the lock while acquiring and installing the
        // provider since it might take a long time to run and it could also potentially
        // be re-entrant in the case where the provider is in the same process.
        ContentProviderHolder holder = null;
        ContentProviderHolder holder;
        final ProviderKey key = getGetProviderKey(auth, userId);
        try {
            synchronized (key) {
@@ -7350,11 +7346,7 @@ public final class ActivityThread extends ClientTransactionHandler
    private ProviderKey getGetProviderKey(String auth, int userId) {
        final ProviderKey key = new ProviderKey(auth, userId);
        synchronized (mGetProviderKeys) {
            ProviderKey lock = mGetProviderKeys.get(key);
            if (lock == null) {
                lock = key;
                mGetProviderKeys.put(key, lock);
            }
            ProviderKey lock = mGetProviderKeys.computeIfAbsent(key, k -> k);
            return lock;
        }
    }
@@ -7991,7 +7983,7 @@ public final class ActivityThread extends ClientTransactionHandler
            if (!DEPRECATE_DATA_COLUMNS) return;

            // Install interception and make sure it sticks!
            Os def = null;
            Os def;
            do {
                def = Os.getDefault();
            } while (!Os.compareAndSetDefault(def, new AndroidOs(def)));
+16 −20
Original line number Diff line number Diff line
@@ -16,9 +16,6 @@

package android.app;

import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;

import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager;
@@ -29,6 +26,9 @@ import android.util.Xml;

import com.android.internal.util.XmlUtils;

import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;

import java.io.IOException;

/**
@@ -76,11 +76,7 @@ public class AliasActivity extends Activity {
            startActivity(intent);
            finish();

        } catch (PackageManager.NameNotFoundException e) {
            throw new RuntimeException("Error parsing alias", e);
        } catch (XmlPullParserException e) {
            throw new RuntimeException("Error parsing alias", e);
        } catch (IOException e) {
        } catch (PackageManager.NameNotFoundException | XmlPullParserException | IOException e) {
            throw new RuntimeException("Error parsing alias", e);
        } finally {
            if (parser != null) parser.close();
+1 −1
Original line number Diff line number Diff line
@@ -535,7 +535,7 @@ public final class SearchableInfo implements Parcelable {
     */
    public static SearchableInfo getActivityMetaData(Context context, ActivityInfo activityInfo,
            int userId) {
        Context userContext = null;
        Context userContext;
        try {
            userContext = context.createPackageContextAsUser("system", 0,
                new UserHandle(userId));
+0 −1
Original line number Diff line number Diff line
@@ -1933,7 +1933,6 @@ public class WallpaperManager {
                    mContext.getUserId());
            if (fd != null) {
                FileOutputStream fos = null;
                boolean ok = false;
                try {
                    fos = new ParcelFileDescriptor.AutoCloseOutputStream(fd);
                    copyStreamToWallpaperFile(resources.openRawResource(resid), fos);