Remove duplicate framework classes/robotest compile stub
Bug: 76167422 Test: robotests Change-Id: Iad16b06e54bd7290fd363c3abebdb8c66434c0e2
This commit is contained in:
@@ -1,49 +0,0 @@
|
||||
/*
|
||||
* 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();
|
||||
}
|
||||
}
|
@@ -1,54 +0,0 @@
|
||||
/*
|
||||
* 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;
|
||||
}
|
||||
}
|
@@ -1,36 +0,0 @@
|
||||
/*
|
||||
* 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;
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,130 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
@@ -1,19 +0,0 @@
|
||||
package android.print;
|
||||
|
||||
import android.annotation.NonNull;
|
||||
import android.content.Context;
|
||||
import android.content.Loader;
|
||||
import android.printservice.PrintServiceInfo;
|
||||
import com.android.internal.util.Preconditions;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* A placeholder class to prevent ClassNotFound exceptions caused by lack of visibility.
|
||||
*/
|
||||
public class PrintServicesLoader extends Loader<List<PrintServiceInfo>> {
|
||||
public PrintServicesLoader(@NonNull PrintManager printManager, @NonNull Context context,
|
||||
int selectionFlags) {
|
||||
super(Preconditions.checkNotNull(context));
|
||||
}
|
||||
}
|
@@ -1,44 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2016 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 com.android.internal.app;
|
||||
|
||||
/**
|
||||
* Fake controller to make robolectric test compile. This is necessary since
|
||||
* ColorDisplayController is not part of Android's API.
|
||||
*/
|
||||
public class ColorDisplayController {
|
||||
|
||||
public static final int AUTO_MODE_DISABLED = 0;
|
||||
public static final int AUTO_MODE_CUSTOM = 1;
|
||||
public static final int AUTO_MODE_TWILIGHT = 2;
|
||||
|
||||
public static final int COLOR_MODE_NATURAL = 0;
|
||||
public static final int COLOR_MODE_BOOSTED = 1;
|
||||
public static final int COLOR_MODE_SATURATED = 2;
|
||||
|
||||
private int mColorMode;
|
||||
|
||||
public void setColorMode(int colorMode) {
|
||||
mColorMode = colorMode;
|
||||
}
|
||||
|
||||
public int getColorMode() {
|
||||
return mColorMode;
|
||||
}
|
||||
|
||||
public interface Callback {
|
||||
}
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
package com.android.internal.app;
|
||||
|
||||
/**
|
||||
* A placeholder class to prevent ClassNotFound exceptions caused by lack of visibility.
|
||||
*/
|
||||
public class LocalePickerWithRegion {
|
||||
|
||||
public interface LocaleSelectedListener {
|
||||
void onLocaleSelected(LocaleStore.LocaleInfo locale);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user