Files
frameworks_base/telephony/java/android/telephony/VoLteServiceState.java
Mathew Inwood 55418eada5 Limit access to suspected false positives.
Members modified herein are suspected to be false positives: i.e. things
that were added to the greylist in P, but subsequent data analysis
suggests that they are not, in fact, used after all.

Add a maxTargetSdk=P to these APIs. This is lower-risk that simply
removing these things from the greylist, as none of out data sources are
perfect nor complete.

For APIs that are not supported yet by annotations, move them to
hiddenapi-greylist-max-p.txt instead which has the same effect.

Exempted-From-Owner-Approval: Automatic changes to the codebase
affecting only @UnsupportedAppUsage annotations, themselves added
without requiring owners approval earlier.

Bug: 115609023
Test: m
Change-Id: Ia937d8c41512e7f1b6e7f67b9104c1878b5cc3a0
Merged-In: I020a9c09672ebcae64c5357abc4993e07e744687
2018-12-28 14:26:35 +00:00

235 lines
5.5 KiB
Java

/*
* Copyright (C) 2014 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.telephony;
import android.annotation.UnsupportedAppUsage;
import android.os.Build;
import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
import android.telephony.Rlog;
/**
* Contains LTE network state related information.
* @deprecated Only contains SRVCC state, which isn't specific to LTE handovers. For SRVCC
* indications, use {@link PhoneStateListener#onSrvccStateChanged(int)}.
* @hide
*/
@Deprecated
public final class VoLteServiceState implements Parcelable {
private static final String LOG_TAG = "VoLteServiceState";
private static final boolean DBG = false;
//Use int max, as -1 is a valid value in signal strength
public static final int INVALID = 0x7FFFFFFF;
public static final int NOT_SUPPORTED = 0;
public static final int SUPPORTED = 1;
// Single Radio Voice Call Continuity(SRVCC) progress state
public static final int HANDOVER_STARTED = 0;
public static final int HANDOVER_COMPLETED = 1;
public static final int HANDOVER_FAILED = 2;
public static final int HANDOVER_CANCELED = 3;
private int mSrvccState;
/**
* Create a new VoLteServiceState from a intent notifier Bundle
*
* This method is used by PhoneStateIntentReceiver and maybe by
* external applications.
*
* @param m Bundle from intent notifier
* @return newly created VoLteServiceState
*
* @hide
*/
public static VoLteServiceState newFromBundle(Bundle m) {
VoLteServiceState ret;
ret = new VoLteServiceState();
ret.setFromNotifierBundle(m);
return ret;
}
/**
* Empty constructor
*
* @hide
*/
public VoLteServiceState() {
initialize();
}
/**
* Constructor
*
* @hide
*/
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
public VoLteServiceState(int srvccState) {
initialize();
mSrvccState = srvccState;
}
/**
* Copy constructors
*
* @param s Source VoLteServiceState
*
* @hide
*/
public VoLteServiceState(VoLteServiceState s) {
copyFrom(s);
}
/**
* Initialize values to defaults.
*
* @hide
*/
private void initialize() {
mSrvccState = INVALID;
}
/**
* @hide
*/
protected void copyFrom(VoLteServiceState s) {
mSrvccState = s.mSrvccState;
}
/**
* Construct a VoLteServiceState object from the given parcel.
*
* @hide
*/
public VoLteServiceState(Parcel in) {
if (DBG) log("Size of VoLteServiceState parcel:" + in.dataSize());
mSrvccState = in.readInt();
}
/**
* {@link Parcelable#writeToParcel}
*/
public void writeToParcel(Parcel out, int flags) {
out.writeInt(mSrvccState);
}
/**
* {@link Parcelable#describeContents}
*/
public int describeContents() {
return 0;
}
/**
* {@link Parcelable.Creator}
*
* @hide
*/
public static final Parcelable.Creator<VoLteServiceState> CREATOR = new Parcelable.Creator() {
public VoLteServiceState createFromParcel(Parcel in) {
return new VoLteServiceState(in);
}
public VoLteServiceState[] newArray(int size) {
return new VoLteServiceState[size];
}
};
/**
* Validate the individual fields as per the range
* specified in ril.h
* Set to invalid any field that is not in the valid range
*
* @return
* Valid values for all fields
* @hide
*/
public void validateInput() {
}
public int hashCode() {
int primeNum = 31;
return ((mSrvccState * primeNum));
}
/**
* @return true if the LTE network states are the same
*/
@Override
public boolean equals (Object o) {
VoLteServiceState s;
try {
s = (VoLteServiceState) o;
} catch (ClassCastException ex) {
return false;
}
if (o == null) {
return false;
}
return (mSrvccState == s.mSrvccState);
}
/**
* @return string representation.
*/
@Override
public String toString() {
return ("VoLteServiceState:"
+ " " + mSrvccState);
}
/**
* Set VoLteServiceState based on intent notifier map
*
* @param m intent notifier map
* @hide
*/
private void setFromNotifierBundle(Bundle m) {
mSrvccState = m.getInt("mSrvccState");
}
/**
* Set intent notifier Bundle based on VoLteServiceState
*
* @param m intent notifier Bundle
* @hide
*/
public void fillInNotifierBundle(Bundle m) {
m.putInt("mSrvccState", mSrvccState);
}
public int getSrvccState() {
return mSrvccState;
}
/**
* log
*/
private static void log(String s) {
Rlog.w(LOG_TAG, s);
}
}