summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Grover <joeygrover@gmail.com>2016-07-06 13:59:05 -0400
committerJoey Grover <joeygrover@gmail.com>2016-07-06 13:59:05 -0400
commitf9140772b7dbd6ed6db7c53d52d1a89923575350 (patch)
tree8b455f338e98815a9f745bf620b8273ba25bf5c3
parent023e618ef802441e5de71c5723c5a17da798e25c (diff)
downloadsdl_android-bugfix/issue_309.tar.gz
Fix #309 removes HelloSdl projectbugfix/issue_309
-rw-r--r--HelloSdl/.settings/org.eclipse.jdt.core.prefs4
-rw-r--r--HelloSdl/AndroidManifest.xml50
-rw-r--r--HelloSdl/ic_launcher-web.pngbin37133 -> 0 bytes
-rw-r--r--HelloSdl/libs/android-support-v4.jarbin995624 -> 0 bytes
-rw-r--r--HelloSdl/lint.xml3
-rw-r--r--HelloSdl/proguard-project.txt20
-rw-r--r--HelloSdl/project.properties15
-rw-r--r--HelloSdl/res/drawable-hdpi/ic_launcher.pngbin5729 -> 0 bytes
-rw-r--r--HelloSdl/res/drawable-mdpi/ic_launcher.pngbin3022 -> 0 bytes
-rw-r--r--HelloSdl/res/drawable-xhdpi/ic_launcher.pngbin9073 -> 0 bytes
-rw-r--r--HelloSdl/res/drawable-xxhdpi/ic_launcher.pngbin17609 -> 0 bytes
-rw-r--r--HelloSdl/res/layout/activity_main.xml16
-rw-r--r--HelloSdl/res/menu/main.xml11
-rw-r--r--HelloSdl/res/values-w820dp/dimens.xml10
-rw-r--r--HelloSdl/res/values/dimens.xml7
-rw-r--r--HelloSdl/res/values/strings.xml8
-rw-r--r--HelloSdl/res/values/styles.xml20
-rw-r--r--HelloSdl/src/com/hellosdl/MainActivity.java42
-rw-r--r--HelloSdl/src/com/hellosdl/sdl/SdlReceiver.java24
-rw-r--r--HelloSdl/src/com/hellosdl/sdl/SdlRouterService.java8
-rw-r--r--HelloSdl/src/com/hellosdl/sdl/SdlService.java688
21 files changed, 0 insertions, 926 deletions
diff --git a/HelloSdl/.settings/org.eclipse.jdt.core.prefs b/HelloSdl/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index b080d2ddc..000000000
--- a/HelloSdl/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,4 +0,0 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.source=1.6
diff --git a/HelloSdl/AndroidManifest.xml b/HelloSdl/AndroidManifest.xml
deleted file mode 100644
index d15dbe2a6..000000000
--- a/HelloSdl/AndroidManifest.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.hellosdl"
- android:versionCode="1"
- android:versionName="1.0" >
-
- <uses-sdk
- android:minSdkVersion="8"
- android:targetSdkVersion="19" />
-
- <uses-permission android:name="android.permission.BLUETOOTH" />
- <uses-permission android:name="android.permission.INTERNET" />
- <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
-
- <application
- android:allowBackup="true"
- android:icon="@drawable/ic_launcher"
- android:label="@string/app_name"
- android:theme="@style/AppTheme" >
- <activity
- android:name=".MainActivity"
- android:label="@string/app_name" >
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
-
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
-
-
- <service android:name=".sdl.SdlService" ></service>
-
- <service android:name=".sdl.SdlRouterService"
- android:exported="true"
- android:process="com.smartdevicelink.router"></service>
-
-
- <receiver android:name=".sdl.SdlReceiver" android:enabled="true" >
- <intent-filter>
- <action android:name="android.intent.action.BOOT_COMPLETED" />
- <action android:name="android.bluetooth.device.action.ACL_CONNECTED"/>
- <action android:name="android.bluetooth.adapter.action.STATE_CHANGED" />
- <action android:name = "sdl.router.startservice"/>
- </intent-filter>
- </receiver>
-
-
- </application>
-
-</manifest>
diff --git a/HelloSdl/ic_launcher-web.png b/HelloSdl/ic_launcher-web.png
deleted file mode 100644
index 3e493438c..000000000
--- a/HelloSdl/ic_launcher-web.png
+++ /dev/null
Binary files differ
diff --git a/HelloSdl/libs/android-support-v4.jar b/HelloSdl/libs/android-support-v4.jar
deleted file mode 100644
index 4ebdaa9ed..000000000
--- a/HelloSdl/libs/android-support-v4.jar
+++ /dev/null
Binary files differ
diff --git a/HelloSdl/lint.xml b/HelloSdl/lint.xml
deleted file mode 100644
index ee0eead5b..000000000
--- a/HelloSdl/lint.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<lint>
-</lint> \ No newline at end of file
diff --git a/HelloSdl/proguard-project.txt b/HelloSdl/proguard-project.txt
deleted file mode 100644
index f2fe1559a..000000000
--- a/HelloSdl/proguard-project.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-# To enable ProGuard in your project, edit project.properties
-# to define the proguard.config property as described in that file.
-#
-# Add project specific ProGuard rules here.
-# By default, the flags in this file are appended to flags specified
-# in ${sdk.dir}/tools/proguard/proguard-android.txt
-# You can edit the include path and order by changing the ProGuard
-# include property in project.properties.
-#
-# For more details, see
-# http://developer.android.com/guide/developing/tools/proguard.html
-
-# Add any project specific keep options here:
-
-# If your project uses WebView with JS, uncomment the following
-# and specify the fully qualified class name to the JavaScript interface
-# class:
-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
-# public *;
-#}
diff --git a/HelloSdl/project.properties b/HelloSdl/project.properties
deleted file mode 100644
index f76c1b9a4..000000000
--- a/HelloSdl/project.properties
+++ /dev/null
@@ -1,15 +0,0 @@
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-#
-# This file must be checked in Version Control Systems.
-#
-# To customize properties used by the Ant build system edit
-# "ant.properties", and override values to adapt the script to your
-# project structure.
-#
-# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
-#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
-
-# Project target.
-target=android-19
-android.library.reference.1=../sdl_android_lib
diff --git a/HelloSdl/res/drawable-hdpi/ic_launcher.png b/HelloSdl/res/drawable-hdpi/ic_launcher.png
deleted file mode 100644
index 903e3d12d..000000000
--- a/HelloSdl/res/drawable-hdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/HelloSdl/res/drawable-mdpi/ic_launcher.png b/HelloSdl/res/drawable-mdpi/ic_launcher.png
deleted file mode 100644
index 8415d3068..000000000
--- a/HelloSdl/res/drawable-mdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/HelloSdl/res/drawable-xhdpi/ic_launcher.png b/HelloSdl/res/drawable-xhdpi/ic_launcher.png
deleted file mode 100644
index 962976da1..000000000
--- a/HelloSdl/res/drawable-xhdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/HelloSdl/res/drawable-xxhdpi/ic_launcher.png b/HelloSdl/res/drawable-xxhdpi/ic_launcher.png
deleted file mode 100644
index f4c378997..000000000
--- a/HelloSdl/res/drawable-xxhdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/HelloSdl/res/layout/activity_main.xml b/HelloSdl/res/layout/activity_main.xml
deleted file mode 100644
index 5056c3b98..000000000
--- a/HelloSdl/res/layout/activity_main.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:paddingBottom="@dimen/activity_vertical_margin"
- android:paddingLeft="@dimen/activity_horizontal_margin"
- android:paddingRight="@dimen/activity_horizontal_margin"
- android:paddingTop="@dimen/activity_vertical_margin"
- tools:context="com.hellosdl.MainActivity" >
-
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/hello_world" />
-
-</RelativeLayout>
diff --git a/HelloSdl/res/menu/main.xml b/HelloSdl/res/menu/main.xml
deleted file mode 100644
index e3df24bab..000000000
--- a/HelloSdl/res/menu/main.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<menu xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
- xmlns:tools="http://schemas.android.com/tools"
- tools:context="com.hellosdl.MainActivity" >
-
- <item
- android:id="@+id/action_settings"
- android:orderInCategory="100"
- android:title="@string/action_settings"/>
-
-</menu>
diff --git a/HelloSdl/res/values-w820dp/dimens.xml b/HelloSdl/res/values-w820dp/dimens.xml
deleted file mode 100644
index f3e70203b..000000000
--- a/HelloSdl/res/values-w820dp/dimens.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<resources>
-
- <!--
- Example customization of dimensions originally defined in res/values/dimens.xml
- (such as screen margins) for screens with more than 820dp of available width. This
- would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively).
- -->
- <dimen name="activity_horizontal_margin">64dp</dimen>
-
-</resources>
diff --git a/HelloSdl/res/values/dimens.xml b/HelloSdl/res/values/dimens.xml
deleted file mode 100644
index 55c1e5908..000000000
--- a/HelloSdl/res/values/dimens.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<resources>
-
- <!-- Default screen margins, per the Android Design guidelines. -->
- <dimen name="activity_horizontal_margin">16dp</dimen>
- <dimen name="activity_vertical_margin">16dp</dimen>
-
-</resources>
diff --git a/HelloSdl/res/values/strings.xml b/HelloSdl/res/values/strings.xml
deleted file mode 100644
index a7f78e961..000000000
--- a/HelloSdl/res/values/strings.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-
- <string name="app_name">HelloSdl</string>
- <string name="hello_world">Hello Car!</string>
- <string name="action_settings">Settings</string>
-
-</resources>
diff --git a/HelloSdl/res/values/styles.xml b/HelloSdl/res/values/styles.xml
deleted file mode 100644
index 4d175139d..000000000
--- a/HelloSdl/res/values/styles.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<resources>
-
- <!--
- Base application theme, dependent on API level. This theme is replaced
- by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
- -->
- <style name="AppBaseTheme">
- <!--
- Theme customizations available in newer API levels can go in
- res/values-vXX/styles.xml, while customizations related to
- backward-compatibility can go here.
- -->
- </style>
-
- <!-- Application theme. -->
- <style name="AppTheme" parent="AppBaseTheme">
- <!-- All customizations that are NOT specific to a particular API-level can go here. -->
- </style>
-
-</resources>
diff --git a/HelloSdl/src/com/hellosdl/MainActivity.java b/HelloSdl/src/com/hellosdl/MainActivity.java
deleted file mode 100644
index da6b8ecaf..000000000
--- a/HelloSdl/src/com/hellosdl/MainActivity.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package com.hellosdl;
-
-import com.hellosdl.sdl.SdlReceiver;
-import com.hellosdl.sdl.SdlService;
-
-import android.app.Activity;
-import android.content.Intent;
-import android.os.Bundle;
-import android.view.Menu;
-import android.view.MenuItem;
-
-public class MainActivity extends Activity {
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
- if(SdlReceiver.isTransportConnected(getBaseContext())){
- Intent startIntent = new Intent(getBaseContext(), SdlService.class);
- startService(startIntent);
- }
- }
-
- @Override
- public boolean onCreateOptionsMenu(Menu menu) {
- // Inflate the menu; this adds items to the action bar if it is present.
- getMenuInflater().inflate(R.menu.main, menu);
- return true;
- }
-
- @Override
- public boolean onOptionsItemSelected(MenuItem item) {
- // Handle action bar item clicks here. The action bar will
- // automatically handle clicks on the Home/Up button, so long
- // as you specify a parent activity in AndroidManifest.xml.
- int id = item.getItemId();
- if (id == R.id.action_settings) {
- return true;
- }
- return super.onOptionsItemSelected(item);
- }
-}
diff --git a/HelloSdl/src/com/hellosdl/sdl/SdlReceiver.java b/HelloSdl/src/com/hellosdl/sdl/SdlReceiver.java
deleted file mode 100644
index 2162516f5..000000000
--- a/HelloSdl/src/com/hellosdl/sdl/SdlReceiver.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package com.hellosdl.sdl;
-
-
-
-import android.content.Context;
-import android.content.Intent;
-import android.util.Log;
-
-
-public class SdlReceiver extends com.smartdevicelink.transport.SdlBroadcastReceiver {
- private static final String TAG = "BCast Receiver";
-
- @Override
- public Class defineLocalSdlRouterClass() {
- return SdlRouterService.class;
- }
-
- @Override
- public void onSdlEnabled(Context context, Intent intent) {
- Log.e(TAG, "SDL Enabled");
- intent.setClass(context, SdlService.class);
- context.startService(intent);
- }
-}
diff --git a/HelloSdl/src/com/hellosdl/sdl/SdlRouterService.java b/HelloSdl/src/com/hellosdl/sdl/SdlRouterService.java
deleted file mode 100644
index b80d30c4e..000000000
--- a/HelloSdl/src/com/hellosdl/sdl/SdlRouterService.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package com.hellosdl.sdl;
-
-
-public class SdlRouterService extends com.smartdevicelink.transport.SdlRouterService {
-
-
-
-}
diff --git a/HelloSdl/src/com/hellosdl/sdl/SdlService.java b/HelloSdl/src/com/hellosdl/sdl/SdlService.java
deleted file mode 100644
index eba5bc780..000000000
--- a/HelloSdl/src/com/hellosdl/sdl/SdlService.java
+++ /dev/null
@@ -1,688 +0,0 @@
-package com.hellosdl.sdl;
-
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-
-import android.app.Service;
-import android.content.Intent;
-import android.os.IBinder;
-import android.util.Log;
-
-import com.hellosdl.MainActivity;
-import com.hellosdl.R;
-import com.smartdevicelink.exception.SdlException;
-import com.smartdevicelink.proxy.SdlProxyALM;
-import com.smartdevicelink.proxy.callbacks.OnServiceEnded;
-import com.smartdevicelink.proxy.callbacks.OnServiceNACKed;
-import com.smartdevicelink.proxy.interfaces.IProxyListenerALM;
-import com.smartdevicelink.proxy.rpc.AddCommandResponse;
-import com.smartdevicelink.proxy.rpc.AddSubMenuResponse;
-import com.smartdevicelink.proxy.rpc.AlertManeuverResponse;
-import com.smartdevicelink.proxy.rpc.AlertResponse;
-import com.smartdevicelink.proxy.rpc.ChangeRegistrationResponse;
-import com.smartdevicelink.proxy.rpc.CreateInteractionChoiceSetResponse;
-import com.smartdevicelink.proxy.rpc.DeleteCommandResponse;
-import com.smartdevicelink.proxy.rpc.DeleteFileResponse;
-import com.smartdevicelink.proxy.rpc.DeleteInteractionChoiceSetResponse;
-import com.smartdevicelink.proxy.rpc.DeleteSubMenuResponse;
-import com.smartdevicelink.proxy.rpc.DiagnosticMessageResponse;
-import com.smartdevicelink.proxy.rpc.DialNumberResponse;
-import com.smartdevicelink.proxy.rpc.EndAudioPassThruResponse;
-import com.smartdevicelink.proxy.rpc.GenericResponse;
-import com.smartdevicelink.proxy.rpc.GetDTCsResponse;
-import com.smartdevicelink.proxy.rpc.GetVehicleDataResponse;
-import com.smartdevicelink.proxy.rpc.ListFilesResponse;
-import com.smartdevicelink.proxy.rpc.OnAudioPassThru;
-import com.smartdevicelink.proxy.rpc.OnButtonEvent;
-import com.smartdevicelink.proxy.rpc.OnButtonPress;
-import com.smartdevicelink.proxy.rpc.OnCommand;
-import com.smartdevicelink.proxy.rpc.OnDriverDistraction;
-import com.smartdevicelink.proxy.rpc.OnHMIStatus;
-import com.smartdevicelink.proxy.rpc.OnHashChange;
-import com.smartdevicelink.proxy.rpc.OnKeyboardInput;
-import com.smartdevicelink.proxy.rpc.OnLanguageChange;
-import com.smartdevicelink.proxy.rpc.OnLockScreenStatus;
-import com.smartdevicelink.proxy.rpc.OnPermissionsChange;
-import com.smartdevicelink.proxy.rpc.OnStreamRPC;
-import com.smartdevicelink.proxy.rpc.OnSystemRequest;
-import com.smartdevicelink.proxy.rpc.OnTBTClientState;
-import com.smartdevicelink.proxy.rpc.OnTouchEvent;
-import com.smartdevicelink.proxy.rpc.OnVehicleData;
-import com.smartdevicelink.proxy.rpc.PerformAudioPassThruResponse;
-import com.smartdevicelink.proxy.rpc.PerformInteractionResponse;
-import com.smartdevicelink.proxy.rpc.PutFile;
-import com.smartdevicelink.proxy.rpc.PutFileResponse;
-import com.smartdevicelink.proxy.rpc.ReadDIDResponse;
-import com.smartdevicelink.proxy.rpc.ResetGlobalPropertiesResponse;
-import com.smartdevicelink.proxy.rpc.ScrollableMessageResponse;
-import com.smartdevicelink.proxy.rpc.SendLocationResponse;
-import com.smartdevicelink.proxy.rpc.SetAppIconResponse;
-import com.smartdevicelink.proxy.rpc.SetDisplayLayoutResponse;
-import com.smartdevicelink.proxy.rpc.SetGlobalPropertiesResponse;
-import com.smartdevicelink.proxy.rpc.SetMediaClockTimerResponse;
-import com.smartdevicelink.proxy.rpc.ShowConstantTbtResponse;
-import com.smartdevicelink.proxy.rpc.ShowResponse;
-import com.smartdevicelink.proxy.rpc.SliderResponse;
-import com.smartdevicelink.proxy.rpc.SpeakResponse;
-import com.smartdevicelink.proxy.rpc.StreamRPCResponse;
-import com.smartdevicelink.proxy.rpc.SubscribeButtonResponse;
-import com.smartdevicelink.proxy.rpc.SubscribeVehicleDataResponse;
-import com.smartdevicelink.proxy.rpc.SystemRequestResponse;
-import com.smartdevicelink.proxy.rpc.UnsubscribeButtonResponse;
-import com.smartdevicelink.proxy.rpc.UnsubscribeVehicleDataResponse;
-import com.smartdevicelink.proxy.rpc.UpdateTurnListResponse;
-import com.smartdevicelink.proxy.rpc.enums.FileType;
-import com.smartdevicelink.proxy.rpc.enums.SdlDisconnectedReason;
-import com.smartdevicelink.proxy.rpc.enums.TextAlignment;
-import com.smartdevicelink.transport.MultiplexTransportConfig;
-import com.smartdevicelink.transport.TransportConstants;
-
-/**
- * While this class is just an extension off the base Android Service class, we hope in the future we can offer something
- * better that takes care of a lot of life cycle stuff.
- * <p>
- * For now this shows the most basic of operations to take when connecting via SDL
- * Here's what it covers
- * 1. Basic Sdl proxy life cycle
- * 2. Sending app icon
- * 3. When to launch activity and dealing with different HMI_STATUS's
- *
- *
- * @author Joey Grover
- *
- */
-public class SdlService extends Service implements IProxyListenerALM{
- private static final String TAG = "SdlService";
- private static final String APP_NAME = "Hello Car"; //TODO enter your own app name here
- private static final String APP_ID = "7331"; //TODO enter your own app id here
- private static final String ICON_SYNC_FILENAME = "icon.png";
- private static final String ICON_FILENAME_SUFFIX = ".png";
-
-
- // variable to create and call functions of the SdlProxy
- private SdlProxyALM proxy = null;
-
- // variable used to increment correlation ID for every request sent to a SDL system
- public int autoIncCorrId = 0;
-
- @Override
- public IBinder onBind(Intent intent) {
- return null;
- }
-
-
-
- @Override
- public void onCreate() {
- super.onCreate();
- startProxy();
- }
-
-
-
- @Override
- public int onStartCommand(Intent intent, int flags, int startId) {
- if(proxy == null){
- startProxy();
- }else if (intent != null && intent.hasExtra(TransportConstants.FORCE_TRANSPORT_CONNECTED)){
- proxy.forceOnConnected();
- }
- return START_STICKY;
- }
-
- @Override
- public void onDestroy() {
- disposeSyncProxy();
- super.onDestroy();
- }
-
-
- /* ***********************************************************************************************************************************************************************
- * ******************************************************* Methods for SdlProxy Management *******************************************************************************
- *************************************************************************************************************************************************************************/
-
- public void startProxy() {
- if (proxy == null) {
- try {
- proxy = new SdlProxyALM(this, APP_NAME,
- true, APP_ID,
- new MultiplexTransportConfig(getBaseContext(), APP_ID));
-
- } catch (SdlException e) {
- e.printStackTrace();
- // error creating proxy, returned proxy = null
- if (proxy == null) {
- stopSelf();
- }
- }
- }
- }
-
- public void disposeSyncProxy() {
- if (proxy != null) {
- try {
- proxy.dispose();
- } catch (SdlException e) {
- e.printStackTrace();
- }
- proxy = null;
- }
- }
-
- /**
- * This will send the app icon over to the SDL system
- * @throws SdlException
- */
- private void sendIcon() throws SdlException {
- PutFile putFile = new PutFile();
- putFile.setFileType(FileType.GRAPHIC_PNG);
- putFile.setSdlFileName(ICON_SYNC_FILENAME);
- putFile.setCorrelationID(autoIncCorrId++);
- putFile.setBulkData(contentsOfResource(R.drawable.ic_launcher));
-
- proxy.sendRPCRequest(putFile);
- }
-
- /**
- * This is a convience method that will grab all the binary data from a resource
- * to be able to be sent to the SDL sytem
- * @param resource
- * @return
- */
- private byte[] contentsOfResource(int resource) {
- InputStream is = null;
- try {
- is = getResources().openRawResource(resource);
- ByteArrayOutputStream os = new ByteArrayOutputStream(is.available());
- final int buffersize = 4096;
- final byte[] buffer = new byte[buffersize];
- int available = 0;
- while ((available = is.read(buffer)) >= 0) {
- os.write(buffer, 0, available);
- }
- return os.toByteArray();
- } catch (IOException e) {
- Log.w("SDL Service", "Can't read icon file", e);
- return null;
- } finally {
- if (is != null) {
- try {
- is.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- }
- }
-
- /* ***********************************************************************************************************************************************************************
- * ******************************************************* Methods for IProxyListenerALM *******************************************************************************
- *************************************************************************************************************************************************************************/
-
- @Override
- public void onOnHMIStatus(OnHMIStatus notification) {
-
- switch(notification.getHmiLevel()) {
- case HMI_FULL:
- Log.i(TAG, "HMI_FULL");
- //When we get this notification it means we have main access to the SDL System
- Intent start = new Intent(this,MainActivity.class);
- start.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP + Intent.FLAG_ACTIVITY_NEW_TASK);
- startActivity(start);
-
- if (notification.getFirstRun()) {
- // send welcome message if applicable
- try {
- proxy.show(APP_NAME + " this is the first", "show command", TextAlignment.CENTERED, autoIncCorrId++);
- }catch (SdlException e) {
- e.printStackTrace();
- }
-
- // TODO this is where the developer should send addcommands and subsribe to buttons
- }else { //If this isn't our first time receiving HMI_FULL
- try {
- proxy.show("SdlProxy is", "Alive", TextAlignment.CENTERED, autoIncCorrId++);
- } catch (SdlException e) {
- e.printStackTrace();
- }
- }
- break;
- case HMI_LIMITED:
- Log.i(TAG, "HMI_LIMITED");
- break;
- case HMI_BACKGROUND:
- Log.i(TAG, "HMI_BACKGROUND");
- break;
- case HMI_NONE:
- Log.i(TAG, "HMI_NONE");
- //Since the first HMI status sent to an app is HMI_NONE we take this as we have just established a connection and we want to send our icon
- if(notification.getFirstRun()){
- try {
- sendIcon();
- } catch (SdlException e) {
- e.printStackTrace();
- }
- }
- break;
- default:
- return;
- }
-
- }
-
-
- @Override
- public void onProxyClosed(String info, Exception e, SdlDisconnectedReason reason) {
- //After we are asked to close the proxy we should shut down our service
- stopSelf();
- }
-
-
- @Override
- public void onError(String info, Exception e) {
-
-
- }
-
-
- @Override
- public void onGenericResponse(GenericResponse response) {
-
-
- }
-
-
- @Override
- public void onOnCommand(OnCommand notification) {
-
-
- }
-
-
- @Override
- public void onAddCommandResponse(AddCommandResponse response) {
-
-
- }
-
-
- @Override
- public void onAddSubMenuResponse(AddSubMenuResponse response) {
-
-
- }
-
-
- @Override
- public void onCreateInteractionChoiceSetResponse(
- CreateInteractionChoiceSetResponse response) {
-
-
- }
-
-
- @Override
- public void onAlertResponse(AlertResponse response) {
-
-
- }
-
-
- @Override
- public void onDeleteCommandResponse(DeleteCommandResponse response) {
-
-
- }
-
-
- @Override
- public void onDeleteInteractionChoiceSetResponse(
- DeleteInteractionChoiceSetResponse response) {
-
-
- }
-
-
- @Override
- public void onDeleteSubMenuResponse(DeleteSubMenuResponse response) {
-
-
- }
-
-
- @Override
- public void onPerformInteractionResponse(PerformInteractionResponse response) {
-
-
- }
-
-
- @Override
- public void onResetGlobalPropertiesResponse(
- ResetGlobalPropertiesResponse response) {
-
-
- }
-
-
- @Override
- public void onSetGlobalPropertiesResponse(
- SetGlobalPropertiesResponse response) {
-
-
- }
-
-
- @Override
- public void onSetMediaClockTimerResponse(SetMediaClockTimerResponse response) {
-
-
- }
-
-
- @Override
- public void onShowResponse(ShowResponse response) {
-
-
- }
-
-
- @Override
- public void onSpeakResponse(SpeakResponse response) {
-
-
- }
-
-
- @Override
- public void onOnButtonEvent(OnButtonEvent notification) {
-
-
- }
-
-
- @Override
- public void onOnButtonPress(OnButtonPress notification) {
-
-
- }
-
-
- @Override
- public void onSubscribeButtonResponse(SubscribeButtonResponse response) {
-
-
- }
-
-
- @Override
- public void onUnsubscribeButtonResponse(UnsubscribeButtonResponse response) {
-
-
- }
-
-
- @Override
- public void onOnPermissionsChange(OnPermissionsChange notification) {
-
-
- }
-
-
- @Override
- public void onSubscribeVehicleDataResponse(
- SubscribeVehicleDataResponse response) {
-
-
- }
-
-
- @Override
- public void onUnsubscribeVehicleDataResponse(
- UnsubscribeVehicleDataResponse response) {
-
-
- }
-
-
- @Override
- public void onGetVehicleDataResponse(GetVehicleDataResponse response) {
-
-
- }
-
-
- @Override
- public void onOnVehicleData(OnVehicleData notification) {
-
-
- }
-
-
- @Override
- public void onPerformAudioPassThruResponse(
- PerformAudioPassThruResponse response) {
-
-
- }
-
-
- @Override
- public void onEndAudioPassThruResponse(EndAudioPassThruResponse response) {
-
-
- }
-
-
- @Override
- public void onOnAudioPassThru(OnAudioPassThru notification) {
-
-
- }
-
-
- @Override
- public void onPutFileResponse(PutFileResponse response) {
-
-
- }
-
-
- @Override
- public void onDeleteFileResponse(DeleteFileResponse response) {
-
-
- }
-
-
- @Override
- public void onListFilesResponse(ListFilesResponse response) {
-
-
- }
-
-
- @Override
- public void onSetAppIconResponse(SetAppIconResponse response) {
-
-
- }
-
-
- @Override
- public void onScrollableMessageResponse(ScrollableMessageResponse response) {
-
-
- }
-
-
- @Override
- public void onChangeRegistrationResponse(ChangeRegistrationResponse response) {
-
-
- }
-
-
- @Override
- public void onSetDisplayLayoutResponse(SetDisplayLayoutResponse response) {
-
-
- }
-
-
- @Override
- public void onOnLanguageChange(OnLanguageChange notification) {
-
-
- }
-
-
- @Override
- public void onOnHashChange(OnHashChange notification) {
-
-
- }
-
-
- @Override
- public void onSliderResponse(SliderResponse response) {
-
-
- }
-
-
- @Override
- public void onOnDriverDistraction(OnDriverDistraction notification) {
-
-
- }
-
-
- @Override
- public void onOnTBTClientState(OnTBTClientState notification) {
-
-
- }
-
-
- @Override
- public void onOnSystemRequest(OnSystemRequest notification) {
-
-
- }
-
-
- @Override
- public void onSystemRequestResponse(SystemRequestResponse response) {
-
- }
-
-
- @Override
- public void onOnKeyboardInput(OnKeyboardInput notification) {
-
- }
-
-
- @Override
- public void onOnTouchEvent(OnTouchEvent notification) {
-
- }
-
-
- @Override
- public void onDiagnosticMessageResponse(DiagnosticMessageResponse response) {
-
- }
-
-
- @Override
- public void onReadDIDResponse(ReadDIDResponse response) {
-
- }
-
-
- @Override
- public void onGetDTCsResponse(GetDTCsResponse response) {
-
- }
-
-
- @Override
- public void onOnLockScreenNotification(OnLockScreenStatus notification) {
-
- }
-
-
- @Override
- public void onOnStreamRPC(OnStreamRPC notification) {
- // TODO Auto-generated method stub
-
- }
-
-
- @Override
- public void onStreamRPCResponse(StreamRPCResponse response) {
- // TODO Auto-generated method stub
-
- }
-
-
- @Override
- public void onDialNumberResponse(DialNumberResponse response) {
- // TODO Auto-generated method stub
-
- }
-
-
- @Override
- public void onSendLocationResponse(SendLocationResponse response) {
- // TODO Auto-generated method stub
-
- }
-
-
- @Override
- public void onServiceEnded(OnServiceEnded serviceEnded) {
- // TODO Auto-generated method stub
-
- }
-
-
- @Override
- public void onServiceNACKed(OnServiceNACKed serviceNACKed) {
- // TODO Auto-generated method stub
-
- }
-
-
- @Override
- public void onShowConstantTbtResponse(ShowConstantTbtResponse response) {
- // TODO Auto-generated method stub
-
- }
-
-
- @Override
- public void onAlertManeuverResponse(AlertManeuverResponse response) {
- // TODO Auto-generated method stub
-
- }
-
-
- @Override
- public void onUpdateTurnListResponse(UpdateTurnListResponse response) {
- // TODO Auto-generated method stub
-
- }
-
-
- @Override
- public void onServiceDataACK() {
- // TODO Auto-generated method stub
-
- }
-
-}