diff --git a/library/src/main/java/android/annotation/SdkConstant.java b/library/src/main/java/android/annotation/SdkConstant.java deleted file mode 100644 index 06827a1f..00000000 --- a/library/src/main/java/android/annotation/SdkConstant.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (C) 2008 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.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Indicates a constant field value should be exported to be used in the SDK tools. - * - * @hide - */ -@Target({ElementType.FIELD}) -@Retention(RetentionPolicy.SOURCE) -public @interface SdkConstant { - public static enum SdkConstantType { - ACTIVITY_INTENT_ACTION, BROADCAST_INTENT_ACTION, SERVICE_ACTION, INTENT_CATEGORY, FEATURE; - } - - SdkConstantType value(); -} diff --git a/library/src/main/java/android/database/sqlite/SqliteWrapper.java b/library/src/main/java/android/database/sqlite/SqliteWrapper.java deleted file mode 100644 index 73e2f70c..00000000 --- a/library/src/main/java/android/database/sqlite/SqliteWrapper.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright (C) 2008 Esmertec AG. - * Copyright (C) 2008 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.database.sqlite; - -import android.content.ContentResolver; -import android.content.ContentValues; -import android.content.Context; -import android.database.Cursor; -import android.net.Uri; -import com.klinker.android.logger.Log; -import android.widget.Toast; - -/** - * @hide - */ - -public final class SqliteWrapper { - private static final String TAG = "SqliteWrapper"; - private static final String SQLITE_EXCEPTION_DETAIL_MESSAGE - = "unable to open database file"; - - private SqliteWrapper() { - // Forbidden being instantiated. - } - - // FIXME: need to optimize this method. - private static boolean isLowMemory(SQLiteException e) { - return e.getMessage().equals(SQLITE_EXCEPTION_DETAIL_MESSAGE); - } - - public static void checkSQLiteException(Context context, SQLiteException e) { - if (isLowMemory(e)) { - Toast.makeText(context, "Low Memory", - Toast.LENGTH_SHORT).show(); - } else { - throw e; - } - } - - public static Cursor query(Context context, ContentResolver resolver, Uri uri, - String[] projection, String selection, String[] selectionArgs, String sortOrder) { - try { - return resolver.query(uri, projection, selection, selectionArgs, sortOrder); - } catch (SQLiteException e) { - Log.e(TAG, "Catch a SQLiteException when query: ", e); - checkSQLiteException(context, e); - return null; - } - } - - @SuppressWarnings("deprecation") - public static boolean requery(Context context, Cursor cursor) { - try { - return cursor.requery(); - } catch (SQLiteException e) { - Log.e(TAG, "Catch a SQLiteException when requery: ", e); - checkSQLiteException(context, e); - return false; - } - } - - public static int update(Context context, ContentResolver resolver, Uri uri, - ContentValues values, String where, String[] selectionArgs) { - try { - return resolver.update(uri, values, where, selectionArgs); - } catch (SQLiteException e) { - Log.e(TAG, "Catch a SQLiteException when update: ", e); - checkSQLiteException(context, e); - return -1; - } - } - - public static int delete(Context context, ContentResolver resolver, Uri uri, - String where, String[] selectionArgs) { - try { - return resolver.delete(uri, where, selectionArgs); - } catch (SQLiteException e) { - Log.e(TAG, "Catch a SQLiteException when delete: ", e); - checkSQLiteException(context, e); - return -1; - } - } - - public static Uri insert(Context context, ContentResolver resolver, - Uri uri, ContentValues values) { - try { - return resolver.insert(uri, values); - } catch (SQLiteException e) { - Log.e(TAG, "Catch a SQLiteException when insert: ", e); - checkSQLiteException(context, e); - return null; - } - } -} diff --git a/library/src/main/java/android/net/IConnectivityManager.java b/library/src/main/java/android/net/IConnectivityManager.java deleted file mode 100644 index 6be723b7..00000000 --- a/library/src/main/java/android/net/IConnectivityManager.java +++ /dev/null @@ -1,1536 +0,0 @@ -/* - * This file is auto-generated. DO NOT MODIFY. - * Original file: frameworks/base/core/java/android/net/IConnectivityManager.aidl - */ -package android.net; -/** - * Interface that answers queries about, and allows changing, the - * state of network connectivity. - */ - -/** - * {@hide} - */ -public interface IConnectivityManager extends android.os.IInterface { - /** - * Local-side IPC implementation stub class. - */ - public static abstract class Stub extends android.os.Binder implements android.net.IConnectivityManager { - private static final java.lang.String DESCRIPTOR = "android.net.IConnectivityManager"; - - /** - * Construct the stub at attach it to the interface. - */ - public Stub() { - this.attachInterface(this, DESCRIPTOR); - } - - /** - * Cast an IBinder object into an android.net.IConnectivityManager interface, - * generating a proxy if needed. - */ - public static android.net.IConnectivityManager asInterface(android.os.IBinder obj) { - if ((obj == null)) { - return null; - } - android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR); - if (((iin != null) && (iin instanceof android.net.IConnectivityManager))) { - return ((android.net.IConnectivityManager) iin); - } - return new android.net.IConnectivityManager.Stub.Proxy(obj); - } - - @Override - public android.os.IBinder asBinder() { - return this; - } - - @Override - public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { - switch (code) { - case INTERFACE_TRANSACTION: { - reply.writeString(DESCRIPTOR); - return true; - } - case TRANSACTION_setNetworkPreference: { - data.enforceInterface(DESCRIPTOR); - int _arg0; - _arg0 = data.readInt(); - this.setNetworkPreference(_arg0); - reply.writeNoException(); - return true; - } - case TRANSACTION_getNetworkPreference: { - data.enforceInterface(DESCRIPTOR); - int _result = this.getNetworkPreference(); - reply.writeNoException(); - reply.writeInt(_result); - return true; - } - case TRANSACTION_getActiveNetworkInfo: { - data.enforceInterface(DESCRIPTOR); - android.net.NetworkInfo _result = this.getActiveNetworkInfo(); - reply.writeNoException(); - if ((_result != null)) { - reply.writeInt(1); - _result.writeToParcel(reply, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - } else { - reply.writeInt(0); - } - return true; - } - case TRANSACTION_getActiveNetworkInfoForUid: { - data.enforceInterface(DESCRIPTOR); - int _arg0; - _arg0 = data.readInt(); - android.net.NetworkInfo _result = this.getActiveNetworkInfoForUid(_arg0); - reply.writeNoException(); - if ((_result != null)) { - reply.writeInt(1); - _result.writeToParcel(reply, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - } else { - reply.writeInt(0); - } - return true; - } - case TRANSACTION_getNetworkInfo: { - data.enforceInterface(DESCRIPTOR); - int _arg0; - _arg0 = data.readInt(); - android.net.NetworkInfo _result = this.getNetworkInfo(_arg0); - reply.writeNoException(); - if ((_result != null)) { - reply.writeInt(1); - _result.writeToParcel(reply, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - } else { - reply.writeInt(0); - } - return true; - } - case TRANSACTION_getAllNetworkInfo: { - data.enforceInterface(DESCRIPTOR); - android.net.NetworkInfo[] _result = this.getAllNetworkInfo(); - reply.writeNoException(); - reply.writeTypedArray(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - return true; - } - case TRANSACTION_isNetworkSupported: { - data.enforceInterface(DESCRIPTOR); - int _arg0; - _arg0 = data.readInt(); - boolean _result = this.isNetworkSupported(_arg0); - reply.writeNoException(); - reply.writeInt(((_result) ? (1) : (0))); - return true; - } - case TRANSACTION_getActiveLinkProperties: { - data.enforceInterface(DESCRIPTOR); - android.net.LinkProperties _result = this.getActiveLinkProperties(); - reply.writeNoException(); - if ((_result != null)) { - reply.writeInt(1); - _result.writeToParcel(reply, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - } else { - reply.writeInt(0); - } - return true; - } - case TRANSACTION_getLinkProperties: { - data.enforceInterface(DESCRIPTOR); - int _arg0; - _arg0 = data.readInt(); - android.net.LinkProperties _result = this.getLinkProperties(_arg0); - reply.writeNoException(); - if ((_result != null)) { - reply.writeInt(1); - _result.writeToParcel(reply, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - } else { - reply.writeInt(0); - } - return true; - } - case TRANSACTION_getAllNetworkState: { - data.enforceInterface(DESCRIPTOR); - android.net.NetworkState[] _result = this.getAllNetworkState(); - reply.writeNoException(); - reply.writeTypedArray(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - return true; - } - case TRANSACTION_getActiveNetworkQuotaInfo: { - data.enforceInterface(DESCRIPTOR); - android.net.NetworkQuotaInfo _result = this.getActiveNetworkQuotaInfo(); - reply.writeNoException(); - if ((_result != null)) { - reply.writeInt(1); - _result.writeToParcel(reply, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - } else { - reply.writeInt(0); - } - return true; - } - case TRANSACTION_isActiveNetworkMetered: { - data.enforceInterface(DESCRIPTOR); - boolean _result = this.isActiveNetworkMetered(); - reply.writeNoException(); - reply.writeInt(((_result) ? (1) : (0))); - return true; - } - case TRANSACTION_setRadios: { - data.enforceInterface(DESCRIPTOR); - boolean _arg0; - _arg0 = (0 != data.readInt()); - boolean _result = this.setRadios(_arg0); - reply.writeNoException(); - reply.writeInt(((_result) ? (1) : (0))); - return true; - } - case TRANSACTION_setRadio: { - data.enforceInterface(DESCRIPTOR); - int _arg0; - _arg0 = data.readInt(); - boolean _arg1; - _arg1 = (0 != data.readInt()); - boolean _result = this.setRadio(_arg0, _arg1); - reply.writeNoException(); - reply.writeInt(((_result) ? (1) : (0))); - return true; - } - case TRANSACTION_startUsingNetworkFeature: { - data.enforceInterface(DESCRIPTOR); - int _arg0; - _arg0 = data.readInt(); - java.lang.String _arg1; - _arg1 = data.readString(); - android.os.IBinder _arg2; - _arg2 = data.readStrongBinder(); - int _result = this.startUsingNetworkFeature(_arg0, _arg1, _arg2); - reply.writeNoException(); - reply.writeInt(_result); - return true; - } - case TRANSACTION_stopUsingNetworkFeature: { - data.enforceInterface(DESCRIPTOR); - int _arg0; - _arg0 = data.readInt(); - java.lang.String _arg1; - _arg1 = data.readString(); - int _result = this.stopUsingNetworkFeature(_arg0, _arg1); - reply.writeNoException(); - reply.writeInt(_result); - return true; - } - case TRANSACTION_requestRouteToHost: { - data.enforceInterface(DESCRIPTOR); - int _arg0; - _arg0 = data.readInt(); - int _arg1; - _arg1 = data.readInt(); - boolean _result = this.requestRouteToHost(_arg0, _arg1); - reply.writeNoException(); - reply.writeInt(((_result) ? (1) : (0))); - return true; - } - case TRANSACTION_requestRouteToHostAddress: { - data.enforceInterface(DESCRIPTOR); - int _arg0; - _arg0 = data.readInt(); - byte[] _arg1; - _arg1 = data.createByteArray(); - boolean _result = this.requestRouteToHostAddress(_arg0, _arg1); - reply.writeNoException(); - reply.writeInt(((_result) ? (1) : (0))); - return true; - } - case TRANSACTION_getMobileDataEnabled: { - data.enforceInterface(DESCRIPTOR); - boolean _result = this.getMobileDataEnabled(); - reply.writeNoException(); - reply.writeInt(((_result) ? (1) : (0))); - return true; - } - case TRANSACTION_setMobileDataEnabled: { - data.enforceInterface(DESCRIPTOR); - boolean _arg0; - _arg0 = (0 != data.readInt()); - this.setMobileDataEnabled(_arg0); - reply.writeNoException(); - return true; - } - case TRANSACTION_setPolicyDataEnable: { - data.enforceInterface(DESCRIPTOR); - int _arg0; - _arg0 = data.readInt(); - boolean _arg1; - _arg1 = (0 != data.readInt()); - this.setPolicyDataEnable(_arg0, _arg1); - reply.writeNoException(); - return true; - } - case TRANSACTION_tether: { - data.enforceInterface(DESCRIPTOR); - java.lang.String _arg0; - _arg0 = data.readString(); - int _result = this.tether(_arg0); - reply.writeNoException(); - reply.writeInt(_result); - return true; - } - case TRANSACTION_untether: { - data.enforceInterface(DESCRIPTOR); - java.lang.String _arg0; - _arg0 = data.readString(); - int _result = this.untether(_arg0); - reply.writeNoException(); - reply.writeInt(_result); - return true; - } - case TRANSACTION_getLastTetherError: { - data.enforceInterface(DESCRIPTOR); - java.lang.String _arg0; - _arg0 = data.readString(); - int _result = this.getLastTetherError(_arg0); - reply.writeNoException(); - reply.writeInt(_result); - return true; - } - case TRANSACTION_isTetheringSupported: { - data.enforceInterface(DESCRIPTOR); - boolean _result = this.isTetheringSupported(); - reply.writeNoException(); - reply.writeInt(((_result) ? (1) : (0))); - return true; - } - case TRANSACTION_getTetherableIfaces: { - data.enforceInterface(DESCRIPTOR); - java.lang.String[] _result = this.getTetherableIfaces(); - reply.writeNoException(); - reply.writeStringArray(_result); - return true; - } - case TRANSACTION_getTetheredIfaces: { - data.enforceInterface(DESCRIPTOR); - java.lang.String[] _result = this.getTetheredIfaces(); - reply.writeNoException(); - reply.writeStringArray(_result); - return true; - } - case TRANSACTION_getTetheredIfacePairs: { - data.enforceInterface(DESCRIPTOR); - java.lang.String[] _result = this.getTetheredIfacePairs(); - reply.writeNoException(); - reply.writeStringArray(_result); - return true; - } - case TRANSACTION_getTetheringErroredIfaces: { - data.enforceInterface(DESCRIPTOR); - java.lang.String[] _result = this.getTetheringErroredIfaces(); - reply.writeNoException(); - reply.writeStringArray(_result); - return true; - } - case TRANSACTION_getTetherableUsbRegexs: { - data.enforceInterface(DESCRIPTOR); - java.lang.String[] _result = this.getTetherableUsbRegexs(); - reply.writeNoException(); - reply.writeStringArray(_result); - return true; - } - case TRANSACTION_getTetherableWifiRegexs: { - data.enforceInterface(DESCRIPTOR); - java.lang.String[] _result = this.getTetherableWifiRegexs(); - reply.writeNoException(); - reply.writeStringArray(_result); - return true; - } - case TRANSACTION_getTetherableBluetoothRegexs: { - data.enforceInterface(DESCRIPTOR); - java.lang.String[] _result = this.getTetherableBluetoothRegexs(); - reply.writeNoException(); - reply.writeStringArray(_result); - return true; - } - case TRANSACTION_setUsbTethering: { - data.enforceInterface(DESCRIPTOR); - boolean _arg0; - _arg0 = (0 != data.readInt()); - int _result = this.setUsbTethering(_arg0); - reply.writeNoException(); - reply.writeInt(_result); - return true; - } - case TRANSACTION_requestNetworkTransitionWakelock: { - data.enforceInterface(DESCRIPTOR); - java.lang.String _arg0; - _arg0 = data.readString(); - this.requestNetworkTransitionWakelock(_arg0); - reply.writeNoException(); - return true; - } - case TRANSACTION_reportInetCondition: { - data.enforceInterface(DESCRIPTOR); - int _arg0; - _arg0 = data.readInt(); - int _arg1; - _arg1 = data.readInt(); - this.reportInetCondition(_arg0, _arg1); - reply.writeNoException(); - return true; - } - case TRANSACTION_getGlobalProxy: { - data.enforceInterface(DESCRIPTOR); - android.net.ProxyProperties _result = this.getGlobalProxy(); - reply.writeNoException(); - if ((_result != null)) { - reply.writeInt(1); - _result.writeToParcel(reply, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - } else { - reply.writeInt(0); - } - return true; - } - case TRANSACTION_setGlobalProxy: { - data.enforceInterface(DESCRIPTOR); - android.net.ProxyProperties _arg0; - if ((0 != data.readInt())) { - _arg0 = android.net.ProxyProperties.CREATOR.createFromParcel(data); - } else { - _arg0 = null; - } - this.setGlobalProxy(_arg0); - reply.writeNoException(); - return true; - } - case TRANSACTION_getProxy: { - data.enforceInterface(DESCRIPTOR); - android.net.ProxyProperties _result = this.getProxy(); - reply.writeNoException(); - if ((_result != null)) { - reply.writeInt(1); - _result.writeToParcel(reply, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - } else { - reply.writeInt(0); - } - return true; - } - case TRANSACTION_setDataDependency: { - data.enforceInterface(DESCRIPTOR); - int _arg0; - _arg0 = data.readInt(); - boolean _arg1; - _arg1 = (0 != data.readInt()); - this.setDataDependency(_arg0, _arg1); - reply.writeNoException(); - return true; - } - case TRANSACTION_protectVpn: { - data.enforceInterface(DESCRIPTOR); - android.os.ParcelFileDescriptor _arg0; - if ((0 != data.readInt())) { - _arg0 = android.os.ParcelFileDescriptor.CREATOR.createFromParcel(data); - } else { - _arg0 = null; - } - boolean _result = this.protectVpn(_arg0); - reply.writeNoException(); - reply.writeInt(((_result) ? (1) : (0))); - return true; - } - case TRANSACTION_prepareVpn: { - data.enforceInterface(DESCRIPTOR); - java.lang.String _arg0; - _arg0 = data.readString(); - java.lang.String _arg1; - _arg1 = data.readString(); - boolean _result = this.prepareVpn(_arg0, _arg1); - reply.writeNoException(); - reply.writeInt(((_result) ? (1) : (0))); - return true; - } - case TRANSACTION_establishVpn: { - data.enforceInterface(DESCRIPTOR); - com.android.internal.net.VpnConfig _arg0; - if ((0 != data.readInt())) { - _arg0 = com.android.internal.net.VpnConfig.CREATOR.createFromParcel(data); - } else { - _arg0 = null; - } - android.os.ParcelFileDescriptor _result = this.establishVpn(_arg0); - reply.writeNoException(); - if ((_result != null)) { - reply.writeInt(1); - _result.writeToParcel(reply, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - } else { - reply.writeInt(0); - } - return true; - } - case TRANSACTION_startLegacyVpn: { - data.enforceInterface(DESCRIPTOR); - com.android.internal.net.VpnProfile _arg0; - if ((0 != data.readInt())) { - _arg0 = com.android.internal.net.VpnProfile.CREATOR.createFromParcel(data); - } else { - _arg0 = null; - } - this.startLegacyVpn(_arg0); - reply.writeNoException(); - return true; - } - case TRANSACTION_getLegacyVpnInfo: { - data.enforceInterface(DESCRIPTOR); - com.android.internal.net.LegacyVpnInfo _result = this.getLegacyVpnInfo(); - reply.writeNoException(); - if ((_result != null)) { - reply.writeInt(1); - _result.writeToParcel(reply, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - } else { - reply.writeInt(0); - } - return true; - } - case TRANSACTION_updateLockdownVpn: { - data.enforceInterface(DESCRIPTOR); - boolean _result = this.updateLockdownVpn(); - reply.writeNoException(); - reply.writeInt(((_result) ? (1) : (0))); - return true; - } - case TRANSACTION_captivePortalCheckComplete: { - data.enforceInterface(DESCRIPTOR); - android.net.NetworkInfo _arg0; - if ((0 != data.readInt())) { - _arg0 = null; - } else { - _arg0 = null; - } - this.captivePortalCheckComplete(_arg0); - reply.writeNoException(); - return true; - } - } - return super.onTransact(code, data, reply, flags); - } - - private static class Proxy implements android.net.IConnectivityManager { - private android.os.IBinder mRemote; - - Proxy(android.os.IBinder remote) { - mRemote = remote; - } - - @Override - public android.os.IBinder asBinder() { - return mRemote; - } - - @Override - public void setNetworkPreference(int pref) throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - try { - _data.writeInterfaceToken(DESCRIPTOR); - _data.writeInt(pref); - mRemote.transact(Stub.TRANSACTION_setNetworkPreference, _data, _reply, 0); - _reply.readException(); - } finally { - _reply.recycle(); - _data.recycle(); - } - } - - @Override - public int getNetworkPreference() throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - int _result; - try { - _data.writeInterfaceToken(DESCRIPTOR); - mRemote.transact(Stub.TRANSACTION_getNetworkPreference, _data, _reply, 0); - _reply.readException(); - _result = _reply.readInt(); - } finally { - _reply.recycle(); - _data.recycle(); - } - return _result; - } - - @Override - public android.net.NetworkInfo getActiveNetworkInfo() throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - android.net.NetworkInfo _result; - try { - _data.writeInterfaceToken(DESCRIPTOR); - mRemote.transact(Stub.TRANSACTION_getActiveNetworkInfo, _data, _reply, 0); - _reply.readException(); - if ((0 != _reply.readInt())) { - _result = null; - } else { - _result = null; - } - } finally { - _reply.recycle(); - _data.recycle(); - } - return _result; - } - - @Override - public android.net.NetworkInfo getActiveNetworkInfoForUid(int uid) throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - android.net.NetworkInfo _result; - try { - _data.writeInterfaceToken(DESCRIPTOR); - _data.writeInt(uid); - mRemote.transact(Stub.TRANSACTION_getActiveNetworkInfoForUid, _data, _reply, 0); - _reply.readException(); - if ((0 != _reply.readInt())) { - _result = null; - } else { - _result = null; - } - } finally { - _reply.recycle(); - _data.recycle(); - } - return _result; - } - - @Override - public android.net.NetworkInfo getNetworkInfo(int networkType) throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - android.net.NetworkInfo _result; - try { - _data.writeInterfaceToken(DESCRIPTOR); - _data.writeInt(networkType); - mRemote.transact(Stub.TRANSACTION_getNetworkInfo, _data, _reply, 0); - _reply.readException(); - if ((0 != _reply.readInt())) { - _result = null; - } else { - _result = null; - } - } finally { - _reply.recycle(); - _data.recycle(); - } - return _result; - } - - @Override - public android.net.NetworkInfo[] getAllNetworkInfo() throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - android.net.NetworkInfo[] _result; - try { - _data.writeInterfaceToken(DESCRIPTOR); - mRemote.transact(Stub.TRANSACTION_getAllNetworkInfo, _data, _reply, 0); - _reply.readException(); - _result = null; - } finally { - _reply.recycle(); - _data.recycle(); - } - return _result; - } - - @Override - public boolean isNetworkSupported(int networkType) throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - boolean _result; - try { - _data.writeInterfaceToken(DESCRIPTOR); - _data.writeInt(networkType); - mRemote.transact(Stub.TRANSACTION_isNetworkSupported, _data, _reply, 0); - _reply.readException(); - _result = (0 != _reply.readInt()); - } finally { - _reply.recycle(); - _data.recycle(); - } - return _result; - } - - @Override - public android.net.LinkProperties getActiveLinkProperties() throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - android.net.LinkProperties _result; - try { - _data.writeInterfaceToken(DESCRIPTOR); - mRemote.transact(Stub.TRANSACTION_getActiveLinkProperties, _data, _reply, 0); - _reply.readException(); - if ((0 != _reply.readInt())) { - _result = android.net.LinkProperties.CREATOR.createFromParcel(_reply); - } else { - _result = null; - } - } finally { - _reply.recycle(); - _data.recycle(); - } - return _result; - } - - @Override - public android.net.LinkProperties getLinkProperties(int networkType) throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - android.net.LinkProperties _result; - try { - _data.writeInterfaceToken(DESCRIPTOR); - _data.writeInt(networkType); - mRemote.transact(Stub.TRANSACTION_getLinkProperties, _data, _reply, 0); - _reply.readException(); - if ((0 != _reply.readInt())) { - _result = android.net.LinkProperties.CREATOR.createFromParcel(_reply); - } else { - _result = null; - } - } finally { - _reply.recycle(); - _data.recycle(); - } - return _result; - } - - @Override - public android.net.NetworkState[] getAllNetworkState() throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - android.net.NetworkState[] _result; - try { - _data.writeInterfaceToken(DESCRIPTOR); - mRemote.transact(Stub.TRANSACTION_getAllNetworkState, _data, _reply, 0); - _reply.readException(); - _result = _reply.createTypedArray(android.net.NetworkState.CREATOR); - } finally { - _reply.recycle(); - _data.recycle(); - } - return _result; - } - - @Override - public android.net.NetworkQuotaInfo getActiveNetworkQuotaInfo() throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - android.net.NetworkQuotaInfo _result; - try { - _data.writeInterfaceToken(DESCRIPTOR); - mRemote.transact(Stub.TRANSACTION_getActiveNetworkQuotaInfo, _data, _reply, 0); - _reply.readException(); - if ((0 != _reply.readInt())) { - _result = android.net.NetworkQuotaInfo.CREATOR.createFromParcel(_reply); - } else { - _result = null; - } - } finally { - _reply.recycle(); - _data.recycle(); - } - return _result; - } - - @Override - public boolean isActiveNetworkMetered() throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - boolean _result; - try { - _data.writeInterfaceToken(DESCRIPTOR); - mRemote.transact(Stub.TRANSACTION_isActiveNetworkMetered, _data, _reply, 0); - _reply.readException(); - _result = (0 != _reply.readInt()); - } finally { - _reply.recycle(); - _data.recycle(); - } - return _result; - } - - @Override - public boolean setRadios(boolean onOff) throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - boolean _result; - try { - _data.writeInterfaceToken(DESCRIPTOR); - _data.writeInt(((onOff) ? (1) : (0))); - mRemote.transact(Stub.TRANSACTION_setRadios, _data, _reply, 0); - _reply.readException(); - _result = (0 != _reply.readInt()); - } finally { - _reply.recycle(); - _data.recycle(); - } - return _result; - } - - @Override - public boolean setRadio(int networkType, boolean turnOn) throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - boolean _result; - try { - _data.writeInterfaceToken(DESCRIPTOR); - _data.writeInt(networkType); - _data.writeInt(((turnOn) ? (1) : (0))); - mRemote.transact(Stub.TRANSACTION_setRadio, _data, _reply, 0); - _reply.readException(); - _result = (0 != _reply.readInt()); - } finally { - _reply.recycle(); - _data.recycle(); - } - return _result; - } - - @Override - public int startUsingNetworkFeature(int networkType, java.lang.String feature, android.os.IBinder binder) throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - int _result; - try { - _data.writeInterfaceToken(DESCRIPTOR); - _data.writeInt(networkType); - _data.writeString(feature); - _data.writeStrongBinder(binder); - mRemote.transact(Stub.TRANSACTION_startUsingNetworkFeature, _data, _reply, 0); - _reply.readException(); - _result = _reply.readInt(); - } finally { - _reply.recycle(); - _data.recycle(); - } - return _result; - } - - @Override - public int stopUsingNetworkFeature(int networkType, java.lang.String feature) throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - int _result; - try { - _data.writeInterfaceToken(DESCRIPTOR); - _data.writeInt(networkType); - _data.writeString(feature); - mRemote.transact(Stub.TRANSACTION_stopUsingNetworkFeature, _data, _reply, 0); - _reply.readException(); - _result = _reply.readInt(); - } finally { - _reply.recycle(); - _data.recycle(); - } - return _result; - } - - @Override - public boolean requestRouteToHost(int networkType, int hostAddress) throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - boolean _result; - try { - _data.writeInterfaceToken(DESCRIPTOR); - _data.writeInt(networkType); - _data.writeInt(hostAddress); - mRemote.transact(Stub.TRANSACTION_requestRouteToHost, _data, _reply, 0); - _reply.readException(); - _result = (0 != _reply.readInt()); - } finally { - _reply.recycle(); - _data.recycle(); - } - return _result; - } - - @Override - public boolean requestRouteToHostAddress(int networkType, byte[] hostAddress) throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - boolean _result; - try { - _data.writeInterfaceToken(DESCRIPTOR); - _data.writeInt(networkType); - _data.writeByteArray(hostAddress); - mRemote.transact(Stub.TRANSACTION_requestRouteToHostAddress, _data, _reply, 0); - _reply.readException(); - _result = (0 != _reply.readInt()); - } finally { - _reply.recycle(); - _data.recycle(); - } - return _result; - } - - @Override - public boolean getMobileDataEnabled() throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - boolean _result; - try { - _data.writeInterfaceToken(DESCRIPTOR); - mRemote.transact(Stub.TRANSACTION_getMobileDataEnabled, _data, _reply, 0); - _reply.readException(); - _result = (0 != _reply.readInt()); - } finally { - _reply.recycle(); - _data.recycle(); - } - return _result; - } - - @Override - public void setMobileDataEnabled(boolean enabled) throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - try { - _data.writeInterfaceToken(DESCRIPTOR); - _data.writeInt(((enabled) ? (1) : (0))); - mRemote.transact(Stub.TRANSACTION_setMobileDataEnabled, _data, _reply, 0); - _reply.readException(); - } finally { - _reply.recycle(); - _data.recycle(); - } - } - - /** - * Policy control over specific {@link NetworkStateTracker}. - */ - @Override - public void setPolicyDataEnable(int networkType, boolean enabled) throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - try { - _data.writeInterfaceToken(DESCRIPTOR); - _data.writeInt(networkType); - _data.writeInt(((enabled) ? (1) : (0))); - mRemote.transact(Stub.TRANSACTION_setPolicyDataEnable, _data, _reply, 0); - _reply.readException(); - } finally { - _reply.recycle(); - _data.recycle(); - } - } - - @Override - public int tether(java.lang.String iface) throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - int _result; - try { - _data.writeInterfaceToken(DESCRIPTOR); - _data.writeString(iface); - mRemote.transact(Stub.TRANSACTION_tether, _data, _reply, 0); - _reply.readException(); - _result = _reply.readInt(); - } finally { - _reply.recycle(); - _data.recycle(); - } - return _result; - } - - @Override - public int untether(java.lang.String iface) throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - int _result; - try { - _data.writeInterfaceToken(DESCRIPTOR); - _data.writeString(iface); - mRemote.transact(Stub.TRANSACTION_untether, _data, _reply, 0); - _reply.readException(); - _result = _reply.readInt(); - } finally { - _reply.recycle(); - _data.recycle(); - } - return _result; - } - - @Override - public int getLastTetherError(java.lang.String iface) throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - int _result; - try { - _data.writeInterfaceToken(DESCRIPTOR); - _data.writeString(iface); - mRemote.transact(Stub.TRANSACTION_getLastTetherError, _data, _reply, 0); - _reply.readException(); - _result = _reply.readInt(); - } finally { - _reply.recycle(); - _data.recycle(); - } - return _result; - } - - @Override - public boolean isTetheringSupported() throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - boolean _result; - try { - _data.writeInterfaceToken(DESCRIPTOR); - mRemote.transact(Stub.TRANSACTION_isTetheringSupported, _data, _reply, 0); - _reply.readException(); - _result = (0 != _reply.readInt()); - } finally { - _reply.recycle(); - _data.recycle(); - } - return _result; - } - - @Override - public java.lang.String[] getTetherableIfaces() throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - java.lang.String[] _result; - try { - _data.writeInterfaceToken(DESCRIPTOR); - mRemote.transact(Stub.TRANSACTION_getTetherableIfaces, _data, _reply, 0); - _reply.readException(); - _result = _reply.createStringArray(); - } finally { - _reply.recycle(); - _data.recycle(); - } - return _result; - } - - @Override - public java.lang.String[] getTetheredIfaces() throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - java.lang.String[] _result; - try { - _data.writeInterfaceToken(DESCRIPTOR); - mRemote.transact(Stub.TRANSACTION_getTetheredIfaces, _data, _reply, 0); - _reply.readException(); - _result = _reply.createStringArray(); - } finally { - _reply.recycle(); - _data.recycle(); - } - return _result; - } - - /** - * Return list of interface pairs that are actively tethered. Even indexes are - * remote interface, and odd indexes are corresponding local interfaces. - */ - @Override - public java.lang.String[] getTetheredIfacePairs() throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - java.lang.String[] _result; - try { - _data.writeInterfaceToken(DESCRIPTOR); - mRemote.transact(Stub.TRANSACTION_getTetheredIfacePairs, _data, _reply, 0); - _reply.readException(); - _result = _reply.createStringArray(); - } finally { - _reply.recycle(); - _data.recycle(); - } - return _result; - } - - @Override - public java.lang.String[] getTetheringErroredIfaces() throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - java.lang.String[] _result; - try { - _data.writeInterfaceToken(DESCRIPTOR); - mRemote.transact(Stub.TRANSACTION_getTetheringErroredIfaces, _data, _reply, 0); - _reply.readException(); - _result = _reply.createStringArray(); - } finally { - _reply.recycle(); - _data.recycle(); - } - return _result; - } - - @Override - public java.lang.String[] getTetherableUsbRegexs() throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - java.lang.String[] _result; - try { - _data.writeInterfaceToken(DESCRIPTOR); - mRemote.transact(Stub.TRANSACTION_getTetherableUsbRegexs, _data, _reply, 0); - _reply.readException(); - _result = _reply.createStringArray(); - } finally { - _reply.recycle(); - _data.recycle(); - } - return _result; - } - - @Override - public java.lang.String[] getTetherableWifiRegexs() throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - java.lang.String[] _result; - try { - _data.writeInterfaceToken(DESCRIPTOR); - mRemote.transact(Stub.TRANSACTION_getTetherableWifiRegexs, _data, _reply, 0); - _reply.readException(); - _result = _reply.createStringArray(); - } finally { - _reply.recycle(); - _data.recycle(); - } - return _result; - } - - @Override - public java.lang.String[] getTetherableBluetoothRegexs() throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - java.lang.String[] _result; - try { - _data.writeInterfaceToken(DESCRIPTOR); - mRemote.transact(Stub.TRANSACTION_getTetherableBluetoothRegexs, _data, _reply, 0); - _reply.readException(); - _result = _reply.createStringArray(); - } finally { - _reply.recycle(); - _data.recycle(); - } - return _result; - } - - @Override - public int setUsbTethering(boolean enable) throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - int _result; - try { - _data.writeInterfaceToken(DESCRIPTOR); - _data.writeInt(((enable) ? (1) : (0))); - mRemote.transact(Stub.TRANSACTION_setUsbTethering, _data, _reply, 0); - _reply.readException(); - _result = _reply.readInt(); - } finally { - _reply.recycle(); - _data.recycle(); - } - return _result; - } - - @Override - public void requestNetworkTransitionWakelock(java.lang.String forWhom) throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - try { - _data.writeInterfaceToken(DESCRIPTOR); - _data.writeString(forWhom); - mRemote.transact(Stub.TRANSACTION_requestNetworkTransitionWakelock, _data, _reply, 0); - _reply.readException(); - } finally { - _reply.recycle(); - _data.recycle(); - } - } - - @Override - public void reportInetCondition(int networkType, int percentage) throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - try { - _data.writeInterfaceToken(DESCRIPTOR); - _data.writeInt(networkType); - _data.writeInt(percentage); - mRemote.transact(Stub.TRANSACTION_reportInetCondition, _data, _reply, 0); - _reply.readException(); - } finally { - _reply.recycle(); - _data.recycle(); - } - } - - @Override - public android.net.ProxyProperties getGlobalProxy() throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - android.net.ProxyProperties _result; - try { - _data.writeInterfaceToken(DESCRIPTOR); - mRemote.transact(Stub.TRANSACTION_getGlobalProxy, _data, _reply, 0); - _reply.readException(); - if ((0 != _reply.readInt())) { - _result = android.net.ProxyProperties.CREATOR.createFromParcel(_reply); - } else { - _result = null; - } - } finally { - _reply.recycle(); - _data.recycle(); - } - return _result; - } - - @Override - public void setGlobalProxy(android.net.ProxyProperties p) throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - try { - _data.writeInterfaceToken(DESCRIPTOR); - if ((p != null)) { - _data.writeInt(1); - p.writeToParcel(_data, 0); - } else { - _data.writeInt(0); - } - mRemote.transact(Stub.TRANSACTION_setGlobalProxy, _data, _reply, 0); - _reply.readException(); - } finally { - _reply.recycle(); - _data.recycle(); - } - } - - @Override - public android.net.ProxyProperties getProxy() throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - android.net.ProxyProperties _result; - try { - _data.writeInterfaceToken(DESCRIPTOR); - mRemote.transact(Stub.TRANSACTION_getProxy, _data, _reply, 0); - _reply.readException(); - if ((0 != _reply.readInt())) { - _result = android.net.ProxyProperties.CREATOR.createFromParcel(_reply); - } else { - _result = null; - } - } finally { - _reply.recycle(); - _data.recycle(); - } - return _result; - } - - @Override - public void setDataDependency(int networkType, boolean met) throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - try { - _data.writeInterfaceToken(DESCRIPTOR); - _data.writeInt(networkType); - _data.writeInt(((met) ? (1) : (0))); - mRemote.transact(Stub.TRANSACTION_setDataDependency, _data, _reply, 0); - _reply.readException(); - } finally { - _reply.recycle(); - _data.recycle(); - } - } - - @Override - public boolean protectVpn(android.os.ParcelFileDescriptor socket) throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - boolean _result; - try { - _data.writeInterfaceToken(DESCRIPTOR); - if ((socket != null)) { - _data.writeInt(1); - socket.writeToParcel(_data, 0); - } else { - _data.writeInt(0); - } - mRemote.transact(Stub.TRANSACTION_protectVpn, _data, _reply, 0); - _reply.readException(); - _result = (0 != _reply.readInt()); - } finally { - _reply.recycle(); - _data.recycle(); - } - return _result; - } - - @Override - public boolean prepareVpn(java.lang.String oldPackage, java.lang.String newPackage) throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - boolean _result; - try { - _data.writeInterfaceToken(DESCRIPTOR); - _data.writeString(oldPackage); - _data.writeString(newPackage); - mRemote.transact(Stub.TRANSACTION_prepareVpn, _data, _reply, 0); - _reply.readException(); - _result = (0 != _reply.readInt()); - } finally { - _reply.recycle(); - _data.recycle(); - } - return _result; - } - - @Override - public android.os.ParcelFileDescriptor establishVpn(com.android.internal.net.VpnConfig config) throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - android.os.ParcelFileDescriptor _result; - try { - _data.writeInterfaceToken(DESCRIPTOR); - if ((config != null)) { - _data.writeInt(1); - config.writeToParcel(_data, 0); - } else { - _data.writeInt(0); - } - mRemote.transact(Stub.TRANSACTION_establishVpn, _data, _reply, 0); - _reply.readException(); - if ((0 != _reply.readInt())) { - _result = android.os.ParcelFileDescriptor.CREATOR.createFromParcel(_reply); - } else { - _result = null; - } - } finally { - _reply.recycle(); - _data.recycle(); - } - return _result; - } - - @Override - public void startLegacyVpn(com.android.internal.net.VpnProfile profile) throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - try { - _data.writeInterfaceToken(DESCRIPTOR); - if ((profile != null)) { - _data.writeInt(1); - profile.writeToParcel(_data, 0); - } else { - _data.writeInt(0); - } - mRemote.transact(Stub.TRANSACTION_startLegacyVpn, _data, _reply, 0); - _reply.readException(); - } finally { - _reply.recycle(); - _data.recycle(); - } - } - - @Override - public com.android.internal.net.LegacyVpnInfo getLegacyVpnInfo() throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - com.android.internal.net.LegacyVpnInfo _result; - try { - _data.writeInterfaceToken(DESCRIPTOR); - mRemote.transact(Stub.TRANSACTION_getLegacyVpnInfo, _data, _reply, 0); - _reply.readException(); - if ((0 != _reply.readInt())) { - _result = com.android.internal.net.LegacyVpnInfo.CREATOR.createFromParcel(_reply); - } else { - _result = null; - } - } finally { - _reply.recycle(); - _data.recycle(); - } - return _result; - } - - @Override - public boolean updateLockdownVpn() throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - boolean _result; - try { - _data.writeInterfaceToken(DESCRIPTOR); - mRemote.transact(Stub.TRANSACTION_updateLockdownVpn, _data, _reply, 0); - _reply.readException(); - _result = (0 != _reply.readInt()); - } finally { - _reply.recycle(); - _data.recycle(); - } - return _result; - } - - @Override - public void captivePortalCheckComplete(android.net.NetworkInfo info) throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - try { - _data.writeInterfaceToken(DESCRIPTOR); - if ((info != null)) { - _data.writeInt(1); - info.writeToParcel(_data, 0); - } else { - _data.writeInt(0); - } - mRemote.transact(Stub.TRANSACTION_captivePortalCheckComplete, _data, _reply, 0); - _reply.readException(); - } finally { - _reply.recycle(); - _data.recycle(); - } - } - } - - static final int TRANSACTION_setNetworkPreference = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); - static final int TRANSACTION_getNetworkPreference = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1); - static final int TRANSACTION_getActiveNetworkInfo = (android.os.IBinder.FIRST_CALL_TRANSACTION + 2); - static final int TRANSACTION_getActiveNetworkInfoForUid = (android.os.IBinder.FIRST_CALL_TRANSACTION + 3); - static final int TRANSACTION_getNetworkInfo = (android.os.IBinder.FIRST_CALL_TRANSACTION + 4); - static final int TRANSACTION_getAllNetworkInfo = (android.os.IBinder.FIRST_CALL_TRANSACTION + 5); - static final int TRANSACTION_isNetworkSupported = (android.os.IBinder.FIRST_CALL_TRANSACTION + 6); - static final int TRANSACTION_getActiveLinkProperties = (android.os.IBinder.FIRST_CALL_TRANSACTION + 7); - static final int TRANSACTION_getLinkProperties = (android.os.IBinder.FIRST_CALL_TRANSACTION + 8); - static final int TRANSACTION_getAllNetworkState = (android.os.IBinder.FIRST_CALL_TRANSACTION + 9); - static final int TRANSACTION_getActiveNetworkQuotaInfo = (android.os.IBinder.FIRST_CALL_TRANSACTION + 10); - static final int TRANSACTION_isActiveNetworkMetered = (android.os.IBinder.FIRST_CALL_TRANSACTION + 11); - static final int TRANSACTION_setRadios = (android.os.IBinder.FIRST_CALL_TRANSACTION + 12); - static final int TRANSACTION_setRadio = (android.os.IBinder.FIRST_CALL_TRANSACTION + 13); - static final int TRANSACTION_startUsingNetworkFeature = (android.os.IBinder.FIRST_CALL_TRANSACTION + 14); - static final int TRANSACTION_stopUsingNetworkFeature = (android.os.IBinder.FIRST_CALL_TRANSACTION + 15); - static final int TRANSACTION_requestRouteToHost = (android.os.IBinder.FIRST_CALL_TRANSACTION + 16); - static final int TRANSACTION_requestRouteToHostAddress = (android.os.IBinder.FIRST_CALL_TRANSACTION + 17); - static final int TRANSACTION_getMobileDataEnabled = (android.os.IBinder.FIRST_CALL_TRANSACTION + 18); - static final int TRANSACTION_setMobileDataEnabled = (android.os.IBinder.FIRST_CALL_TRANSACTION + 19); - static final int TRANSACTION_setPolicyDataEnable = (android.os.IBinder.FIRST_CALL_TRANSACTION + 20); - static final int TRANSACTION_tether = (android.os.IBinder.FIRST_CALL_TRANSACTION + 21); - static final int TRANSACTION_untether = (android.os.IBinder.FIRST_CALL_TRANSACTION + 22); - static final int TRANSACTION_getLastTetherError = (android.os.IBinder.FIRST_CALL_TRANSACTION + 23); - static final int TRANSACTION_isTetheringSupported = (android.os.IBinder.FIRST_CALL_TRANSACTION + 24); - static final int TRANSACTION_getTetherableIfaces = (android.os.IBinder.FIRST_CALL_TRANSACTION + 25); - static final int TRANSACTION_getTetheredIfaces = (android.os.IBinder.FIRST_CALL_TRANSACTION + 26); - static final int TRANSACTION_getTetheredIfacePairs = (android.os.IBinder.FIRST_CALL_TRANSACTION + 27); - static final int TRANSACTION_getTetheringErroredIfaces = (android.os.IBinder.FIRST_CALL_TRANSACTION + 28); - static final int TRANSACTION_getTetherableUsbRegexs = (android.os.IBinder.FIRST_CALL_TRANSACTION + 29); - static final int TRANSACTION_getTetherableWifiRegexs = (android.os.IBinder.FIRST_CALL_TRANSACTION + 30); - static final int TRANSACTION_getTetherableBluetoothRegexs = (android.os.IBinder.FIRST_CALL_TRANSACTION + 31); - static final int TRANSACTION_setUsbTethering = (android.os.IBinder.FIRST_CALL_TRANSACTION + 32); - static final int TRANSACTION_requestNetworkTransitionWakelock = (android.os.IBinder.FIRST_CALL_TRANSACTION + 33); - static final int TRANSACTION_reportInetCondition = (android.os.IBinder.FIRST_CALL_TRANSACTION + 34); - static final int TRANSACTION_getGlobalProxy = (android.os.IBinder.FIRST_CALL_TRANSACTION + 35); - static final int TRANSACTION_setGlobalProxy = (android.os.IBinder.FIRST_CALL_TRANSACTION + 36); - static final int TRANSACTION_getProxy = (android.os.IBinder.FIRST_CALL_TRANSACTION + 37); - static final int TRANSACTION_setDataDependency = (android.os.IBinder.FIRST_CALL_TRANSACTION + 38); - static final int TRANSACTION_protectVpn = (android.os.IBinder.FIRST_CALL_TRANSACTION + 39); - static final int TRANSACTION_prepareVpn = (android.os.IBinder.FIRST_CALL_TRANSACTION + 40); - static final int TRANSACTION_establishVpn = (android.os.IBinder.FIRST_CALL_TRANSACTION + 41); - static final int TRANSACTION_startLegacyVpn = (android.os.IBinder.FIRST_CALL_TRANSACTION + 42); - static final int TRANSACTION_getLegacyVpnInfo = (android.os.IBinder.FIRST_CALL_TRANSACTION + 43); - static final int TRANSACTION_updateLockdownVpn = (android.os.IBinder.FIRST_CALL_TRANSACTION + 44); - static final int TRANSACTION_captivePortalCheckComplete = (android.os.IBinder.FIRST_CALL_TRANSACTION + 45); - } - - public void setNetworkPreference(int pref) throws android.os.RemoteException; - - public int getNetworkPreference() throws android.os.RemoteException; - - public android.net.NetworkInfo getActiveNetworkInfo() throws android.os.RemoteException; - - public android.net.NetworkInfo getActiveNetworkInfoForUid(int uid) throws android.os.RemoteException; - - public android.net.NetworkInfo getNetworkInfo(int networkType) throws android.os.RemoteException; - - public android.net.NetworkInfo[] getAllNetworkInfo() throws android.os.RemoteException; - - public boolean isNetworkSupported(int networkType) throws android.os.RemoteException; - - public android.net.LinkProperties getActiveLinkProperties() throws android.os.RemoteException; - - public android.net.LinkProperties getLinkProperties(int networkType) throws android.os.RemoteException; - - public android.net.NetworkState[] getAllNetworkState() throws android.os.RemoteException; - - public android.net.NetworkQuotaInfo getActiveNetworkQuotaInfo() throws android.os.RemoteException; - - public boolean isActiveNetworkMetered() throws android.os.RemoteException; - - public boolean setRadios(boolean onOff) throws android.os.RemoteException; - - public boolean setRadio(int networkType, boolean turnOn) throws android.os.RemoteException; - - public int startUsingNetworkFeature(int networkType, java.lang.String feature, android.os.IBinder binder) throws android.os.RemoteException; - - public int stopUsingNetworkFeature(int networkType, java.lang.String feature) throws android.os.RemoteException; - - public boolean requestRouteToHost(int networkType, int hostAddress) throws android.os.RemoteException; - - public boolean requestRouteToHostAddress(int networkType, byte[] hostAddress) throws android.os.RemoteException; - - public boolean getMobileDataEnabled() throws android.os.RemoteException; - - public void setMobileDataEnabled(boolean enabled) throws android.os.RemoteException; - - /** - * Policy control over specific {@link NetworkStateTracker}. - */ - public void setPolicyDataEnable(int networkType, boolean enabled) throws android.os.RemoteException; - - public int tether(java.lang.String iface) throws android.os.RemoteException; - - public int untether(java.lang.String iface) throws android.os.RemoteException; - - public int getLastTetherError(java.lang.String iface) throws android.os.RemoteException; - - public boolean isTetheringSupported() throws android.os.RemoteException; - - public java.lang.String[] getTetherableIfaces() throws android.os.RemoteException; - - public java.lang.String[] getTetheredIfaces() throws android.os.RemoteException; - - /** - * Return list of interface pairs that are actively tethered. Even indexes are - * remote interface, and odd indexes are corresponding local interfaces. - */ - public java.lang.String[] getTetheredIfacePairs() throws android.os.RemoteException; - - public java.lang.String[] getTetheringErroredIfaces() throws android.os.RemoteException; - - public java.lang.String[] getTetherableUsbRegexs() throws android.os.RemoteException; - - public java.lang.String[] getTetherableWifiRegexs() throws android.os.RemoteException; - - public java.lang.String[] getTetherableBluetoothRegexs() throws android.os.RemoteException; - - public int setUsbTethering(boolean enable) throws android.os.RemoteException; - - public void requestNetworkTransitionWakelock(java.lang.String forWhom) throws android.os.RemoteException; - - public void reportInetCondition(int networkType, int percentage) throws android.os.RemoteException; - - public android.net.ProxyProperties getGlobalProxy() throws android.os.RemoteException; - - public void setGlobalProxy(android.net.ProxyProperties p) throws android.os.RemoteException; - - public android.net.ProxyProperties getProxy() throws android.os.RemoteException; - - public void setDataDependency(int networkType, boolean met) throws android.os.RemoteException; - - public boolean protectVpn(android.os.ParcelFileDescriptor socket) throws android.os.RemoteException; - - public boolean prepareVpn(java.lang.String oldPackage, java.lang.String newPackage) throws android.os.RemoteException; - - public android.os.ParcelFileDescriptor establishVpn(com.android.internal.net.VpnConfig config) throws android.os.RemoteException; - - public void startLegacyVpn(com.android.internal.net.VpnProfile profile) throws android.os.RemoteException; - - public com.android.internal.net.LegacyVpnInfo getLegacyVpnInfo() throws android.os.RemoteException; - - public boolean updateLockdownVpn() throws android.os.RemoteException; - - public void captivePortalCheckComplete(android.net.NetworkInfo info) throws android.os.RemoteException; -} diff --git a/library/src/main/java/android/net/INetworkPolicyListener.java b/library/src/main/java/android/net/INetworkPolicyListener.java deleted file mode 100644 index d6ec4e59..00000000 --- a/library/src/main/java/android/net/INetworkPolicyListener.java +++ /dev/null @@ -1,138 +0,0 @@ -/* - * This file is auto-generated. DO NOT MODIFY. - * Original file: frameworks/base/core/java/android/net/INetworkPolicyListener.aidl - */ -package android.net; - -/** - * {@hide} - */ -public interface INetworkPolicyListener extends android.os.IInterface { - /** - * Local-side IPC implementation stub class. - */ - public static abstract class Stub extends android.os.Binder implements android.net.INetworkPolicyListener { - private static final java.lang.String DESCRIPTOR = "android.net.INetworkPolicyListener"; - - /** - * Construct the stub at attach it to the interface. - */ - public Stub() { - this.attachInterface(this, DESCRIPTOR); - } - - /** - * Cast an IBinder object into an android.net.INetworkPolicyListener interface, - * generating a proxy if needed. - */ - public static android.net.INetworkPolicyListener asInterface(android.os.IBinder obj) { - if ((obj == null)) { - return null; - } - android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR); - if (((iin != null) && (iin instanceof android.net.INetworkPolicyListener))) { - return ((android.net.INetworkPolicyListener) iin); - } - return new android.net.INetworkPolicyListener.Stub.Proxy(obj); - } - - @Override - public android.os.IBinder asBinder() { - return this; - } - - @Override - public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { - switch (code) { - case INTERFACE_TRANSACTION: { - reply.writeString(DESCRIPTOR); - return true; - } - case TRANSACTION_onUidRulesChanged: { - data.enforceInterface(DESCRIPTOR); - int _arg0; - _arg0 = data.readInt(); - int _arg1; - _arg1 = data.readInt(); - this.onUidRulesChanged(_arg0, _arg1); - return true; - } - case TRANSACTION_onMeteredIfacesChanged: { - data.enforceInterface(DESCRIPTOR); - java.lang.String[] _arg0; - _arg0 = data.createStringArray(); - this.onMeteredIfacesChanged(_arg0); - return true; - } - case TRANSACTION_onRestrictBackgroundChanged: { - data.enforceInterface(DESCRIPTOR); - boolean _arg0; - _arg0 = (0 != data.readInt()); - this.onRestrictBackgroundChanged(_arg0); - return true; - } - } - return super.onTransact(code, data, reply, flags); - } - - private static class Proxy implements android.net.INetworkPolicyListener { - private android.os.IBinder mRemote; - - Proxy(android.os.IBinder remote) { - mRemote = remote; - } - - @Override - public android.os.IBinder asBinder() { - return mRemote; - } - - @Override - public void onUidRulesChanged(int uid, int uidRules) throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - try { - _data.writeInterfaceToken(DESCRIPTOR); - _data.writeInt(uid); - _data.writeInt(uidRules); - mRemote.transact(Stub.TRANSACTION_onUidRulesChanged, _data, null, android.os.IBinder.FLAG_ONEWAY); - } finally { - _data.recycle(); - } - } - - @Override - public void onMeteredIfacesChanged(java.lang.String[] meteredIfaces) throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - try { - _data.writeInterfaceToken(DESCRIPTOR); - _data.writeStringArray(meteredIfaces); - mRemote.transact(Stub.TRANSACTION_onMeteredIfacesChanged, _data, null, android.os.IBinder.FLAG_ONEWAY); - } finally { - _data.recycle(); - } - } - - @Override - public void onRestrictBackgroundChanged(boolean restrictBackground) throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - try { - _data.writeInterfaceToken(DESCRIPTOR); - _data.writeInt(((restrictBackground) ? (1) : (0))); - mRemote.transact(Stub.TRANSACTION_onRestrictBackgroundChanged, _data, null, android.os.IBinder.FLAG_ONEWAY); - } finally { - _data.recycle(); - } - } - } - - static final int TRANSACTION_onUidRulesChanged = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); - static final int TRANSACTION_onMeteredIfacesChanged = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1); - static final int TRANSACTION_onRestrictBackgroundChanged = (android.os.IBinder.FIRST_CALL_TRANSACTION + 2); - } - - public void onUidRulesChanged(int uid, int uidRules) throws android.os.RemoteException; - - public void onMeteredIfacesChanged(java.lang.String[] meteredIfaces) throws android.os.RemoteException; - - public void onRestrictBackgroundChanged(boolean restrictBackground) throws android.os.RemoteException; -} diff --git a/library/src/main/java/android/net/INetworkPolicyManager.java b/library/src/main/java/android/net/INetworkPolicyManager.java deleted file mode 100644 index 309ff21f..00000000 --- a/library/src/main/java/android/net/INetworkPolicyManager.java +++ /dev/null @@ -1,494 +0,0 @@ -/* - * This file is auto-generated. DO NOT MODIFY. - * Original file: frameworks/base/core/java/android/net/INetworkPolicyManager.aidl - */ -package android.net; - -/** - * Interface that creates and modifies network policy rules. - *
- * {@hide} - */ -public interface INetworkPolicyManager extends android.os.IInterface { - /** - * Local-side IPC implementation stub class. - */ - public static abstract class Stub extends android.os.Binder implements android.net.INetworkPolicyManager { - private static final java.lang.String DESCRIPTOR = "android.net.INetworkPolicyManager"; - - /** - * Construct the stub at attach it to the interface. - */ - public Stub() { - this.attachInterface(this, DESCRIPTOR); - } - - /** - * Cast an IBinder object into an android.net.INetworkPolicyManager interface, - * generating a proxy if needed. - */ - public static android.net.INetworkPolicyManager asInterface(android.os.IBinder obj) { - if ((obj == null)) { - return null; - } - android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR); - if (((iin != null) && (iin instanceof android.net.INetworkPolicyManager))) { - return ((android.net.INetworkPolicyManager) iin); - } - return new android.net.INetworkPolicyManager.Stub.Proxy(obj); - } - - @Override - public android.os.IBinder asBinder() { - return this; - } - - @Override - public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { - switch (code) { - case INTERFACE_TRANSACTION: { - reply.writeString(DESCRIPTOR); - return true; - } - case TRANSACTION_setUidPolicy: { - data.enforceInterface(DESCRIPTOR); - int _arg0; - _arg0 = data.readInt(); - int _arg1; - _arg1 = data.readInt(); - this.setUidPolicy(_arg0, _arg1); - reply.writeNoException(); - return true; - } - case TRANSACTION_getUidPolicy: { - data.enforceInterface(DESCRIPTOR); - int _arg0; - _arg0 = data.readInt(); - int _result = this.getUidPolicy(_arg0); - reply.writeNoException(); - reply.writeInt(_result); - return true; - } - case TRANSACTION_getUidsWithPolicy: { - data.enforceInterface(DESCRIPTOR); - int _arg0; - _arg0 = data.readInt(); - int[] _result = this.getUidsWithPolicy(_arg0); - reply.writeNoException(); - reply.writeIntArray(_result); - return true; - } - case TRANSACTION_isUidForeground: { - data.enforceInterface(DESCRIPTOR); - int _arg0; - _arg0 = data.readInt(); - boolean _result = this.isUidForeground(_arg0); - reply.writeNoException(); - reply.writeInt(((_result) ? (1) : (0))); - return true; - } - case TRANSACTION_registerListener: { - data.enforceInterface(DESCRIPTOR); - android.net.INetworkPolicyListener _arg0; - _arg0 = android.net.INetworkPolicyListener.Stub.asInterface(data.readStrongBinder()); - this.registerListener(_arg0); - reply.writeNoException(); - return true; - } - case TRANSACTION_unregisterListener: { - data.enforceInterface(DESCRIPTOR); - android.net.INetworkPolicyListener _arg0; - _arg0 = android.net.INetworkPolicyListener.Stub.asInterface(data.readStrongBinder()); - this.unregisterListener(_arg0); - reply.writeNoException(); - return true; - } - case TRANSACTION_setNetworkPolicies: { - data.enforceInterface(DESCRIPTOR); - android.net.NetworkPolicy[] _arg0; - _arg0 = data.createTypedArray(android.net.NetworkPolicy.CREATOR); - this.setNetworkPolicies(_arg0); - reply.writeNoException(); - return true; - } - case TRANSACTION_getNetworkPolicies: { - data.enforceInterface(DESCRIPTOR); - android.net.NetworkPolicy[] _result = this.getNetworkPolicies(); - reply.writeNoException(); - reply.writeTypedArray(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - return true; - } - case TRANSACTION_snoozeLimit: { - data.enforceInterface(DESCRIPTOR); - android.net.NetworkTemplate _arg0; - if ((0 != data.readInt())) { - _arg0 = android.net.NetworkTemplate.CREATOR.createFromParcel(data); - } else { - _arg0 = null; - } - this.snoozeLimit(_arg0); - reply.writeNoException(); - return true; - } - case TRANSACTION_setRestrictBackground: { - data.enforceInterface(DESCRIPTOR); - boolean _arg0; - _arg0 = (0 != data.readInt()); - this.setRestrictBackground(_arg0); - reply.writeNoException(); - return true; - } - case TRANSACTION_getRestrictBackground: { - data.enforceInterface(DESCRIPTOR); - boolean _result = this.getRestrictBackground(); - reply.writeNoException(); - reply.writeInt(((_result) ? (1) : (0))); - return true; - } - case TRANSACTION_getNetworkQuotaInfo: { - data.enforceInterface(DESCRIPTOR); - android.net.NetworkState _arg0; - if ((0 != data.readInt())) { - _arg0 = android.net.NetworkState.CREATOR.createFromParcel(data); - } else { - _arg0 = null; - } - android.net.NetworkQuotaInfo _result = this.getNetworkQuotaInfo(_arg0); - reply.writeNoException(); - if ((_result != null)) { - reply.writeInt(1); - _result.writeToParcel(reply, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - } else { - reply.writeInt(0); - } - return true; - } - case TRANSACTION_isNetworkMetered: { - data.enforceInterface(DESCRIPTOR); - android.net.NetworkState _arg0; - if ((0 != data.readInt())) { - _arg0 = android.net.NetworkState.CREATOR.createFromParcel(data); - } else { - _arg0 = null; - } - boolean _result = this.isNetworkMetered(_arg0); - reply.writeNoException(); - reply.writeInt(((_result) ? (1) : (0))); - return true; - } - } - return super.onTransact(code, data, reply, flags); - } - - private static class Proxy implements android.net.INetworkPolicyManager { - private android.os.IBinder mRemote; - - Proxy(android.os.IBinder remote) { - mRemote = remote; - } - - @Override - public android.os.IBinder asBinder() { - return mRemote; - } - - /** - * Control UID policies. - */ - @Override - public void setUidPolicy(int uid, int policy) throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - try { - _data.writeInterfaceToken(DESCRIPTOR); - _data.writeInt(uid); - _data.writeInt(policy); - mRemote.transact(Stub.TRANSACTION_setUidPolicy, _data, _reply, 0); - _reply.readException(); - } finally { - _reply.recycle(); - _data.recycle(); - } - } - - @Override - public int getUidPolicy(int uid) throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - int _result; - try { - _data.writeInterfaceToken(DESCRIPTOR); - _data.writeInt(uid); - mRemote.transact(Stub.TRANSACTION_getUidPolicy, _data, _reply, 0); - _reply.readException(); - _result = _reply.readInt(); - } finally { - _reply.recycle(); - _data.recycle(); - } - return _result; - } - - @Override - public int[] getUidsWithPolicy(int policy) throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - int[] _result; - try { - _data.writeInterfaceToken(DESCRIPTOR); - _data.writeInt(policy); - mRemote.transact(Stub.TRANSACTION_getUidsWithPolicy, _data, _reply, 0); - _reply.readException(); - _result = _reply.createIntArray(); - } finally { - _reply.recycle(); - _data.recycle(); - } - return _result; - } - - @Override - public boolean isUidForeground(int uid) throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - boolean _result; - try { - _data.writeInterfaceToken(DESCRIPTOR); - _data.writeInt(uid); - mRemote.transact(Stub.TRANSACTION_isUidForeground, _data, _reply, 0); - _reply.readException(); - _result = (0 != _reply.readInt()); - } finally { - _reply.recycle(); - _data.recycle(); - } - return _result; - } - - @Override - public void registerListener(android.net.INetworkPolicyListener listener) throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - try { - _data.writeInterfaceToken(DESCRIPTOR); - _data.writeStrongBinder((((listener != null)) ? (listener.asBinder()) : (null))); - mRemote.transact(Stub.TRANSACTION_registerListener, _data, _reply, 0); - _reply.readException(); - } finally { - _reply.recycle(); - _data.recycle(); - } - } - - @Override - public void unregisterListener(android.net.INetworkPolicyListener listener) throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - try { - _data.writeInterfaceToken(DESCRIPTOR); - _data.writeStrongBinder((((listener != null)) ? (listener.asBinder()) : (null))); - mRemote.transact(Stub.TRANSACTION_unregisterListener, _data, _reply, 0); - _reply.readException(); - } finally { - _reply.recycle(); - _data.recycle(); - } - } - - /** - * Control network policies atomically. - */ - @Override - public void setNetworkPolicies(android.net.NetworkPolicy[] policies) throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - try { - _data.writeInterfaceToken(DESCRIPTOR); - _data.writeTypedArray(policies, 0); - mRemote.transact(Stub.TRANSACTION_setNetworkPolicies, _data, _reply, 0); - _reply.readException(); - } finally { - _reply.recycle(); - _data.recycle(); - } - } - - @Override - public android.net.NetworkPolicy[] getNetworkPolicies() throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - android.net.NetworkPolicy[] _result; - try { - _data.writeInterfaceToken(DESCRIPTOR); - mRemote.transact(Stub.TRANSACTION_getNetworkPolicies, _data, _reply, 0); - _reply.readException(); - _result = _reply.createTypedArray(android.net.NetworkPolicy.CREATOR); - } finally { - _reply.recycle(); - _data.recycle(); - } - return _result; - } - - /** - * Snooze limit on policy matching given template. - */ - @Override - public void snoozeLimit(android.net.NetworkTemplate template) throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - try { - _data.writeInterfaceToken(DESCRIPTOR); - if ((template != null)) { - _data.writeInt(1); - template.writeToParcel(_data, 0); - } else { - _data.writeInt(0); - } - mRemote.transact(Stub.TRANSACTION_snoozeLimit, _data, _reply, 0); - _reply.readException(); - } finally { - _reply.recycle(); - _data.recycle(); - } - } - - /** - * Control if background data is restricted system-wide. - */ - @Override - public void setRestrictBackground(boolean restrictBackground) throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - try { - _data.writeInterfaceToken(DESCRIPTOR); - _data.writeInt(((restrictBackground) ? (1) : (0))); - mRemote.transact(Stub.TRANSACTION_setRestrictBackground, _data, _reply, 0); - _reply.readException(); - } finally { - _reply.recycle(); - _data.recycle(); - } - } - - @Override - public boolean getRestrictBackground() throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - boolean _result; - try { - _data.writeInterfaceToken(DESCRIPTOR); - mRemote.transact(Stub.TRANSACTION_getRestrictBackground, _data, _reply, 0); - _reply.readException(); - _result = (0 != _reply.readInt()); - } finally { - _reply.recycle(); - _data.recycle(); - } - return _result; - } - - @Override - public android.net.NetworkQuotaInfo getNetworkQuotaInfo(android.net.NetworkState state) throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - android.net.NetworkQuotaInfo _result; - try { - _data.writeInterfaceToken(DESCRIPTOR); - if ((state != null)) { - _data.writeInt(1); - state.writeToParcel(_data, 0); - } else { - _data.writeInt(0); - } - mRemote.transact(Stub.TRANSACTION_getNetworkQuotaInfo, _data, _reply, 0); - _reply.readException(); - if ((0 != _reply.readInt())) { - _result = android.net.NetworkQuotaInfo.CREATOR.createFromParcel(_reply); - } else { - _result = null; - } - } finally { - _reply.recycle(); - _data.recycle(); - } - return _result; - } - - @Override - public boolean isNetworkMetered(android.net.NetworkState state) throws android.os.RemoteException { - android.os.Parcel _data = android.os.Parcel.obtain(); - android.os.Parcel _reply = android.os.Parcel.obtain(); - boolean _result; - try { - _data.writeInterfaceToken(DESCRIPTOR); - if ((state != null)) { - _data.writeInt(1); - state.writeToParcel(_data, 0); - } else { - _data.writeInt(0); - } - mRemote.transact(Stub.TRANSACTION_isNetworkMetered, _data, _reply, 0); - _reply.readException(); - _result = (0 != _reply.readInt()); - } finally { - _reply.recycle(); - _data.recycle(); - } - return _result; - } - } - - static final int TRANSACTION_setUidPolicy = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); - static final int TRANSACTION_getUidPolicy = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1); - static final int TRANSACTION_getUidsWithPolicy = (android.os.IBinder.FIRST_CALL_TRANSACTION + 2); - static final int TRANSACTION_isUidForeground = (android.os.IBinder.FIRST_CALL_TRANSACTION + 3); - static final int TRANSACTION_registerListener = (android.os.IBinder.FIRST_CALL_TRANSACTION + 4); - static final int TRANSACTION_unregisterListener = (android.os.IBinder.FIRST_CALL_TRANSACTION + 5); - static final int TRANSACTION_setNetworkPolicies = (android.os.IBinder.FIRST_CALL_TRANSACTION + 6); - static final int TRANSACTION_getNetworkPolicies = (android.os.IBinder.FIRST_CALL_TRANSACTION + 7); - static final int TRANSACTION_snoozeLimit = (android.os.IBinder.FIRST_CALL_TRANSACTION + 8); - static final int TRANSACTION_setRestrictBackground = (android.os.IBinder.FIRST_CALL_TRANSACTION + 9); - static final int TRANSACTION_getRestrictBackground = (android.os.IBinder.FIRST_CALL_TRANSACTION + 10); - static final int TRANSACTION_getNetworkQuotaInfo = (android.os.IBinder.FIRST_CALL_TRANSACTION + 11); - static final int TRANSACTION_isNetworkMetered = (android.os.IBinder.FIRST_CALL_TRANSACTION + 12); - } - - /** - * Control UID policies. - */ - public void setUidPolicy(int uid, int policy) throws android.os.RemoteException; - - public int getUidPolicy(int uid) throws android.os.RemoteException; - - public int[] getUidsWithPolicy(int policy) throws android.os.RemoteException; - - public boolean isUidForeground(int uid) throws android.os.RemoteException; - - public void registerListener(android.net.INetworkPolicyListener listener) throws android.os.RemoteException; - - public void unregisterListener(android.net.INetworkPolicyListener listener) throws android.os.RemoteException; - - /** - * Control network policies atomically. - */ - public void setNetworkPolicies(android.net.NetworkPolicy[] policies) throws android.os.RemoteException; - - public android.net.NetworkPolicy[] getNetworkPolicies() throws android.os.RemoteException; - - /** - * Snooze limit on policy matching given template. - */ - public void snoozeLimit(android.net.NetworkTemplate template) throws android.os.RemoteException; - - /** - * Control if background data is restricted system-wide. - */ - public void setRestrictBackground(boolean restrictBackground) throws android.os.RemoteException; - - public boolean getRestrictBackground() throws android.os.RemoteException; - - public android.net.NetworkQuotaInfo getNetworkQuotaInfo(android.net.NetworkState state) throws android.os.RemoteException; - - public boolean isNetworkMetered(android.net.NetworkState state) throws android.os.RemoteException; -} diff --git a/library/src/main/java/android/net/LinkAddress.java b/library/src/main/java/android/net/LinkAddress.java deleted file mode 100644 index 21a5fe3f..00000000 --- a/library/src/main/java/android/net/LinkAddress.java +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Copyright (C) 2010 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.net; - -import android.os.Parcel; -import android.os.Parcelable; - -import java.net.Inet4Address; -import java.net.InetAddress; -import java.net.InterfaceAddress; -import java.net.UnknownHostException; - -/** - * Identifies an address of a network link - * - * @hide - */ -public class LinkAddress implements Parcelable { - /** - * IPv4 or IPv6 address. - */ - private final InetAddress address; - - /** - * Network prefix length - */ - private final int prefixLength; - - public LinkAddress(InetAddress address, int prefixLength) { - if (address == null || prefixLength < 0 || - ((address instanceof Inet4Address) && prefixLength > 32) || - (prefixLength > 128)) { - throw new IllegalArgumentException("Bad LinkAddress haloParams " + address + - prefixLength); - } - this.address = address; - this.prefixLength = prefixLength; - } - - public LinkAddress(InterfaceAddress interfaceAddress) { - this.address = interfaceAddress.getAddress(); - this.prefixLength = interfaceAddress.getNetworkPrefixLength(); - } - - @Override - public String toString() { - return (address == null ? "" : (address.getHostAddress() + "/" + prefixLength)); - } - - /** - * Compares this {@code LinkAddress} instance against the specified address - * in {@code obj}. Two addresses are equal if their InetAddress and prefixLength - * are equal - * - * @param obj the object to be tested for equality. - * @return {@code true} if both objects are equal, {@code false} otherwise. - */ - @Override - public boolean equals(Object obj) { - if (!(obj instanceof LinkAddress)) { - return false; - } - LinkAddress linkAddress = (LinkAddress) obj; - return this.address.equals(linkAddress.address) && - this.prefixLength == linkAddress.prefixLength; - } - - @Override - /* - * generate hashcode based on significant fields - */ - public int hashCode() { - return ((null == address) ? 0 : address.hashCode()) + prefixLength; - } - - /** - * Returns the InetAddress for this address. - */ - public InetAddress getAddress() { - return address; - } - - /** - * Get network prefix length - */ - public int getNetworkPrefixLength() { - return prefixLength; - } - - /** - * Implement the Parcelable interface - * - * @hide - */ - public int describeContents() { - return 0; - } - - /** - * Implement the Parcelable interface. - * - * @hide - */ - public void writeToParcel(Parcel dest, int flags) { - if (address != null) { - dest.writeByte((byte) 1); - dest.writeByteArray(address.getAddress()); - dest.writeInt(prefixLength); - } else { - dest.writeByte((byte) 0); - } - } - - /** - * Implement the Parcelable interface. - * - * @hide - */ - public static final CreatorType: TEXT
- *Owner can Init/Read
- */ - public static final String COLUMN_URI = "uri"; - - /** - * The name of the column containing application-specific data. - *Type: TEXT
- *Owner can Init/Read/Write
- */ - public static final String COLUMN_APP_DATA = "entity"; - - /** - * The name of the column containing the flags that indicates whether - * the initiating application is capable of verifying the integrity of - * the downloaded file. When this flag is set, the download manager - * performs downloads and reports success even in some situations where - * it can't guarantee that the download has completed (e.g. when doing - * a byte-range request without an ETag, or when it can't determine - * whether a download fully completed). - *Type: BOOLEAN
- *Owner can Init
- */ - public static final String COLUMN_NO_INTEGRITY = "no_integrity"; - - /** - * The name of the column containing the filename that the initiating - * application recommends. When possible, the download manager will attempt - * to use this filename, or a variation, as the actual name for the file. - *Type: TEXT
- *Owner can Init
- */ - public static final String COLUMN_FILE_NAME_HINT = "hint"; - - /** - * The name of the column containing the filename where the downloaded data - * was actually stored. - *Type: TEXT
- *Owner can Read
- */ - public static final String _DATA = "_data"; - - /** - * The name of the column containing the MIME type of the downloaded data. - *Type: TEXT
- *Owner can Init/Read
- */ - public static final String COLUMN_MIME_TYPE = "mimetype"; - - /** - * The name of the column containing the flag that controls the destination - * of the download. See the DESTINATION_* constants for a list of legal values. - *Type: INTEGER
- *Owner can Init
- */ - public static final String COLUMN_DESTINATION = "destination"; - - /** - * The name of the column containing the flags that controls whether the - * download is displayed by the UI. See the VISIBILITY_* constants for - * a list of legal values. - *Type: INTEGER
- *Owner can Init/Read/Write
- */ - public static final String COLUMN_VISIBILITY = "visibility"; - - /** - * The name of the column containing the current control state of the download. - * Applications can write to this to control (pause/resume) the download. - * the CONTROL_* constants for a list of legal values. - *Type: INTEGER
- *Owner can Read
- */ - public static final String COLUMN_CONTROL = "control"; - - /** - * The name of the column containing the current status of the download. - * Applications can read this to follow the progress of each download. See - * the STATUS_* constants for a list of legal values. - *Type: INTEGER
- *Owner can Read
- */ - public static final String COLUMN_STATUS = "status"; - - /** - * The name of the column containing the date at which some interesting - * status changed in the download. Stored as a System.currentTimeMillis() - * value. - *Type: BIGINT
- *Owner can Read
- */ - public static final String COLUMN_LAST_MODIFICATION = "lastmod"; - - /** - * The name of the column containing the package name of the application - * that initiating the download. The download manager will send - * notifications to a component in this package when the download completes. - *Type: TEXT
- *Owner can Init/Read
- */ - public static final String COLUMN_NOTIFICATION_PACKAGE = "notificationpackage"; - - /** - * The name of the column containing the component name of the class that - * will receive notifications associated with the download. The - * package/class combination is passed to - * Intent.setClassName(String,String). - *Type: TEXT
- *Owner can Init/Read
- */ - public static final String COLUMN_NOTIFICATION_CLASS = "notificationclass"; - - /** - * If extras are specified when requesting a download they will be provided in the intent that - * is sent to the specified class and package when a download has finished. - *Type: TEXT
- *Owner can Init
- */ - public static final String COLUMN_NOTIFICATION_EXTRAS = "notificationextras"; - - /** - * The name of the column contain the values of the cookie to be used for - * the download. This is used directly as the value for the Cookie: HTTP - * header that gets sent with the request. - *Type: TEXT
- *Owner can Init
- */ - public static final String COLUMN_COOKIE_DATA = "cookiedata"; - - /** - * The name of the column containing the user agent that the initiating - * application wants the download manager to use for this download. - *Type: TEXT
- *Owner can Init
- */ - public static final String COLUMN_USER_AGENT = "useragent"; - - /** - * The name of the column containing the referer (sic) that the initiating - * application wants the download manager to use for this download. - *Type: TEXT
- *Owner can Init
- */ - public static final String COLUMN_REFERER = "referer"; - - /** - * The name of the column containing the total size of the file being - * downloaded. - *Type: INTEGER
- *Owner can Read
- */ - public static final String COLUMN_TOTAL_BYTES = "total_bytes"; - - /** - * The name of the column containing the size of the part of the file that - * has been downloaded so far. - *Type: INTEGER
- *Owner can Read
- */ - public static final String COLUMN_CURRENT_BYTES = "current_bytes"; - - /** - * The name of the column where the initiating application can provide the - * UID of another application that is allowed to access this download. If - * multiple applications share the same UID, all those applications will be - * allowed to access this download. This column can be updated after the - * download is initiated. This requires the permission - * android.permission.ACCESS_DOWNLOAD_MANAGER_ADVANCED. - *Type: INTEGER
- *Owner can Init
- */ - public static final String COLUMN_OTHER_UID = "otheruid"; - - /** - * The name of the column where the initiating application can provided the - * title of this download. The title will be displayed ito the user in the - * list of downloads. - *Type: TEXT
- *Owner can Init/Read/Write
- */ - public static final String COLUMN_TITLE = "title"; - - /** - * The name of the column where the initiating application can provide the - * description of this download. The description will be displayed to the - * user in the list of downloads. - *Type: TEXT
- *Owner can Init/Read/Write
- */ - public static final String COLUMN_DESCRIPTION = "description"; - - /** - * The name of the column indicating whether the download was requesting through the public - * API. This controls some differences in behavior. - *Type: BOOLEAN
- *Owner can Init/Read
- */ - public static final String COLUMN_IS_PUBLIC_API = "is_public_api"; - - /** - * The name of the column holding a bitmask of allowed network types. This is only used for - * public API downloads. - *Type: INTEGER
- *Owner can Init/Read
- */ - public static final String COLUMN_ALLOWED_NETWORK_TYPES = "allowed_network_types"; - - /** - * The name of the column indicating whether roaming connections can be used. This is only - * used for public API downloads. - *Type: BOOLEAN
- *Owner can Init/Read
- */ - public static final String COLUMN_ALLOW_ROAMING = "allow_roaming"; - - /** - * The name of the column indicating whether metered connections can be used. This is only - * used for public API downloads. - *Type: BOOLEAN
- *Owner can Init/Read
- */ - public static final String COLUMN_ALLOW_METERED = "allow_metered"; - - /** - * Whether or not this download should be displayed in the system's Downloads UI. Defaults - * to true. - *Type: INTEGER
- *Owner can Init/Read
- */ - public static final String COLUMN_IS_VISIBLE_IN_DOWNLOADS_UI = "is_visible_in_downloads_ui"; - - /** - * If true, the user has confirmed that this download can proceed over the mobile network - * even though it exceeds the recommended maximum size. - *Type: BOOLEAN
- */ - public static final String COLUMN_BYPASS_RECOMMENDED_SIZE_LIMIT = - "bypass_recommended_size_limit"; - - /** - * Set to true if this download is deleted. It is completely removed from the database - * when MediaProvider database also deletes the metadata asociated with this downloaded file. - *Type: BOOLEAN
- *Owner can Read
- */ - public static final String COLUMN_DELETED = "deleted"; - - /** - * The URI to the corresponding entry in MediaProvider for this downloaded entry. It is - * used to delete the entries from MediaProvider database when it is deleted from the - * downloaded list. - *Type: TEXT
- *Owner can Read
- */ - public static final String COLUMN_MEDIAPROVIDER_URI = "mediaprovider_uri"; - - /** - * The column that is used to remember whether the media scanner was invoked. - * It can take the values: null or 0(not scanned), 1(scanned), 2 (not scannable). - *Type: TEXT
- */ - public static final String COLUMN_MEDIA_SCANNED = "scanned"; - - /** - * The column with errorMsg for a failed downloaded. - * Used only for debugging purposes. - *Type: TEXT
- */ - public static final String COLUMN_ERROR_MSG = "errorMsg"; - - /** - * This column stores the source of the last update to this row. - * This column is only for internal use. - * Valid values are indicated by LAST_UPDATESRC_* constants. - *Type: INT
- */ - public static final String COLUMN_LAST_UPDATESRC = "lastUpdateSrc"; - - /** - * default value for {@link #COLUMN_LAST_UPDATESRC}. - * This value is used when this column's value is not relevant. - */ - public static final int LAST_UPDATESRC_NOT_RELEVANT = 0; - - /** - * One of the values taken by {@link #COLUMN_LAST_UPDATESRC}. - * This value is used when the update is NOT to be relayed to the DownloadService - * (and thus spare DownloadService from scanning the database when this change occurs) - */ - public static final int LAST_UPDATESRC_DONT_NOTIFY_DOWNLOADSVC = 1; - - /* - * Lists the destinations that an application can specify for a download. - */ - - /** - * This download will be saved to the external storage. This is the - * default behavior, and should be used for any file that the user - * can freely access, copy, delete. Even with that destination, - * unencrypted DRM files are saved in secure internal storage. - * Downloads to the external destination only write files for which - * there is a registered handler. The resulting files are accessible - * by filename to all applications. - */ - public static final int DESTINATION_EXTERNAL = 0; - - /** - * This download will be saved to the download manager's private - * partition. This is the behavior used by applications that want to - * download private files that are used and deleted soon after they - * get downloaded. All file types are allowed, and only the initiating - * application can access the file (indirectly through a content - * provider). This requires the - * android.permission.ACCESS_DOWNLOAD_MANAGER_ADVANCED permission. - */ - public static final int DESTINATION_CACHE_PARTITION = 1; - - /** - * This download will be saved to the download manager's private - * partition and will be purged as necessary to make space. This is - * for private files (similar to CACHE_PARTITION) that aren't deleted - * immediately after they are used, and are kept around by the download - * manager as long as space is available. - */ - public static final int DESTINATION_CACHE_PARTITION_PURGEABLE = 2; - - /** - * This download will be saved to the download manager's private - * partition, as with DESTINATION_CACHE_PARTITION, but the download - * will not proceed if the user is on a roaming data connection. - */ - public static final int DESTINATION_CACHE_PARTITION_NOROAMING = 3; - - /** - * This download will be saved to the location given by the file URI in - * {@link #COLUMN_FILE_NAME_HINT}. - */ - public static final int DESTINATION_FILE_URI = 4; - - /** - * This download will be saved to the system cache ("/cache") - * partition. This option is only used by system apps and so it requires - * android.permission.ACCESS_CACHE_FILESYSTEM permission. - */ - public static final int DESTINATION_SYSTEMCACHE_PARTITION = 5; - - /** - * This download was completed by the caller (i.e., NOT downloadmanager) - * and caller wants to have this download displayed in Downloads App. - */ - public static final int DESTINATION_NON_DOWNLOADMANAGER_DOWNLOAD = 6; - - /** - * This download is allowed to run. - */ - public static final int CONTROL_RUN = 0; - - /** - * This download must pause at the first opportunity. - */ - public static final int CONTROL_PAUSED = 1; - - /* - * Lists the states that the download manager can set on a download - * to notify applications of the download progress. - * The codes follow the HTTP families:visibility
argument can be used to specific what the original
- * visibility should have been if it had not been made public or package-private for testing.
- * The default is to consider the element private.
- */
-@Retention(RetentionPolicy.SOURCE)
-public @interface VisibleForTesting {
- /**
- * Intended visibility if the element had not been made public or package-private for
- * testing.
- */
- enum Visibility {
- /**
- * The element should be considered protected.
- */
- PROTECTED,
- /**
- * The element should be considered package-private.
- */
- PACKAGE,
- /**
- * The element should be considered private.
- */
- PRIVATE
- }
-
- /**
- * Intended visibility if the element had not been made public or package-private for testing.
- * If not specified, one should assume the element originally intended to be private.
- */
- Visibility visibility() default Visibility.PRIVATE;
-}
diff --git a/library/src/main/java/com/android/internal/net/LegacyVpnInfo.java b/library/src/main/java/com/android/internal/net/LegacyVpnInfo.java
deleted file mode 100644
index a0d5695b..00000000
--- a/library/src/main/java/com/android/internal/net/LegacyVpnInfo.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright (C) 2011 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.net;
-
-import android.app.PendingIntent;
-import android.net.NetworkInfo;
-import android.os.Parcel;
-import android.os.Parcelable;
-import com.klinker.android.logger.Log;
-
-/**
- * A simple container used to carry information of the ongoing legacy VPN.
- * Internal use only.
- *
- * @hide
- */
-public class LegacyVpnInfo implements Parcelable {
- private static final String TAG = "LegacyVpnInfo";
-
- public static final int STATE_DISCONNECTED = 0;
- public static final int STATE_INITIALIZING = 1;
- public static final int STATE_CONNECTING = 2;
- public static final int STATE_CONNECTED = 3;
- public static final int STATE_TIMEOUT = 4;
- public static final int STATE_FAILED = 5;
-
- public String key;
- public int state = -1;
- public PendingIntent intent;
-
- @Override
- public int describeContents() {
- return 0;
- }
-
- @Override
- public void writeToParcel(Parcel out, int flags) {
- out.writeString(key);
- out.writeInt(state);
- out.writeParcelable(intent, flags);
- }
-
- public static final Parcelable.Creators
of the first character
- * after limit
septets have been reached, starting at
- * index start
. This is used when dividing messages
- * into units within the SMS message size limit.
- *
- * @param s source string
- * @param start index of where to start counting septets
- * @param limit maximum septets to include,
- * e.g. MAX_USER_DATA_SEPTETS
- * @param langTable the 7 bit character table to use (0 for default GSM 7-bit alphabet)
- * @param langShiftTable the 7 bit shift table to use (0 for default GSM extension table)
- * @return index of first character that won't fit, or the length
- * of the entire string if everything fits
- */
- public static int
- findGsmSeptetLimitIndex(String s, int start, int limit, int langTable, int langShiftTable) {
- int accumulator = 0;
- int size = s.length();
-
- SparseIntArray charToLangTable = sCharsToGsmTables[langTable];
- SparseIntArray charToLangShiftTable = sCharsToShiftTables[langShiftTable];
- for (int i = start; i < size; i++) {
- int encodedSeptet = charToLangTable.get(s.charAt(i), -1);
- if (encodedSeptet == -1) {
- encodedSeptet = charToLangShiftTable.get(s.charAt(i), -1);
- if (encodedSeptet == -1) {
- // char not found, assume we're replacing with space
- accumulator++;
- } else {
- accumulator += 2; // escape character + shift table index
- }
- } else {
- accumulator++;
- }
- if (accumulator > limit) {
- return i;
- }
- }
- return size;
- }
-
- /**
- * Modify the array of enabled national language single shift tables for SMS
- * encoding. This is used for unit testing, but could also be used to
- * modify the enabled encodings based on the active MCC/MNC, for example.
- *
- * @param tables the new list of enabled single shift tables
- */
- static synchronized void setEnabledSingleShiftTables(int[] tables) {
- sEnabledSingleShiftTables = tables;
- sDisableCountryEncodingCheck = true;
-
- if (tables.length > 0) {
- sHighestEnabledSingleShiftCode = tables[tables.length - 1];
- } else {
- sHighestEnabledSingleShiftCode = 0;
- }
- }
-
- /**
- * Modify the array of enabled national language locking shift tables for SMS
- * encoding. This is used for unit testing, but could also be used to
- * modify the enabled encodings based on the active MCC/MNC, for example.
- *
- * @param tables the new list of enabled locking shift tables
- */
- static synchronized void setEnabledLockingShiftTables(int[] tables) {
- sEnabledLockingShiftTables = tables;
- sDisableCountryEncodingCheck = true;
- }
-
- /**
- * Return the array of enabled national language single shift tables for SMS
- * encoding. This is used for unit testing. The returned array is not a copy, so
- * the caller should be careful not to modify it.
- *
- * @return the list of enabled single shift tables
- */
- static synchronized int[] getEnabledSingleShiftTables() {
- return sEnabledSingleShiftTables;
- }
-
- /**
- * Return the array of enabled national language locking shift tables for SMS
- * encoding. This is used for unit testing. The returned array is not a copy, so
- * the caller should be careful not to modify it.
- *
- * @return the list of enabled locking shift tables
- */
- static synchronized int[] getEnabledLockingShiftTables() {
- return sEnabledLockingShiftTables;
- }
-
- /**
- * Enable country-specific language tables from MCC-specific overlays.
- *
- * @context the context to use to get the TelephonyManager
- */
- private static void enableCountrySpecificEncodings() {
- // See comments in frameworks/base/core/res/res/values/config.xml for allowed values
- sEnabledSingleShiftTables = new int[1];
- sEnabledLockingShiftTables = new int[1];
-
- if (sEnabledSingleShiftTables.length > 0) {
- sHighestEnabledSingleShiftCode =
- sEnabledSingleShiftTables[sEnabledSingleShiftTables.length - 1];
- } else {
- sHighestEnabledSingleShiftCode = 0;
- }
- }
-
- /**
- * Reverse mapping from Unicode characters to indexes into language tables.
- */
- private static final SparseIntArray[] sCharsToGsmTables;
-
- /**
- * Reverse mapping from Unicode characters to indexes into language shift tables.
- */
- private static final SparseIntArray[] sCharsToShiftTables;
-
- /**
- * OEM configured list of enabled national language single shift tables for encoding.
- */
- private static int[] sEnabledSingleShiftTables;
-
- /**
- * OEM configured list of enabled national language locking shift tables for encoding.
- */
- private static int[] sEnabledLockingShiftTables;
-
- /**
- * Highest language code to include in array of single shift counters.
- */
- private static int sHighestEnabledSingleShiftCode;
-
- /**
- * Flag to bypass check for country-specific overlays (for test cases only).
- */
- private static boolean sDisableCountryEncodingCheck = false;
-
- /**
- * Septet counter for a specific locking shift table and all of
- * the single shift tables that it can be paired with.
- */
- private static class LanguagePairCount {
- final int languageCode;
- final int[] septetCounts;
- final int[] unencodableCounts;
-
- LanguagePairCount(int code) {
- this.languageCode = code;
- int maxSingleShiftCode = sHighestEnabledSingleShiftCode;
- septetCounts = new int[maxSingleShiftCode + 1];
- unencodableCounts = new int[maxSingleShiftCode + 1];
- // set counters for disabled single shift tables to -1
- // (GSM default extension table index 0 is always enabled)
- for (int i = 1, tableOffset = 0; i <= maxSingleShiftCode; i++) {
- if (sEnabledSingleShiftTables[tableOffset] == i) {
- tableOffset++;
- } else {
- septetCounts[i] = -1; // disabled
- }
- }
- // exclude Turkish locking + Turkish single shift table and
- // Portuguese locking + Spanish single shift table (these
- // combinations will never be optimal for any input).
- if (code == 1 && maxSingleShiftCode >= 1) {
- septetCounts[1] = -1; // Turkish + Turkish
- } else if (code == 3 && maxSingleShiftCode >= 2) {
- septetCounts[2] = -1; // Portuguese + Spanish
- }
- }
- }
-
- /**
- * GSM default 7 bit alphabet plus national language locking shift character tables.
- * Comment lines above strings indicate the lower four bits of the table position.
- */
- private static final String[] sLanguageTables = {
- /* 3GPP TS 23.038 V9.1.1 section 6.2.1 - GSM 7 bit Default Alphabet
- 01.....23.....4.....5.....6.....7.....8.....9.....A.B.....C.....D.E.....F.....0.....1 */
- "@\u00a3$\u00a5\u00e8\u00e9\u00f9\u00ec\u00f2\u00c7\n\u00d8\u00f8\r\u00c5\u00e5\u0394_"
- // 2.....3.....4.....5.....6.....7.....8.....9.....A.....B.....C.....D.....E.....
- + "\u03a6\u0393\u039b\u03a9\u03a0\u03a8\u03a3\u0398\u039e\uffff\u00c6\u00e6\u00df"
- // F.....012.34.....56789ABCDEF0123456789ABCDEF0.....123456789ABCDEF0123456789A
- + "\u00c9 !\"#\u00a4%&'()*+,-./0123456789:;<=>?\u00a1ABCDEFGHIJKLMNOPQRSTUVWXYZ"
- // B.....C.....D.....E.....F.....0.....123456789ABCDEF0123456789AB.....C.....D.....
- + "\u00c4\u00d6\u00d1\u00dc\u00a7\u00bfabcdefghijklmnopqrstuvwxyz\u00e4\u00f6\u00f1"
- // E.....F.....
- + "\u00fc\u00e0",
-
- /* A.3.1 Turkish National Language Locking Shift Table
- 01.....23.....4.....5.....6.....7.....8.....9.....A.B.....C.....D.E.....F.....0.....1 */
- "@\u00a3$\u00a5\u20ac\u00e9\u00f9\u0131\u00f2\u00c7\n\u011e\u011f\r\u00c5\u00e5\u0394_"
- // 2.....3.....4.....5.....6.....7.....8.....9.....A.....B.....C.....D.....E.....
- + "\u03a6\u0393\u039b\u03a9\u03a0\u03a8\u03a3\u0398\u039e\uffff\u015e\u015f\u00df"
- // F.....012.34.....56789ABCDEF0123456789ABCDEF0.....123456789ABCDEF0123456789A
- + "\u00c9 !\"#\u00a4%&'()*+,-./0123456789:;<=>?\u0130ABCDEFGHIJKLMNOPQRSTUVWXYZ"
- // B.....C.....D.....E.....F.....0.....123456789ABCDEF0123456789AB.....C.....D.....
- + "\u00c4\u00d6\u00d1\u00dc\u00a7\u00e7abcdefghijklmnopqrstuvwxyz\u00e4\u00f6\u00f1"
- // E.....F.....
- + "\u00fc\u00e0",
-
- /* A.3.2 Void (no locking shift table for Spanish) */
- "",
-
- /* A.3.3 Portuguese National Language Locking Shift Table
- 01.....23.....4.....5.....6.....7.....8.....9.....A.B.....C.....D.E.....F.....0.....1 */
- "@\u00a3$\u00a5\u00ea\u00e9\u00fa\u00ed\u00f3\u00e7\n\u00d4\u00f4\r\u00c1\u00e1\u0394_"
- // 2.....3.....4.....5.....67.8.....9.....AB.....C.....D.....E.....F.....012.34.....
- + "\u00aa\u00c7\u00c0\u221e^\\\u20ac\u00d3|\uffff\u00c2\u00e2\u00ca\u00c9 !\"#\u00ba"
- // 56789ABCDEF0123456789ABCDEF0.....123456789ABCDEF0123456789AB.....C.....D.....E.....
- + "%&'()*+,-./0123456789:;<=>?\u00cdABCDEFGHIJKLMNOPQRSTUVWXYZ\u00c3\u00d5\u00da\u00dc"
- // F.....0123456789ABCDEF0123456789AB.....C.....DE.....F.....
- + "\u00a7~abcdefghijklmnopqrstuvwxyz\u00e3\u00f5`\u00fc\u00e0",
-
- /* A.3.4 Bengali National Language Locking Shift Table
- 0.....1.....2.....3.....4.....5.....6.....7.....8.....9.....A.B.....CD.EF.....0..... */
- "\u0981\u0982\u0983\u0985\u0986\u0987\u0988\u0989\u098a\u098b\n\u098c \r \u098f\u0990"
- // 123.....4.....5.....6.....7.....8.....9.....A.....B.....C.....D.....E.....F.....
- + " \u0993\u0994\u0995\u0996\u0997\u0998\u0999\u099a\uffff\u099b\u099c\u099d\u099e"
- // 012.....3.....4.....5.....6.....7.....89A.....B.....CD.....EF.....0123456789ABC
- + " !\u099f\u09a0\u09a1\u09a2\u09a3\u09a4)(\u09a5\u09a6,\u09a7.\u09a80123456789:; "
- // D.....E.....F0.....1.....2.....3.....4.....56.....789A.....B.....C.....D.....
- + "\u09aa\u09ab?\u09ac\u09ad\u09ae\u09af\u09b0 \u09b2 \u09b6\u09b7\u09b8\u09b9"
- // E.....F.....0.....1.....2.....3.....4.....5.....6.....789.....A.....BCD.....E.....
- + "\u09bc\u09bd\u09be\u09bf\u09c0\u09c1\u09c2\u09c3\u09c4 \u09c7\u09c8 \u09cb\u09cc"
- // F.....0.....123456789ABCDEF0123456789AB.....C.....D.....E.....F.....
- + "\u09cd\u09ceabcdefghijklmnopqrstuvwxyz\u09d7\u09dc\u09dd\u09f0\u09f1",
-
- /* A.3.5 Gujarati National Language Locking Shift Table
- 0.....1.....2.....3.....4.....5.....6.....7.....8.....9.....A.B.....C.....D.EF.....0.....*/
- "\u0a81\u0a82\u0a83\u0a85\u0a86\u0a87\u0a88\u0a89\u0a8a\u0a8b\n\u0a8c\u0a8d\r \u0a8f\u0a90"
- // 1.....23.....4.....5.....6.....7.....8.....9.....A.....B.....C.....D.....E.....
- + "\u0a91 \u0a93\u0a94\u0a95\u0a96\u0a97\u0a98\u0a99\u0a9a\uffff\u0a9b\u0a9c\u0a9d"
- // F.....012.....3.....4.....5.....6.....7.....89A.....B.....CD.....EF.....0123456789AB
- + "\u0a9e !\u0a9f\u0aa0\u0aa1\u0aa2\u0aa3\u0aa4)(\u0aa5\u0aa6,\u0aa7.\u0aa80123456789:;"
- // CD.....E.....F0.....1.....2.....3.....4.....56.....7.....89.....A.....B.....C.....
- + " \u0aaa\u0aab?\u0aac\u0aad\u0aae\u0aaf\u0ab0 \u0ab2\u0ab3 \u0ab5\u0ab6\u0ab7\u0ab8"
- // D.....E.....F.....0.....1.....2.....3.....4.....5.....6.....7.....89.....A.....
- + "\u0ab9\u0abc\u0abd\u0abe\u0abf\u0ac0\u0ac1\u0ac2\u0ac3\u0ac4\u0ac5 \u0ac7\u0ac8"
- // B.....CD.....E.....F.....0.....123456789ABCDEF0123456789AB.....C.....D.....E.....
- + "\u0ac9 \u0acb\u0acc\u0acd\u0ad0abcdefghijklmnopqrstuvwxyz\u0ae0\u0ae1\u0ae2\u0ae3"
- // F.....
- + "\u0af1",
-
- /* A.3.6 Hindi National Language Locking Shift Table
- 0.....1.....2.....3.....4.....5.....6.....7.....8.....9.....A.B.....C.....D.E.....F.....*/
- "\u0901\u0902\u0903\u0905\u0906\u0907\u0908\u0909\u090a\u090b\n\u090c\u090d\r\u090e\u090f"
- // 0.....1.....2.....3.....4.....5.....6.....7.....8.....9.....A.....B.....C.....D.....
- + "\u0910\u0911\u0912\u0913\u0914\u0915\u0916\u0917\u0918\u0919\u091a\uffff\u091b\u091c"
- // E.....F.....012.....3.....4.....5.....6.....7.....89A.....B.....CD.....EF.....012345
- + "\u091d\u091e !\u091f\u0920\u0921\u0922\u0923\u0924)(\u0925\u0926,\u0927.\u0928012345"
- // 6789ABC.....D.....E.....F0.....1.....2.....3.....4.....5.....6.....7.....8.....
- + "6789:;\u0929\u092a\u092b?\u092c\u092d\u092e\u092f\u0930\u0931\u0932\u0933\u0934"
- // 9.....A.....B.....C.....D.....E.....F.....0.....1.....2.....3.....4.....5.....6.....
- + "\u0935\u0936\u0937\u0938\u0939\u093c\u093d\u093e\u093f\u0940\u0941\u0942\u0943\u0944"
- // 7.....8.....9.....A.....B.....C.....D.....E.....F.....0.....123456789ABCDEF012345678
- + "\u0945\u0946\u0947\u0948\u0949\u094a\u094b\u094c\u094d\u0950abcdefghijklmnopqrstuvwx"
- // 9AB.....C.....D.....E.....F.....
- + "yz\u0972\u097b\u097c\u097e\u097f",
-
- /* A.3.7 Kannada National Language Locking Shift Table
- NOTE: TS 23.038 V9.1.1 shows code 0x24 as \u0caa, corrected to \u0ca1 (typo)
- 01.....2.....3.....4.....5.....6.....7.....8.....9.....A.B.....CD.E.....F.....0.....1 */
- " \u0c82\u0c83\u0c85\u0c86\u0c87\u0c88\u0c89\u0c8a\u0c8b\n\u0c8c \r\u0c8e\u0c8f\u0c90 "
- // 2.....3.....4.....5.....6.....7.....8.....9.....A.....B.....C.....D.....E.....F.....
- + "\u0c92\u0c93\u0c94\u0c95\u0c96\u0c97\u0c98\u0c99\u0c9a\uffff\u0c9b\u0c9c\u0c9d\u0c9e"
- // 012.....3.....4.....5.....6.....7.....89A.....B.....CD.....EF.....0123456789ABC
- + " !\u0c9f\u0ca0\u0ca1\u0ca2\u0ca3\u0ca4)(\u0ca5\u0ca6,\u0ca7.\u0ca80123456789:; "
- // D.....E.....F0.....1.....2.....3.....4.....5.....6.....7.....89.....A.....B.....
- + "\u0caa\u0cab?\u0cac\u0cad\u0cae\u0caf\u0cb0\u0cb1\u0cb2\u0cb3 \u0cb5\u0cb6\u0cb7"
- // C.....D.....E.....F.....0.....1.....2.....3.....4.....5.....6.....78.....9.....
- + "\u0cb8\u0cb9\u0cbc\u0cbd\u0cbe\u0cbf\u0cc0\u0cc1\u0cc2\u0cc3\u0cc4 \u0cc6\u0cc7"
- // A.....BC.....D.....E.....F.....0.....123456789ABCDEF0123456789AB.....C.....D.....
- + "\u0cc8 \u0cca\u0ccb\u0ccc\u0ccd\u0cd5abcdefghijklmnopqrstuvwxyz\u0cd6\u0ce0\u0ce1"
- // E.....F.....
- + "\u0ce2\u0ce3",
-
- /* A.3.8 Malayalam National Language Locking Shift Table
- 01.....2.....3.....4.....5.....6.....7.....8.....9.....A.B.....CD.E.....F.....0.....1 */
- " \u0d02\u0d03\u0d05\u0d06\u0d07\u0d08\u0d09\u0d0a\u0d0b\n\u0d0c \r\u0d0e\u0d0f\u0d10 "
- // 2.....3.....4.....5.....6.....7.....8.....9.....A.....B.....C.....D.....E.....F.....
- + "\u0d12\u0d13\u0d14\u0d15\u0d16\u0d17\u0d18\u0d19\u0d1a\uffff\u0d1b\u0d1c\u0d1d\u0d1e"
- // 012.....3.....4.....5.....6.....7.....89A.....B.....CD.....EF.....0123456789ABC
- + " !\u0d1f\u0d20\u0d21\u0d22\u0d23\u0d24)(\u0d25\u0d26,\u0d27.\u0d280123456789:; "
- // D.....E.....F0.....1.....2.....3.....4.....5.....6.....7.....8.....9.....A.....
- + "\u0d2a\u0d2b?\u0d2c\u0d2d\u0d2e\u0d2f\u0d30\u0d31\u0d32\u0d33\u0d34\u0d35\u0d36"
- // B.....C.....D.....EF.....0.....1.....2.....3.....4.....5.....6.....78.....9.....
- + "\u0d37\u0d38\u0d39 \u0d3d\u0d3e\u0d3f\u0d40\u0d41\u0d42\u0d43\u0d44 \u0d46\u0d47"
- // A.....BC.....D.....E.....F.....0.....123456789ABCDEF0123456789AB.....C.....D.....
- + "\u0d48 \u0d4a\u0d4b\u0d4c\u0d4d\u0d57abcdefghijklmnopqrstuvwxyz\u0d60\u0d61\u0d62"
- // E.....F.....
- + "\u0d63\u0d79",
-
- /* A.3.9 Oriya National Language Locking Shift Table
- 0.....1.....2.....3.....4.....5.....6.....7.....8.....9.....A.B.....CD.EF.....0.....12 */
- "\u0b01\u0b02\u0b03\u0b05\u0b06\u0b07\u0b08\u0b09\u0b0a\u0b0b\n\u0b0c \r \u0b0f\u0b10 "
- // 3.....4.....5.....6.....7.....8.....9.....A.....B.....C.....D.....E.....F.....01
- + "\u0b13\u0b14\u0b15\u0b16\u0b17\u0b18\u0b19\u0b1a\uffff\u0b1b\u0b1c\u0b1d\u0b1e !"
- // 2.....3.....4.....5.....6.....7.....89A.....B.....CD.....EF.....0123456789ABCD.....
- + "\u0b1f\u0b20\u0b21\u0b22\u0b23\u0b24)(\u0b25\u0b26,\u0b27.\u0b280123456789:; \u0b2a"
- // E.....F0.....1.....2.....3.....4.....56.....7.....89.....A.....B.....C.....D.....
- + "\u0b2b?\u0b2c\u0b2d\u0b2e\u0b2f\u0b30 \u0b32\u0b33 \u0b35\u0b36\u0b37\u0b38\u0b39"
- // E.....F.....0.....1.....2.....3.....4.....5.....6.....789.....A.....BCD.....E.....
- + "\u0b3c\u0b3d\u0b3e\u0b3f\u0b40\u0b41\u0b42\u0b43\u0b44 \u0b47\u0b48 \u0b4b\u0b4c"
- // F.....0.....123456789ABCDEF0123456789AB.....C.....D.....E.....F.....
- + "\u0b4d\u0b56abcdefghijklmnopqrstuvwxyz\u0b57\u0b60\u0b61\u0b62\u0b63",
-
- /* A.3.10 Punjabi National Language Locking Shift Table
- 0.....1.....2.....3.....4.....5.....6.....7.....8.....9A.BCD.EF.....0.....123.....4.....*/
- "\u0a01\u0a02\u0a03\u0a05\u0a06\u0a07\u0a08\u0a09\u0a0a \n \r \u0a0f\u0a10 \u0a13\u0a14"
- // 5.....6.....7.....8.....9.....A.....B.....C.....D.....E.....F.....012.....3.....
- + "\u0a15\u0a16\u0a17\u0a18\u0a19\u0a1a\uffff\u0a1b\u0a1c\u0a1d\u0a1e !\u0a1f\u0a20"
- // 4.....5.....6.....7.....89A.....B.....CD.....EF.....0123456789ABCD.....E.....F0.....
- + "\u0a21\u0a22\u0a23\u0a24)(\u0a25\u0a26,\u0a27.\u0a280123456789:; \u0a2a\u0a2b?\u0a2c"
- // 1.....2.....3.....4.....56.....7.....89.....A.....BC.....D.....E.....F0.....1.....
- + "\u0a2d\u0a2e\u0a2f\u0a30 \u0a32\u0a33 \u0a35\u0a36 \u0a38\u0a39\u0a3c \u0a3e\u0a3f"
- // 2.....3.....4.....56789.....A.....BCD.....E.....F.....0.....123456789ABCDEF012345678
- + "\u0a40\u0a41\u0a42 \u0a47\u0a48 \u0a4b\u0a4c\u0a4d\u0a51abcdefghijklmnopqrstuvwx"
- // 9AB.....C.....D.....E.....F.....
- + "yz\u0a70\u0a71\u0a72\u0a73\u0a74",
-
- /* A.3.11 Tamil National Language Locking Shift Table
- 01.....2.....3.....4.....5.....6.....7.....8.....9A.BCD.E.....F.....0.....12.....3..... */
- " \u0b82\u0b83\u0b85\u0b86\u0b87\u0b88\u0b89\u0b8a \n \r\u0b8e\u0b8f\u0b90 \u0b92\u0b93"
- // 4.....5.....6789.....A.....B.....CD.....EF.....012.....3456.....7.....89ABCDEF.....
- + "\u0b94\u0b95 \u0b99\u0b9a\uffff \u0b9c \u0b9e !\u0b9f \u0ba3\u0ba4)( , .\u0ba8"
- // 0123456789ABC.....D.....EF012.....3.....4.....5.....6.....7.....8.....9.....A.....
- + "0123456789:;\u0ba9\u0baa ? \u0bae\u0baf\u0bb0\u0bb1\u0bb2\u0bb3\u0bb4\u0bb5\u0bb6"
- // B.....C.....D.....EF0.....1.....2.....3.....4.....5678.....9.....A.....BC.....D.....
- + "\u0bb7\u0bb8\u0bb9 \u0bbe\u0bbf\u0bc0\u0bc1\u0bc2 \u0bc6\u0bc7\u0bc8 \u0bca\u0bcb"
- // E.....F.....0.....123456789ABCDEF0123456789AB.....C.....D.....E.....F.....
- + "\u0bcc\u0bcd\u0bd0abcdefghijklmnopqrstuvwxyz\u0bd7\u0bf0\u0bf1\u0bf2\u0bf9",
-
- /* A.3.12 Telugu National Language Locking Shift Table
- 0.....1.....2.....3.....4.....5.....6.....7.....8.....9.....A.B.....CD.E.....F.....0.....*/
- "\u0c01\u0c02\u0c03\u0c05\u0c06\u0c07\u0c08\u0c09\u0c0a\u0c0b\n\u0c0c \r\u0c0e\u0c0f\u0c10"
- // 12.....3.....4.....5.....6.....7.....8.....9.....A.....B.....C.....D.....E.....
- + " \u0c12\u0c13\u0c14\u0c15\u0c16\u0c17\u0c18\u0c19\u0c1a\uffff\u0c1b\u0c1c\u0c1d"
- // F.....012.....3.....4.....5.....6.....7.....89A.....B.....CD.....EF.....0123456789AB
- + "\u0c1e !\u0c1f\u0c20\u0c21\u0c22\u0c23\u0c24)(\u0c25\u0c26,\u0c27.\u0c280123456789:;"
- // CD.....E.....F0.....1.....2.....3.....4.....5.....6.....7.....89.....A.....B.....
- + " \u0c2a\u0c2b?\u0c2c\u0c2d\u0c2e\u0c2f\u0c30\u0c31\u0c32\u0c33 \u0c35\u0c36\u0c37"
- // C.....D.....EF.....0.....1.....2.....3.....4.....5.....6.....78.....9.....A.....B
- + "\u0c38\u0c39 \u0c3d\u0c3e\u0c3f\u0c40\u0c41\u0c42\u0c43\u0c44 \u0c46\u0c47\u0c48 "
- // C.....D.....E.....F.....0.....123456789ABCDEF0123456789AB.....C.....D.....E.....
- + "\u0c4a\u0c4b\u0c4c\u0c4d\u0c55abcdefghijklmnopqrstuvwxyz\u0c56\u0c60\u0c61\u0c62"
- // F.....
- + "\u0c63",
-
- /* A.3.13 Urdu National Language Locking Shift Table
- 0.....1.....2.....3.....4.....5.....6.....7.....8.....9.....A.B.....C.....D.E.....F.....*/
- "\u0627\u0622\u0628\u067b\u0680\u067e\u06a6\u062a\u06c2\u067f\n\u0679\u067d\r\u067a\u067c"
- // 0.....1.....2.....3.....4.....5.....6.....7.....8.....9.....A.....B.....C.....D.....
- + "\u062b\u062c\u0681\u0684\u0683\u0685\u0686\u0687\u062d\u062e\u062f\uffff\u068c\u0688"
- // E.....F.....012.....3.....4.....5.....6.....7.....89A.....B.....CD.....EF.....012345
- + "\u0689\u068a !\u068f\u068d\u0630\u0631\u0691\u0693)(\u0699\u0632,\u0696.\u0698012345"
- // 6789ABC.....D.....E.....F0.....1.....2.....3.....4.....5.....6.....7.....8.....
- + "6789:;\u069a\u0633\u0634?\u0635\u0636\u0637\u0638\u0639\u0641\u0642\u06a9\u06aa"
- // 9.....A.....B.....C.....D.....E.....F.....0.....1.....2.....3.....4.....5.....6.....
- + "\u06ab\u06af\u06b3\u06b1\u0644\u0645\u0646\u06ba\u06bb\u06bc\u0648\u06c4\u06d5\u06c1"
- // 7.....8.....9.....A.....B.....C.....D.....E.....F.....0.....123456789ABCDEF012345678
- + "\u06be\u0621\u06cc\u06d0\u06d2\u064d\u0650\u064f\u0657\u0654abcdefghijklmnopqrstuvwx"
- // 9AB.....C.....D.....E.....F.....
- + "yz\u0655\u0651\u0653\u0656\u0670"
- };
-
- /**
- * GSM default extension table plus national language single shift character tables.
- */
- private static final String[] sLanguageShiftTables = new String[]{
- /* 6.2.1.1 GSM 7 bit Default Alphabet Extension Table
- 0123456789A.....BCDEF0123456789ABCDEF0123456789ABCDEF.0123456789ABCDEF0123456789ABCDEF */
- " \u000c ^ {} \\ [~] | "
- // 0123456789ABCDEF012345.....6789ABCDEF0123456789ABCDEF
- + " \u20ac ",
-
- /* A.2.1 Turkish National Language Single Shift Table
- 0123456789A.....BCDEF0123456789ABCDEF0123456789ABCDEF.0123456789ABCDEF01234567.....8 */
- " \u000c ^ {} \\ [~] | \u011e "
- // 9.....ABCDEF0123.....456789ABCDEF0123.....45.....67.....89.....ABCDEF0123.....
- + "\u0130 \u015e \u00e7 \u20ac \u011f \u0131 \u015f"
- // 456789ABCDEF
- + " ",
-
- /* A.2.2 Spanish National Language Single Shift Table
- 0123456789.....A.....BCDEF0123456789ABCDEF0123456789ABCDEF.0123456789ABCDEF01.....23 */
- " \u00e7\u000c ^ {} \\ [~] |\u00c1 "
- // 456789.....ABCDEF.....012345.....6789ABCDEF01.....2345.....6789.....ABCDEF.....012
- + " \u00cd \u00d3 \u00da \u00e1 \u20ac \u00ed \u00f3 "
- // 345.....6789ABCDEF
- + " \u00fa ",
-
- /* A.2.3 Portuguese National Language Single Shift Table
- 012345.....6789.....A.....B.....C.....DE.....F.....012.....3.....45.....6.....7.....8....*/
- " \u00ea \u00e7\u000c\u00d4\u00f4 \u00c1\u00e1 \u03a6\u0393^\u03a9\u03a0\u03a8\u03a3"
- // 9.....ABCDEF.....0123456789ABCDEF.0123456789ABCDEF01.....23456789.....ABCDE
- + "\u0398 \u00ca {} \\ [~] |\u00c0 \u00cd "
- // F.....012345.....6789AB.....C.....DEF01.....2345.....6789.....ABCDEF.....01234
- + "\u00d3 \u00da \u00c3\u00d5 \u00c2 \u20ac \u00ed \u00f3 "
- // 5.....6789AB.....C.....DEF.....
- + "\u00fa \u00e3\u00f5 \u00e2",
-
- /* A.2.4 Bengali National Language Single Shift Table
- 01.....23.....4.....5.6.....789A.....BCDEF0123.....45.....6789.....A.....BC.....D..... */
- "@\u00a3$\u00a5\u00bf\"\u00a4%&'\u000c*+ -/<=>\u00a1^\u00a1_#*\u09e6\u09e7 \u09e8\u09e9"
- // E.....F.....0.....1.....2.....3.....4.....5.....6.....7.....89A.....B.....C.....
- + "\u09ea\u09eb\u09ec\u09ed\u09ee\u09ef\u09df\u09e0\u09e1\u09e2{}\u09e3\u09f2\u09f3"
- // D.....E.....F.0.....1.....2.....3.....4.....56789ABCDEF0123456789ABCDEF
- + "\u09f4\u09f5\\\u09f6\u09f7\u09f8\u09f9\u09fa [~] |ABCDEFGHIJKLMNO"
- // 0123456789ABCDEF012345.....6789ABCDEF0123456789ABCDEF
- + "PQRSTUVWXYZ \u20ac ",
-
- /* A.2.5 Gujarati National Language Single Shift Table
- 01.....23.....4.....5.6.....789A.....BCDEF0123.....45.....6789.....A.....BC.....D..... */
- "@\u00a3$\u00a5\u00bf\"\u00a4%&'\u000c*+ -/<=>\u00a1^\u00a1_#*\u0964\u0965 \u0ae6\u0ae7"
- // E.....F.....0.....1.....2.....3.....4.....5.....6789ABCDEF.0123456789ABCDEF
- + "\u0ae8\u0ae9\u0aea\u0aeb\u0aec\u0aed\u0aee\u0aef {} \\ [~] "
- // 0123456789ABCDEF0123456789ABCDEF012345.....6789ABCDEF0123456789ABCDEF
- + "|ABCDEFGHIJKLMNOPQRSTUVWXYZ \u20ac ",
-
- /* A.2.6 Hindi National Language Single Shift Table
- 01.....23.....4.....5.6.....789A.....BCDEF0123.....45.....6789.....A.....BC.....D..... */
- "@\u00a3$\u00a5\u00bf\"\u00a4%&'\u000c*+ -/<=>\u00a1^\u00a1_#*\u0964\u0965 \u0966\u0967"
- // E.....F.....0.....1.....2.....3.....4.....5.....6.....7.....89A.....B.....C.....
- + "\u0968\u0969\u096a\u096b\u096c\u096d\u096e\u096f\u0951\u0952{}\u0953\u0954\u0958"
- // D.....E.....F.0.....1.....2.....3.....4.....5.....6.....7.....8.....9.....A.....
- + "\u0959\u095a\\\u095b\u095c\u095d\u095e\u095f\u0960\u0961\u0962\u0963\u0970\u0971"
- // BCDEF0123456789ABCDEF0123456789ABCDEF012345.....6789ABCDEF0123456789ABCDEF
- + " [~] |ABCDEFGHIJKLMNOPQRSTUVWXYZ \u20ac ",
-
- /* A.2.7 Kannada National Language Single Shift Table
- 01.....23.....4.....5.6.....789A.....BCDEF0123.....45.....6789.....A.....BC.....D..... */
- "@\u00a3$\u00a5\u00bf\"\u00a4%&'\u000c*+ -/<=>\u00a1^\u00a1_#*\u0964\u0965 \u0ce6\u0ce7"
- // E.....F.....0.....1.....2.....3.....4.....5.....6.....7.....89A.....BCDEF.01234567
- + "\u0ce8\u0ce9\u0cea\u0ceb\u0cec\u0ced\u0cee\u0cef\u0cde\u0cf1{}\u0cf2 \\ "
- // 89ABCDEF0123456789ABCDEF0123456789ABCDEF012345.....6789ABCDEF0123456789ABCDEF
- + " [~] |ABCDEFGHIJKLMNOPQRSTUVWXYZ \u20ac ",
-
- /* A.2.8 Malayalam National Language Single Shift Table
- 01.....23.....4.....5.6.....789A.....BCDEF0123.....45.....6789.....A.....BC.....D..... */
- "@\u00a3$\u00a5\u00bf\"\u00a4%&'\u000c*+ -/<=>\u00a1^\u00a1_#*\u0964\u0965 \u0d66\u0d67"
- // E.....F.....0.....1.....2.....3.....4.....5.....6.....7.....89A.....B.....C.....
- + "\u0d68\u0d69\u0d6a\u0d6b\u0d6c\u0d6d\u0d6e\u0d6f\u0d70\u0d71{}\u0d72\u0d73\u0d74"
- // D.....E.....F.0.....1.....2.....3.....4.....56789ABCDEF0123456789ABCDEF0123456789A
- + "\u0d75\u0d7a\\\u0d7b\u0d7c\u0d7d\u0d7e\u0d7f [~] |ABCDEFGHIJKLMNOPQRSTUVWXYZ"
- // BCDEF012345.....6789ABCDEF0123456789ABCDEF
- + " \u20ac ",
-
- /* A.2.9 Oriya National Language Single Shift Table
- 01.....23.....4.....5.6.....789A.....BCDEF0123.....45.....6789.....A.....BC.....D..... */
- "@\u00a3$\u00a5\u00bf\"\u00a4%&'\u000c*+ -/<=>\u00a1^\u00a1_#*\u0964\u0965 \u0b66\u0b67"
- // E.....F.....0.....1.....2.....3.....4.....5.....6.....7.....89A.....B.....C.....DE
- + "\u0b68\u0b69\u0b6a\u0b6b\u0b6c\u0b6d\u0b6e\u0b6f\u0b5c\u0b5d{}\u0b5f\u0b70\u0b71 "
- // F.0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF012345.....6789ABCDEF0123456789A
- + "\\ [~] |ABCDEFGHIJKLMNOPQRSTUVWXYZ \u20ac "
- // BCDEF
- + " ",
-
- /* A.2.10 Punjabi National Language Single Shift Table
- 01.....23.....4.....5.6.....789A.....BCDEF0123.....45.....6789.....A.....BC.....D..... */
- "@\u00a3$\u00a5\u00bf\"\u00a4%&'\u000c*+ -/<=>\u00a1^\u00a1_#*\u0964\u0965 \u0a66\u0a67"
- // E.....F.....0.....1.....2.....3.....4.....5.....6.....7.....89A.....B.....C.....
- + "\u0a68\u0a69\u0a6a\u0a6b\u0a6c\u0a6d\u0a6e\u0a6f\u0a59\u0a5a{}\u0a5b\u0a5c\u0a5e"
- // D.....EF.0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF012345.....6789ABCDEF01
- + "\u0a75 \\ [~] |ABCDEFGHIJKLMNOPQRSTUVWXYZ \u20ac "
- // 23456789ABCDEF
- + " ",
-
- /* A.2.11 Tamil National Language Single Shift Table
- NOTE: TS 23.038 V9.1.1 shows code 0x24 as \u0bef, corrected to \u0bee (typo)
- 01.....23.....4.....5.6.....789A.....BCDEF0123.....45.....6789.....A.....BC.....D..... */
- "@\u00a3$\u00a5\u00bf\"\u00a4%&'\u000c*+ -/<=>\u00a1^\u00a1_#*\u0964\u0965 \u0be6\u0be7"
- // E.....F.....0.....1.....2.....3.....4.....5.....6.....7.....89A.....B.....C.....
- + "\u0be8\u0be9\u0bea\u0beb\u0bec\u0bed\u0bee\u0bef\u0bf3\u0bf4{}\u0bf5\u0bf6\u0bf7"
- // D.....E.....F.0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF012345.....6789ABC
- + "\u0bf8\u0bfa\\ [~] |ABCDEFGHIJKLMNOPQRSTUVWXYZ \u20ac "
- // DEF0123456789ABCDEF
- + " ",
-
- /* A.2.12 Telugu National Language Single Shift Table
- NOTE: TS 23.038 V9.1.1 shows code 0x22-0x23 as \u06cc\u06cd, corrected to \u0c6c\u0c6d
- 01.....23.....4.....5.6.....789A.....BCDEF0123.....45.....6789ABC.....D.....E.....F..... */
- "@\u00a3$\u00a5\u00bf\"\u00a4%&'\u000c*+ -/<=>\u00a1^\u00a1_#* \u0c66\u0c67\u0c68\u0c69"
- // 0.....1.....2.....3.....4.....5.....6.....7.....89A.....B.....C.....D.....E.....F.
- + "\u0c6a\u0c6b\u0c6c\u0c6d\u0c6e\u0c6f\u0c58\u0c59{}\u0c78\u0c79\u0c7a\u0c7b\u0c7c\\"
- // 0.....1.....2.....3456789ABCDEF0123456789ABCDEF0123456789ABCDEF012345.....6789ABCD
- + "\u0c7d\u0c7e\u0c7f [~] |ABCDEFGHIJKLMNOPQRSTUVWXYZ \u20ac "
- // EF0123456789ABCDEF
- + " ",
-
- /* A.2.13 Urdu National Language Single Shift Table
- 01.....23.....4.....5.6.....789A.....BCDEF0123.....45.....6789.....A.....BC.....D..... */
- "@\u00a3$\u00a5\u00bf\"\u00a4%&'\u000c*+ -/<=>\u00a1^\u00a1_#*\u0600\u0601 \u06f0\u06f1"
- // E.....F.....0.....1.....2.....3.....4.....5.....6.....7.....89A.....B.....C.....
- + "\u06f2\u06f3\u06f4\u06f5\u06f6\u06f7\u06f8\u06f9\u060c\u060d{}\u060e\u060f\u0610"
- // D.....E.....F.0.....1.....2.....3.....4.....5.....6.....7.....8.....9.....A.....
- + "\u0611\u0612\\\u0613\u0614\u061b\u061f\u0640\u0652\u0658\u066b\u066c\u0672\u0673"
- // B.....CDEF.....0123456789ABCDEF0123456789ABCDEF012345.....6789ABCDEF0123456789ABCDEF
- + "\u06cd[~]\u06d4|ABCDEFGHIJKLMNOPQRSTUVWXYZ \u20ac "
- };
-
- static {
- enableCountrySpecificEncodings();
- int numTables = sLanguageTables.length;
- int numShiftTables = sLanguageShiftTables.length;
- if (numTables != numShiftTables) {
- Log.e(TAG, "Error: language tables array length " + numTables +
- " != shift tables array length " + numShiftTables);
- }
-
- sCharsToGsmTables = new SparseIntArray[numTables];
- for (int i = 0; i < numTables; i++) {
- String table = sLanguageTables[i];
-
- int tableLen = table.length();
- if (tableLen != 0 && tableLen != 128) {
- Log.e(TAG, "Error: language tables index " + i +
- " length " + tableLen + " (expected 128 or 0)");
- }
-
- SparseIntArray charToGsmTable = new SparseIntArray(tableLen);
- sCharsToGsmTables[i] = charToGsmTable;
- for (int j = 0; j < tableLen; j++) {
- char c = table.charAt(j);
- charToGsmTable.put(c, j);
- }
- }
-
- sCharsToShiftTables = new SparseIntArray[numTables];
- for (int i = 0; i < numShiftTables; i++) {
- String shiftTable = sLanguageShiftTables[i];
-
- int shiftTableLen = shiftTable.length();
- if (shiftTableLen != 0 && shiftTableLen != 128) {
- Log.e(TAG, "Error: language shift tables index " + i +
- " length " + shiftTableLen + " (expected 128 or 0)");
- }
-
- SparseIntArray charToShiftTable = new SparseIntArray(shiftTableLen);
- sCharsToShiftTables[i] = charToShiftTable;
- for (int j = 0; j < shiftTableLen; j++) {
- char c = shiftTable.charAt(j);
- if (c != ' ') {
- charToShiftTable.put(c, j);
- }
- }
- }
- }
-}
diff --git a/library/src/main/java/com/android/internal/telephony/SmsConstants.java b/library/src/main/java/com/android/internal/telephony/SmsConstants.java
deleted file mode 100644
index b36f8368..00000000
--- a/library/src/main/java/com/android/internal/telephony/SmsConstants.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (C) 2012 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.telephony;
-
-/**
- * SMS Constants and must be the same as the corresponding
- * deprecated version in SmsMessage.
- *
- * @hide
- */
-public class SmsConstants {
- /**
- * User data text encoding code unit size
- */
- public static final int ENCODING_UNKNOWN = 0;
- public static final int ENCODING_7BIT = 1;
- public static final int ENCODING_8BIT = 2;
- public static final int ENCODING_16BIT = 3;
-
- /**
- * The maximum number of payload septets per message
- */
- public static final int MAX_USER_DATA_SEPTETS = 160;
-
- /**
- * The maximum number of payload septets per message if a user data header
- * is present. This assumes the header only contains the
- * CONCATENATED_8_BIT_REFERENCE element.
- */
- public static final int MAX_USER_DATA_SEPTETS_WITH_HEADER = 153;
-
- /**
- * This value is not defined in global standard. Only in Korea, this is used.
- */
- public static final int ENCODING_KSC5601 = 4;
-
- /**
- * The maximum number of payload bytes per message
- */
- public static final int MAX_USER_DATA_BYTES = 140;
-
- /**
- * The maximum number of payload bytes per message if a user data header
- * is present. This assumes the header only contains the
- * CONCATENATED_8_BIT_REFERENCE element.
- */
- public static final int MAX_USER_DATA_BYTES_WITH_HEADER = 134;
-
- /**
- * SMS Class enumeration.
- * See TS 23.038.
- */
- public enum MessageClass {
- UNKNOWN, CLASS_0, CLASS_1, CLASS_2, CLASS_3;
- }
-
- /**
- * Indicates a 3GPP format SMS message.
- *
- * @hide pending API council approval
- */
- public static final String FORMAT_3GPP = "3gpp";
-
- /**
- * Indicates a 3GPP2 format SMS message.
- *
- * @hide pending API council approval
- */
- public static final String FORMAT_3GPP2 = "3gpp2";
-}
diff --git a/library/src/main/java/com/android/internal/telephony/TelephonyProperties.java b/library/src/main/java/com/android/internal/telephony/TelephonyProperties.java
deleted file mode 100644
index 61aaaa36..00000000
--- a/library/src/main/java/com/android/internal/telephony/TelephonyProperties.java
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
- * Copyright (C) 2006 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.telephony;
-
-/**
- * Contains a list of string constants used to get or set telephone properties
- * in the system. You can use {@link android.os.SystemProperties os.SystemProperties}
- * to get and set these values.
- *
- * @hide
- */
-public interface TelephonyProperties {
- //****** Baseband and Radio Interface version
-
- //TODO T: property strings do not have to be gsm specific
- // change gsm.*operator.*" properties to "operator.*" properties
-
- /**
- * Baseband version
- * Availability: property is available any time radio is on
- */
- static final String PROPERTY_BASEBAND_VERSION = "gsm.version.baseband";
-
- /**
- * Radio Interface Layer (RIL) library implementation.
- */
- static final String PROPERTY_RIL_IMPL = "gsm.version.ril-impl";
-
- //****** Current Network
-
- /**
- * Alpha name of current registered operator.- * Availability: when registered to a network. Result may be unreliable on - * CDMA networks. - */ - static final String PROPERTY_OPERATOR_ALPHA = "gsm.operator.alpha"; - //TODO: most of these properties are generic, substitute gsm. with phone. bug 1856959 - - /** - * Numeric name (MCC+MNC) of current registered operator.
- * Availability: when registered to a network. Result may be unreliable on - * CDMA networks. - */ - static final String PROPERTY_OPERATOR_NUMERIC = "gsm.operator.numeric"; - - /** - * 'true' if the device is on a manually selected network - *
- * Availability: when registered to a network - */ - static final String PROPERTY_OPERATOR_ISMANUAL = "operator.ismanual"; - - /** - * 'true' if the device is considered roaming on this network for GSM - * purposes. - * Availability: when registered to a network - */ - static final String PROPERTY_OPERATOR_ISROAMING = "gsm.operator.isroaming"; - - /** - * The ISO country code equivalent of the current registered operator's - * MCC (Mobile Country Code)
- * Availability: when registered to a network. Result may be unreliable on
- * CDMA networks.
- */
- static final String PROPERTY_OPERATOR_ISO_COUNTRY = "gsm.operator.iso-country";
-
- /**
- * The contents of this property is the value of the kernel command line
- * product_type variable that corresponds to a product that supports LTE on CDMA.
- * {@see BaseCommands#getLteOnCdmaMode()}
- */
- static final String PROPERTY_LTE_ON_CDMA_PRODUCT_TYPE = "telephony.lteOnCdmaProductType";
-
- /**
- * The contents of this property is the one of {@link Phone#LTE_ON_CDMA_TRUE} or
- * {@link Phone#LTE_ON_CDMA_FALSE}. If absent the value will assumed to be false
- * and the {@see #PROPERTY_LTE_ON_CDMA_PRODUCT_TYPE} will be used to determine its
- * final value which could also be {@link Phone#LTE_ON_CDMA_FALSE}.
- * {@see BaseCommands#getLteOnCdmaMode()}
- */
- static final String PROPERTY_LTE_ON_CDMA_DEVICE = "telephony.lteOnCdmaDevice";
-
- static final String CURRENT_ACTIVE_PHONE = "gsm.current.phone-type";
-
- //****** SIM Card
- /**
- * One of Note: if {@code E} is an {@link Enum} type, use {@link
- * EnumSet#noneOf} instead.
- * Note: if you only need an immutable empty Set,
- * use {@link Collections#emptySet} instead.
- *
- * @return a newly-created, initially-empty {@code HashSet}
- */
- public static Note: due to a bug in javac 1.5.0_06, we cannot support the
- * following:
- * {@code Set where {@code sub1} and {@code sub2} are references to subtypes of {@code
- * Base}, not of {@code Base} itself. To get around this, you must use:
- * {@code Set"UNKNOWN"
"ABSENT"
"PIN_REQUIRED"
- * "PUK_REQUIRED"
"NETWORK_LOCKED"
or "READY"
- */
- static String PROPERTY_SIM_STATE = "gsm.sim.state";
-
- /**
- * The MCC+MNC (mobile country code+mobile network code) of the
- * provider of the SIM. 5 or 6 decimal digits.
- * Availability: SIM state must be "READY"
- */
- static String PROPERTY_ICC_OPERATOR_NUMERIC = "gsm.sim.operator.numeric";
-
- /**
- * PROPERTY_ICC_OPERATOR_ALPHA is also known as the SPN, or Service Provider Name.
- * Availability: SIM state must be "READY"
- */
- static String PROPERTY_ICC_OPERATOR_ALPHA = "gsm.sim.operator.alpha";
-
- /**
- * ISO country code equivalent for the SIM provider's country code
- */
- static String PROPERTY_ICC_OPERATOR_ISO_COUNTRY = "gsm.sim.operator.iso-country";
-
- /**
- * Indicates the available radio technology. Values include: "unknown"
,
- * "GPRS"
, "EDGE"
and "UMTS"
.
- */
- static String PROPERTY_DATA_NETWORK_TYPE = "gsm.network.type";
-
- /**
- * Indicate if phone is in emergency callback mode
- */
- static final String PROPERTY_INECM_MODE = "ril.cdma.inecmmode";
-
- /**
- * Indicate the timer value for exiting emergency callback mode
- */
- static final String PROPERTY_ECM_EXIT_TIMER = "ro.cdma.ecmexittimer";
-
- /**
- * The international dialing prefix conversion string
- */
- static final String PROPERTY_IDP_STRING = "ro.cdma.idpstring";
-
- /**
- * Defines the schema for the carrier specified OTASP number
- */
- static final String PROPERTY_OTASP_NUM_SCHEMA = "ro.cdma.otaspnumschema";
-
- /**
- * Disable all calls including Emergency call when it set to true.
- */
- static final String PROPERTY_DISABLE_CALL = "ro.telephony.disable-call";
-
- /**
- * Set to true for vendor RIL's that send multiple UNSOL_CALL_RING notifications.
- */
- static final String PROPERTY_RIL_SENDS_MULTIPLE_CALL_RING =
- "ro.telephony.call_ring.multiple";
-
- /**
- * The number of milliseconds between CALL_RING notifications.
- */
- static final String PROPERTY_CALL_RING_DELAY = "ro.telephony.call_ring.delay";
-
- /**
- * Track CDMA SMS message id numbers to ensure they increment
- * monotonically, regardless of reboots.
- */
- static final String PROPERTY_CDMA_MSG_ID = "persist.radio.cdma.msgid";
-
- /**
- * Property to override DEFAULT_WAKE_LOCK_TIMEOUT
- */
- static final String PROPERTY_WAKE_LOCK_TIMEOUT = "ro.ril.wake_lock_timeout";
-
- /**
- * Set to true to indicate that the modem needs to be reset
- * when there is a radio technology change.
- */
- static final String PROPERTY_RESET_ON_RADIO_TECH_CHANGE = "persist.radio.reset_on_switch";
-
- /**
- * Set to false to disable SMS receiving, default is
- * the value of config_sms_capable
- */
- static final String PROPERTY_SMS_RECEIVE = "telephony.sms.receive";
-
- /**
- * Set to false to disable SMS sending, default is
- * the value of config_sms_capable
- */
- static final String PROPERTY_SMS_SEND = "telephony.sms.send";
-
- /**
- * Set to true to indicate a test CSIM card is used in the device.
- * This property is for testing purpose only. This should not be defined
- * in commercial configuration.
- */
- static final String PROPERTY_TEST_CSIM = "persist.radio.test-csim";
-
- /**
- * Ignore RIL_UNSOL_NITZ_TIME_RECEIVED completely, used for debugging/testing.
- */
- static final String PROPERTY_IGNORE_NITZ = "telephony.test.ignore.nitz";
-}
diff --git a/library/src/main/java/com/android/internal/util/ArrayUtils.java b/library/src/main/java/com/android/internal/util/ArrayUtils.java
deleted file mode 100644
index 74013582..00000000
--- a/library/src/main/java/com/android/internal/util/ArrayUtils.java
+++ /dev/null
@@ -1,243 +0,0 @@
-/*
- * Copyright (C) 2006 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.util;
-
-import java.lang.reflect.Array;
-
-// XXX these should be changed to reflect the actual memory allocator we use.
-// it looks like right now objects want to be powers of 2 minus 8
-// and the array size eats another 4 bytes
-
-/**
- * ArrayUtils contains some methods that you can call to find out
- * the most efficient increments by which to grow arrays.
- */
-public class ArrayUtils {
- private static Object[] EMPTY = new Object[0];
- private static final int CACHE_SIZE = 73;
- private static Object[] sCache = new Object[CACHE_SIZE];
-
- private ArrayUtils() { /* cannot be instantiated */ }
-
- public static int idealByteArraySize(int need) {
- for (int i = 4; i < 32; i++)
- if (need <= (1 << i) - 12)
- return (1 << i) - 12;
-
- return need;
- }
-
- public static int idealBooleanArraySize(int need) {
- return idealByteArraySize(need);
- }
-
- public static int idealShortArraySize(int need) {
- return idealByteArraySize(need * 2) / 2;
- }
-
- public static int idealCharArraySize(int need) {
- return idealByteArraySize(need * 2) / 2;
- }
-
- public static int idealIntArraySize(int need) {
- return idealByteArraySize(need * 4) / 4;
- }
-
- public static int idealFloatArraySize(int need) {
- return idealByteArraySize(need * 4) / 4;
- }
-
- public static int idealObjectArraySize(int need) {
- return idealByteArraySize(need * 4) / 4;
- }
-
- public static int idealLongArraySize(int need) {
- return idealByteArraySize(need * 8) / 8;
- }
-
- /**
- * Checks if the beginnings of two byte arrays are equal.
- *
- * @param array1 the first byte array
- * @param array2 the second byte array
- * @param length the number of bytes to check
- * @return true if they're equal, false otherwise
- */
- public static boolean equals(byte[] array1, byte[] array2, int length) {
- if (array1 == array2) {
- return true;
- }
- if (array1 == null || array2 == null || array1.length < length || array2.length < length) {
- return false;
- }
- for (int i = 0; i < length; i++) {
- if (array1[i] != array2[i]) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Returns an empty array of the specified type. The intent is that
- * it will return the same empty array every time to avoid reallocation,
- * although this is not guaranteed.
- */
- @SuppressWarnings("unchecked")
- public static