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

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

Merge changes I236b1124,Iad16b06e into pi-dev

* changes:
  Add conformance test for preference controller constructor
  Remove duplicate framework classes/robotest compile stub
parents f3ea58a7 92ca05e1
Loading
Loading
Loading
Loading
+31 −0
Original line number Diff line number Diff line
com.android.settings.applications.appinfo.AppActionButtonPreferenceController
com.android.settings.applications.appinfo.AppBatteryPreferenceController
com.android.settings.applications.appinfo.AppDataUsagePreferenceController
com.android.settings.applications.appinfo.AppHeaderViewPreferenceController
com.android.settings.applications.appinfo.AppInstallerInfoPreferenceController
com.android.settings.applications.appinfo.AppMemoryPreferenceController
com.android.settings.applications.appinfo.AppNotificationPreferenceController
com.android.settings.applications.appinfo.AppOpenByDefaultPreferenceController
com.android.settings.applications.appinfo.AppPermissionPreferenceController
com.android.settings.applications.appinfo.AppStoragePreferenceController
com.android.settings.applications.appinfo.AppVersionPreferenceController
com.android.settings.applications.appinfo.DrawOverlayDetailPreferenceController
com.android.settings.applications.appinfo.ExternalSourceDetailPreferenceController
com.android.settings.applications.appinfo.InstantAppButtonsPreferenceController
com.android.settings.applications.appinfo.InstantAppDomainsPreferenceController
com.android.settings.applications.appinfo.PictureInPictureDetailPreferenceController
com.android.settings.applications.appinfo.WriteSystemSettingsPreferenceController
com.android.settings.bluetooth.BluetoothDeviceNamePreferenceController
com.android.settings.bluetooth.BluetoothDeviceRenamePreferenceController
com.android.settings.bluetooth.BluetoothSwitchPreferenceController
com.android.settings.connecteddevice.ConnectedDeviceGroupController
com.android.settings.connecteddevice.SavedDeviceGroupController
com.android.settings.datausage.DataUsageSummaryPreferenceController
com.android.settings.datetime.timezone.TimeZoneInfoPreferenceController
com.android.settings.fuelgauge.RestrictAppPreferenceController
com.android.settings.fuelgauge.batterysaver.AutoBatterySeekBarPreferenceController
com.android.settings.fuelgauge.batterysaver.BatterySaverButtonPreferenceController
com.android.settings.fuelgauge.batterytip.BatteryTipPreferenceController
com.android.settings.security.VisiblePatternProfilePreferenceController
com.android.settings.security.screenlock.LockScreenPreferenceController
com.android.settings.wifi.details.WifiMeteredPreferenceController
 No newline at end of file
+0 −49
Original line number Diff line number Diff line
/*
 * Copyright (C) 2017 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
 *
 *      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.
 */

package android.app.admin;

import android.annotation.NonNull;

/**
 * Stub implementation of framework's PasswordMetrics for Robolectric tests. Otherwise Robolectric
 * is throwing ClassNotFoundError.
 *
 * TODO: Remove this class when Robolectric supports O
 */
public class PasswordMetrics {

    // Maximum allowed number of repeated or ordered characters in a sequence before we'll
    // consider it a complex PIN/password.
    public static final int MAX_ALLOWED_SEQUENCE = 3;

    public int length = 0;
    public int letters = 0;
    public int upperCase = 0;
    public int lowerCase = 0;
    public int numeric = 0;
    public int symbols = 0;
    public int nonLetter = 0;

    public static int maxLengthSequence(@NonNull String string) {
        // Stub implementation
        return 1;
    }

    public static PasswordMetrics computeForPassword(@NonNull String password) {
        return new PasswordMetrics();
    }
}
 No newline at end of file
+0 −54
Original line number Diff line number Diff line
/*
 * Copyright (C) 2017 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
 *
 *      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.
 */

package android.bluetooth;

/**
 * A placeholder class to prevent ClassNotFound exceptions caused by lack of visibility.
 */
public class BluetoothCodecConfig {

    public static final int SAMPLE_RATE_NONE = 0;
    public static final int SAMPLE_RATE_48000 = 0x1 << 1;
    public static final int SOURCE_CODEC_TYPE_INVALID = 1000 * 1000;
    public static final int SOURCE_CODEC_TYPE_AAC = 1;
    public static final int CODEC_PRIORITY_DEFAULT = 0;
    public static final int CODEC_PRIORITY_HIGHEST = 1000 * 1000;
    public static final int BITS_PER_SAMPLE_NONE = 0;
    public static final int CHANNEL_MODE_NONE = 0;
    public static final int BITS_PER_SAMPLE_24 =  0x1 << 1;
    public static final int CHANNEL_MODE_STEREO = 0x1 << 1;

    public int getSampleRate() {
        return 0;
    }

    public int getCodecType() {
        return 0;
    }

    public int getBitsPerSample() {
        return 0;
    }

    public int getChannelMode() {
        return 0;
    }

