diff options
author | Robert Henigan <robert.henigan@livio.io> | 2020-09-03 10:44:54 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-03 10:44:54 -0400 |
commit | 3f3ca319c105f7f9af2341aaabacd2a64f5cdc00 (patch) | |
tree | 53602e7d583f47fc8baaa29e11daea883e3c7c95 | |
parent | 707a0a9a0620c79e6e8cfb8c269591c5e4cd9c55 (diff) | |
parent | bda523e62089bb9e48598ee48936e916be5949e2 (diff) | |
download | sdl_android-3f3ca319c105f7f9af2341aaabacd2a64f5cdc00.tar.gz |
Merge pull request #1477 from smartdevicelink/feature/remove_deprecated_apis_part1
Remove Deprecated APIs Part 1
16 files changed, 34 insertions, 706 deletions
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/lifecycle/LifecycleManager.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/lifecycle/LifecycleManager.java index ed3f5f219..78233dc0f 100644 --- a/android/sdl_android/src/main/java/com/smartdevicelink/managers/lifecycle/LifecycleManager.java +++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/lifecycle/LifecycleManager.java @@ -111,15 +111,9 @@ public class LifecycleManager extends BaseLifecycleManager { super.setSdlSecurityStaticVars(); Context context = null; - Service service = null; - if(this.contextWeakReference != null){ context = contextWeakReference.get(); } - if (context != null && context instanceof Service) { - service = (Service) context; - } - SdlSecurityBase.setAppService(service); SdlSecurityBase.setContext(context); } diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/security/SdlSecurityBase.java b/android/sdl_android/src/main/java/com/smartdevicelink/security/SdlSecurityBase.java index 0323beb21..2e1ac540c 100644 --- a/android/sdl_android/src/main/java/com/smartdevicelink/security/SdlSecurityBase.java +++ b/android/sdl_android/src/main/java/com/smartdevicelink/security/SdlSecurityBase.java @@ -1,57 +1,42 @@ -/* - * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ +/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
package com.smartdevicelink.security;
-import android.app.Service;
import android.content.Context;
public abstract class SdlSecurityBase extends AbstractSdlSecurityBase{
- protected static Service appService = null;
protected static Context context;
- @Deprecated
- public static Service getAppService() {
- return appService;
- }
-
- @Deprecated
- public static void setAppService(Service val) {
- appService = val;
- if (val != null && val.getApplicationContext() != null){
- setContext(val.getApplicationContext());
- }
- }
-
public static Context getContext() {
return context;
}
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/transport/SdlBroadcastReceiver.java b/android/sdl_android/src/main/java/com/smartdevicelink/transport/SdlBroadcastReceiver.java index 1ad6a3e9a..62a4b682c 100644 --- a/android/sdl_android/src/main/java/com/smartdevicelink/transport/SdlBroadcastReceiver.java +++ b/android/sdl_android/src/main/java/com/smartdevicelink/transport/SdlBroadcastReceiver.java @@ -237,7 +237,7 @@ public abstract class SdlBroadcastReceiver extends BroadcastReceiver{ context.startService(serviceIntent); } else { serviceIntent.putExtra(FOREGROUND_EXTRA, true); - DebugTool.logInfo("Attempting to startForegroundService - " + System.currentTimeMillis()); + DebugTool.logInfo(TAG, "Attempting to startForegroundService - " + System.currentTimeMillis()); setForegroundExceptionHandler(); //Prevent ANR in case the OS takes too long to start the service context.startForegroundService(serviceIntent); @@ -297,7 +297,7 @@ public abstract class SdlBroadcastReceiver extends BroadcastReceiver{ } else { //There are currently running services if(DebugTool.isDebugEnabled()){ for(ComponentName service : runningBluetoothServicePackage){ - DebugTool.logInfo("Currently running router service: " + service.getPackageName()); + DebugTool.logInfo(TAG, "Currently running router service: " + service.getPackageName()); } } if (altTransportWake) { diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/util/HttpUtils.java b/android/sdl_android/src/main/java/com/smartdevicelink/util/HttpUtils.java deleted file mode 100644 index ad43c40f5..000000000 --- a/android/sdl_android/src/main/java/com/smartdevicelink/util/HttpUtils.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ -package com.smartdevicelink.util; - -import android.graphics.Bitmap; - -import java.io.IOException; - -/** - * @see AndroidTools - */ -@Deprecated -public class HttpUtils{ - - public static Bitmap downloadImage(String urlStr) throws IOException{ - return AndroidTools.downloadImage(urlStr); - } - -} diff --git a/base/src/main/java/com/smartdevicelink/Dispatcher/IDispatchingStrategy.java b/base/src/main/java/com/smartdevicelink/Dispatcher/IDispatchingStrategy.java deleted file mode 100644 index f6f3b1cc2..000000000 --- a/base/src/main/java/com/smartdevicelink/Dispatcher/IDispatchingStrategy.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ -package com.smartdevicelink.Dispatcher; - -@Deprecated -public interface IDispatchingStrategy<T> { - public void dispatch(T message); - - public void handleDispatchingError(String info, Exception ex); - - public void handleQueueingError(String info, Exception ex); -} diff --git a/base/src/main/java/com/smartdevicelink/Dispatcher/ProxyMessageDispatcher.java b/base/src/main/java/com/smartdevicelink/Dispatcher/ProxyMessageDispatcher.java deleted file mode 100644 index 16681e600..000000000 --- a/base/src/main/java/com/smartdevicelink/Dispatcher/ProxyMessageDispatcher.java +++ /dev/null @@ -1,96 +0,0 @@ -/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-package com.smartdevicelink.Dispatcher;
-
-import com.smartdevicelink.util.DebugTool;
-
-import java.util.concurrent.LinkedBlockingQueue;
-
-@Deprecated
-public class ProxyMessageDispatcher<T> {
- private static final String TAG = "ProxyMessageDispatcher";
- LinkedBlockingQueue<T> _queue = null;
- private Thread _messageDispatchingThread = null;
- IDispatchingStrategy<T> _strategy = null;
-
- // Boolean to track if disposed
- private Boolean dispatcherDisposed = false;
-
- public ProxyMessageDispatcher(String THREAD_NAME, IDispatchingStrategy<T> strategy) {
- _queue = new LinkedBlockingQueue<T>();
-
- _strategy = strategy;
-
- // Create dispatching thread
- _messageDispatchingThread = new Thread(new Runnable() {public void run(){handleMessages();}});
- _messageDispatchingThread.setName(THREAD_NAME);
- _messageDispatchingThread.setDaemon(true);
- _messageDispatchingThread.start();
- }
-
- public void dispose() {
- dispatcherDisposed = true;
-
- if(_messageDispatchingThread != null) {
- _messageDispatchingThread.interrupt();
- _messageDispatchingThread = null;
- }
- }
-
- private void handleMessages() {
-
- try {
- T thisMessage;
-
- while(dispatcherDisposed == false) {
- thisMessage = _queue.take();
- _strategy.dispatch(thisMessage);
- }
- } catch (InterruptedException e) {
- // Thread was interrupted by dispose() method, no action required
- return;
- } catch (Exception e) {
- DebugTool.logError(TAG, "Error occurred dispating message.", e);
- _strategy.handleDispatchingError("Error occurred dispating message.", e);
- }
- }
-
- public void queueMessage(T message) {
- try {
- _queue.put(message);
- } catch(ClassCastException e) {
- _strategy.handleQueueingError("ClassCastException encountered when queueing message.", e);
- } catch(Exception e) {
- _strategy.handleQueueingError("Exception encountered when queueing message.", e);
- }
- }
-}
diff --git a/base/src/main/java/com/smartdevicelink/SdlConnection/BaseSdlSession.java b/base/src/main/java/com/smartdevicelink/SdlConnection/BaseSdlSession.java index c3e6158dd..09e959b90 100644 --- a/base/src/main/java/com/smartdevicelink/SdlConnection/BaseSdlSession.java +++ b/base/src/main/java/com/smartdevicelink/SdlConnection/BaseSdlSession.java @@ -375,12 +375,4 @@ public abstract class BaseSdlSession implements ISdlProtocol, ISecurityInitializ public boolean isTransportForServiceAvailable(SessionType sessionType){ return sdlProtocol!=null && sdlProtocol.isTransportForServiceAvailable(sessionType); } - - - @Deprecated - public void clearConnection(){/* Not supported */} - - - - } diff --git a/base/src/main/java/com/smartdevicelink/managers/lifecycle/BaseLifecycleManager.java b/base/src/main/java/com/smartdevicelink/managers/lifecycle/BaseLifecycleManager.java index e83c0e843..a366d5984 100644 --- a/base/src/main/java/com/smartdevicelink/managers/lifecycle/BaseLifecycleManager.java +++ b/base/src/main/java/com/smartdevicelink/managers/lifecycle/BaseLifecycleManager.java @@ -622,7 +622,7 @@ abstract class BaseLifecycleManager { @SuppressWarnings("UnusedReturnValue") private boolean onRPCRequestReceived(RPCRequest request) { if (request == null) { - DebugTool.logError("onRPCRequestReceived - request was null"); + DebugTool.logError(TAG, "onRPCRequestReceived - request was null"); return false; } DebugTool.logInfo(TAG, "onRPCRequestReceived - " + request.getFunctionName()); diff --git a/base/src/main/java/com/smartdevicelink/util/DebugTool.java b/base/src/main/java/com/smartdevicelink/util/DebugTool.java index d073fc654..f36e9ca7c 100644 --- a/base/src/main/java/com/smartdevicelink/util/DebugTool.java +++ b/base/src/main/java/com/smartdevicelink/util/DebugTool.java @@ -97,11 +97,6 @@ public class DebugTool { }
}
- @Deprecated
- public static void logError(String msg) {
- logError(TAG, msg);
- }
-
public static void logError(String tag, String msg, Throwable ex) {
Boolean wasWritten = false;
@@ -119,11 +114,6 @@ public class DebugTool { }
}
- @Deprecated
- public static void logError(String msg, Throwable ex) {
- logError(TAG, msg, ex);
- }
-
public static void logWarning(String tag, String msg) {
Boolean wasWritten = false;
@@ -137,11 +127,6 @@ public class DebugTool { }
}
- @Deprecated
- public static void logWarning(String msg) {
- logWarning(TAG, msg);
- }
-
public static void logInfo(String tag, String msg) {
Boolean wasWritten = false;
@@ -155,11 +140,6 @@ public class DebugTool { }
}
- @Deprecated
- public static void logInfo(String msg) {
- logInfo(TAG, msg);
- }
-
public static void logInfo(String tag, String msg, Boolean bPrependVersion) {
Boolean wasWritten = false;
@@ -173,11 +153,6 @@ public class DebugTool { }
}
- @Deprecated
- public static void logInfo(String msg, boolean bPrependVersion) {
- logInfo(TAG, msg, bPrependVersion);
- }
-
protected static Boolean logToSiphon(String msg) {
if (SiphonServer.getSiphonEnabledStatus()) {
// Initialize the SiphonServer, will be ignored if already initialized
diff --git a/javaSE/src/main/java/android/os/AsyncTask.java b/javaSE/src/main/java/android/os/AsyncTask.java deleted file mode 100644 index db6b69a8e..000000000 --- a/javaSE/src/main/java/android/os/AsyncTask.java +++ /dev/null @@ -1,27 +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. - * - * Note: This file has been modified from its original form. - */ - -package android.os; - -@Deprecated -public abstract class AsyncTask<Params, Progress, Result> { - - - abstract protected Result doInBackground(Params...params); - -} diff --git a/javaSE/src/main/java/android/os/Parcel.java b/javaSE/src/main/java/android/os/Parcel.java deleted file mode 100644 index b99dbc671..000000000 --- a/javaSE/src/main/java/android/os/Parcel.java +++ /dev/null @@ -1,59 +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. - * - * Note: This file has been modified from its original form. - */ - -package android.os; - -@Deprecated -public class Parcel { - - public void writeInt(int data){ - - } - - public void writeByteArray(byte[] bytes){ - - } - - public void writeString(String data){ - - } - - public void writeParcelable(Parcelable p, int flags){ - - } - - public int readInt(){ - return 0; - } - - public String readString(){ - return "hello"; - } - - public byte[] readByteArray(byte[] array){ - return array; - } - - public Parcelable readParcelable(ClassLoader loader){ - return null; - } - - public int dataAvail(){ - return 0; - } -} diff --git a/javaSE/src/main/java/android/os/Parcelable.java b/javaSE/src/main/java/android/os/Parcelable.java deleted file mode 100644 index e09a1754c..000000000 --- a/javaSE/src/main/java/android/os/Parcelable.java +++ /dev/null @@ -1,31 +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. - * - * Note: This file has been modified from its original form. - */ -package android.os; - -@Deprecated -public interface Parcelable { - - int describeContents(); - void writeToParcel(Parcel dest, int flags); - - - abstract class Creator<T>{ - public abstract T[] newArray(int size); - } - -} diff --git a/javaSE/src/main/java/android/util/Log.java b/javaSE/src/main/java/android/util/Log.java deleted file mode 100644 index 7374ff04c..000000000 --- a/javaSE/src/main/java/android/util/Log.java +++ /dev/null @@ -1,71 +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. - * - * Note: This file has been modified from its original form. - */ - -package android.util; - -@Deprecated -public class Log { - - - public static int i(String tag, String message){ - System.out.print("\r\nINFO: " + tag+ " - " + message); - return 10; - - - } - public static int v(String tag, String message){ - System.out.print("\r\nVERBOSE: " + tag+ " - " + message); - return 10; - - - } - public static int d(String tag, String message){ - System.out.print("\r\nDEBUG: " + tag+ " - " + message); - return 10; - - - } - public static int w(String tag, String message){ - System.out.print("\r\nWARN: " + tag+ " - " + message); - return 10; - - - } - public static int e(String tag, String message){ - System.out.print("\r\nERROR: " + tag+ " - " + message); - return 10; - - } - public static int e(String tag, String message, Exception e){ - if(e != null){ - System.out.print("\r\nERROR: " + tag+ " - " + message + " - " + e.getMessage()); - }else{ - System.out.print("\r\nERROR: " + tag+ " - " + message); - } - return 10; - } - public static int e(String tag, String message, Throwable t){ - if(t != null){ - System.out.print("\r\nERROR: " + tag+ " - " + message + " - " + t.getMessage()); - }else{ - System.out.print("\r\nERROR: " + tag+ " - " + message); - } - return 10; - } - -} diff --git a/javaSE/src/main/java/com/smartdevicelink/protocol/SdlPacket.java b/javaSE/src/main/java/com/smartdevicelink/protocol/SdlPacket.java index d9a14b6f7..4f37da493 100644 --- a/javaSE/src/main/java/com/smartdevicelink/protocol/SdlPacket.java +++ b/javaSE/src/main/java/com/smartdevicelink/protocol/SdlPacket.java @@ -31,8 +31,6 @@ */ package com.smartdevicelink.protocol; -import android.os.Parcel; -import android.os.Parcelable; public class SdlPacket extends BaseSdlPacket { @@ -55,28 +53,4 @@ public class SdlPacket extends BaseSdlPacket { protected SdlPacket(BaseSdlPacket packet) { super(packet); } - - @Deprecated - public SdlPacket(Parcel p){} - - @Deprecated - public int describeContents() { - return 0; - } - - @Deprecated - public void writeToParcel(Parcel dest, int flags) {} - - @Deprecated - public static final Parcelable.Creator<SdlPacket> CREATOR = new Parcelable.Creator<SdlPacket>() { - public SdlPacket createFromParcel(Parcel in) { - return new SdlPacket(in); - } - - @Override - public SdlPacket[] newArray(int size) { - return new SdlPacket[size]; - } - - }; } diff --git a/javaSE/src/main/java/com/smartdevicelink/transport/utl/TransportRecord.java b/javaSE/src/main/java/com/smartdevicelink/transport/utl/TransportRecord.java index 7bc15e2ab..d8155c2fd 100644 --- a/javaSE/src/main/java/com/smartdevicelink/transport/utl/TransportRecord.java +++ b/javaSE/src/main/java/com/smartdevicelink/transport/utl/TransportRecord.java @@ -31,8 +31,6 @@ */ package com.smartdevicelink.transport.utl; -import android.os.Parcel; -import android.os.Parcelable; import com.smartdevicelink.transport.enums.TransportType; public class TransportRecord extends BaseTransportRecord { @@ -40,38 +38,4 @@ public class TransportRecord extends BaseTransportRecord { public TransportRecord(TransportType transportType, String address) { super(transportType, address); } - - @Deprecated - public TransportRecord(Parcel p) {} - - @Deprecated - public int describeContents() { - return 0; - }; - - @Deprecated - public void writeToParcel(Parcel dest, int flags) { - dest.writeInt(type!=null? 1 : 0); - if(type != null){ - dest.writeString(type.name()); - } - - dest.writeInt(address !=null? 1 : 0); - if(address != null){ - dest.writeString(address); - } - } - - @Deprecated - public static final Parcelable.Creator<TransportRecord> CREATOR = new Parcelable.Creator<TransportRecord>() { - public TransportRecord createFromParcel(Parcel in) { - return new TransportRecord(in); - } - - @Override - public TransportRecord[] newArray(int size) { - return new TransportRecord[size]; - } - - }; } diff --git a/javaSE/src/main/java/com/smartdevicelink/util/HttpRequestTask.java b/javaSE/src/main/java/com/smartdevicelink/util/HttpRequestTask.java deleted file mode 100644 index 77c9f4f7a..000000000 --- a/javaSE/src/main/java/com/smartdevicelink/util/HttpRequestTask.java +++ /dev/null @@ -1,183 +0,0 @@ -package com.smartdevicelink.util; - -import android.os.AsyncTask; - -import java.io.BufferedReader; -import java.io.BufferedWriter; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.OutputStreamWriter; -import java.io.Writer; -import java.net.HttpURLConnection; -import java.net.URL; - - -@Deprecated -public class HttpRequestTask extends AsyncTask<String, String, String> { - private static final String TAG = "Http Request Task"; - - public static final String REQUEST_TYPE_POST = "POST"; - public static final String REQUEST_TYPE_GET = "GET"; - public static final String REQUEST_TYPE_DELETE = "DELETE"; - - HttpRequestTaskCallback cb; - - /** - * @param hcb callback for when this task finishes - * <br><br><b> - When calling execute, params as followed: </b><br> - * 1. Url String<br> - * 2. Request type (Defined in this class) REQUEST_TYPE_POST, REQUEST_TYPE_GET, REQUEST_TYPE_DELETE<br> - * 3. (Optional) Data to be sent. <br> - * 4. (Optional) Content Type Default will be application/json<br> - * 5. (Optional) Accept Type default will be application/json - * - */ - @Deprecated - public HttpRequestTask( HttpRequestTaskCallback hcb){ - this.cb = hcb; - } - - @Deprecated - protected String doInBackground(String... params) { - int length = params.length; - String urlString = params[0]; - String request_type = params[1]; - - //Grab and set data to be written if included - String data; - if(length>2){ - data = params[2]; - }else{ - data = null; - } - - //Grab and set content type for the header if included - String contentType; - if(length>3){ - contentType = params[3]; - }else{ - contentType = "application/json"; - } - //Grab and set accept type for the header if included - String acceptType; - if(length>4){ - acceptType = params[4]; - }else{ - acceptType = "application/json"; - } - - if(urlString == null || request_type == null){ - DebugTool.logError(TAG, "Can't process request, param error"); - if(cb!=null){ - cb.httpFailure(-1); - cb = null; - } - return "Error"; - } - - HttpURLConnection urlConnection = null; - BufferedReader reader = null; - try { - URL url = new URL(urlString); - urlConnection = (HttpURLConnection) url.openConnection(); - urlConnection.setDoOutput(true); - urlConnection.setRequestMethod(request_type); - urlConnection.setRequestProperty("Content-Type", contentType); - urlConnection.setRequestProperty("Accept", acceptType); - //If we have data, we should write it out - if(data !=null){ - Writer writer = new BufferedWriter(new OutputStreamWriter(urlConnection.getOutputStream(), "UTF-8")); - writer.write(data); - writer.close(); - } - InputStream inputStream = urlConnection.getInputStream(); - - int responseCode = urlConnection.getResponseCode(); - if (responseCode == 200) { //Success - //input stream - StringBuffer buffer = new StringBuffer(); - if (inputStream == null) { - // Nothing to do. - if(cb!=null){ - cb.httpCallComplete(null); - cb = null; - } - return null; - } - reader = new BufferedReader(new InputStreamReader(inputStream)); - - String inputLine; - while ((inputLine = reader.readLine()) != null) - buffer.append(inputLine).append("\n"); - if (buffer.length() == 0) { - // Stream was empty. No point in parsing. - if(cb!=null){ - cb.httpCallComplete(null); - cb = null; - } - return null; - } - String response = null; - - response = buffer.toString(); - //send to post execute - if(cb!=null){ - cb.httpCallComplete(response); - cb = null; - } - return response; - }else{ - if(cb!=null){ - cb.httpFailure(responseCode); - cb = null; - } - DebugTool.logError(TAG, "Failed to download file - " + responseCode); - return null; - } - - - } catch (IOException e) { - e.printStackTrace(); - } catch (NullPointerException e){ // Only to catch error in urlConnection.getOutputStream() - when servers are down - e.printStackTrace(); - urlConnection = null; - } - finally { - if (urlConnection != null) { - urlConnection.disconnect(); - } - if (reader != null) { - try { - reader.close(); - } catch (final IOException e) { - DebugTool.logError(TAG, "Error closing stream", e); - } - } - if(cb!=null){ - cb.httpFailure(-1); - } - } - return null; - } - - /** - * Callback interface for HTTP requests. - * @author Joey Grover - * - */ - @Deprecated - public interface HttpRequestTaskCallback{ - /** - * Called when HTTP request is successfully completed. - * @param response The response to the HTTP request. - */ - public abstract void httpCallComplete(String response); - /** - * Called when HTTP request failed. - * @param statusCode The HTTP failure code. - */ - public abstract void httpFailure(int statusCode); - } - -} |