Commit 6a449bd0 authored by Oliver Behnke's avatar Oliver Behnke

Merge branch 'master' into drupal-eah-einstein

parents c1c9e5ae 06ed2cf4
......@@ -17,7 +17,7 @@ A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**System Information (please complete the following information):**
**System Information**
- OS:
- BOINC Version:
......
......@@ -4,7 +4,7 @@
# Social
[![Slack](https://img.shields.io/badge/slack-boincworkspace-blue?logo=slack)](https://join.slack.com/t/boincworkspace/shared_invite/enQtNzA3MTQ4NDA0Njc4LTM4NTEyZTY1MWEwZjAyNTVmOTg3NDA2NjVjZDQzMWQ3NmFjYTc4MTNkNTEyNjRkOTQ4MWU5Nzk3NzRhNTg0NDI) [![Discord](https://img.shields.io/badge/discord-boincnetwork-blue?logo=discord)](https://discord.gg/kebpfnr)
[![Slack](https://img.shields.io/badge/slack-boincworkspace-blue?logo=slack)](https://join.slack.com/t/boincworkspace/shared_invite/enQtNzA3MTQ4NDA0Njc4LTM4NTEyZTY1MWEwZjAyNTVmOTg3NDA2NjVjZDQzMWQ3NmFjYTc4MTNkNTEyNjRkOTQ4MWU5Nzk3NzRhNTg0NDI) [![Discord](https://img.shields.io/badge/discord-boincnetwork-blue?logo=discord)](https://discord.gg/wPRafUq)
# BOINC
......
......@@ -34,6 +34,7 @@
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<!-- Features required for Android TV, consoles, and set-top boxes like Nexus Player, OUYA,
Razer Forge TV, Nvidia SHIELD, etc -->
......
/*******************************************************************************
* This file is part of BOINC.
* http://boinc.berkeley.edu
* Copyright (C) 2012 University of California
* Copyright (C) 2019 University of California
*
* BOINC is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License
......@@ -33,6 +33,7 @@ import edu.berkeley.boinc.rpc.ProjectInfo;
import edu.berkeley.boinc.rpc.Project;
import edu.berkeley.boinc.rpc.Result;
import edu.berkeley.boinc.rpc.ImageWrapper;
import edu.berkeley.boinc.utils.ErrorCodeDescription;
interface IMonitor {
/////// client interface //////////////////////////////////////////
......@@ -46,7 +47,7 @@ boolean resultOp(in int op, in String url, in String name); // implement: c
AccountOut createAccountPolling(in AccountIn information); // implement: call clientInterface.createAccountPolling(information);
String readAuthToken(in String path); // implement: call clientInterface.readAuthToken(String);
ProjectConfig getProjectConfigPolling(in String url); // implement: call clientInterface.getProjectConfigPolling(url);
int addAcctMgrErrorNum(in String url, in String userName, in String pwd); // implement: return clientInterface.addAcctMgr(url, userName, pwd).error_num; check return null!=clientInterface.addAcctMgr(url, userName, pwd)
ErrorCodeDescription addAcctMgrErrorNum(in String url, in String userName, in String pwd); // implement: return clientInterface.addAcctMgr(url, userName, pwd).error_num; check return null!=clientInterface.addAcctMgr(url, userName, pwd)
AcctMgrInfo getAcctMgrInfo(); // implement: call clientInterface.getAcctMgrInfo();
boolean synchronizeAcctMgr(in String url); // implement: call clientInterface.synchronizeAcctMgr(String);
boolean setRunMode(in int mode); // implement: call clientInterface.setRunMode(Integer);
......@@ -65,7 +66,7 @@ ProjectInfo getProjectInfo(String url); // clientInterface.getProjectInfo(Strin
boolean setDomainName(in String deviceName); // clientInterface.setDomainName(String deviceName);
/////// general //////////////////////////////////////////
boolean boincMutexAcquired(); // implment: call Monitor.boincMutexAcquired();
boolean boincMutexAcquired(); // implement: call Monitor.boincMutexAcquired();
void forceRefresh(); // implement: call Monitor.forceRefresh();
boolean isStationaryDeviceSuspected(); // implement: call Monitor.getDeviceStatus().isStationaryDevice();
int getBatteryChargeStatus(); // implement: return getDeviceStatus().getStatus().battery_charge_pct;
......@@ -114,4 +115,4 @@ void setShowAdvanced(in boolean isShow);
void setStationaryDeviceMode(in boolean mode);
boolean getSuspendWhenScreenOn();
void setSuspendWhenScreenOn(in boolean swso);
}
\ No newline at end of file
}
/*******************************************************************************
* This file is part of BOINC.
* http://boinc.berkeley.edu
* Copyright (C) 2019 University of California
*
* BOINC is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation,
* either version 3 of the License, or (at your option) any later version.
*
* BOINC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with BOINC. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/
package edu.berkeley.boinc.utils;
parcelable ErrorCodeDescription;
/*
* This file is part of BOINC.
* http://boinc.berkeley.edu
* Copyright (C) 2012 University of California
* Copyright (C) 2019 University of California
*
* BOINC is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License
......@@ -531,7 +531,7 @@ public class ProjectsFragment extends Fragment {
case RpcClient.MGR_SYNC:
return BOINCActivity.monitor.synchronizeAcctMgr(data.acctMgrInfo.acct_mgr_url);
case RpcClient.MGR_DETACH:
return BOINCActivity.monitor.addAcctMgrErrorNum("", "", "") == BOINCErrors.ERR_OK;
return BOINCActivity.monitor.addAcctMgrErrorNum("", "", "").code == BOINCErrors.ERR_OK;
// transfer operations
case RpcClient.TRANSFER_RETRY:
......
/*
* This file is part of BOINC.
* http://boinc.berkeley.edu
* Copyright (C) 2012 University of California
* Copyright (C) 2019 University of California
*
* BOINC is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License
......@@ -314,7 +314,7 @@ public class AcctMgrFragment extends DialogFragment {
return getString(stringResource);
}
private class AttachProjectAsyncTask extends AsyncTask<String, Void, Integer> {
private class AttachProjectAsyncTask extends AsyncTask<String, Void, ErrorCodeDescription> {
@Override
protected void onPreExecute() {
......@@ -322,7 +322,7 @@ public class AcctMgrFragment extends DialogFragment {
}
@Override
protected Integer doInBackground(String... arg0) {
protected ErrorCodeDescription doInBackground(String... arg0) {
String url = arg0[0];
String name = arg0[1];
......@@ -332,11 +332,11 @@ public class AcctMgrFragment extends DialogFragment {
}
@Override
protected void onPostExecute(Integer result) {
protected void onPostExecute(ErrorCodeDescription result) {
super.onPostExecute(result);
if (Logging.DEBUG)
Log.d(Logging.TAG, "AcctMgrFragment.AttachProjectAsyncTask onPostExecute, returned: " + result);
if (result == BOINCErrors.ERR_OK) {
if (result.code == BOINCErrors.ERR_OK && (result.description == null || result.description.isEmpty())) {
dismiss();
if (returnToMainActivity) {
if (Logging.DEBUG)
......@@ -352,7 +352,11 @@ public class AcctMgrFragment extends DialogFragment {
ongoingWrapper.setVisibility(View.GONE);
continueB.setVisibility(View.VISIBLE);
warning.setVisibility(View.VISIBLE);
warning.setText(mapErrorNumToString(result));
if (result.description != null && !result.description.isEmpty()) {
warning.setText(result.description);
} else {
warning.setText(mapErrorNumToString(result.code));
}
}
}
}
......
/*
* This file is part of BOINC.
* http://boinc.berkeley.edu
* Copyright (C) 2012 University of California
* Copyright (C) 2019 University of California
*
* BOINC is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License
......@@ -30,6 +30,7 @@ import edu.berkeley.boinc.rpc.AcctMgrInfo;
import edu.berkeley.boinc.rpc.ProjectConfig;
import edu.berkeley.boinc.rpc.ProjectInfo;
import edu.berkeley.boinc.utils.BOINCErrors;
import edu.berkeley.boinc.utils.ErrorCodeDescription;
import edu.berkeley.boinc.utils.Logging;
import android.app.Service;
......@@ -316,9 +317,9 @@ public class ProjectAttachService extends Service {
* @param pwd password
* @return result code, see BOINCErrors
*/
public int attachAcctMgr(String url, String name, String pwd) {
public ErrorCodeDescription attachAcctMgr(String url, String name, String pwd) {
int reply = -1;
ErrorCodeDescription reply = new ErrorCodeDescription();
Integer maxAttempts = getResources().getInteger(R.integer.attach_acctmgr_retries);
Integer attemptCounter = 0;
Boolean retry = true;
......@@ -340,7 +341,7 @@ public class ProjectAttachService extends Service {
if(Logging.DEBUG) {
Log.d(Logging.TAG, "ProjectAttachService.attachAcctMgr returned: " + reply);
}
switch(reply) {
switch(reply.code) {
case BOINCErrors.ERR_GETHOSTBYNAME: // no internet
attemptCounter++; // limit number of retries
break;
......@@ -365,7 +366,7 @@ public class ProjectAttachService extends Service {
}
}
if(reply != BOINCErrors.ERR_OK) {
if(reply.code != BOINCErrors.ERR_OK || (reply.description != null && !reply.description.isEmpty())) {
return reply;
}
......@@ -379,7 +380,7 @@ public class ProjectAttachService extends Service {
}
}
if(info == null) {
return -1;
return new ErrorCodeDescription(-1);
}
if(Logging.DEBUG) {
......@@ -387,7 +388,7 @@ public class ProjectAttachService extends Service {
"ProjectAttachService.attachAcctMgr successful: " + info.acct_mgr_url + info.acct_mgr_name +
info.have_credentials);
}
return BOINCErrors.ERR_OK;
return new ErrorCodeDescription(BOINCErrors.ERR_OK);
}
public class ProjectAttachWrapper {
......
/*
* This file is part of BOINC.
* http://boinc.berkeley.edu
* Copyright (C) 2012 University of California
* Copyright (C) 2019 University of California
*
* BOINC is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License
......@@ -1176,13 +1176,13 @@ public class Monitor extends Service {
}
@Override
public int addAcctMgrErrorNum(String url, String userName, String pwd)
public ErrorCodeDescription addAcctMgrErrorNum(String url, String userName, String pwd)
throws RemoteException {
AcctMgrRPCReply acctMgr = clientInterface.addAcctMgr(url, userName, pwd);
if (acctMgr != null) {
return acctMgr.error_num;
return new ErrorCodeDescription(acctMgr.error_num, acctMgr.messages.isEmpty() ? "" : acctMgr.messages.toString());
}
return -1;
return new ErrorCodeDescription(-1);
}
@Override
......
/*******************************************************************************
* This file is part of BOINC.
* http://boinc.berkeley.edu
* Copyright (C) 2019 University of California
*
* BOINC is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation,
* either version 3 of the License, or (at your option) any later version.
*
* BOINC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with BOINC. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/
package edu.berkeley.boinc.utils;
import android.os.Parcel;
import android.os.Parcelable;
public class ErrorCodeDescription implements Parcelable {
public int code;
public String description;
public static final Parcelable.Creator<ErrorCodeDescription> CREATOR = new Parcelable.Creator<ErrorCodeDescription>() {
public ErrorCodeDescription createFromParcel(Parcel in) {
return new ErrorCodeDescription(in);
}
public ErrorCodeDescription[] newArray(int size) {
return null;
}
};
public ErrorCodeDescription() {
code = 0;
description = "";
}
public ErrorCodeDescription(Parcel parcel)
{
readFromParcel(parcel);
}
public ErrorCodeDescription (int _code, String _description) {
code = _code;
description = _description;
}
public ErrorCodeDescription (int _code) {
code = _code;
description = "";
}
public int describeContents() {
return 0;
}
public void writeToParcel(Parcel parcel, int i) {
parcel.writeInt(code);
parcel.writeString(description);
}
public void readFromParcel(Parcel in) {
code = in.readInt();
description= in.readString();
}
}
......@@ -44,7 +44,6 @@
android:layout_height="0dip"
android:padding="5dp"
android:clickable="true"
android:focusable="true"
android:layout_margin="5dp"
android:background="@drawable/shape_button_blue"
android:textColor="@color/white_smoke"
......
......@@ -21,8 +21,7 @@
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:clickable="true"
android:focusable="true">
android:clickable="true">
<RelativeLayout
android:layout_width="60dp"
......
......@@ -50,7 +50,6 @@
android:layout_height="wrap_content"
android:padding="5dp"
android:clickable="true"
android:focusable="true"
android:layout_margin="5dp"
android:background="@drawable/shape_button_blue"
android:textColor="@color/white_smoke"
......@@ -64,7 +63,6 @@
android:layout_height="wrap_content"
android:padding="5dp"
android:clickable="true"
android:focusable="true"
android:layout_margin="5dp"
android:background="@drawable/shape_button_red"
android:textColor="@color/white_smoke"
......
......@@ -22,7 +22,6 @@
android:layout_height="match_parent"
android:orientation="vertical"
android:clickable="true"
android:focusable="true"
android:padding="5dp">
<LinearLayout
......
......@@ -163,7 +163,6 @@
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:clickable="true"
android:focusable="true"
android:textColor="@color/dark_blue"/>
</LinearLayout>
......
......@@ -21,8 +21,7 @@
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:clickable="true"
android:focusable="true">
android:clickable="true">
<RelativeLayout
android:id="@+id/icon_background"
......
......@@ -22,7 +22,6 @@
android:layout_height="wrap_content"
android:orientation="horizontal"
android:clickable="true"
android:focusable="true"
android:background="@drawable/shape_light_blue_background_wo_stroke">
<RelativeLayout
......
......@@ -25,7 +25,6 @@
android:id="@+id/tasksList"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:clickable="true"
android:focusable="true"></ListView>
android:clickable="true"></ListView>
</LinearLayout>
......@@ -208,7 +208,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
android:focusable="true"
android:contentDescription="@drawable/resumetask"
android:src="@drawable/resumetask"
android:layout_marginTop="5dp"/>
......@@ -218,7 +217,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
android:focusable="true"
android:contentDescription="@drawable/aborttask"
android:src="@drawable/aborttask"
android:layout_marginTop="5dp"
......
......@@ -42,7 +42,7 @@
<string name="attachproject_hint_projectwebsite_science">Mehr über die Wissenschaft zu erfahren</string>
<string name="attachproject_hint_projectwebsite_stats">Die Statistik zur Teilnahme zu sehen</string>
<string name="attachproject_hint_projectwebsite_community">Kontakt mit anderen Teilnehmern aufzunehmen</string>
<string name="attachproject_hint_platforms_header">BOINC ist auch für Ihren Computer oder Laptop verfügbar, auf boinc.berkeley.edu erfahren Sie mehr.</string>
<string name="attachproject_hint_platforms_header">BOINC ist auch für Ihren Computer oder Laptop erhältlich, besuchen Sie uns unter boinc.berkeley.edu, um mehr zu erfahren.</string>
<!--project login-->
<string name="attachproject_login_loading">kontaktiere Projektserver…</string>
<string name="attachproject_login_image_description">Projektlogo.</string>
......@@ -104,6 +104,7 @@
<string name="attachproject_error_bad_pwd">Passwort zu kurz</string>
<string name="attachproject_error_creation_disabled">Die Kontoerstellung ist bei diesem Projekt deaktiviert</string>
<string name="attachproject_error_invalid_url">Ungültige Adresse</string>
<string name="attachproject_error_consent_required">Dieses Projekt erfordert die Zustimmung zu seinen Nutzungsbedingungen.</string>
<!--working activity-->
<string name="attachproject_working_back_button">Zurück</string>
<string name="attachproject_working_finish_button">Beenden</string>
......@@ -341,6 +342,7 @@
<string name="about_name">BOINC</string>
<string name="about_version">Version</string>
<string name="about_name_long">Berkeley Open Infrastructure for Network Computing</string>
<string name="about_copyright">\u00A9 2003–2019 Universität von Kalifornien, Berkeley.</string>
<string name="about_copyright_reserved">Alle Rechte vorbehalten.</string>
<string name="about_credits">Dank dem Max Planck Institut für Gravitationsphysik, IBM und HTC, für die Unterstützung.</string>
<!--notice notification e.g. New notice from SETI@HOME OR 3 new notices-->
......
......@@ -113,6 +113,7 @@ goiko erabilpen baldintzak onartzen dituzu.
<string name="attachproject_error_bad_pwd">Pasahitza baztertu da</string>
<string name="attachproject_error_creation_disabled">Kontu-sortzea desgaituta dago proiektu honetan</string>
<string name="attachproject_error_invalid_url">URL baliogabea</string>
<string name="attachproject_error_consent_required">Proiektu honek bere erabiltzeko baldintzen onarpena eskatzen du</string>
<!--working activity-->
<string name="attachproject_working_back_button">Atzera</string>
<string name="attachproject_working_finish_button">Amaitu</string>
......@@ -362,6 +363,7 @@ gehigarria
<string name="about_name">BOINC</string>
<string name="about_version">Bertsioa</string>
<string name="about_name_long">Sare bidezko Konputaziorako Berkeleyko Azpiegitura Irekia</string>
<string name="about_copyright">\u00A9 2003–2019 Kaliforniako Unibertsitatea Berkeleyn.</string>
<string name="about_copyright_reserved">Eskubide guztiak erreserbatuta.</string>
<string name="about_credits">Eskerrik asko Max Planck-en Grabitazioaren Fisikako Institutuari, IBM Korporazioari eta HTC
Korporazioari beraien laguntzagatik.
......
......@@ -3,7 +3,7 @@
<!--app global-->
<string name="app_name">BOINC</string>
<!--generic. used by multiple Activities/tabs-->
<string name="generic_loading">Veuillez patienter...</string>
<string name="generic_loading">Chargement en cours. Veuillez patienter...</string>
<string name="generic_button_continue">Continuer</string>
<string name="generic_button_finish">Terminer</string>
<!--attach project-->
......@@ -113,6 +113,7 @@
<string name="attachproject_error_bad_pwd">Mot de passe refusé</string>
<string name="attachproject_error_creation_disabled">La création de compte est désactivée pour ce projet</string>
<string name="attachproject_error_invalid_url">URL non valide</string>
<string name="attachproject_error_consent_required">Ce projet nécessite le consentement à ses conditions d\'utilisation</string>
<!--working activity-->
<string name="attachproject_working_back_button">Retour</string>
<string name="attachproject_working_finish_button">Terminer</string>
......@@ -362,6 +363,7 @@
<string name="about_name">BOINC</string>
<string name="about_version">Version</string>