    public long getCodecSpecific1() {
        return 0;
    }
}
+0 −36
Original line number Diff line number Diff line
/*
 * Copyright (C) 2017 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
 *
 *      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.
 */

package android.content.om;

import android.os.IBinder;

import java.util.List;

public interface IOverlayManager {

    OverlayInfo getOverlayInfo(String packageName, int userId);

    List getOverlayInfosForTarget(String targetPackageName, int userId);

    boolean setEnabled(String packageName, boolean enabled, int userId);

    boolean setEnabledExclusiveInCategory(String packageName, int userId);

    class Stub {
        public static IOverlayManager asInterface(IBinder b) {
            return null;
        }
    }
}
+0 −130
Original line number Diff line number Diff line
package android.net;

import android.annotation.Nullable;
import android.content.ComponentName;
import android.os.Parcel;
import android.os.Parcelable;

import java.util.Objects;

/**
 * Holds metadata about a discovered network scorer/recommendation application.
 *
 * TODO: delete this class once robolectric supports Android O
 */
public final class NetworkScorerAppData implements Parcelable {
    /** UID of the scorer app. */
    public final int packageUid;
    private final ComponentName mRecommendationService;
    /** User visible label in Settings for the recommendation service. */
    private final String mRecommendationServiceLabel;
    /**
     * The {@link ComponentName} of the Activity to start before enabling the "connect to open
     * wifi networks automatically" feature.
     */
    private final ComponentName mEnableUseOpenWifiActivity;
    /**
     * The {@link android.app.NotificationChannel} ID used by {@link #mRecommendationService} to
     * post open network notifications.
     */
    private final String mNetworkAvailableNotificationChannelId;

    public NetworkScorerAppData(int packageUid, ComponentName recommendationServiceComp,
            String recommendationServiceLabel, ComponentName enableUseOpenWifiActivity,
            String networkAvailableNotificationChannelId) {
        this.packageUid = packageUid;
        this.mRecommendationService = recommendationServiceComp;
        this.mRecommendationServiceLabel = recommendationServiceLabel;
        this.mEnableUseOpenWifiActivity = enableUseOpenWifiActivity;
        this.mNetworkAvailableNotificationChannelId = networkAvailableNotificationChannelId;
    }

    protected NetworkScorerAppData(Parcel in) {
        packageUid = in.readInt();
        mRecommendationService = ComponentName.readFromParcel(in);
        mRecommendationServiceLabel = in.readString();
        mEnableUseOpenWifiActivity = ComponentName.readFromParcel(in);
        mNetworkAvailableNotificationChannelId = in.readString();
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(packageUid);
        ComponentName.writeToParcel(mRecommendationService, dest);
        dest.writeString(mRecommendationServiceLabel);
        ComponentName.writeToParcel(mEnableUseOpenWifiActivity, dest);
        dest.writeString(mNetworkAvailableNotificationChannelId);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<NetworkScorerAppData> CREATOR =
            new Creator<NetworkScorerAppData>() {
                @Override
                public NetworkScorerAppData createFromParcel(Parcel in) {
                    return new NetworkScorerAppData(in);
                }

                @Override
                public NetworkScorerAppData[] newArray(int size) {
                    return new NetworkScorerAppData[size];
                }
            };

    public String getRecommendationServicePackageName() {
        return mRecommendationService.getPackageName();
    }

    public ComponentName getRecommendationServiceComponent() {
        return mRecommendationService;
    }

    @Nullable
    public ComponentName getEnableUseOpenWifiActivity() {
        return mEnableUseOpenWifiActivity;
    }

    @Nullable
    public String getRecommendationServiceLabel() {
        return mRecommendationServiceLabel;
    }

    @Nullable
    public String getNetworkAvailableNotificationChannelId() {
        return mNetworkAvailableNotificationChannelId;
    }

    @Override
    public String toString() {
        return "NetworkScorerAppData{" +
                "packageUid=" + packageUid +
                ", mRecommendationService=" + mRecommendationService +
                ", mRecommendationServiceLabel=" + mRecommendationServiceLabel +
                ", mEnableUseOpenWifiActivity=" + mEnableUseOpenWifiActivity +
                ", mNetworkAvailableNotificationChannelId=" +
                mNetworkAvailableNotificationChannelId +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        NetworkScorerAppData that = (NetworkScorerAppData) o;
        return packageUid == that.packageUid &&
                Objects.equals(mRecommendationService, that.mRecommendationService) &&
                Objects.equals(mRecommendationServiceLabel, that.mRecommendationServiceLabel) &&
                Objects.equals(mEnableUseOpenWifiActivity, that.mEnableUseOpenWifiActivity) &&
                Objects.equals(mNetworkAvailableNotificationChannelId,
                        that.mNetworkAvailableNotificationChannelId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(packageUid, mRecommendationService, mRecommendationServiceLabel,
                mEnableUseOpenWifiActivity, mNetworkAvailableNotificationChannelId);
    }
}
Loading