(Android Phoenix) Add 'permissions' to ModuleWrapper etc.

This commit is contained in:
twinaphex 2013-12-14 21:51:21 +01:00
parent 122613efdb
commit f5edd42535
5 changed files with 39 additions and 12 deletions

View File

@ -10,7 +10,7 @@
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.CAMERA"/> <uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION " /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<application <application
android:allowBackup="true" android:allowBackup="true"

View File

@ -36,9 +36,10 @@
<string name="core_info_displayNameTitle">Display Name</string> <string name="core_info_displayNameTitle">Display Name</string>
<string name="core_info_internalNameTitle">Internal Name</string> <string name="core_info_internalNameTitle">Internal Name</string>
<string name="core_info_systemNameTitle">Description</string> <string name="core_info_systemNameTitle">Description</string>
<string name="core_info_emu_author">Author(s)</string> <string name="core_info_author">Author(s)</string>
<string name="core_info_licenseTitle">Core License</string> <string name="core_info_licenseTitle">Core License</string>
<string name="core_info_manufacterer">Manufacturer</string> <string name="core_info_manufacturer">Manufacturer</string>
<string name="core_info_permissions">Permissions</string>
<!-- Display Refresh Rate Test Class --> <!-- Display Refresh Rate Test Class -->
<string name="refresh_rate_calibration">Refresh rate calibration</string> <string name="refresh_rate_calibration">Refresh rate calibration</string>

View File

@ -24,6 +24,7 @@ public final class ModuleWrapper implements IconAdapterItem, Comparable<ModuleWr
private final String license; private final String license;
private final List<String> authors; private final List<String> authors;
private final List<String> supportedExtensions; private final List<String> supportedExtensions;
private final List<String> permissions;
/** /**
* Constructor * Constructor
@ -89,6 +90,17 @@ public final class ModuleWrapper implements IconAdapterItem, Comparable<ModuleWr
this.authors = new ArrayList<String>(); this.authors = new ArrayList<String>();
this.authors.add(emuAuthors); this.authors.add(emuAuthors);
} }
final String permissions = infoFile.getString("permissions");
if (permissions != null && permissions.contains("|"))
{
this.permissions = new ArrayList<String>(Arrays.asList(permissions.split("\\|")));
}
else
{
this.permissions = new ArrayList<String>();
this.permissions.add(permissions);
}
} }
else // No info file. else // No info file.
{ {
@ -99,6 +111,7 @@ public final class ModuleWrapper implements IconAdapterItem, Comparable<ModuleWr
this.authors = new ArrayList<String>(); this.authors = new ArrayList<String>();
this.supportedExtensions = new ArrayList<String>(); this.supportedExtensions = new ArrayList<String>();
this.coreName = coreName; this.coreName = coreName;
this.permissions = new ArrayList<String>();
} }
} }
@ -134,6 +147,7 @@ public final class ModuleWrapper implements IconAdapterItem, Comparable<ModuleWr
/** /**
* Gets the name of the system that is emulated by this wrapped core. * Gets the name of the system that is emulated by this wrapped core.
* (optional - in case core is an emulator)
* *
* @return the name of the system that is emulated by this wrapped core. * @return the name of the system that is emulated by this wrapped core.
*/ */
@ -154,10 +168,11 @@ public final class ModuleWrapper implements IconAdapterItem, Comparable<ModuleWr
/** /**
* Gets the name of the manufacturer of the console that * Gets the name of the manufacturer of the console that
* this core emulates. * this core emulates. (optional - in case core is an
* emulator)
* *
* @return the name of the manufacturer of the console that * @return the name of the manufacturer of the console that
* this core emulates. * this core emulates. (optional)
*/ */
public String getManufacturer() public String getManufacturer()
{ {
@ -165,15 +180,25 @@ public final class ModuleWrapper implements IconAdapterItem, Comparable<ModuleWr
} }
/** /**
* Gets the list of authors of this emulator core. * Gets the list of authors of this core.
* *
* @return the list of authors of this emulator core. * @return the list of authors of this core.
*/ */
public List<String> getEmulatorAuthors() public List<String> getAuthors()
{ {
return authors; return authors;
} }
/**
* Gets the list of permissions of this core.
*
* @return the list of authors of this core.
*/
public List<String> getPermissions()
{
return permissions;
}
/** /**
* Gets the List of supported extensions for this core. * Gets the List of supported extensions for this core.
* *

View File

@ -56,9 +56,10 @@ public final class InstalledCoreInfoFragment extends ListFragment
adapter.add(new InstalledCoreInfoItem(getString(R.string.core_info_displayNameTitle), core.getDisplayName())); adapter.add(new InstalledCoreInfoItem(getString(R.string.core_info_displayNameTitle), core.getDisplayName()));
adapter.add(new InstalledCoreInfoItem(getString(R.string.core_info_internalNameTitle), core.getInternalName())); adapter.add(new InstalledCoreInfoItem(getString(R.string.core_info_internalNameTitle), core.getInternalName()));
adapter.add(new InstalledCoreInfoItem(getString(R.string.core_info_systemNameTitle), core.getEmulatedSystemName())); adapter.add(new InstalledCoreInfoItem(getString(R.string.core_info_systemNameTitle), core.getEmulatedSystemName()));
adapter.add(new InstalledCoreInfoItem(getString(R.string.core_info_manufacterer), core.getManufacturer())); adapter.add(new InstalledCoreInfoItem(getString(R.string.core_info_manufacturer), core.getManufacturer()));
adapter.add(new InstalledCoreInfoItem(getString(R.string.core_info_emu_author), core.getEmulatorAuthors())); adapter.add(new InstalledCoreInfoItem(getString(R.string.core_info_author), core.getAuthors()));
adapter.add(new InstalledCoreInfoItem(getString(R.string.core_info_licenseTitle), core.getCoreLicense())); adapter.add(new InstalledCoreInfoItem(getString(R.string.core_info_licenseTitle), core.getCoreLicense()));
adapter.add(new InstalledCoreInfoItem(getString(R.string.core_info_permissions), core.getPermissions()));
// Set the list adapter. // Set the list adapter.
infoView.setAdapter(adapter); infoView.setAdapter(adapter);

View File

@ -9,7 +9,7 @@ import java.io.InputStreamReader;
import android.annotation.TargetApi; import android.annotation.TargetApi;
import android.content.Context; import android.content.Context;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.content.pm.PackageManager; //import android.content.pm.PackageManager;
import android.media.AudioManager; import android.media.AudioManager;
import android.media.AudioTrack; import android.media.AudioTrack;
import android.os.Build; import android.os.Build;
@ -476,7 +476,7 @@ public final class UserPreferences
@TargetApi(17) @TargetApi(17)
private static boolean hasLowLatencyAudio(Context ctx) private static boolean hasLowLatencyAudio(Context ctx)
{ {
PackageManager pm = ctx.getPackageManager(); //PackageManager pm = ctx.getPackageManager();
return true;//pm.hasSystemFeature(PackageManager.FEATURE_AUDIO_LOW_LATENCY); return true;//pm.hasSystemFeature(PackageManager.FEATURE_AUDIO_LOW_LATENCY);
} }