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

Commit a49a7335 authored by Todd Kennedy's avatar Todd Kennedy Committed by Android (Google) Code Review
Browse files

Merge "OMS: fix checkstyle warnings"

parents 3a90c604 38988345
Loading
Loading
Loading
Loading
+6 −7
Original line number Diff line number Diff line
@@ -278,13 +278,12 @@ public abstract class OverlayBaseTest {
            }
        }

        final String no = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, " +
            "sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. " +
            "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip " +
            "ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit " +
            "esse cillum dolore eu fugiat nulla pariatur. " +
            "Excepteur sint occaecat cupidatat non proident, " +
            "sunt in culpa qui officia deserunt mollit anim id est laborum.";
        final String no = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do "
                + "eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim "
                + "veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo "
                + "consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse "
                + "cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non "
                + "proident, sunt in culpa qui officia deserunt mollit anim id est laborum.";
        final String so = "Lorem ipsum: single overlay.";
        final String mo = "Lorem ipsum: multiple overlays.";

+8 −8
Original line number Diff line number Diff line
/*
 * Copyright (C) 2018 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy
 * of the License at
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations
 * under the License.
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.android.server.om.hosttest;

+8 −8
Original line number Diff line number Diff line
/*
 * Copyright (C) 2018 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy
 * of the License at
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations
 * under the License.
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.android.server.om.hosttest.update_overlay_test;

+12 −12
Original line number Diff line number Diff line
@@ -223,8 +223,8 @@ public final class OverlayManagerService extends SystemService {
    public OverlayManagerService(@NonNull final Context context,
            @NonNull final Installer installer) {
        super(context);
        mSettingsFile =
            new AtomicFile(new File(Environment.getDataSystemDirectory(), "overlays.xml"), "overlays");
        mSettingsFile = new AtomicFile(
                new File(Environment.getDataSystemDirectory(), "overlays.xml"), "overlays");
        mPackageManager = new PackageManagerHelper();
        mUserManager = UserManagerService.getInstance();
        IdmapManager im = new IdmapManager(installer);
@@ -718,8 +718,8 @@ public final class OverlayManagerService extends SystemService {
        synchronized (mLock) {
            final List<String> frameworkOverlays =
                    mImpl.getEnabledOverlayPackageNames("android", userId);
            final int N = targetPackageNames.size();
            for (int i = 0; i < N; i++) {
            final int n = targetPackageNames.size();
            for (int i = 0; i < n; i++) {
                final String targetPackageName = targetPackageNames.get(i);
                List<String> list = new ArrayList<>();
                if (!"android".equals(targetPackageName)) {
@@ -730,8 +730,8 @@ public final class OverlayManagerService extends SystemService {
            }
        }

        final int N = targetPackageNames.size();
        for (int i = 0; i < N; i++) {
        final int n = targetPackageNames.size();
        for (int i = 0; i < n; i++) {
            final String targetPackageName = targetPackageNames.get(i);
            if (DEBUG) {
                Slog.d(TAG, "-> Updating overlay: target=" + targetPackageName + " overlays=["
@@ -789,7 +789,7 @@ public final class OverlayManagerService extends SystemService {
            if (!mSettingsFile.getBaseFile().exists()) {
                return;
            }
            try (final FileInputStream stream = mSettingsFile.openRead()) {
            try (FileInputStream stream = mSettingsFile.openRead()) {
                mSettings.restore(stream);

                // We might have data for dying users if the device was
@@ -915,8 +915,8 @@ public final class OverlayManagerService extends SystemService {

            if (!verbose) {
                int count = 0;
                final int N = mCache.size();
                for (int i = 0; i < N; i++) {
                final int n = mCache.size();
                for (int i = 0; i < n; i++) {
                    final int userId = mCache.keyAt(i);
                    count += mCache.get(userId).size();
                }
@@ -929,8 +929,8 @@ public final class OverlayManagerService extends SystemService {
                return;
            }

            final int N = mCache.size();
            for (int i = 0; i < N; i++) {
            final int n = mCache.size();
            for (int i = 0; i < n; i++) {
                final int userId = mCache.keyAt(i);
                pw.println(TAB1 + "User " + userId);
                final HashMap<String, PackageInfo> map = mCache.get(userId);
+11 −11
Original line number Diff line number Diff line
@@ -89,8 +89,8 @@ final class OverlayManagerServiceImpl {
        // a change in priority is only relevant for static RROs: specifically,
        // a regular RRO should not have its state reset only because a change
        // in priority
        if (theTruth.isStaticOverlayPackage() &&
                theTruth.overlayPriority != oldSettings.priority) {
        if (theTruth.isStaticOverlayPackage()
                && theTruth.overlayPriority != oldSettings.priority) {
            return true;
        }
        return false;
@@ -294,8 +294,8 @@ final class OverlayManagerServiceImpl {
            final int userId, final int flags) {
        boolean modified = false;
        final List<OverlayInfo> ois = mSettings.getOverlaysForTarget(targetPackageName, userId);
        final int N = ois.size();
        for (int i = 0; i < N; i++) {
        final int n = ois.size();
        for (int i = 0; i < n; i++) {
            final OverlayInfo oi = ois.get(i);
            final PackageInfo overlayPackage = mPackageManager.getPackageInfo(oi.packageName,
                    userId);
@@ -610,8 +610,8 @@ final class OverlayManagerServiceImpl {
        final List<OverlayInfo> overlays = mSettings.getOverlaysForTarget(targetPackageName,
                userId);
        final List<String> paths = new ArrayList<>(overlays.size());
        final int N = overlays.size();
        for (int i = 0; i < N; i++) {
        final int n = overlays.size();
        for (int i = 0; i < n; i++) {
            final OverlayInfo oi = overlays.get(i);
            if (oi.isEnabled()) {
                paths.add(oi.packageName);
@@ -632,8 +632,8 @@ final class OverlayManagerServiceImpl {
                userId);

        // Static RROs targeting to "android", ie framework-res.apk, are handled by native layers.
        if (targetPackage != null && overlayPackage != null &&
                !("android".equals(targetPackageName)
        if (targetPackage != null && overlayPackage != null
                && !("android".equals(targetPackageName)
                        && overlayPackage.isStaticOverlayPackage())) {
            mIdmapManager.createIdmap(targetPackage, overlayPackage, userId);
        }
Loading