forked from henrichg/PhoneProfilesPlus
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcospravit.txt
More file actions
478 lines (377 loc) · 22.2 KB
/
cospravit.txt
File metadata and controls
478 lines (377 loc) · 22.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
------------------------
funkční nastavení pro Huawei P30 s Androidem 10 a EMUI 10.
nastavení-aplikace- aplikace-PPP-podrobnosti o spotřebě energie-spouštění aplikací:
Spravovat automaticky - ne
Spravovat ručně 3x ano
-automatické souštění
-sekundární souštění
-Spustit na ozadí
------------------------
Ulohy, ktore su spravene [x] a ktore nie [ ]:
[ ] Priority Notification Event
[ ] Normal media volume, headphone media volume, Bluetooth media volume
[ ] Sony's "Stamina" mode as profile preference - skor Power save change senzor
[ ] USB connection to PC as storage device, USB connection to PC as camera, connection to USB stick in accessories parameter for events
[ ] option to hide PPP from Launcher
[ ] Set min and max CPU frequency
[ ] Open a website with profile
[ ] profile/event search
[ ] Persistent profile/event: sets its options every x minutes - asi periodic sensor
[ ] Android Wear support?
[ ] (AND, OR, XOR, NOT. Or at least NOT.)<-NOT is already available in most preferences. If that stays, that does the same.
[ ] a plugin system? (very small core app, ability to install additional event preferences, maybe only time event preinstalled)
------------------------
UNDO:
=====
Na "Undo profile" sa pouziva FIFO, je to vlastne zoznam profilov a udalosti v poradi, v akom sa aktivovali, spustili.
1. DataWrapper.fifoAddProfile()
PhoneProfilesService.doFirstStart() - PPApplication.prefLastActivatedProfle, 0
DataWrapper._activateProfile() - profileId (ktory sa aktivuje), 0
DataWrapper.activateProfileFromEvent() - profieId, event_id
Event.startEvent() - profileId, _id - ked nejde o merge profilov a nie je to manualna aktivacia z udalosti
Event.doActivateEndProfile() - profileId, _id - ked nejde o merge profilov a nie je to manualna aktivacia z udalosti
koniec udalosti, nie je manualne aktivovany profil:
EventsHandler.handleEvents() - defaultProfile, 0 - ak ide o aktivaciu default profilu, je nakonfigurovany
EventsHandler.handleEvents() - PPApplication.prefLastActivatedProfile, 0 - ak nie je nakonfigurovany default profile
koniec udalosti, je manualne aktivovany profil:
EventsHandler.handleEvents() - semiOldActivatedProfileId, 0 - ak je aktivovany daky profil
EventsHandler.handleEvents() - defaultProfile, 0 - ak nie je aktivovany daky profil a ide o aktivaciu default profilu, je nakonfigurovany
EventsHandler.handleEvents() - PPApplication.prefLastActivatedProfile, 0 - ak nie je aktivovany daky profil a nie je nakonfigurovany default profile
2. DataWrapper.fifoSaveProfiles()
DataWrapper.activateProfile() - pre STARTUP_SOURCE_FOR_FIRST_START - vyprazdni FIFO
EditorProfileListFragment.deleteProfile() - vymaze vymazavany profil z FIFO
EditorProfileListFragment.deleteAllProfiles() - vyprazdnenie FIFO
EventHlandler.handleEvents() - vyprazdnenie FIFO pri starte udalosti pred spustanim udalosti
PhoneProfilesService.doForFirstStart() - vyprazdnenie FIFO na prvy start, potom hned nasleduje pridanie PPApplication.prefLastActivatedProfile
PPApplication._exitApp() - vyprazdnenie FIFO na ukoncenie PPP
Ako sa robi UNDO:
Event.doActivateEndProfile() - ak je EATENDDO_UNDONE_PROFILE - pre merge an non-merge profiles
- Spravi sa zonznam FIFO udalosti, ktore nie su rovne ukoncovanej udalosti.
Profily z ukoncovanej udalosti nas uz nezaujimaju, vsetky sa z FIFO vymazu.
- Z novovzniknuteho FIFO sa vezme posledny profil a ten sa aktivuje
ProfileDurationAlarmBroadcastReceiver._doWork() - ak je AFTER_DURATION_DO_UNDO_PROFILE
- Vymaze sa posledny profil z FIFO, j jedno, ci ma priradenu udalost
- Potom za z FIFO vezme posledny profil a ten sa aktivuje
------------------------
System.Settings:
notifications_use_ring_volume ---+--> ze by na odlinkovanie zvonenia a notifikacii?
unlink_volumes_together ---------+
mute_streams_affected
mode_ringer_streams_affected
System.Global:
heads_up_notifications_enabled
Ako disablovat lockscreen, 2 kroky:
1. nastavit, ze power tlacitko nema lockovat
/data/system/locksettings.db - lockscreen.power_button_instantly_locks (0,1)
len je otazka, ci toto existuje aj na starsich androidoch ako 5.0
2. nastavit lockscreen timeout
Settings.Secure - lock_screen_lock_after_timeout (milisekundy)
--------
4. sprav notifikaciu ako dasboard, kde budu ikony profilov, klikom na ikonu sa profil aktivuje.
poradie bude take iste ako pro aktivatore. Ak sa nezmestia na jednu notifikaciu, spravit dalsiu.
Notifikacia bude mat prioritu nastavitelnu, default bude Minimal. Uzivatel si bude moct zmenit, aby sa
takat notifikacia zobrazila aj v lockscreene. ;-)
--------
---------- PIN/password
1. ako zrusim pin/heslo
deviceManager.setPasswordMinimumLength(compName, 0);
boolean result = deviceManager.resetPassword("", DevicePolicyManager.RESET_PASSWORD_REQUIRE_ENTRY);
2. ako nahodim pin/heslo
DevicePolicyManager deviceManager = (DevicePolicyManager)getSystemService(Context.DEVICE_POLICY_SERVICE);
ComponentName compName = new ComponentName(MessageService.this, LockAdmin.class);
boolean active = deviceManager.isAdminActive(compName);
if (active) {
deviceManager.setPasswordQuality(compName,DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED);
deviceManager.setPasswordMinimumLength(compName, 5);
boolean result = deviceManager.resetPassword("blablabla", DevicePolicyManager.RESET_PASSWORD_REQUIRE_ENTRY);
}
3. password quality:
DevicePolicyManager.PASSWORD_QUALITY_SOMETHING - pattern lock?
DevicePolicyManager.PASSWORD_QUALITY_BIOMETRIC_WEAK - tvar, odtlacok prstu?
DevicePolicyManager.PASSWORD_QUALITY_NUMERIC - pin?
DevicePolicyManager.PASSWORD_QUALITY_ALPHABETIC - heslo?
DevicePolicyManager.PASSWORD_QUALITY_ALPHANUMERIC - heslo?
DevicePolicyManager.PASSWORD_QUALITY_COMPLEX - heslo?
--------------------------------
NFC tag senzor - NEFUNGUJE PRI CITANI TAGU NA POZADI!
Tu mas ako sa to id cita: https://gist.github.com/luixal/5768921.
- Sprav aby to len citalo UID a to pouzivaj na identifikaciu tagu.
Takto precitas UID: https://gist.github.com/luixal/5768921
- Na nacitanie tagu v NFCTagPreference sa vytvori nova aktivita NFCTagReadEditorActivity.
Ta bude normalna ako je teraz NFCTagWritreActivity, ktoru zahodim.
Zobrazovat bude precitane UID tagu a aj jeho obsah.
Aj citanie by malo zacat automaticky, ked prilozim tag ku mobilu.
- Pridanie tagu nech hned vyvola citanie UID
- Write to tag polozku menu tagu zrus a zamen za citanir UID tagu
- Premenovanie tagu teraz je nahovno, nespravi aj zapis dso tagu, ale po novom to bude OK ako to je.
- V tabulke TABLE_NFC_TAGS pribudne polozka KEY_NT_UID = "uid". Tam sa zapise precitane uid.
- Aby bola spatna kompatibilita so starymi tagmi, bude NFCTagReadActivity citat uid aj obsah tagu.
Ak bude uid v tabulke KEY_NT_UID prazdne, pouzije sa ako teraz obsah tagu. Inac sa pouzije uid tagu.
- Pre NFCTagReadActivity zmenit v manifeste intent filter na tento:
<intent-filter>
<action android:name="android.nfc.action.TAG_DISCOVERED"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
----------------------
Direct boot:
- Asi nemozem spravit, nepodporuje to WorkManager. :-(
- toto je super na to, aby sa PPP startol aj pri uzamknutej obrazovke.
- android.intent.action.LOCKED_BOOT_COMPLETED vid:
https://medium.com/@jordan_shifter/direct-boot-on-android-nougat-71f06c4a7c9e
- Ak nepuzijes direct boot, tak apka pada napr. v Fabric, android_job.
To preto, lebo chcu pouzivat shared preferences a v uzamknutej obrazovke bez direct boot
to spadne na IllegalStateException.
Fabric, android-job uz nepouzivam, treba testnut s Firebase Crashlytics a WorkManager
- Ako spravit podporu Direct boot:
https://developer.android.com/training/articles/direct-boot
- Len mam taky strasne blby pocit, ze neviem ako movnut shared preferences z device do credential storage.
Vid:
https://developer.android.com/reference/android/content/Context#moveSharedPreferencesFrom(android.content.Context,%20java.lang.String)
https://developer.android.com/reference/android/content/Context#moveDatabaseFrom(android.content.Context,%20java.lang.String)
Alebo, ze by pomohlo toto?
https://stackoverflow.com/questions/51377089/android-crashlytics-fails-on-direct-boot-due-to-disk-encryption
----------------------------------------
Extender:
- Vypada to, ze parametrov, ktore pouzivaju Extender je stale viac.
- Co tak spravit daky dialog, z ktoreho sa bude dat Extender managovat?
- Aby nemuseli byt pri kazdom profil/event parametri 3 dalsie kvoli Extenderu.
- Pridaj dakde v Editore daku indikaciu, ze je Extender vyzadovany v novej verzii.
Nieco uz o tom mas v Important info, notifikacia o tom sa zobrazi po upgrade PPP.
----------------------------------------
EventsHandler.handleEvents()
- volane strasne vela krat zaujima ma restart udalosti a samotny orientacny senzor
- SENSOR_TYPE_DEVICE_ORIENTATION
- z OrientationScanner.runEventsHandlerForOrientationChange() - zisti, aky thread to pouziva
- z PPPExtenderBroadcastRecveiver.onReceive() - je to volane v HandlerThread - vroadcast treba, lebo senzor sleduje aplikacie na popredi
--------------
Start udalosti:
1. Start s delay nastavi alarm pre SENSOR_TYPE_EVENT_DELAY_START a NENASTAVI event._status na ESTATUS_RUNNING, necha ho ESTATUS_PAUSE
2. Po delay znova testuje, ci sa zmeni stav udalosti a tiez ci event._isInDelayStart je uz false. Az tu vola startEvemt(), cize nastavi ESTATUS_RUNNING.
Vysledok je, ze pocas delay je stale PAUSE az po delay je RUNNING.
Koniec udalosti:
1. Koniec s delay nastavi alarm pre SENSOR_TYPE_EVENT_DELAY_END a NENASTAVI event._status na ESTATUS_PAUSE, necha ho ESTATUS_RUNNING
2. Po delay znova testuje, ci sa zmeni stav udalosti a tiez ci event._isInDelayEnd je uz false. Az tu vola pauseEvemt(), cize nastavi ESTATUS_PAUSE.
Vysledok je, ze pocas delay je stale RUNNING az po delay je PAUSE.
-----------------
Battery historian:
1. sudo apt install docker.io
2. Ako pouzivat: https://developer.android.com/topic/performance/power/setup-battery-historian
3. Spustaj ale takto:
sudo docker run -p 20000:9999 gcr.io/android-battery-historian/stable:3.0 --port 9999
4. V Chrome potom: http://localhost:20000
------------------
Toto daj do Important info. Je to ako nastavit PPP pre znizenie spotreby baterie:
1. Battery optimization, must by dislabled - it is PPP Settings/System/Ignore battery optimization
2. Scanning intervals, set it >= recommended
- Background scanning = 15 minutes
- Location scanning = 15 minutes
- Wi-Fi scanning = 15 minutes
- Bluetooth scanning = 15 minutes
- Orientation scanning = 10 seconds
3. For location scanning disable "Use GPS when not in Power Save mode". This is required only when another location sources are not available.
Location sources used by Android:
- Wi-Fi
- Bluetooth
- network
- mobile cells
- GPS
4. For increasing location accuracy, you can force usage of Wi-Fi and BLuetooth as source. For this, enable it in Location system setting "Wi-Fi and Bluetooth scanning"
5. Battery sensor: do not use battery levels when are not needed. Set levels: 0%-100%
---------------------
Orientation sensor:
Light senzor sa generuje hrozne casto. Na Samsungu donekonecna a par krat za sekundu.
Spravil som sice:
- ze sa neregistruje, ak ziadna udalost ho nepouziva
- ze sa ma handler volat az o polovicu intervalu
Ale aj tak to musi zrat vela. Kazdych 5 sekund volat eventsHandler je proste vela.
Zatial mam nenapadlo, co s tym. Do nastaveni senzora daj aspon info preference o tom ze check light zerie bateriu.
-----------------------
Co je toto? Nastavenie tonu pri aktivacii profilu? Prehratie tonu na notifikacu?
Zistujem, ktory ton je nastaveny (najdi kde), preco by som ho mal aj prehravat? Nemam to nastavene.
2020-09-07 00:05:35.217 31399-31557/sk.henrichg.phoneprofilesplus I/RingtoneManager: path and URI match to each other
2020-09-07 00:05:55.189 31399-31557/sk.henrichg.phoneprofilesplus I/RingtoneManager: path and URI match to each other
2020-09-07 00:26:45.609 31399-31557/sk.henrichg.phoneprofilesplus I/RingtoneManager: path and URI match to each other
2020-09-07 00:26:46.097 31399-31557/sk.henrichg.phoneprofilesplus I/RingtoneManager: path and URI match to each other
2020-09-07 00:26:52.669 31399-31557/sk.henrichg.phoneprofilesplus I/RingtoneManager: path and URI match to each other
2020-09-07 00:28:43.189 31399-31557/sk.henrichg.phoneprofilesplus I/RingtoneManager: path and URI match to each other
2020-09-07 00:29:03.187 31399-31557/sk.henrichg.phoneprofilesplus I/RingtoneManager: path and URI match to each other
------------------------
am mám funkční nastavení pro Huawei P30 s Androidem 10 a EMUI 10.
nastavení-aplikace- aplikace-PPP-podrobnosti o spotřebě energie-spouštění aplikací:
Spravovat automaticky - ne
Spravovat ručně 3x ano
-automatické souštění
-sekundární souštění
-Spustit na ozadí
třeba se to bude hodit.
-------------------------
ActivateProfileHelper.setScreenTimeout()
- disableScreenTimeoutInternalChange = true;
- pre kazdy timeout z parametra:
if (PPApplication.lockDeviceActivity != null)
// in LockDeviceActivity.onDestroy() will be used this value to revert back system screen timeout
PPApplication.screenTimeoutBeforeDeviceLock = 15000;
else {
Settings.System.putInt(appContext.getContentResolver(), Settings.System.SCREEN_OFF_TIMEOUT, xxx);
}
- nerobi 6, 8. Preco?
- zavola:
setActivatedProfileScreenTimeout(appContext, 0);
- zavola work:
DisableScreenTimeoutInternalChangeWorker.class
- volane z:
- ActivateProfileHelper.execute() - aktivacia profilu ak je obrazovka zapnuta
- LockDeviceActivity.onDestroy() - na nastavenie timeoutu, ak sa este nenastavil
- ScreenOnOffBroadcastReceiver.onReceive() na ACTION_USER_PRESENT
ActivateProfileHelper.setActivatedProfileScreenTimeout()
- ulozi do shared preferences timeout.
- ulozi to aj do ApplicationPreferences.prefActivatedProfileScreenTimeout
- pouzije to v ScreenOnOffBroadcastReceiver.onReceive() na ACTION_USER_PRESENT
- pouzije to aj v LockDeviceActivity.onDestroy() na vratenie timeoutu
- volane je z:
- ActivateProfileHelper.setScreenTimeout() - nastavi 0, lebo netreba nastavovat na screen On ACTION_USER_PRESENT
- ActivateProfileHelper.execute - nastavi profile parameter _deviceScreenTimeout, ak je screen off
- SettingsContentObserver.onChange() - nastvi 0 ak posledny zapamatany timeout je iny ako aktualny. a nie je to internalChange
ActivateProfileHelper.disableScreenTimeoutInternalChange
to aby sa nepouzila na ten screen On ACTION_USER_PRESENT. Tu sa predpoklada, ze zmena prisla z vonka.
premenna PPApplication.screenTimeoutBeforeDeviceLock:
- tu si pamatam, aky timeout je pred spustenim LockDeviceActivity.
- na onCreate() ho zistuje
- na onDestroy() nastavi spat timeout na tuto odpamatanu hodnotu
- na onDestroy() potom nastavi timeot na hodnotu ApplicationPreferences.prefActivatedProfileScreenTimeout.
Takto sa nastavuje tiemout pri aktivacii profilu:
// screen timeout
if (Permissions.checkProfileScreenTimeout(appContext, profile, null)) {
if (PPApplication.isScreenOn) {
if (PPApplication.screenTimeoutHandler != null) {
PPApplication.screenTimeoutHandler.post(() -> {
setScreenTimeout(profile._deviceScreenTimeout, appContext);
});
}
else {
setActivatedProfileScreenTimeout(appContext, profile._deviceScreenTimeout);
}
}
- cize ak je screen on, nastavi sa timeount hned.
- ak je screen off, nastavi sa timeount az v ScreenOnOffBroadcastReceiver.onReceive() na ACTION_USER_PRESENT
cize len sa hodnota ulozi do ApplicationPreferences.prefActivatedProfileScreenTimeout.
Toto cele chapem.
-----
Extender v obchode:
*** IMPORTANT ***
- It is "plugin", so does NOT work standalone!
- Designed for co-working with 'PhoneProfilesPlus' application. Without it, this application do nothing.
-----------------------
Ako stiahnut najnovsiu verziu:
https://github.com/henrichg/PhoneProfilesPlus/releases/latest/download/PhoneProfilesPlus.apk
https://github.com/henrichg/PhoneProfilesPlusExtender/releases/latest/download/PhoneProfilesPlusExtender.apk
-----------------------
Airplane mod bez rootu:
Hladaj v:
/home/henrisko/Stiahnuté/MacroDroidDeviceAutomation_v5.17.3_apkpure.com_source_from_JADX/sources/com/arlosoft/macrodroid
pripona suboru: xml
retazec: BIND_VOICE_INTERACTION
volaj toto:
Intent intent = new Intent(PPPVoiceService.ACTION_ASSISTANT);
intent.putExtra("ACTION", "android.settings.VOICE_CONTROL_AIRPLANE_MODE");
intent.putExtra("airplane_mode_enabled", z3);
mo15668c0().sendBroadcast(intent);
Ako zistit default asistenta:
https://stackoverflow.com/questions/40500143/how-to-get-default-device-assistance-app-in-android-by-code
Alebo asi lepsie: Macrodroid class: common/C5258c1.java
Ako nastavit default asistenta:
activity.startActivity(new Intent("android.settings.VOICE_INPUT_SETTINGS"));
- Settings.ACTION_VOICE_INPUT_SETTINGS
Alebo Macrodroid class: permissions/PermissionRequestActivity.java
--------------------------
Zmena hlasitosti profilom:
Toto su parametre:
forRingerMode -> true, ak menim aj ringer mod?
- ak profil meni ringer mod, ton zvonenia, notifikacie, systemu, DTMF, tak je true
- inac je false
forProfileActivation -> true ak volam pre aktivaciu profilu?
- ak je volane z ActivateProfileHelper.execute(), je true, cize ano ide o aktivaciu profilu
- ak je volane z PhoneCallListener.setLinkUnlinkNotificationVolume() je false, cize je to pocas hovoru
aby sa vykonal unlink.
setRingerVolume(appContext, profile.getVolumeRingtoneValue()); -> pozri co za premennu to nastavuje
- ApplicationPreferences.prefRingerVolume
meni sa pri starte PPP, pri aktivacii profilu, pri zmene hlasitosti zvonenia v systeme
setNotificationVolume(appContext, profile.getVolumeNotificationValue()); -> pozri co za premennu to nastavuje
- ApplicationPreferences.prefNotificationVolume
meni sa pri starte PPP, pri aktivacii profilu, pri zmene hlasitosti notifikacii v systeme
meni sa aj na hlaitost zvonenia pri unlinku, podla mna preto, lebo v podstate je len 1 volume
pri zmerovananych hlasitostiach, tak nech su rovnake.
-> Len ak je system ringer mode audible, alebo ak ApplicationPreferences.prefRingerMode=0
-> ringerMode == 0 znamena, ze je nenastaveny. Ide o ringer mod podla Profile.RINGERMODE_*
if (isAudibleSystemRingerMode(audioManager, systemZenMode/*, appContext*/) || (ringerMode == 0)) {
...
-> tu zistujem ci ma zlinkovane (merged) ringing a notificartion
vrati to:
if (ApplicationPreferences.applicationForceSetMergeRingNotificationVolumes > 0)
ApplicationPreferences.applicationForceSetMergeRingNotificationVolumes == 1
- cize ak je natrdo v Settongs, ze ma zmergovane
else
ApplicationPreferences.prefMergedRingNotificationVolumes
cize v podstate bud ak uzivatel nastavil natvrdo, ze ma zmergovane alebo a detekcia vratila, ze ma zmergovane
if (ActivateProfileHelper.getMergedRingNotificationVolumes() &&
ApplicationPreferences.applicationUnlinkRingerNotificationVolumes) {
-> ma zmergovane a ma zapnuty unlink
...
} else {
-> tu zistujem ci ma zlinkovane (merged) ringing a notificartion
vrati to:
if (ApplicationPreferences.applicationForceSetMergeRingNotificationVolumes > 0)
ApplicationPreferences.applicationForceSetMergeRingNotificationVolumes == 1
- cize ak je natrdo v Settongs, ze ma zmergovane
else
ApplicationPreferences.prefMergedRingNotificationVolumes
cize v podstate bud ak uzivatel nastavil natvrdo, ze ma zmergovane alebo a detekcia vratila, ze ma zmergovane
if (!ActivateProfileHelper.getMergedRingNotificationVolumes()) {
-> nie je zmergovane
...
-> nastavuje hlasitost notifikacie, ale z ApplicationPreferences.prefNotificationVolume
nastavi sa hore na zaciatku
volume = ApplicationPreferences.prefNotificationVolume;
}
-> nastavuje hlasitost zvonenia, ale z ApplicationPreferences.prefRingerVolume
nastavi sa hore na zaciatku
volume = ApplicationPreferences.prefRingerVolume;
-> zapisuje sa aj do servisu, NACO?
PhoneProfilesService.getInstance().ringingVolume = volume;
...
}
...
}
static void getMergedRingNotificationVolumes(Context context) {
synchronized (PPApplication.profileActivationMutex) {
ApplicationPreferences.prefMergedRingNotificationVolumes =
ApplicationPreferences.getSharedPreferences(context).getBoolean(PREF_MERGED_RING_NOTIFICATION_VOLUMES, true);
}
}
static boolean getMergedRingNotificationVolumes() {
//PPApplication.logE("ActivateProfileHelper.getMergedRingNotificationVolumes", "force set="+ApplicationPreferences.applicationForceSetMergeRingNotificationVolumes(context));
//PPApplication.logE("ActivateProfileHelper.getMergedRingNotificationVolumes", "merged="+ApplicationPreferences.preferences.getBoolean(PREF_MERGED_RING_NOTIFICATION_VOLUMES, true));
if (ApplicationPreferences.applicationForceSetMergeRingNotificationVolumes > 0)
return ApplicationPreferences.applicationForceSetMergeRingNotificationVolumes == 1;
else
return ApplicationPreferences.prefMergedRingNotificationVolumes;
}
Ak v Settings menim ringtone na Pixeli, meni sa STREAM_RING aj STREAM_NOTIFICATION
Ale ako pozeram, tak sa to ignoruje, tie zmeny v observeri, lebo prave aktivujem porfil.
To je to, co to ma aj robit.
Tak preco kua to na tej Xperii robi inac? Jedine mi zostava to testnut u Marta. Logovat si to.
--------
root:
Moze sa stat, ze bootnem do nie-root particie (S10ka).
No a vtedy pre kazdy parameter mi to pise, ze nie je grantnuty root.
No nemoze byt, ked nie je rootnuty.
Vsade testujem premennu ApplicationPreferences.applicationNeverAskForGrantRoot.
A v red error text mam checkbox, ktory tu premenu anstavuje.
No a teraz co spravit s tym? Ta premenna by mala mat funkcionalitu aku ma.
Lebo iny uzivatel chcel, ze sice ma rottnuty mobil, ale nechce grantovat root.
Nema pre PPP nastaveny permanentny grant. Nechce to.
Podla mna by som asi mal spravit to, ze ak nie je mobil rootnuty, malo by to proste len zakazat
premenne a nezobrazovat red text. Pozri to.
Zatial tu premennu sprav tak, ze je to spriahnute s tym, ci je root. Nie ci je grantnuty.
Cize v PPService.doForFirsStart() ju nastav na false, ak je mobil rootnuty.
---------